update 支付宝小程序

This commit is contained in:
Guoqs
2024-06-17 14:11:59 +08:00
parent 27c199617e
commit 20d7f06e8f
5 changed files with 77 additions and 19 deletions

View File

@@ -90,6 +90,11 @@ public class PileMerchantInfo extends BaseEntity {
*/ */
private String appId; private String appId;
/**
* 运营商的支付宝小程序id
*/
private String alipayAppId;
/** /**
* 部门id * 部门id
*/ */

View File

@@ -37,7 +37,7 @@ public interface PileMerchantInfoMapper {
* @param appId * @param appId
* @return * @return
*/ */
List<PileMerchantInfo> selectPileMerchantInfoByAppId(String appId); List<PileMerchantInfo> selectPileMerchantInfoByWxAppId(String appId);
/** /**
* 查询充电桩运营商信息列表 * 查询充电桩运营商信息列表
@@ -102,17 +102,24 @@ public interface PileMerchantInfoMapper {
/** /**
* 根据appid查询对应一级运营商id * 根据appid查询对应一级运营商id
* @param appId * @param wxAppId
* @return * @return
*/ */
PileMerchantInfo getFirstLevelMerchantByAppId(String appId); PileMerchantInfo getFirstLevelMerchantByWxAppId(String wxAppId);
/**
* 根据支付宝appid查询对应一级运营商id
* @param alipayAppId
* @return
*/
PileMerchantInfo getFirstLevelMerchantByAlipayAppId(String alipayAppId);
/** /**
* 通过appid查询运营商部门id * 通过appid查询运营商部门id
* @param appId * @param appId
* @return * @return
*/ */
List<String> getDeptIdsByAppId(@Param("appId") String appId); List<String> getDeptIdsByWxAppId(@Param("appId") String appId);
/** /**
* 后管财务中心页面运营商列表 * 后管财务中心页面运营商列表

View File

@@ -70,7 +70,19 @@ public interface PileMerchantInfoService {
*/ */
public int deletePileMerchantInfoById(Long id); public int deletePileMerchantInfoById(Long id);
PileMerchantInfo getFirstLevelMerchantByAppId(String appId); /**
* 根据微信appId查询一级运营商信息
* @param wxAppId 微信appId
* @return
*/
PileMerchantInfo getFirstLevelMerchantByWxAppId(String wxAppId);
/**
* 根据支付宝appId查询一级运营商信息
* @param alipayAppId 微信appId
* @return
*/
PileMerchantInfo getFirstLevelMerchantByAlipayAppId(String alipayAppId);
/** /**
* 通过微信小程序appId查询一级运营商merchantId * 通过微信小程序appId查询一级运营商merchantId

View File

@@ -293,15 +293,28 @@ public class PileMerchantInfoServiceImpl implements PileMerchantInfoService {
/** /**
* 通过微信小程序appId查询一级运营商merchant对象 * 通过微信小程序appId查询一级运营商merchant对象
* @param appId 微信小程序appId * @param wxAppId 微信小程序appId
* @return 一级运营商merchant对象 * @return 一级运营商merchant对象
*/ */
@Override @Override
public PileMerchantInfo getFirstLevelMerchantByAppId(String appId) { public PileMerchantInfo getFirstLevelMerchantByWxAppId(String wxAppId) {
if (StringUtils.isBlank(appId)) { if (StringUtils.isBlank(wxAppId)) {
return null; return null;
} }
return pileMerchantInfoMapper.getFirstLevelMerchantByAppId(appId); return pileMerchantInfoMapper.getFirstLevelMerchantByWxAppId(wxAppId);
}
/**
* 通过支付宝小程序appId查询一级运营商merchant对象
* @param alipayAppId 支付宝小程序appId
* @return 一级运营商merchant对象
*/
@Override
public PileMerchantInfo getFirstLevelMerchantByAlipayAppId(String alipayAppId) {
if (StringUtils.isBlank(alipayAppId)) {
return null;
}
return pileMerchantInfoMapper.getFirstLevelMerchantByAlipayAppId(alipayAppId);
} }
/** /**
@@ -312,7 +325,7 @@ public class PileMerchantInfoServiceImpl implements PileMerchantInfoService {
@Override @Override
public String getFirstLevelMerchantIdByWxAppId(String wechatAppId) { public String getFirstLevelMerchantIdByWxAppId(String wechatAppId) {
String merchantId = null; String merchantId = null;
PileMerchantInfo merchant = getFirstLevelMerchantByAppId(wechatAppId); PileMerchantInfo merchant = getFirstLevelMerchantByWxAppId(wechatAppId);
if (Objects.nonNull(merchant)) { if (Objects.nonNull(merchant)) {
merchantId = String.valueOf(merchant.getId()); merchantId = String.valueOf(merchant.getId());
} }
@@ -327,7 +340,7 @@ public class PileMerchantInfoServiceImpl implements PileMerchantInfoService {
@Override @Override
public String getFirstLevelMerchantIdByAliAppId(String alipayAppId) { public String getFirstLevelMerchantIdByAliAppId(String alipayAppId) {
String merchantId = null; String merchantId = null;
PileMerchantInfo merchant = getFirstLevelMerchantByAppId(alipayAppId); PileMerchantInfo merchant = getFirstLevelMerchantByAlipayAppId(alipayAppId);
if (Objects.nonNull(merchant)) { if (Objects.nonNull(merchant)) {
merchantId = String.valueOf(merchant.getId()); merchantId = String.valueOf(merchant.getId());
} }
@@ -467,7 +480,7 @@ public class PileMerchantInfoServiceImpl implements PileMerchantInfoService {
*/ */
@Override @Override
public List<String> getDeptIdsByAppId(String appId) { public List<String> getDeptIdsByAppId(String appId) {
return pileMerchantInfoMapper.getDeptIdsByAppId(appId); return pileMerchantInfoMapper.getDeptIdsByWxAppId(appId);
} }
/** /**
@@ -494,7 +507,7 @@ public class PileMerchantInfoServiceImpl implements PileMerchantInfoService {
*/ */
@Override @Override
public String getDelayModeByWechatAppId(String wechatAppId) { public String getDelayModeByWechatAppId(String wechatAppId) {
PileMerchantInfo merchant = getFirstLevelMerchantByAppId(wechatAppId); PileMerchantInfo merchant = getFirstLevelMerchantByWxAppId(wechatAppId);
if (merchant == null) { if (merchant == null) {
throw new BusinessException(ReturnCodeEnum.CODE_GET_FIRST_LEVEL_MERCHANT_BY_APP_ID); throw new BusinessException(ReturnCodeEnum.CODE_GET_FIRST_LEVEL_MERCHANT_BY_APP_ID);
} }

View File

@@ -17,6 +17,7 @@
<result property="servicePhone" column="service_phone"/> <result property="servicePhone" column="service_phone"/>
<result property="logoUrl" column="logo_url"/> <result property="logoUrl" column="logo_url"/>
<result property="appId" column="app_id"/> <result property="appId" column="app_id"/>
<result property="alipayAppId" column="alipay_app_id"/>
<result property="deptId" column="dept_id"/> <result property="deptId" column="dept_id"/>
<result property="createBy" column="create_by"/> <result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/> <result property="createTime" column="create_time"/>
@@ -39,6 +40,7 @@
service_phone, service_phone,
logo_url, logo_url,
app_id, app_id,
alipay_app_id,
dept_id, dept_id,
create_by, create_by,
create_time, create_time,
@@ -153,6 +155,9 @@
<if test="appId != null"> <if test="appId != null">
app_id, app_id,
</if> </if>
<if test="alipayAppId != null">
alipay_app_id,
</if>
<if test="deptId != null"> <if test="deptId != null">
dept_id, dept_id,
</if> </if>
@@ -212,6 +217,9 @@
<if test="appId != null"> <if test="appId != null">
#{appId}, #{appId},
</if> </if>
<if test="alipayAppId != null">
#{alipayAppId},
</if>
<if test="deptId != null"> <if test="deptId != null">
#{deptId}, #{deptId},
</if> </if>
@@ -272,6 +280,9 @@
<if test="appId != null"> <if test="appId != null">
app_id = #{appId}, app_id = #{appId},
</if> </if>
<if test="alipayAppId != null">
alipay_app_id = #{alipayAppId},
</if>
<if test="createBy != null"> <if test="createBy != null">
create_by = #{createBy}, create_by = #{createBy},
</if> </if>
@@ -306,7 +317,7 @@
</foreach> </foreach>
</delete> </delete>
<select id="selectPileMerchantInfoByAppId" resultMap="PileMerchantInfoResult"> <select id="selectPileMerchantInfoByWxAppId" resultMap="PileMerchantInfoResult">
select select
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from pile_merchant_info from pile_merchant_info
@@ -361,24 +372,34 @@
and merchant_level = '1' and merchant_level = '1'
</select> </select>
<select id="getFirstLevelMerchantByAppId" resultMap="PileMerchantInfoResult"> <select id="getFirstLevelMerchantByWxAppId" resultMap="PileMerchantInfoResult">
select select
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from from
pile_merchant_info pile_merchant_info
where del_flag = '0' where del_flag = '0'
and merchant_level = '1' and merchant_level = '1'
and app_id = #{appId,jdbcType=VARCHAR} and app_id = #{wxAppId,jdbcType=VARCHAR}
</select> </select>
<select id="getDeptIdsByAppId" resultType="java.lang.String"> <select id="getFirstLevelMerchantByAlipayAppId" resultMap="PileMerchantInfoResult">
select
<include refid="Base_Column_List"/>
from
pile_merchant_info
where del_flag = '0'
and merchant_level = '1'
and alipay_app_id = #{alipayAppId,jdbcType=VARCHAR}
</select>
<select id="getDeptIdsByWxAppId" resultType="java.lang.String">
select select
dept_id as deptId dept_id as deptId
from from
pile_merchant_info pile_merchant_info
where del_flag = '0' where del_flag = '0'
<if test="appId != null and appId != ''"> <if test="appId != null and appId != ''">
and app_id = #{appId,jdbcType=VARCHAR} and (app_id = #{appId,jdbcType=VARCHAR} or alipay_app_id = #{appId,jdbcType=VARCHAR})
</if> </if>
</select> </select>