From a13573d76b0ccce13b94c729dda31cccc0bd281b Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Fri, 1 Apr 2022 10:31:02 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BA=8B=E4=BB=B6?= =?UTF-8?q?=E4=B8=8A=E6=8A=A5=E8=80=97=E6=97=B6log?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/service/impl/DataReportingServiceImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/DataReportingServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/DataReportingServiceImpl.java index 3bc6b5969d..8b33031420 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/DataReportingServiceImpl.java +++ b/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 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)); } From 6cbd70cc26b303865529149fd98b98e7eee995cb Mon Sep 17 00:00:00 2001 From: wangxianzhang Date: Fri, 1 Apr 2022 15:49:41 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E5=AF=BC=E5=85=A5=E6=A0=B8=E9=85=B8?= =?UTF-8?q?=E6=A3=80=E6=B5=8B=EF=BC=9A=E9=92=88=E5=AF=B9=E6=96=B0=E9=9C=80?= =?UTF-8?q?=E6=B1=82=E9=87=8D=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/entity/IcNatRelationEntity.java | 3 + .../handler/IcNatExcelImportListener.java | 4 +- .../epmet/service/impl/IcNatServiceImpl.java | 182 ++++++++++++++++-- .../src/main/resources/excel/ic_nat.xlsx | Bin 9157 -> 9220 bytes 4 files changed, 177 insertions(+), 12 deletions(-) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcNatRelationEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcNatRelationEntity.java index 7da911ee59..ce74babe94 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcNatRelationEntity.java +++ b/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; /** diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/IcNatExcelImportListener.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/IcNatExcelImportListener.java index dccc8d106a..32bb100b3b 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/IcNatExcelImportListener.java +++ b/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 { @@ -110,7 +112,7 @@ public class IcNatExcelImportListener implements ReadListener 0) { - icNatService.batchPersist(datas); + icNatService.batchPersist(datas, this); } } finally { datas.clear(); diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNatServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNatServiceImpl.java index a71f480f26..51e22193de 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNatServiceImpl.java +++ b/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 imp private UserBaseInfoDao userBaseInfoDao; @Autowired private IcNatRelationDao icNatRelationDao; + @Autowired + private IcResiUserDao icResiUserDao; /** * @Author sun @@ -313,7 +314,9 @@ public class IcNatServiceImpl extends BaseServiceImpl 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(); @@ -425,14 +428,171 @@ public class IcNatServiceImpl extends BaseServiceImpl imp * 批量持久化 * @param entities */ - public void batchPersist(List entities) { - //insertBatch(entities); + public void batchPersist(List 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.ErrorRow errorRow = new IcNatImportExcelData.ErrorRow(); + errorRow.setName(e.getName()); + errorRow.setMobile(e.getMobile()); + errorRow.setIdCard(e.getIdCard()); + errorRow.setErrorInfo("未知系统错误c "); + 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 errorRows = listener.getErrorRows(); + + 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.ErrorRow errorRow = new IcNatImportExcelData.ErrorRow(); + errorRow.setName(name); + errorRow.setMobile(mobile); + errorRow.setIdCard(idCard); + errorRow.setErrorInfo(message); + errorRows.add(errorRow); + return; + } + + if (resiNat != null) { + boolean needUpdate = false; + // 有这个人,也是导入的,那就要更新le + ArrayList 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.ErrorRow errorRow = new IcNatImportExcelData.ErrorRow(); + errorRow.setName(name); + errorRow.setMobile(mobile); + errorRow.setIdCard(idCard); + errorRow.setErrorInfo(message); + errorRows.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 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 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 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); + } } diff --git a/epmet-user/epmet-user-server/src/main/resources/excel/ic_nat.xlsx b/epmet-user/epmet-user-server/src/main/resources/excel/ic_nat.xlsx index d74d726f950651308593eff7a73765535b44aff8..d9038bfdc4faa94007e45287efb4b4b9e34a099b 100644 GIT binary patch delta 4517 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:34:13 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E9=9C=80=E6=B1=82=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/commons/tools/exception/EpmetErrorCode.java | 1 + .../java/com/epmet/service/impl/IcNatServiceImpl.java | 9 ++++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java index e0623c7648..a059504d2e 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java +++ b/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 diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNatServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNatServiceImpl.java index 51e22193de..cbb234aa0d 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNatServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNatServiceImpl.java @@ -92,9 +92,12 @@ public class IcNatServiceImpl extends BaseServiceImpl 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 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); From d8f723a873b6e0b67bcf2b4ac42c769bcc8e3ed6 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Fri, 1 Apr 2022 17:02:07 +0800 Subject: [PATCH 4/6] redis --- .../epmet/commons/tools/redis/RedisKeys.java | 10 ++++++++++ .../java/com/epmet/redis/AreaCodeRedis.java | 11 +++++++++++ .../service/impl/AreaCodeServiceImpl.java | 19 +++++++++++++++++-- 3 files changed, 38 insertions(+), 2 deletions(-) diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java index 7bc68a4842..04db67cfed 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java +++ b/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); + } } diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/redis/AreaCodeRedis.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/redis/AreaCodeRedis.java index d1c6218ea0..1743dcb3d4 100644 --- a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/redis/AreaCodeRedis.java +++ b/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 getNextAreaCodeKey(String key) { + List list = (List) redisUtils.get(key); + return list; + } + + public void setNextAreaCodeKey(String key, List list) { + redisUtils.set(key, list); + } } \ No newline at end of file diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/AreaCodeServiceImpl.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/AreaCodeServiceImpl.java index f300c4bb4e..6f4ad9f000 100644 --- a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/AreaCodeServiceImpl.java +++ b/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 nextArea(AreaCodeFormDTO formDTO) { if(StringUtils.isBlank(formDTO.getParentAreaCode())&&StringUtils.isBlank(formDTO.getParentLevel())){ - return baseDao.selectProvince(); + String pKey=RedisKeys.getNextAreaCodeKey(NumConstant.ZERO_STR); + List list=areaCodeRedis.getNextAreaCodeKey(pKey); + if(org.apache.commons.collections4.CollectionUtils.isNotEmpty(list)){ + return list; + } + List pList=baseDao.selectProvince(); + areaCodeRedis.setNextAreaCodeKey(pKey,pList); + return pList; + } + String key=RedisKeys.getNextAreaCodeKey(formDTO.getParentAreaCode()); + List list=areaCodeRedis.getNextAreaCodeKey(key); + if(org.apache.commons.collections4.CollectionUtils.isNotEmpty(list)){ + return list; } - List list=new ArrayList<>(); switch (formDTO.getParentLevel()) { case AreaCodeConstant.PROVINCE: list = baseDao.selectCity(formDTO.getParentAreaCode()); @@ -716,6 +728,9 @@ public class AreaCodeServiceImpl extends BaseServiceImpl Date: Fri, 1 Apr 2022 17:12:30 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E5=AF=BC=E5=85=A5=E6=A0=B8=E9=85=B8?= =?UTF-8?q?=E6=A3=80=E6=B5=8B=EF=BC=9A=E6=9B=B4=E6=96=B0=E4=BA=86=EF=BC=8C?= =?UTF-8?q?=E6=88=96=E8=80=85=E6=98=AF=E8=B7=B3=E8=BF=87=E4=BA=86=EF=BC=8C?= =?UTF-8?q?=E9=83=BD=E7=AE=97=E6=98=AF=E6=88=90=E5=8A=9F=E7=9A=84=EF=BC=8C?= =?UTF-8?q?=E5=8F=AA=E6=9C=89=E5=87=BA=E7=8E=B0=E5=BC=82=E5=B8=B8=EF=BC=8C?= =?UTF-8?q?=E6=88=96=E8=80=85=E4=BF=A1=E6=81=AF=E7=A1=AE=E5=AE=9E=E6=A0=A1?= =?UTF-8?q?=E9=AA=8C=E4=B8=8D=E9=80=9A=E8=BF=87=EF=BC=8C=E6=89=8D=E7=AE=97?= =?UTF-8?q?=E6=98=AF=E5=A4=B1=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../excel/data/IcNatImportExcelData.java | 2 +- .../handler/IcNatExcelImportListener.java | 10 ++++--- .../epmet/service/impl/IcNatServiceImpl.java | 27 ++++++++++++------- 3 files changed, 25 insertions(+), 14 deletions(-) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/IcNatImportExcelData.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/IcNatImportExcelData.java index 6e8d252c1f..b29a1928ff 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/data/IcNatImportExcelData.java +++ b/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) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/IcNatExcelImportListener.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/IcNatExcelImportListener.java index 32bb100b3b..854507d471 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/IcNatExcelImportListener.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/handler/IcNatExcelImportListener.java @@ -44,7 +44,11 @@ public class IcNatExcelImportListener implements ReadListener errorRows = new ArrayList<>(); + private List errorRows = new ArrayList<>(); + /** + * 其他被标记出来的列表列表 + */ + private List otherRows = new ArrayList<>(); private IcNatServiceImpl icNatService; @@ -91,7 +95,7 @@ public class IcNatExcelImportListener implements ReadListener getErrorRows() { + public List getErrorRows() { return errorRows; } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNatServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNatServiceImpl.java index 51e22193de..1a0caf24e5 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNatServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcNatServiceImpl.java @@ -322,7 +322,14 @@ public class IcNatServiceImpl extends BaseServiceImpl imp Path errorDescFile = null; String errorDesFileUrl = null; - List errorRows = listener.getErrorRows(); + + List errorRows = listener.getErrorRows(); + List otherRows = listener.getOtherRows(); + + boolean failed = errorRows.size() > 0; + + // 合并到一起写入 + errorRows.addAll(otherRows); // 生成并上传错误文件 try { @@ -335,7 +342,7 @@ public class IcNatServiceImpl extends BaseServiceImpl 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 errorDesFileUploadResult = ossFeignClient.uploadImportTaskDescFile(new CommonsMultipartFile(fileItem)); @@ -350,7 +357,7 @@ public class IcNatServiceImpl extends BaseServiceImpl 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); @@ -439,11 +446,11 @@ public class IcNatServiceImpl extends BaseServiceImpl imp String errorMsg = ExceptionUtils.getErrorStackTrace(exception); log.error(errorMsg); - IcNatImportExcelData.ErrorRow errorRow = new IcNatImportExcelData.ErrorRow(); + IcNatImportExcelData.RowRemarkMessage errorRow = new IcNatImportExcelData.RowRemarkMessage(); errorRow.setName(e.getName()); errorRow.setMobile(e.getMobile()); errorRow.setIdCard(e.getIdCard()); - errorRow.setErrorInfo("未知系统错误c "); + errorRow.setErrorInfo("未知系统错误"); listener.getErrorRows().add(errorRow); } }); @@ -458,7 +465,7 @@ public class IcNatServiceImpl extends BaseServiceImpl imp */ @Transactional(rollbackFor = Exception.class) public void persisNat(IcNatEntity e, String customerId, String currentUserId, IcNatExcelImportListener listener) { - List errorRows = listener.getErrorRows(); + List otherRows = listener.getOtherRows(); Date natTime = e.getNatTime(); String idCard = e.getIdCard(); @@ -473,12 +480,12 @@ public class IcNatServiceImpl extends BaseServiceImpl imp // 有这个人,并且不是导入的 String message = "已存在该次核酸检测录入记录,请到系统中修改"; - IcNatImportExcelData.ErrorRow errorRow = new IcNatImportExcelData.ErrorRow(); + IcNatImportExcelData.RowRemarkMessage errorRow = new IcNatImportExcelData.RowRemarkMessage(); errorRow.setName(name); errorRow.setMobile(mobile); errorRow.setIdCard(idCard); errorRow.setErrorInfo(message); - errorRows.add(errorRow); + otherRows.add(errorRow); return; } @@ -514,12 +521,12 @@ public class IcNatServiceImpl extends BaseServiceImpl imp if (changedFieldNames.size() > 0) { String fieldsStr = String.join(",", changedFieldNames); String message = "该次核酸检测记录已存在,执行更新动作," + fieldsStr + "已成功更新"; - IcNatImportExcelData.ErrorRow errorRow = new IcNatImportExcelData.ErrorRow(); + IcNatImportExcelData.RowRemarkMessage errorRow = new IcNatImportExcelData.RowRemarkMessage(); errorRow.setName(name); errorRow.setMobile(mobile); errorRow.setIdCard(idCard); errorRow.setErrorInfo(message); - errorRows.add(errorRow); + otherRows.add(errorRow); } if (needUpdate) { From 7e6b5d19799709dc05be24c349a1c25f76ab6951 Mon Sep 17 00:00:00 2001 From: jianjun Date: Fri, 1 Apr 2022 17:41:52 +0800 Subject: [PATCH 6/6] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../migration/V0.0.14__add_areacode_flag.sql | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 epmet-module/epmet-common-service/common-service-server/src/main/resources/db/migration/V0.0.14__add_areacode_flag.sql diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/resources/db/migration/V0.0.14__add_areacode_flag.sql b/epmet-module/epmet-common-service/common-service-server/src/main/resources/db/migration/V0.0.14__add_areacode_flag.sql new file mode 100644 index 0000000000..6e0bc91b75 --- /dev/null +++ b/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;