diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/domain/PileMerchantInfo.java b/jsowell-pile/src/main/java/com/jsowell/pile/domain/PileMerchantInfo.java index df039163c..a3e8f968f 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/domain/PileMerchantInfo.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/domain/PileMerchantInfo.java @@ -90,6 +90,11 @@ public class PileMerchantInfo extends BaseEntity { */ private String appId; + /** + * 运营商的支付宝小程序id + */ + private String alipayAppId; + /** * 部门id */ diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/mapper/PileMerchantInfoMapper.java b/jsowell-pile/src/main/java/com/jsowell/pile/mapper/PileMerchantInfoMapper.java index 622ff8a8a..e34633544 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/mapper/PileMerchantInfoMapper.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/mapper/PileMerchantInfoMapper.java @@ -37,7 +37,7 @@ public interface PileMerchantInfoMapper { * @param appId * @return */ - List selectPileMerchantInfoByAppId(String appId); + List 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 getDeptIdsByAppId(@Param("appId") String appId); + List getDeptIdsByWxAppId(@Param("appId") String appId); /** * 后管财务中心页面运营商列表 diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/service/PileMerchantInfoService.java b/jsowell-pile/src/main/java/com/jsowell/pile/service/PileMerchantInfoService.java index 88465ccec..f4c0a1f6b 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/service/PileMerchantInfoService.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/service/PileMerchantInfoService.java @@ -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 diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileMerchantInfoServiceImpl.java b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileMerchantInfoServiceImpl.java index 98fa4ca43..4bde424f6 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileMerchantInfoServiceImpl.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileMerchantInfoServiceImpl.java @@ -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 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); } diff --git a/jsowell-pile/src/main/resources/mapper/pile/PileMerchantInfoMapper.xml b/jsowell-pile/src/main/resources/mapper/pile/PileMerchantInfoMapper.xml index 3fa417743..d0c279e1a 100644 --- a/jsowell-pile/src/main/resources/mapper/pile/PileMerchantInfoMapper.xml +++ b/jsowell-pile/src/main/resources/mapper/pile/PileMerchantInfoMapper.xml @@ -17,6 +17,7 @@ + @@ -39,6 +40,7 @@ service_phone, logo_url, app_id, + alipay_app_id, dept_id, create_by, create_time, @@ -153,6 +155,9 @@ app_id, + + alipay_app_id, + dept_id, @@ -212,6 +217,9 @@ #{appId}, + + #{alipayAppId}, + #{deptId}, @@ -272,6 +280,9 @@ app_id = #{appId}, + + alipay_app_id = #{alipayAppId}, + create_by = #{createBy}, @@ -306,7 +317,7 @@ - select from pile_merchant_info @@ -361,24 +372,34 @@ and merchant_level = '1' - select 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 + + from + pile_merchant_info + where del_flag = '0' + and merchant_level = '1' + and alipay_app_id = #{alipayAppId,jdbcType=VARCHAR} + + +