mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-20 02:55:04 +08:00
微信登录查询方法修改为 根据appid查询一级运营商merchantid
This commit is contained in:
@@ -633,7 +633,7 @@ public class AgentDevService {
|
||||
// 获取openId
|
||||
String openId = getOpenIdByCode(dto.getOpenIdCode(), appId);
|
||||
// 通过 appid 查询 merchantId
|
||||
String merchantId = pileMerchantInfoService.getMerchantIdByAppId(appId);
|
||||
String merchantId = pileMerchantInfoService.getFirstLevelMerchantIdByAppId(appId);
|
||||
logger.info("微信一键登录 获取merchantId:{}", merchantId);
|
||||
// 下面方法有判断 merchantId 是否为空,因此可直接传值
|
||||
return memberService.memberRegisterAndLogin(phoneNumber, merchantId, openId);
|
||||
|
||||
@@ -207,7 +207,7 @@ public class MemberService {
|
||||
log.error("getOpenIdByCode发生异常", e);
|
||||
}
|
||||
// 根据appid查询merchantId
|
||||
String merchantId = pileMerchantInfoService.getMerchantIdByAppId(APP_ID);
|
||||
String merchantId = pileMerchantInfoService.getFirstLevelMerchantIdByAppId(APP_ID);
|
||||
// 查询手机号码是否注册过
|
||||
return memberRegisterAndLogin(mobileNumber, merchantId, openId);
|
||||
}
|
||||
|
||||
@@ -89,4 +89,11 @@ public interface PileMerchantInfoMapper {
|
||||
* 查询一级运营商
|
||||
*/
|
||||
List<PileMerchantInfo> queryFirstLevelMerchant();
|
||||
|
||||
/**
|
||||
* 根据appid查询对应一级运营商id
|
||||
* @param appId
|
||||
* @return
|
||||
*/
|
||||
String getFirstLevelMerchantIdByAppId(String appId);
|
||||
}
|
||||
|
||||
@@ -64,9 +64,12 @@ public interface IPileMerchantInfoService {
|
||||
*/
|
||||
public int deletePileMerchantInfoById(Long id);
|
||||
|
||||
String getMerchantIdByAppId(String appId);
|
||||
|
||||
List<String> getMerchantIdsByAppId(String appId);
|
||||
/**
|
||||
* 获取一级运营商merchantId
|
||||
* @param appId
|
||||
* @return
|
||||
*/
|
||||
String getFirstLevelMerchantIdByAppId(String appId);
|
||||
|
||||
MerchantInfoVO getMerchantInfo(String merchantId);
|
||||
|
||||
|
||||
@@ -253,14 +253,14 @@ public class PileMerchantInfoServiceImpl implements IPileMerchantInfoService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMerchantIdByAppId(String appId) {
|
||||
public String getFirstLevelMerchantIdByAppId(String appId) {
|
||||
if (StringUtils.isBlank(appId)) {
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
List<PileMerchantInfo> pileMerchantInfos = pileMerchantInfoMapper.selectPileMerchantInfoByAppId(appId);
|
||||
if (CollectionUtils.isNotEmpty(pileMerchantInfos)) {
|
||||
return pileMerchantInfos.get(0).getId().toString();
|
||||
String merchantId = pileMerchantInfoMapper.getFirstLevelMerchantIdByAppId(appId);
|
||||
if (StringUtils.isNotBlank(merchantId)) {
|
||||
return merchantId;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("通过appid获取运营商id error", e);
|
||||
@@ -268,23 +268,6 @@ public class PileMerchantInfoServiceImpl implements IPileMerchantInfoService {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getMerchantIdsByAppId(String appId) {
|
||||
if (StringUtils.isBlank(appId)) {
|
||||
return null;
|
||||
}
|
||||
List<String> resultList = Lists.newArrayList();
|
||||
try {
|
||||
List<PileMerchantInfo> pileMerchantInfos = pileMerchantInfoMapper.selectPileMerchantInfoByAppId(appId);
|
||||
if (CollectionUtils.isNotEmpty(pileMerchantInfos)) {
|
||||
resultList = pileMerchantInfos.stream().map(x -> String.valueOf(x.getId())).collect(Collectors.toList());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("通过appid获取运营商ids error", e);
|
||||
}
|
||||
return resultList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MerchantInfoVO getMerchantInfo(String merchantId) {
|
||||
PileMerchantInfo pileMerchantInfo = selectPileMerchantInfoById(Long.parseLong(merchantId));
|
||||
|
||||
@@ -333,4 +333,14 @@
|
||||
where del_flag = '0'
|
||||
and merchant_level = '1'
|
||||
</select>
|
||||
|
||||
<select id="getFirstLevelMerchantIdByAppId" resultType="java.lang.String">
|
||||
select
|
||||
id
|
||||
from
|
||||
pile_merchant_info
|
||||
where
|
||||
app_id = #{appId,jdbcType=VARCHAR}
|
||||
and merchant_level = '1'
|
||||
</select>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user