diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/DataSyncRecordDisabilityDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/DataSyncRecordDisabilityDTO.java index 66762c7617..517a6bf26d 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/DataSyncRecordDisabilityDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/DataSyncRecordDisabilityDTO.java @@ -107,6 +107,7 @@ public class DataSyncRecordDisabilityDTO implements Serializable { * 现居住地址 */ private String nowAdd; + private String address; /** * 监护人 diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/DataSyncRecordDisabilityController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/DataSyncRecordDisabilityController.java index 4685545676..b9e8cd3c15 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/DataSyncRecordDisabilityController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/DataSyncRecordDisabilityController.java @@ -74,6 +74,14 @@ public class DataSyncRecordDisabilityController { return new Result(); } + /** + * Desc: 导出 + * @param tokenDto + * @param formDTO + * @param response + * @author zxc + * @date 2022/10/13 16:17 + */ @PostMapping("export") public void export(@LoginUser TokenDto tokenDto, @RequestBody DataSyncRecordDisabilityFormDTO formDTO, HttpServletResponse response) throws IOException { formDTO.setCustomerId(tokenDto.getCustomerId()); @@ -81,9 +89,15 @@ public class DataSyncRecordDisabilityController { dataSyncRecordDisabilityService.export(formDTO,response); } + /** + * Desc: 批量更新 + * @param ids + * @author zxc + * @date 2022/10/13 16:18 + */ @PostMapping("batchUpdate") - public Result batchUpdate(){ - + public Result batchUpdate(@RequestBody String[] ids,@LoginUser TokenDto tokenDto){ + dataSyncRecordDisabilityService.batchUpdate(ids,tokenDto.getCustomerId()); return new Result(); } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/DataSyncRecordDisabilityDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/DataSyncRecordDisabilityDao.java index 8f7d1f4713..c920bf67b1 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/DataSyncRecordDisabilityDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/DataSyncRecordDisabilityDao.java @@ -20,4 +20,6 @@ public interface DataSyncRecordDisabilityDao extends BaseDao list); List list(DataSyncRecordDisabilityFormDTO formDTO); + + void batchUpdateResiDisability(List entities); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/DataSyncRecordDisabilityEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/DataSyncRecordDisabilityEntity.java index 3ea26e8050..b09103c8d7 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/DataSyncRecordDisabilityEntity.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/DataSyncRecordDisabilityEntity.java @@ -1,5 +1,6 @@ package com.epmet.entity; +import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableName; import com.epmet.commons.mybatis.entity.BaseEpmetEntity; import lombok.Data; @@ -68,11 +69,17 @@ public class DataSyncRecordDisabilityEntity extends BaseEpmetEntity { */ private String cjzkCn; + @TableField(exist = false) + private String cjzk; + /** * 残疾类别 */ private String cjlbCn; + @TableField(exist = false) + private String cjlb; + /** * 文化程度 */ diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/DataSyncRecordDisabilityExcel.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/DataSyncRecordDisabilityExcel.java index e7a52a2b40..9b4d338451 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/DataSyncRecordDisabilityExcel.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/DataSyncRecordDisabilityExcel.java @@ -26,11 +26,11 @@ public class DataSyncRecordDisabilityExcel { @ExcelProperty(value = "性别") @ColumnWidth(20) - private String gender; + private Integer gender; @ExcelProperty(value = "民族") @ColumnWidth(20) - private String mz; + private String mzCn; @ExcelProperty(value = "家庭住址") @ColumnWidth(20) @@ -38,11 +38,11 @@ public class DataSyncRecordDisabilityExcel { @ExcelProperty(value = "残疾类别") @ColumnWidth(20) - private String cjlb; + private String cjlbCn; @ExcelProperty(value = "残疾等级") @ColumnWidth(20) - private String cjzk; + private String cjzkCn; @ExcelProperty(value = "监护人") @ColumnWidth(20) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/DataSyncRecordDisabilityService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/DataSyncRecordDisabilityService.java index 99ea18d578..3c1d294b05 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/DataSyncRecordDisabilityService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/DataSyncRecordDisabilityService.java @@ -82,7 +82,28 @@ public interface DataSyncRecordDisabilityService extends BaseService queryWrapper); + /** + * Desc: 列表 + * @param formDTO + * @author zxc + * @date 2022/10/13 16:17 + */ PageData list(DataSyncRecordDisabilityFormDTO formDTO); + /** + * Desc: 导出 + * @param formDTO + * @param response + * @author zxc + * @date 2022/10/13 16:17 + */ void export(DataSyncRecordDisabilityFormDTO formDTO, HttpServletResponse response) throws IOException; + + /** + * Desc: 批量更新 + * @param ids + * @author zxc + * @date 2022/10/13 16:18 + */ + void batchUpdate(String[] ids,String customerId); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/DataSyncRecordDisabilityServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/DataSyncRecordDisabilityServiceImpl.java index a08f6c9502..939c4d37b8 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/DataSyncRecordDisabilityServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/DataSyncRecordDisabilityServiceImpl.java @@ -23,10 +23,14 @@ import com.epmet.commons.tools.utils.poi.excel.handler.FreezeAndFilter; import com.epmet.dao.DataSyncRecordDisabilityDao; import com.epmet.dto.DataSyncRecordDisabilityDTO; import com.epmet.dto.IcResiUserDTO; +import com.epmet.dto.form.CustomerFormQueryDTO; +import com.epmet.dto.form.IcFormOptionsQueryFormDTO; import com.epmet.dto.form.dataSync.DataSyncRecordDisabilityFormDTO; import com.epmet.dto.form.dataSync.ResiInfoDTO; +import com.epmet.dto.result.FormItemResult; import com.epmet.entity.DataSyncRecordDisabilityEntity; import com.epmet.excel.DataSyncRecordDisabilityExcel; +import com.epmet.feign.OperCustomizeOpenFeignClient; import com.epmet.service.DataSyncRecordDisabilityService; import com.epmet.service.IcResiUserService; import com.github.pagehelper.PageHelper; @@ -55,6 +59,8 @@ public class DataSyncRecordDisabilityServiceImpl extends BaseServiceImpl page(Map params) { @@ -171,4 +177,56 @@ public class DataSyncRecordDisabilityServiceImpl extends BaseServiceImpl all = Arrays.asList(ids); + List entities = baseDao.selectBatchIds(all); + IcFormOptionsQueryFormDTO formDTO = new IcFormOptionsQueryFormDTO(); + formDTO.setCustomerId(customerId); + formDTO.setFormCode("resi_base_info"); + formDTO.setColumnName("CJZK"); + Result> cjzkOptionsMap = operCustomizeOpenFeignClient.getOptionsMap(formDTO); + if (!cjzkOptionsMap.success()){ + throw new EpmetException("operCustomizeOpenFeignClient.getOptionsMap执行失败"); + } + formDTO.setColumnName("CJLB"); + Result> cjlbOptionsMap = operCustomizeOpenFeignClient.getOptionsMap(formDTO); + if (!cjlbOptionsMap.success()){ + throw new EpmetException("operCustomizeOpenFeignClient.getOptionsMap执行失败"); + } + Map cjlbMap = cjlbOptionsMap.getData(); + Map cjzkMap = cjzkOptionsMap.getData(); + entities.forEach(e -> { + cjlbMap.forEach((k,v) ->{ + if (e.getCjlbCn().equals(v)){ + e.setCjlb(k); + } + }); + cjzkMap.forEach((k,v) -> { + if (e.getCjzkCn().equals(v)){ + e.setCjzk(k); + } + }); + }); + // 变更记录 + + } + + @Transactional(rollbackFor = Exception.class) + public void disposeDisabilitybatchUpdate(List entities){ + baseDao.batchUpdateResiDisability(entities); + } + } diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/DataSyncRecordDisabilityDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/DataSyncRecordDisabilityDao.xml index e545808db8..c9ecd32591 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/DataSyncRecordDisabilityDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/DataSyncRecordDisabilityDao.xml @@ -36,12 +36,67 @@ + + UPDATE ic_resi_user + + + + + when id = #{item.icResiUserId} then #{item.disabilityStatus} + + + + + + + + when id = #{item.icResiUserId} then #{item.cjzh} + + + when id = #{item.icResiUserId} then '' + + + + + + + + + when id = #{item.icResiUserId} then #{item.cjzk} + + + when id = #{item.icResiUserId} then '' + + + + + + + + + when id = #{item.icResiUserId} then #{item.cjlb} + + + when id = #{item.icResiUserId} then '' + + + + + UPDATED_TIME = NOW() + WHERE + + id = #{item.icResiUserId} + + + +