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;
/**
* 运营商的支付宝小程序id
*/
private String alipayAppId;
/**
* 部门id
*/

View File

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

View File

@@ -70,9 +70,21 @@ public interface PileMerchantInfoService {
*/
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
* @param wechatAppId 微信小程序appId
* @return 一级运营商merchantId

View File

@@ -293,15 +293,28 @@ public class PileMerchantInfoServiceImpl implements PileMerchantInfoService {
/**
* 通过微信小程序appId查询一级运营商merchant对象
* @param appId 微信小程序appId
* @param wxAppId 微信小程序appId
* @return 一级运营商merchant对象
*/
@Override
public PileMerchantInfo getFirstLevelMerchantByAppId(String appId) {
if (StringUtils.isBlank(appId)) {
public PileMerchantInfo getFirstLevelMerchantByWxAppId(String wxAppId) {
if (StringUtils.isBlank(wxAppId)) {
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
public String getFirstLevelMerchantIdByWxAppId(String wechatAppId) {
String merchantId = null;
PileMerchantInfo merchant = getFirstLevelMerchantByAppId(wechatAppId);
PileMerchantInfo merchant = getFirstLevelMerchantByWxAppId(wechatAppId);
if (Objects.nonNull(merchant)) {
merchantId = String.valueOf(merchant.getId());
}
@@ -327,7 +340,7 @@ public class PileMerchantInfoServiceImpl implements PileMerchantInfoService {
@Override
public String getFirstLevelMerchantIdByAliAppId(String alipayAppId) {
String merchantId = null;
PileMerchantInfo merchant = getFirstLevelMerchantByAppId(alipayAppId);
PileMerchantInfo merchant = getFirstLevelMerchantByAlipayAppId(alipayAppId);
if (Objects.nonNull(merchant)) {
merchantId = String.valueOf(merchant.getId());
}
@@ -467,7 +480,7 @@ public class PileMerchantInfoServiceImpl implements PileMerchantInfoService {
*/
@Override
public List<String> getDeptIdsByAppId(String appId) {
return pileMerchantInfoMapper.getDeptIdsByAppId(appId);
return pileMerchantInfoMapper.getDeptIdsByWxAppId(appId);
}
/**
@@ -494,7 +507,7 @@ public class PileMerchantInfoServiceImpl implements PileMerchantInfoService {
*/
@Override
public String getDelayModeByWechatAppId(String wechatAppId) {
PileMerchantInfo merchant = getFirstLevelMerchantByAppId(wechatAppId);
PileMerchantInfo merchant = getFirstLevelMerchantByWxAppId(wechatAppId);
if (merchant == null) {
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="logoUrl" column="logo_url"/>
<result property="appId" column="app_id"/>
<result property="alipayAppId" column="alipay_app_id"/>
<result property="deptId" column="dept_id"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
@@ -39,6 +40,7 @@
service_phone,
logo_url,
app_id,
alipay_app_id,
dept_id,
create_by,
create_time,
@@ -153,6 +155,9 @@
<if test="appId != null">
app_id,
</if>
<if test="alipayAppId != null">
alipay_app_id,
</if>
<if test="deptId != null">
dept_id,
</if>
@@ -212,6 +217,9 @@
<if test="appId != null">
#{appId},
</if>
<if test="alipayAppId != null">
#{alipayAppId},
</if>
<if test="deptId != null">
#{deptId},
</if>
@@ -272,6 +280,9 @@
<if test="appId != null">
app_id = #{appId},
</if>
<if test="alipayAppId != null">
alipay_app_id = #{alipayAppId},
</if>
<if test="createBy != null">
create_by = #{createBy},
</if>
@@ -306,7 +317,7 @@
</foreach>
</delete>
<select id="selectPileMerchantInfoByAppId" resultMap="PileMerchantInfoResult">
<select id="selectPileMerchantInfoByWxAppId" resultMap="PileMerchantInfoResult">
select
<include refid="Base_Column_List"/>
from pile_merchant_info
@@ -361,24 +372,34 @@
and merchant_level = '1'
</select>
<select id="getFirstLevelMerchantByAppId" resultMap="PileMerchantInfoResult">
<select id="getFirstLevelMerchantByWxAppId" resultMap="PileMerchantInfoResult">
select
<include refid="Base_Column_List"/>
from
pile_merchant_info
where del_flag = '0'
and merchant_level = '1'
and app_id = #{appId,jdbcType=VARCHAR}
and app_id = #{wxAppId,jdbcType=VARCHAR}
</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
dept_id as deptId
from
pile_merchant_info
where del_flag = '0'
<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>
</select>