update 新增站点白名单

This commit is contained in:
2023-11-02 09:33:45 +08:00
parent 76ed77250b
commit 632816e7d4
4 changed files with 20 additions and 6 deletions

View File

@@ -81,6 +81,7 @@ public class PileStationWhitelistController extends BaseController {
} catch (BusinessException e) { } catch (BusinessException e) {
result = AjaxResult.error(e.getMessage()); result = AjaxResult.error(e.getMessage());
} catch (Exception e) { } catch (Exception e) {
logger.error("添加站点白名单失败", e);
result = AjaxResult.error("添加站点白名单失败"); result = AjaxResult.error("添加站点白名单失败");
} }
return result; return result;

View File

@@ -1,6 +1,5 @@
package com.jsowell.pile.service; package com.jsowell.pile.service;
import com.jsowell.common.core.domain.vo.AuthorizedDeptVO;
import com.jsowell.pile.domain.PileMerchantInfo; import com.jsowell.pile.domain.PileMerchantInfo;
import com.jsowell.pile.dto.CreateMerchantDTO; import com.jsowell.pile.dto.CreateMerchantDTO;
import com.jsowell.pile.dto.QueryMerchantInfoDTO; import com.jsowell.pile.dto.QueryMerchantInfoDTO;
@@ -119,5 +118,8 @@ public interface IPileMerchantInfoService {
*/ */
PileMerchantInfo getFirstLevelMerchantByMerchantId(String merchantId); PileMerchantInfo getFirstLevelMerchantByMerchantId(String merchantId);
/**
* 通过merchantId获取一级运营商id
*/
String getFirstLevelMerchantIdByMerchantId(String merchantId); String getFirstLevelMerchantIdByMerchantId(String merchantId);
} }

View File

@@ -3,11 +3,9 @@ package com.jsowell.pile.service.impl;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.jsowell.common.constant.CacheConstants; import com.jsowell.common.constant.CacheConstants;
import com.jsowell.common.constant.Constants; import com.jsowell.common.constant.Constants;
import com.jsowell.common.core.domain.vo.AuthorizedDeptVO;
import com.jsowell.common.core.redis.RedisCache; import com.jsowell.common.core.redis.RedisCache;
import com.jsowell.common.enums.MemberWalletEnum; import com.jsowell.common.enums.MemberWalletEnum;
import com.jsowell.common.util.DateUtils; import com.jsowell.common.util.DateUtils;
import com.jsowell.common.util.SecurityUtils;
import com.jsowell.common.util.StringUtils; import com.jsowell.common.util.StringUtils;
import com.jsowell.pile.domain.MemberBasicInfo; import com.jsowell.pile.domain.MemberBasicInfo;
import com.jsowell.pile.domain.MemberPlateNumberRelation; import com.jsowell.pile.domain.MemberPlateNumberRelation;
@@ -37,7 +35,6 @@ import org.springframework.stereotype.Service;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
/** /**
* 会员基础信息Service业务层处理 * 会员基础信息Service业务层处理
@@ -141,7 +138,7 @@ public class MemberBasicInfoServiceImpl implements IMemberBasicInfoService {
/** /**
* 根据手机号和运营商id查询会员信息 * 根据手机号和运营商id查询会员信息
* @param mobileNumber 手机号 * @param mobileNumber 手机号
* @param merchantId 运营商id * @param merchantId 所属运营商 运营商id
* @return 会员信息 * @return 会员信息
*/ */
@Override @Override

View File

@@ -8,7 +8,10 @@ import com.jsowell.pile.domain.MemberBasicInfo;
import com.jsowell.pile.domain.PileStationWhitelist; import com.jsowell.pile.domain.PileStationWhitelist;
import com.jsowell.pile.mapper.PileStationWhitelistMapper; import com.jsowell.pile.mapper.PileStationWhitelistMapper;
import com.jsowell.pile.service.IMemberBasicInfoService; import com.jsowell.pile.service.IMemberBasicInfoService;
import com.jsowell.pile.service.IPileMerchantInfoService;
import com.jsowell.pile.service.IPileStationInfoService;
import com.jsowell.pile.service.IPileStationWhitelistService; import com.jsowell.pile.service.IPileStationWhitelistService;
import com.jsowell.pile.vo.web.PileStationVO;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@@ -29,6 +32,12 @@ public class PileStationWhitelistServiceImpl implements IPileStationWhitelistSer
@Autowired @Autowired
private IMemberBasicInfoService memberBasicInfoService; private IMemberBasicInfoService memberBasicInfoService;
@Autowired
private IPileStationInfoService pileStationInfoService;
@Autowired
private IPileMerchantInfoService pileMerchantInfoService;
/** /**
* 查询站点白名单 * 查询站点白名单
* *
@@ -63,7 +72,12 @@ public class PileStationWhitelistServiceImpl implements IPileStationWhitelistSer
if (StringUtils.isBlank(pileStationWhitelist.getMobileNumber())) { if (StringUtils.isBlank(pileStationWhitelist.getMobileNumber())) {
throw new BusinessException(ReturnCodeEnum.CODE_PARAM_NOT_NULL_ERROR); throw new BusinessException(ReturnCodeEnum.CODE_PARAM_NOT_NULL_ERROR);
} }
MemberBasicInfo memberInfo = memberBasicInfoService.selectInfoByMobileNumber(pileStationWhitelist.getMobileNumber(), pileStationWhitelist.getMerchantId()); // 查询站点信息
PileStationVO stationInfo = pileStationInfoService.getStationInfo(pileStationWhitelist.getStationId());
// 获取一级运营商id
String firstLevelMerchantId = pileMerchantInfoService.getFirstLevelMerchantIdByMerchantId(stationInfo.getMerchantId());
// 查询是否注册会员
MemberBasicInfo memberInfo = memberBasicInfoService.selectInfoByMobileNumber(pileStationWhitelist.getMobileNumber(), firstLevelMerchantId);
if (memberInfo == null) { if (memberInfo == null) {
throw new BusinessException(ReturnCodeEnum.CODE_MEMBER_NOT_FOUND_ERROR); throw new BusinessException(ReturnCodeEnum.CODE_MEMBER_NOT_FOUND_ERROR);
} }