This commit is contained in:
2023-07-26 15:30:14 +08:00
parent ce080bbf95
commit a4aace1e68
6 changed files with 32 additions and 13 deletions

View File

@@ -27,7 +27,7 @@ public interface PileMerchantInfoMapper {
* @param appId
* @return
*/
PileMerchantInfo selectPileMerchantInfoByAppId(String appId);
List<PileMerchantInfo> selectPileMerchantInfoByAppId(String appId);
/**
* 查询充电桩运营商信息列表

View File

@@ -73,7 +73,7 @@ public interface IMemberBasicInfoService {
* @param merchantId 运营商id
* @return 会员信息
*/
MemberBasicInfo selectInfoByMobileNumberAndMerchantId(String phone, String merchantId);
MemberBasicInfo selectInfoByMobileNumber(String phone, String merchantId);
/**
* 根据手机号查询会员信息

View File

@@ -64,6 +64,8 @@ public interface IPileMerchantInfoService {
String getMerchantIdByAppId(String appId);
List<String> getMerchantIdsByAppId(String appId);
MerchantInfoVO getMerchantInfo(String merchantId);
/**

View File

@@ -137,13 +137,14 @@ public class MemberBasicInfoServiceImpl implements IMemberBasicInfoService {
* @param merchantId 运营商id
* @return 会员信息
*/
public MemberBasicInfo selectInfoByMobileNumberAndMerchantId(String mobileNumber, String merchantId) {
@Override
public MemberBasicInfo selectInfoByMobileNumber(String mobileNumber, String merchantId) {
return memberBasicInfoMapper.selectInfoByMobileNumberAndMerchantId(mobileNumber, merchantId);
}
@Override
public MemberBasicInfo selectInfoByMobileNumber(String mobileNumber) {
return selectInfoByMobileNumberAndMerchantId(mobileNumber, null);
return selectInfoByMobileNumber(mobileNumber, null);
}
@Override

View File

@@ -26,6 +26,7 @@ import org.springframework.transaction.annotation.Transactional;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
/**
* 充电桩运营商信息Service业务层处理
@@ -248,9 +249,9 @@ public class PileMerchantInfoServiceImpl implements IPileMerchantInfoService {
return null;
}
try {
PileMerchantInfo pileMerchantInfo = pileMerchantInfoMapper.selectPileMerchantInfoByAppId(appId);
if (pileMerchantInfo != null) {
return pileMerchantInfo.getId().toString();
List<PileMerchantInfo> pileMerchantInfos = pileMerchantInfoMapper.selectPileMerchantInfoByAppId(appId);
if (CollectionUtils.isNotEmpty(pileMerchantInfos)) {
return pileMerchantInfos.get(0).getId().toString();
}
} catch (Exception e) {
log.error("通过appid获取运营商id error", e);
@@ -258,6 +259,23 @@ 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));