Browse Source

Merge branch 'develop' of http://git.elinkit.com.cn:7070/r/epmet-cloud into 主线测试

dev
jianjun 3 years ago
parent
commit
b46d0f0eb1
  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. 4
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/DataReportingServiceImpl.java
  4. 11
      epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/redis/AreaCodeRedis.java
  5. 19
      epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/AreaCodeServiceImpl.java
  6. 20
      epmet-module/epmet-common-service/common-service-server/src/main/resources/db/migration/V0.0.14__add_areacode_flag.sql
  7. 3
      epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcNatRelationEntity.java
  8. 2
      epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/IcNatImportExcelData.java
  9. 14
      epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/IcNatExcelImportListener.java
  10. 204
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNatServiceImpl.java
  11. BIN
      epmet-user/epmet-user-server/src/main/resources/excel/ic_nat.xlsx

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);
}
}

4
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/DataReportingServiceImpl.java

@ -139,7 +139,7 @@ public class DataReportingServiceImpl implements DataReportingService {
//根据入参,获取项目
long start = System.currentTimeMillis();
List<ScreenProjectDataDTO> projectList = screenProjectDataService.getProjectList(formDTO.getCustomerId(), formDTO.getProjectId(), formDTO.getPageNo(), formDTO.getPageSize());
log.error("事件上报-查询项目列表耗时:{}ms",System.currentTimeMillis()-start);
log.info("事件上报-查询项目列表耗时:{}ms",System.currentTimeMillis()-start);
//项目列表为空,返回空数组
if(CollectionUtils.isEmpty(projectList)) {
return Collections.emptyList();
@ -197,7 +197,7 @@ public class DataReportingServiceImpl implements DataReportingService {
return dto;
}).collect(Collectors.toList());
}
log.error("事件上报-组装数据耗时:{}ms",System.currentTimeMillis()-start);
log.info("事件上报-组装数据耗时:{}ms",System.currentTimeMillis()-start);
return list.stream().collect(collectingAndThen(toCollection(() -> new TreeSet<>(Comparator.comparing(EventInfoResultDTO::getId))), ArrayList::new));
}

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;
}

20
epmet-module/epmet-common-service/common-service-server/src/main/resources/db/migration/V0.0.14__add_areacode_flag.sql

@ -0,0 +1,20 @@
#添加 是否自定义字段
ALTER TABLE `epmet_common_service`.`area_code_child`
ADD COLUMN `USER_DEFINED` tinyint(1) NULL DEFAULT 0 COMMENT '是否自定义 1:是0否' AFTER `CATAGORY`;
#更新 字段值
UPDATE area_code_child SET USER_DEFINED = 1 WHERE code like '%_UD%';
#清空数据
DELETE FROM area_code_child WHERE USER_DEFINED = 0;
#插入数据
INSERT INTO `epmet_common_service`.`area_code_child` (`ID`, `CODE`, `NAME`, `P_CODE`, `LEVEL`, `CATAGORY`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`)
SELECT ID, `CODE`, `NAME`, `P_CODE`, `LEVEL`, `CATAGORY`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME` FROM area_code_child_new;
SELECT * FROM area_code_new WHERE county_code = '441900';
#清空数据
DELETE FROM area_code;
#插入数据
INSERT INTO `epmet_common_service`.`area_code`
SELECT * FROM area_code_new;
SELECT COUNT(1) FROM area_code;

3
epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcNatRelationEntity.java

@ -1,5 +1,7 @@
package com.epmet.entity;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
@ -24,6 +26,7 @@ public class IcNatRelationEntity extends BaseEpmetEntity {
/**
* 客户Id
*/
@TableField(fill = FieldFill.INSERT)
private String customerId;
/**

2
epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/IcNatImportExcelData.java

@ -40,7 +40,7 @@ public class IcNatImportExcelData {
private String natResultZh;
@Data
public static class ErrorRow {
public static class RowRemarkMessage {
@ExcelProperty("姓名")
@ColumnWidth(20)

14
epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/IcNatExcelImportListener.java

@ -9,6 +9,7 @@ import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.entity.IcNatEntity;
import com.epmet.excel.data.IcNatImportExcelData;
import com.epmet.service.impl.IcNatServiceImpl;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
@ -18,6 +19,7 @@ import java.util.List;
/**
* 核酸检测excel导入监听器
*/
@Data
@Slf4j
public class IcNatExcelImportListener implements ReadListener<IcNatImportExcelData> {
@ -42,7 +44,11 @@ public class IcNatExcelImportListener implements ReadListener<IcNatImportExcelDa
/**
* 错误项列表
*/
private List<IcNatImportExcelData.ErrorRow> errorRows = new ArrayList<>();
private List<IcNatImportExcelData.RowRemarkMessage> errorRows = new ArrayList<>();
/**
* 其他被标记出来的列表列表
*/
private List<IcNatImportExcelData.RowRemarkMessage> otherRows = new ArrayList<>();
private IcNatServiceImpl icNatService;
@ -89,7 +95,7 @@ public class IcNatExcelImportListener implements ReadListener<IcNatImportExcelDa
log.error("【核酸检测信息导入】出错:{}", ExceptionUtils.getErrorStackTrace(e));
}
IcNatImportExcelData.ErrorRow errorRow = new IcNatImportExcelData.ErrorRow();
IcNatImportExcelData.RowRemarkMessage errorRow = new IcNatImportExcelData.RowRemarkMessage();
errorRow.setName(data.getName());
errorRow.setMobile(data.getMobile());
errorRow.setIdCard(data.getIdCard());
@ -110,7 +116,7 @@ public class IcNatExcelImportListener implements ReadListener<IcNatImportExcelDa
private void execPersist() {
try {
if (datas != null && datas.size() > 0) {
icNatService.batchPersist(datas);
icNatService.batchPersist(datas, this);
}
} finally {
datas.clear();
@ -121,7 +127,7 @@ public class IcNatExcelImportListener implements ReadListener<IcNatImportExcelDa
* 获取错误行
* @return
*/
public List<IcNatImportExcelData.ErrorRow> getErrorRows() {
public List<IcNatImportExcelData.RowRemarkMessage> getErrorRows() {
return errorRows;
}
}

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

@ -22,6 +22,7 @@ import com.epmet.commons.tools.utils.*;
import com.epmet.constants.ImportTaskConstants;
import com.epmet.dao.IcNatDao;
import com.epmet.dao.IcNatRelationDao;
import com.epmet.dao.IcResiUserDao;
import com.epmet.dao.UserBaseInfoDao;
import com.epmet.dto.IcNatDTO;
import com.epmet.dto.IcNoticeDTO;
@ -29,6 +30,7 @@ import com.epmet.dto.form.*;
import com.epmet.dto.result.*;
import com.epmet.entity.IcNatEntity;
import com.epmet.entity.IcNatRelationEntity;
import com.epmet.entity.IcResiUserEntity;
import com.epmet.excel.data.IcNatImportExcelData;
import com.epmet.excel.handler.IcNatExcelImportListener;
import com.epmet.feign.EpmetCommonServiceOpenFeignClient;
@ -54,10 +56,7 @@ import java.io.IOException;
import java.io.OutputStream;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.UUID;
import java.util.*;
import java.util.stream.Collectors;
/**
@ -82,6 +81,8 @@ public class IcNatServiceImpl extends BaseServiceImpl<IcNatDao, IcNatEntity> imp
private UserBaseInfoDao userBaseInfoDao;
@Autowired
private IcNatRelationDao icNatRelationDao;
@Autowired
private IcResiUserDao icResiUserDao;
/**
* @Author sun
@ -91,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());
@ -208,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);
@ -313,13 +317,22 @@ public class IcNatServiceImpl extends BaseServiceImpl<IcNatDao, IcNatEntity> imp
LoginUserDetailsResultDTO loginUserDetails = getResultDataOrThrowsException(epmetUserOpenFeignClient.getLoginUserDetails(ludf), ServiceConstant.EPMET_USER_SERVER,
EpmetErrorCode.SERVER_ERROR.getCode(), "调用user出错", "");
IcNatExcelImportListener listener = new IcNatExcelImportListener(userId, loginUserDetails.getAgencyId(), loginUserDetails.getOrgIdPath(), this);
String agencyId = loginUserDetails.getAgencyId();
IcNatExcelImportListener listener = new IcNatExcelImportListener(userId, agencyId, loginUserDetails.getOrgIdPath().replace(":".concat(agencyId), ""), this);
EasyExcel.read(filePath.toFile(), IcNatImportExcelData.class, listener).headRowNumber(2).sheet(0).doRead();
Path errorDescFile = null;
String errorDesFileUrl = null;
List<IcNatImportExcelData.ErrorRow> errorRows = listener.getErrorRows();
List<IcNatImportExcelData.RowRemarkMessage> errorRows = listener.getErrorRows();
List<IcNatImportExcelData.RowRemarkMessage> otherRows = listener.getOtherRows();
boolean failed = errorRows.size() > 0;
// 合并到一起写入
errorRows.addAll(otherRows);
// 生成并上传错误文件
try {
@ -332,7 +345,7 @@ public class IcNatServiceImpl extends BaseServiceImpl<IcNatDao, IcNatEntity> imp
FileItem fileItem = factory.createItem("file", ContentType.APPLICATION_OCTET_STREAM.toString(), true, fileName);
OutputStream os = fileItem.getOutputStream();
EasyExcel.write(os, IcNatImportExcelData.ErrorRow.class).sheet("导入失败列表").doWrite(errorRows);
EasyExcel.write(os, IcNatImportExcelData.RowRemarkMessage.class).sheet("信息列表").doWrite(errorRows);
// 文件上传oss
Result<UploadImgResultDTO> errorDesFileUploadResult = ossFeignClient.uploadImportTaskDescFile(new CommonsMultipartFile(fileItem));
@ -347,7 +360,7 @@ public class IcNatServiceImpl extends BaseServiceImpl<IcNatDao, IcNatEntity> imp
ImportTaskCommonFormDTO importFinishTaskForm = new ImportTaskCommonFormDTO();
importFinishTaskForm.setTaskId(importTaskId);
importFinishTaskForm.setProcessStatus(errorRows.size() <= 0 ? ImportTaskConstants.PROCESS_STATUS_FINISHED_SUCCESS : ImportTaskConstants.PROCESS_STATUS_FINISHED_FAIL);
importFinishTaskForm.setProcessStatus(failed ? ImportTaskConstants.PROCESS_STATUS_FINISHED_FAIL : ImportTaskConstants.PROCESS_STATUS_FINISHED_SUCCESS);
importFinishTaskForm.setOperatorId(userId);
importFinishTaskForm.setResultDesc("");
importFinishTaskForm.setResultDescFilePath(errorDesFileUrl);
@ -425,14 +438,171 @@ public class IcNatServiceImpl extends BaseServiceImpl<IcNatDao, IcNatEntity> imp
* 批量持久化
* @param entities
*/
public void batchPersist(List<IcNatEntity> entities) {
//insertBatch(entities);
public void batchPersist(List<IcNatEntity> entities, IcNatExcelImportListener listener) {
String customerId = EpmetRequestHolder.getHeader(AppClientConstant.CUSTOMER_ID);
String currentUserId = EpmetRequestHolder.getHeader(AppClientConstant.USER_ID);
entities.forEach(e -> {
String id = IdWorker.getIdStr(e);
e.setId(id);
e.setUpdatedBy(currentUserId);
baseDao.insertOrUpdate(e);
try {
persisNat(e, customerId, currentUserId, listener);
} catch (Exception exception) {
String errorMsg = ExceptionUtils.getErrorStackTrace(exception);
log.error(errorMsg);
IcNatImportExcelData.RowRemarkMessage errorRow = new IcNatImportExcelData.RowRemarkMessage();
errorRow.setName(e.getName());
errorRow.setMobile(e.getMobile());
errorRow.setIdCard(e.getIdCard());
errorRow.setErrorInfo("未知系统错误");
listener.getErrorRows().add(errorRow);
}
});
}
/**
* 单条持久化
* @param e
* @param customerId
* @param currentUserId
* @param listener
*/
@Transactional(rollbackFor = Exception.class)
public void persisNat(IcNatEntity e, String customerId, String currentUserId, IcNatExcelImportListener listener) {
List<IcNatImportExcelData.RowRemarkMessage> otherRows = listener.getOtherRows();
Date natTime = e.getNatTime();
String idCard = e.getIdCard();
String name = e.getName();
String mobile = e.getMobile();
String natResult = e.getNatResult();
String natAddress = e.getNatAddress();
//1.先看客户下有没有这个人
IcNatEntity resiNat = getResiNat(customerId, idCard, natTime);
if (resiNat != null && !"import".equals(resiNat.getUserType())) {
// 有这个人,并且不是导入的
String message = "已存在该次核酸检测录入记录,请到系统中修改";
IcNatImportExcelData.RowRemarkMessage errorRow = new IcNatImportExcelData.RowRemarkMessage();
errorRow.setName(name);
errorRow.setMobile(mobile);
errorRow.setIdCard(idCard);
errorRow.setErrorInfo(message);
otherRows.add(errorRow);
return;
}
if (resiNat != null) {
boolean needUpdate = false;
// 有这个人,也是导入的,那就要更新le
ArrayList<String> changedFieldNames = new ArrayList<>();
if (!name.equals(resiNat.getName())) {
changedFieldNames.add("姓名");
resiNat.setName(name);
needUpdate = true;
}
if (!natResult.equals(resiNat.getNatResult())) {
changedFieldNames.add("检测结果");
resiNat.setNatResult(natResult);
needUpdate = true;
}
// 检测地点和手机号先不提示,说需要提示再提示
if (!natAddress.equals(resiNat.getNatAddress())) {
changedFieldNames.add("检测地点");
resiNat.setNatResult(natAddress);
needUpdate = true;
}
if (!mobile.equals(resiNat.getMobile())) {
changedFieldNames.add("手机号");
resiNat.setMobile(mobile);
needUpdate = true;
}
if (changedFieldNames.size() > 0) {
String fieldsStr = String.join(",", changedFieldNames);
String message = "该次核酸检测记录已存在,执行更新动作," + fieldsStr + "已成功更新";
IcNatImportExcelData.RowRemarkMessage errorRow = new IcNatImportExcelData.RowRemarkMessage();
errorRow.setName(name);
errorRow.setMobile(mobile);
errorRow.setIdCard(idCard);
errorRow.setErrorInfo(message);
otherRows.add(errorRow);
}
if (needUpdate) {
resiNat.setUpdatedBy(currentUserId);
resiNat.setUpdatedTime(new Date());
baseDao.updateById(resiNat);
}
// 还要创建关系
createNatRelation(resiNat.getId(), listener.getCurrentAgencyId(), listener.getCurrentAgencyPids());
return;
}
// 执行新增操作
e.setIsResiUser(isResi(customerId, idCard));
e.setUserType("import");
baseDao.insert(e);
// 还要创建关系
createNatRelation(e.getId(), listener.getCurrentAgencyId(), listener.getCurrentAgencyPids());
}
/**
* 是否是客户下的居民
* 0
* 1
* @param customerId
* @param idCard
* @return
*/
public String isResi(String customerId, String idCard) {
LambdaQueryWrapper<IcResiUserEntity> query = new LambdaQueryWrapper();
query.eq(IcResiUserEntity::getCustomerId, customerId);
query.eq(IcResiUserEntity::getIdCard, idCard);
return icResiUserDao.selectCount(query) > 0 ? "1" : "0";
}
/**
*
* @param customerId
* @param idCard
* @return
*/
public IcNatEntity getResiNat(String customerId, String idCard, Date natTime) {
LambdaQueryWrapper<IcNatEntity> query = new LambdaQueryWrapper<>();
query.eq(IcNatEntity::getCustomerId, customerId);
query.eq(IcNatEntity::getIdCard, idCard);
query.eq(IcNatEntity::getNatTime, natTime);
return baseDao.selectOne(query);
}
/**
* 创建nat关系
* @param natId
* @param currentUserAgencyId
*/
private void createNatRelation(String natId, String currentUserAgencyId, String agencyPids) {
// 没有关系创建关系,有关系就跳过
LambdaQueryWrapper<IcNatRelationEntity> query = new LambdaQueryWrapper<>();
query.eq(IcNatRelationEntity::getIcNatId, natId);
query.eq(IcNatRelationEntity::getAgencyId, currentUserAgencyId);
if (icNatRelationDao.selectCount(query) > 0) {
return;
}
IcNatRelationEntity relation = new IcNatRelationEntity();
relation.setAgencyId(currentUserAgencyId);
relation.setPids(String.join(":", Arrays.asList(agencyPids, currentUserAgencyId)));
relation.setIcNatId(natId);
relation.setUserType("import");
icNatRelationDao.insert(relation);
}
}

BIN
epmet-user/epmet-user-server/src/main/resources/excel/ic_nat.xlsx

Binary file not shown.
Loading…
Cancel
Save