From 02525ad7998bbcc25a38679d8d880ddc8e2d54c0 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Sat, 2 Apr 2022 10:21:22 +0800 Subject: [PATCH 01/10] zhushixia --- .../main/java/com/epmet/controller/HouseController.java | 7 ++++++- .../main/java/com/epmet/service/impl/HouseServiceImpl.java | 4 +++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java index ab86eb425b..74021391de 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java @@ -170,8 +170,13 @@ public class HouseController implements ResultDataResolver { return new Result(); } + /** + * lzh + * @param formDTO + * @return 单独删除房屋内部调用/gov/org/house/delete + */ @PostMapping("housedel") - public Result houseDel(@LoginUser TokenDto tokenDTO, @RequestBody IcHouseFormDTO formDTO){ + public Result houseDel(@RequestBody IcHouseFormDTO formDTO){ //效验数据 ValidatorUtils.validateEntity(formDTO, IcNeighborHoodFormDTO.DeleteGroup.class); houseService.delHouse(formDTO.getHouseId()); diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java index 6a07ba0ea2..44d1cbfa58 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java @@ -153,7 +153,9 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver { //单个删除房屋,房屋内有居民不允许删除 NeighborHoodManageDelFormDTO formDTO=new NeighborHoodManageDelFormDTO(); formDTO.setType(CustomerGridConstant.HOUSE); - formDTO.setIds(Arrays.asList(houseId)); + List ids=new ArrayList<>(); + ids.add(houseId); + formDTO.setIds(ids); allDelete(formDTO); } From a5eec335b68c264697960fa71d5ca4b5b1d8eacc Mon Sep 17 00:00:00 2001 From: wangxianzhang Date: Sat, 2 Apr 2022 11:04:41 +0800 Subject: [PATCH 02/10] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=EF=BC=9A1.=E6=A0=B8?= =?UTF-8?q?=E9=85=B8=E6=A3=80=E6=B5=8B=E7=BB=93=E6=9E=9C=E5=A1=AB=E5=85=A5?= =?UTF-8?q?=E6=A0=B8=E9=85=B8=E6=A3=80=E6=B5=8B=E5=9C=B0=E5=9D=80=E5=AF=BC?= =?UTF-8?q?=E8=87=B4sql=E6=8A=A5=E9=94=99=E7=9A=84bug=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../excel/data/IcNatImportExcelData.java | 3 ++- .../handler/IcNatExcelImportListener.java | 5 ++++ .../epmet/service/impl/IcNatServiceImpl.java | 24 ++++++++++++------- 3 files changed, 22 insertions(+), 10 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 266da5175a..385d02b171 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 @@ -2,8 +2,8 @@ package com.epmet.excel.data; import com.alibaba.excel.annotation.ExcelProperty; import com.alibaba.excel.annotation.write.style.ColumnWidth; -import com.epmet.dto.form.AddIcNatFormDTO; import lombok.Data; +import org.hibernate.validator.constraints.Length; import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotNull; @@ -25,6 +25,7 @@ public class IcNatImportExcelData { @NotBlank(message = "身份证号为必填项") @ExcelProperty("身份证号") + @Length(max = 18, message = "身份证号长度不正确,应小于18位") private String idCard; @NotNull(message = "检测时间为必填项") 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 854507d471..db24888b03 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 @@ -66,6 +66,11 @@ public class IcNatExcelImportListener implements ReadListener imp private IcNatRelationDao icNatRelationDao; @Autowired private IcResiUserDao icResiUserDao; + @Autowired + private UserService userService; /** * @Author sun @@ -313,9 +314,7 @@ public class IcNatServiceImpl extends BaseServiceImpl imp String app = EpmetRequestHolder.getHeader(AppClientConstant.APP); String client = EpmetRequestHolder.getHeader(AppClientConstant.CLIENT); - LoginUserDetailsFormDTO ludf = new LoginUserDetailsFormDTO(app, client, userId); - LoginUserDetailsResultDTO loginUserDetails = getResultDataOrThrowsException(epmetUserOpenFeignClient.getLoginUserDetails(ludf), ServiceConstant.EPMET_USER_SERVER, - EpmetErrorCode.SERVER_ERROR.getCode(), "调用user出错", ""); + LoginUserDetailsResultDTO loginUserDetails = userService.getLoginUserDetails(app, client, userId); String agencyId = loginUserDetails.getAgencyId(); @@ -513,7 +512,7 @@ public class IcNatServiceImpl extends BaseServiceImpl imp // 检测地点和手机号先不提示,说需要提示再提示 if (!natAddress.equals(resiNat.getNatAddress())) { changedFieldNames.add("检测地点"); - resiNat.setNatResult(natAddress); + resiNat.setNatAddress(natAddress); needUpdate = true; } @@ -537,6 +536,11 @@ public class IcNatServiceImpl extends BaseServiceImpl imp if (needUpdate) { resiNat.setUpdatedBy(currentUserId); resiNat.setUpdatedTime(new Date()); + + IcResiUserEntity resi = getResi(customerId, idCard); + resiNat.setIsResiUser(resi != null ? "1" : "0"); + resiNat.setUserId(resi != null ? resi.getId() : ""); + baseDao.updateById(resiNat); } @@ -547,7 +551,9 @@ public class IcNatServiceImpl extends BaseServiceImpl imp } // 执行新增操作 - e.setIsResiUser(isResi(customerId, idCard)); + IcResiUserEntity resi = getResi(customerId, idCard); + e.setIsResiUser(resi != null ? "1" : "0"); + e.setUserId(resi != null ? resi.getId() : ""); e.setUserType("import"); baseDao.insert(e); @@ -564,11 +570,11 @@ public class IcNatServiceImpl extends BaseServiceImpl imp * @param idCard * @return */ - public String isResi(String customerId, String idCard) { + public IcResiUserEntity getResi(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"; + return icResiUserDao.selectOne(query); } /** From afe68a52d72e2cfa26de8b1549fdff48b48338f9 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Sat, 2 Apr 2022 13:35:23 +0800 Subject: [PATCH 03/10] =?UTF-8?q?=E5=88=97=E8=A1=A8=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E6=8E=92=E5=BA=8F=E3=80=81=E8=A1=A8=E5=A2=9E=E5=8A=A0=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E7=94=A8=E7=B4=A2=E5=BC=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/controller/IcNatController.java | 15 +++++++++++++++ .../db/migration/V0.0.36__ic_nat_normal.sql | 4 ++++ .../src/main/resources/mapper/IcNatDao.xml | 4 ++-- 3 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.36__ic_nat_normal.sql diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNatController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNatController.java index 6ef36407e7..e2d6b7344f 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNatController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcNatController.java @@ -63,6 +63,21 @@ public class IcNatController implements ResultDataResolver { @Autowired private EpmetCommonServiceOpenFeignClient commonServiceOpenFeignClient; + /** + * 记录一下核酸记录模块的业务程序逻辑,防止后续理不清 ic_nat:基础信息表 ic_nat_relation:关系表 + * 1.数字平台导入时,按身份证检测时间查询数据,查到数据不是导入的状态则记录下并跳过,是导入数据更新结果,未查到直接新增 + * 是否居民以及userId值查询数据平台居民,能查到就相应的赋值; + * 2.居民端录入可以录自己的或别人的,但是数据属于当前录入的组织; + * 3.数据平台录入可以为已有居民录入也可以录新数据,新数据则是否居民和userId无值; + * 4.导入数据不允许修改删除,录入数据可以修改删除,删除时相应的删除基础表和可能存在的所有关心表数据, + * 数据同步可多次重复,只是修改对应的关系表数据,基础信息表数据公用; + * 5.同一条数据被A街道和A社区都同步了,街道在看本辖区数据时会看到两条,但是只有A街道的那一条才能看到取消同步按钮; + * 6.数据库一个人一个检测时间只存在一条记录,以导入数据结果为准,已导入的各项值都不能修改,即使错误也只能通过导入修改; + * 7.新增、删除居民时会相应的修改基础信息表是否居民以及userId的值; + * 注:1.导入数据不允许修改是觉得导入数据是官方提供的且没有问题的数据,不需要在平台有维护操作,只要看就可以了; + * 2.是否居民的查询条件以及是否居民的列标题在看整个客户列表数据时这两个都隐藏 + * + */ /** * @Author sun diff --git a/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.36__ic_nat_normal.sql b/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.36__ic_nat_normal.sql new file mode 100644 index 0000000000..a0bfefa9f9 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.36__ic_nat_normal.sql @@ -0,0 +1,4 @@ +ALTER TABLE `ic_nat` +MODIFY COLUMN `USER_TYPE` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '数据来源【居民端小程序的人:resi;\r\n数字社区的居民:icresi;\r\n导入的:import;】' AFTER `USER_ID`, +ADD INDEX `idx_ic_card` (`ID_CARD`) USING BTREE ; + diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcNatDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcNatDao.xml index 66a10d467d..16b5e20990 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/IcNatDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcNatDao.xml @@ -69,7 +69,7 @@ AND b.is_resi_user = #{isResiUser} - ORDER BY b.nat_time DESC + ORDER BY b.nat_time DESC, b.id ASC +