Browse Source

Merge remote-tracking branch 'origin/dev_epidemic_situation' into dev_epidemic_situation

master
wangxianzhang 3 years ago
parent
commit
d960748180
  1. 1
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java
  2. 10
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java
  3. 11
      epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/redis/AreaCodeRedis.java
  4. 19
      epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/AreaCodeServiceImpl.java
  5. 9
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNatServiceImpl.java

1
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java

@ -252,6 +252,7 @@ public enum EpmetErrorCode {
ORG_DEL_FAILED(8921,"删除失败"),
NEIGHBORHOOD_DEL_FAILED(8922,""),
IC_NAT_IDCARD_NATTIME(8923,"已存在相同记录"),
IC_NAT(8924,"平台已存在记录,请去修改原有记录"),
//通用错误码 start

10
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java

@ -753,4 +753,14 @@ public class RedisKeys {
public static String getCustomerMenuListPrefix() {
return rootPrefix.concat("oper:access:nav:customerId:");
}
/**
* 如果是省列表epmet:areacode:parentCode:0
* 山东省的下一级epmet:areacode:parentCode:37
* @param areaCode
* @return
*/
public static String getNextAreaCodeKey(String areaCode) {
return rootPrefix.concat("areaCode:parentCode:").concat(areaCode);
}
}

11
epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/redis/AreaCodeRedis.java

@ -19,9 +19,12 @@ package com.epmet.redis;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.redis.RedisUtils;
import com.epmet.dto.result.AreaCodeResultDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.List;
/**
* 大陆省市区地区码
*
@ -49,4 +52,12 @@ public class AreaCodeRedis {
return null;
}
public List<AreaCodeResultDTO> getNextAreaCodeKey(String key) {
List<AreaCodeResultDTO> list = (List<AreaCodeResultDTO>) redisUtils.get(key);
return list;
}
public void setNextAreaCodeKey(String key, List<AreaCodeResultDTO> list) {
redisUtils.set(key, list);
}
}

19
epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/AreaCodeServiceImpl.java

@ -29,6 +29,7 @@ import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.redis.RedisKeys;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.constant.AreaCodeConstant;
import com.epmet.dao.AreaCodeChildDao;
@ -693,9 +694,20 @@ public class AreaCodeServiceImpl extends BaseServiceImpl<AreaCodeDao, AreaCodeEn
@Override
public List<AreaCodeResultDTO> nextArea(AreaCodeFormDTO formDTO) {
if(StringUtils.isBlank(formDTO.getParentAreaCode())&&StringUtils.isBlank(formDTO.getParentLevel())){
return baseDao.selectProvince();
String pKey=RedisKeys.getNextAreaCodeKey(NumConstant.ZERO_STR);
List<AreaCodeResultDTO> list=areaCodeRedis.getNextAreaCodeKey(pKey);
if(org.apache.commons.collections4.CollectionUtils.isNotEmpty(list)){
return list;
}
List<AreaCodeResultDTO> pList=baseDao.selectProvince();
areaCodeRedis.setNextAreaCodeKey(pKey,pList);
return pList;
}
String key=RedisKeys.getNextAreaCodeKey(formDTO.getParentAreaCode());
List<AreaCodeResultDTO> list=areaCodeRedis.getNextAreaCodeKey(key);
if(org.apache.commons.collections4.CollectionUtils.isNotEmpty(list)){
return list;
}
List<AreaCodeResultDTO> list=new ArrayList<>();
switch (formDTO.getParentLevel()) {
case AreaCodeConstant.PROVINCE:
list = baseDao.selectCity(formDTO.getParentAreaCode());
@ -716,6 +728,9 @@ public class AreaCodeServiceImpl extends BaseServiceImpl<AreaCodeDao, AreaCodeEn
default:
log.warn("parentLevel错误:"+formDTO.getParentLevel());
}
if(org.apache.commons.collections4.CollectionUtils.isNotEmpty(list)){
areaCodeRedis.setNextAreaCodeKey(key,list);
}
return list;
}

9
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNatServiceImpl.java

@ -92,9 +92,12 @@ public class IcNatServiceImpl extends BaseServiceImpl<IcNatDao, IcNatEntity> imp
@Transactional(rollbackFor = Exception.class)
public void add(AddIcNatFormDTO formDTO) {
//0.先根据身份证号和检查时间以及检测结果校验数据是否存在
IcNatDTO icNatDTO = baseDao.getNatDTO(formDTO.getCustomerId(), null, formDTO.getIdCard(), DateUtils.format(formDTO.getNatTime(), DateUtils.DATE_TIME_PATTERN_END_WITH_MINUTE), formDTO.getNatResult());
if (null != icNatDTO) {
IcNatDTO icNatDTO = baseDao.getNatDTO(formDTO.getCustomerId(), null, formDTO.getIdCard(), DateUtils.format(formDTO.getNatTime(), DateUtils.DATE_TIME_PATTERN_END_WITH_MINUTE), null);
//按身份证号核酸时间存在记录的 核酸结果相同的提示已存在相同记录核酸结果不同的提示已存在去修改【业务要求的】
if (null != icNatDTO && icNatDTO.getNatResult().equals(formDTO.getNatResult())) {
throw new RenException(EpmetErrorCode.IC_NAT_IDCARD_NATTIME.getCode(), EpmetErrorCode.IC_NAT_IDCARD_NATTIME.getMsg());
} else if (null != icNatDTO && !icNatDTO.getNatResult().equals(formDTO.getNatResult())) {
throw new RenException(EpmetErrorCode.IC_NAT.getCode(), EpmetErrorCode.IC_NAT.getMsg());
}
//1.获取所填居民所属组织缓存信息
AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(formDTO.getAgencyId());
@ -209,7 +212,7 @@ public class IcNatServiceImpl extends BaseServiceImpl<IcNatDao, IcNatEntity> imp
//0.先根据身份证号和检测时间以及检测结果校验除当前数据是否还存在相同数据
IcNatDTO icNatDTO = baseDao.getNatDTO(formDTO.getCustomerId(), formDTO.getIcNatId(), formDTO.getIdCard(), DateUtils.format(formDTO.getNatTime(), DateUtils.DATE_TIME_PATTERN_END_WITH_MINUTE), formDTO.getNatResult());
if (null != icNatDTO) {
throw new RenException(EpmetErrorCode.IC_NAT_IDCARD_NATTIME.getCode(), EpmetErrorCode.IC_NAT_IDCARD_NATTIME.getMsg());
throw new RenException(EpmetErrorCode.IC_NAT.getCode(), EpmetErrorCode.IC_NAT.getMsg());
}
//1.更新核酸记录基础信息表数据
IcNatEntity entity = ConvertUtils.sourceToTarget(formDTO, IcNatEntity.class);

Loading…
Cancel
Save