From ecd1b062b6a5ae8d2540d1ff2f0966b23f2a3d23 Mon Sep 17 00:00:00 2001 From: wangxianzhang Date: Wed, 19 Jan 2022 12:56:34 +0800 Subject: [PATCH 01/15] =?UTF-8?q?fix:=20=E7=A4=BE=E5=8C=BA=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E4=BF=AE=E6=94=B9=E5=AF=BC=E8=87=B4=E6=88=BF=E5=B1=8B?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/service/impl/HouseServiceImpl.java | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) 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 90a46acfc0..6614f9aad3 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 @@ -31,10 +31,7 @@ import com.epmet.enums.HouseRentFlagEnums; import com.epmet.enums.HouseTypeEnums; import com.epmet.excel.IcHouseExcel; import com.epmet.feign.GovOrgOpenFeignClient; -import com.epmet.service.HouseService; -import com.epmet.service.IcBuildingService; -import com.epmet.service.IcBuildingUnitService; -import com.epmet.service.IcHouseService; +import com.epmet.service.*; import com.epmet.util.ExcelPoiUtils; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; @@ -69,6 +66,9 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver { private IcHouseDao icHouseDao; @Autowired private GovOrgOpenFeignClient govOrgOpenFeignClient; + @Autowired + private AgencyService agencyservice; + @Override @Transactional(rollbackFor = Exception.class) @@ -230,11 +230,10 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver { //IPage> resultMap = searchHouse(buildingId, ownerName, ownerPhone, neighborHoodName, buildingName, pageNo, pageSize); // 查询pids - CustomerAgencyDTO agency = getResultDataOrThrowsException(govOrgOpenFeignClient.getAgencyById(ancestorAgencyId), ServiceConstant.GOV_ORG_SERVER, - EpmetErrorCode.SERVER_ERROR.getCode(), "【社区查询-查询需求列表】查询当前staff所属组织信息失败", null); + CustomerAgencyDTO agency = agencyservice.getAgencyById(ancestorAgencyId); if (agency == null) { - throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), "【社区查询-查询需求列表】查询当前staff所属组织信息失败"); + throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), "【社区查询-查询房屋列表】查询当前staff所属组织信息失败"); } String pids; From d563ac9e319f9ce20b170f750cc35183fc4b718b Mon Sep 17 00:00:00 2001 From: wangxianzhang Date: Wed, 19 Jan 2022 13:35:06 +0800 Subject: [PATCH 02/15] fix --- .../epmet/service/impl/HouseServiceImpl.java | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) 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 f1307a997d..4c809cb812 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 @@ -40,6 +40,7 @@ import com.epmet.service.IcHouseService; import com.epmet.service.*; import com.epmet.util.ExcelPoiUtils; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -238,18 +239,20 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver { //IPage> resultMap = searchHouse(buildingId, ownerName, ownerPhone, neighborHoodName, buildingName, pageNo, pageSize); // 查询pids - CustomerAgencyDTO agency = agencyservice.getAgencyById(ancestorAgencyId); + String pids = null; + if (StringUtils.isNotBlank(ancestorAgencyId)) { + CustomerAgencyDTO agency = agencyservice.getAgencyById(ancestorAgencyId); - if (agency == null) { - throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), "【社区查询-查询房屋列表】查询当前staff所属组织信息失败"); - } + if (agency == null) { + throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), "【社区查询-查询房屋列表】查询当前staff所属组织信息失败"); + } - String pids; - if(NumConstant.ZERO_STR.equals(agency.getPid())){ - pids = ancestorAgencyId; - }else{ - pids = agency.getPids().concat(StrConstant.COLON).concat(ancestorAgencyId); + if (NumConstant.ZERO_STR.equals(agency.getPid())) { + pids = ancestorAgencyId; + } else { + pids = agency.getPids().concat(StrConstant.COLON).concat(ancestorAgencyId); + } } IPage page = new Page(pageNo,pageSize); From f339dd6bd955710a8e8232315b63013d1b9d421c Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 19 Jan 2022 13:57:22 +0800 Subject: [PATCH 03/15] type --- .../src/main/resources/mapper/IcUserChangeRecordDao.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcUserChangeRecordDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcUserChangeRecordDao.xml index 6ef762b208..8dc8770dcb 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/IcUserChangeRecordDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcUserChangeRecordDao.xml @@ -43,6 +43,9 @@ on(d.IC_USER_CHANGE_RECORD_ID=r.id and r.DEL_FLAG='0') where d.DEL_FLAG='0' and d.FIELD_NAME=#{categoryKey} + + and d.type=#{type} + and (d.AGENCY_ID=#{orgId} or d.pids like concat('%',#{orgId},'%')) From e40b0ca92caaa56d5c1e28e167c78ab04183a85f Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Wed, 19 Jan 2022 14:52:32 +0800 Subject: [PATCH 04/15] =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=8C=96=E5=B1=85?= =?UTF-8?q?=E6=B0=91=E5=8F=98=E6=9B=B4=E8=AE=B0=E5=BD=95=E5=92=8C=E5=8F=98?= =?UTF-8?q?=E6=9B=B4=E6=98=8E=E7=BB=86=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../form/IcUserChangeRecordInitFormDTO.java | 20 +++ .../IcUserChangeRecordController.java | 13 ++ .../java/com/epmet/dao/IcResiUserDao.java | 4 + .../epmet/dao/IcUserChangeDetailedDao.java | 8 +- .../com/epmet/dao/IcUserChangeRecordDao.java | 6 + .../service/IcUserChangeDetailedService.java | 5 + .../service/IcUserChangeRecordService.java | 9 ++ .../impl/IcUserChangeDetailedServiceImpl.java | 9 +- .../impl/IcUserChangeRecordServiceImpl.java | 142 +++++++++++++++++- .../main/resources/mapper/IcResiUserDao.xml | 45 ++++++ .../mapper/IcUserChangeDetailedDao.xml | 8 + .../mapper/IcUserChangeRecordDao.xml | 10 ++ 12 files changed, 273 insertions(+), 6 deletions(-) create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcUserChangeRecordInitFormDTO.java diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcUserChangeRecordInitFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcUserChangeRecordInitFormDTO.java new file mode 100644 index 0000000000..0e7a105fe1 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcUserChangeRecordInitFormDTO.java @@ -0,0 +1,20 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 【基础信息】变更记录 + * @Author sun + */ +@Data +public class IcUserChangeRecordInitFormDTO implements Serializable { + private static final long serialVersionUID = 9156247659994638103L; + + /** + * 客户Id + */ + private String customerId; + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcUserChangeRecordController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcUserChangeRecordController.java index 5ab2dae1eb..7e77f5b6ab 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcUserChangeRecordController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcUserChangeRecordController.java @@ -22,6 +22,7 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.form.IcResiUserChangeRecordFormDTO; import com.epmet.dto.form.IcResiUserTransferFormDTO; +import com.epmet.dto.form.IcUserChangeRecordInitFormDTO; import com.epmet.dto.form.IcUsercategoryAnalysisFormDTO; import com.epmet.dto.result.IcUserChangeRecordResultDTO; import com.epmet.dto.result.IcUsercategoryAnalysisResultDTO; @@ -32,6 +33,8 @@ import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; +import java.text.ParseException; + /** * 居民变更记录表 @@ -67,4 +70,14 @@ public class IcUserChangeRecordController { ValidatorUtils.validateEntity(formDTO,IcUsercategoryAnalysisFormDTO.AddUserShowGroup.class,IcUsercategoryAnalysisFormDTO.AddUserInternalGroup.class); return new Result>().ok(icUserChangeRecordService.categoryAnalysisList(formDTO)); } + /** + * @Author sun + * @Description 历史居民数据生成变更记录和变更明细数据 + **/ + @PostMapping("icuserchangerecordinit") + public Result icUserChangeRecordInit(@RequestBody IcUserChangeRecordInitFormDTO formDTO) throws ParseException { + icUserChangeRecordService.icUserChangeRecordInit(formDTO); + return new Result(); + } + } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java index bc292276a2..2419e678f6 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java @@ -233,4 +233,8 @@ public interface IcResiUserDao extends BaseDao { Map getCategoryListMap(@Param("icUserId") String icUserId); List> selectResiUsers(@Param("types")List types,@Param("orgId")String orgId); + + List icUserCustomerIds(); + + List> getIcUserList(@Param("customerId") String customerId); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcUserChangeDetailedDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcUserChangeDetailedDao.java index 6ba4093056..b78f1077e2 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcUserChangeDetailedDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcUserChangeDetailedDao.java @@ -20,6 +20,7 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.entity.IcUserChangeDetailedEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; /** * 变更明细表 @@ -30,5 +31,10 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface IcUserChangeDetailedDao extends BaseDao { - + + /** + * @Author sun + * @Description 删除客户是新增类型的变更明细历史数据 + **/ + void delByCustomerId(@Param("customerId") String customerId, @Param("type") String type); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcUserChangeRecordDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcUserChangeRecordDao.java index 0e82f9564e..9e9b0b06af 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcUserChangeRecordDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcUserChangeRecordDao.java @@ -43,4 +43,10 @@ public interface IcUserChangeRecordDao extends BaseDao List getList(@Param("icUserId") String icUserId); List categoryAnalysisList(IcUsercategoryAnalysisFormDTO formDTO); + + /** + * @Author sun + * @Description 删除客户是新增类型的变更历史数据 + **/ + void delByCustomerId(@Param("customerId") String customerId, @Param("type") String type); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcUserChangeDetailedService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcUserChangeDetailedService.java index 859a324c82..04f01d63a1 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcUserChangeDetailedService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcUserChangeDetailedService.java @@ -29,4 +29,9 @@ import com.epmet.entity.IcUserChangeDetailedEntity; */ public interface IcUserChangeDetailedService extends BaseService { + /** + * @Author sun + * @Description 删除客户是新增类型的变更明细历史数据 + **/ + void delByCustomerId(String customerId, String type); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcUserChangeRecordService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcUserChangeRecordService.java index 252c5abd94..a75d3a1fe1 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcUserChangeRecordService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcUserChangeRecordService.java @@ -20,11 +20,14 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; import com.epmet.dto.form.IcResiUserChangeRecordFormDTO; +import com.epmet.dto.form.IcUserChangeRecordInitFormDTO; import com.epmet.dto.form.IcUsercategoryAnalysisFormDTO; import com.epmet.dto.result.IcUserChangeRecordResultDTO; import com.epmet.dto.result.IcUsercategoryAnalysisResultDTO; import com.epmet.entity.IcUserChangeRecordEntity; +import java.text.ParseException; + /** * 居民变更记录表 * @@ -45,4 +48,10 @@ public interface IcUserChangeRecordService extends BaseService categoryAnalysisList(IcUsercategoryAnalysisFormDTO formDTO); + + /** + * @Author sun + * @Description 历史居民数据生成变更记录和变更明细数据 + **/ + void icUserChangeRecordInit(IcUserChangeRecordInitFormDTO formDTO) throws ParseException; } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserChangeDetailedServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserChangeDetailedServiceImpl.java index 6bff100276..c6ffcb3c14 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserChangeDetailedServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserChangeDetailedServiceImpl.java @@ -33,5 +33,12 @@ import org.springframework.stereotype.Service; @Service public class IcUserChangeDetailedServiceImpl extends BaseServiceImpl implements IcUserChangeDetailedService { - + /** + * @Author sun + * @Description 删除客户是新增类型的变更明细历史数据 + **/ + @Override + public void delByCustomerId(String customerId, String type) { + baseDao.delByCustomerId(customerId, type); + } } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserChangeRecordServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserChangeRecordServiceImpl.java index 9f764e9c05..7a882e807e 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserChangeRecordServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserChangeRecordServiceImpl.java @@ -20,29 +20,39 @@ package com.epmet.service.impl; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.StrConstant; +import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.redis.common.CustomerStaffRedis; import com.epmet.commons.tools.utils.Result; +import com.epmet.dao.IcResiUserDao; import com.epmet.dao.IcUserChangeRecordDao; +import com.epmet.dto.IcResiCategoryWarnConfigDTO; import com.epmet.dto.IcUserChangeRecordDTO; import com.epmet.dto.form.IcResiUserChangeRecordFormDTO; +import com.epmet.dto.form.IcUserChangeRecordInitFormDTO; import com.epmet.dto.form.IcUsercategoryAnalysisFormDTO; import com.epmet.dto.result.AllGridsByUserIdResultDTO; import com.epmet.dto.result.BuildingResultDTO; import com.epmet.dto.result.IcUserChangeRecordResultDTO; import com.epmet.dto.result.IcUsercategoryAnalysisResultDTO; +import com.epmet.entity.IcUserChangeDetailedEntity; import com.epmet.entity.IcUserChangeRecordEntity; import com.epmet.feign.GovOrgOpenFeignClient; +import com.epmet.feign.OperCustomizeOpenFeignClient; +import com.epmet.service.IcUserChangeDetailedService; import com.epmet.service.IcUserChangeRecordService; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Set; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.*; import java.util.function.Function; import java.util.stream.Collectors; @@ -53,9 +63,18 @@ import java.util.stream.Collectors; * @since v1.0.0 2022-01-14 */ @Service +@Slf4j public class IcUserChangeRecordServiceImpl extends BaseServiceImpl implements IcUserChangeRecordService { @Autowired private GovOrgOpenFeignClient govOrgOpenFeignClient; + @Autowired + private IcResiUserDao icResiUserDao; + @Autowired + private OperCustomizeOpenFeignClient operCustomizeOpenFeignClient; + @Autowired + private IcUserChangeRecordService icUserChangeRecordService; + @Autowired + private IcUserChangeDetailedService icUserChangeDetailedService; /** @@ -118,4 +137,119 @@ public class IcUserChangeRecordServiceImpl extends BaseServiceImpl(list, pageInfo.getTotal()); } + /** + * @Author sun + * @Description 历史居民数据生成变更记录和变更明细数据 + **/ + @Override + public void icUserChangeRecordInit(IcUserChangeRecordInitFormDTO formDTO) throws ParseException { + //1.有客户id按客户执行,没有的按ic_resi_user表有效客户执行 + //入参有客户Id的则按客户Id执行,没有的则全部客户都执行 + if (null != formDTO && StringUtils.isNotBlank(formDTO.getCustomerId())) { + initIcUserChange(formDTO.getCustomerId()); + } else { + List customerIdList = icResiUserDao.icUserCustomerIds(); + for (String customerId : customerIdList) { + try { + //遍历统计每一个客户数据 + initIcUserChange(customerId); + } catch (Exception e) { + log.error("初始客户居民变更记录数据失败,对应客户Id:" + customerId, e); + log.error("Error creating model JSON", e); + } + } + } + } + + /** + * @Author sun + * @Description 按客户初始化客户下居民的变更记录、变更明细数据 + **/ + @Transactional(rollbackFor = Exception.class) + public void initIcUserChange(String customerId) throws ParseException { + log.info("开始初始客户下居民的变更记录和变更明细数据,客户Id->"+customerId); + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + //1.获取客户居民类别预警配置表数据 + Result> resultList = operCustomizeOpenFeignClient.categoryWarnConfigList(customerId); + if (!resultList.success()) { + throw new RuntimeException("居民信息修改,获取客户居民类别预警配置表数据失败"); + } + List changeList = new ArrayList<>(); + IcUserChangeRecordEntity change = null; + List detailedList = new ArrayList<>(); + IcUserChangeDetailedEntity detailed = null; + //存放工作人员姓名 + Map hash = new HashMap<>(); + //2.分批处理客户下居民数据 + int pageNo = NumConstant.ONE; + List> icUserList = new ArrayList<>(); + do { + //一千条一循环查询客户下居民数据 + PageHelper.startPage(pageNo, NumConstant.ONE_THOUSAND); + icUserList = icResiUserDao.getIcUserList(customerId); + pageNo++; + + //3.遍历封装数据 + for (Map map : icUserList){ + //存放一个人的类别为是的变更明细数据 + List subList = new ArrayList<>(); + String changeId = UUID.randomUUID().toString().replaceAll("-", ""); + for (IcResiCategoryWarnConfigDTO dto : resultList.getData()){ + if(map.containsKey(dto.getColumnName())&&"1".equals(map.get(dto.getColumnName()))){ + detailed = new IcUserChangeDetailedEntity(); + detailed.setCustomerId(customerId); + detailed.setIcUserChangeRecordId(changeId); + detailed.setPids(map.get("PIDS")); + detailed.setAgencyId(map.get("AGENCY_ID")); + detailed.setGridId(map.get("GRID_ID")); + detailed.setNeighborHoodId(map.get("VILLAGE_ID")); + detailed.setBuildingId(map.get("BUILD_ID")); + detailed.setBuildingUnitId(map.get("UNIT_ID")); + detailed.setHouseId(map.get("HOME_ID")); + detailed.setIcUserId(map.get("HOME_ID")); + detailed.setType("add"); + detailed.setTypeName("新增"); + detailed.setFieldName(dto.getColumnName()); + detailed.setValue(1); + detailed.setCreatedBy(map.get("CREATED_BY")); + detailed.setCreatedTime(sdf.parse(map.get("CREATED_TIME"))); + detailed.setUpdatedBy("APP_USER"); + detailed.setUpdatedTime(new Date()); + subList.add(detailed); + } + } + if (subList.size() > NumConstant.ZERO) { + detailedList.addAll(subList); + if (!hash.containsKey(map.get("CREATED_BY"))) { + CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(customerId, map.get("CREATED_BY")); + //被删除或被移除的工作人员,名字为空 + hash.put(map.get("CREATED_BY"), null != staffInfoCache ? staffInfoCache.getRealName() : ""); + } + change = new IcUserChangeRecordEntity(); + change.setId(changeId); + change.setCustomerId(customerId); + change.setOperatorId(map.get("CREATED_BY")); + change.setIcUserId(map.get("ID")); + change.setOperatorName(hash.get(map.get("CREATED_BY"))); + change.setIcUserName(map.get("NAME")); + change.setType("add"); + change.setTypeName("新增"); + change.setBeforeChangeName("-"); + change.setAfterChangeName("-"); + change.setChangeTime(sdf.parse(map.get("CREATED_TIME"))); + change.setCreatedBy(map.get("CREATED_BY")); + change.setCreatedTime(sdf.parse(map.get("CREATED_TIME"))); + change.setUpdatedBy("APP_USER"); + change.setUpdatedTime(new Date()); + changeList.add(change); + } + } + } while (icUserList.size() == NumConstant.ONE_THOUSAND); + //4.批量新增数据,先删后增【只删除新增节点的历史数据】 + baseDao.delByCustomerId(customerId, "add"); + icUserChangeDetailedService.delByCustomerId(customerId, "add"); + icUserChangeRecordService.insertBatch(changeList); + icUserChangeDetailedService.insertBatch(detailedList); + } + } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml index dbba0456fc..1e91222ee2 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml @@ -560,4 +560,49 @@ ORDER BY CREATED_TIME DESC + + + + diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcUserChangeDetailedDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcUserChangeDetailedDao.xml index acb4aa197b..24fe11c678 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/IcUserChangeDetailedDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcUserChangeDetailedDao.xml @@ -3,5 +3,13 @@ + + DELETE + FROM + ic_user_change_detailed + WHERE + CUSTOMER_ID = #{customerId} + AND type = #{type} + \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcUserChangeRecordDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcUserChangeRecordDao.xml index 8dc8770dcb..80bd84eccb 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/IcUserChangeRecordDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcUserChangeRecordDao.xml @@ -58,4 +58,14 @@ order by d.CREATED_TIME asc,d.id asc + + + DELETE + FROM + ic_user_change_record + WHERE + CUSTOMER_ID = #{customerId} + AND type = #{type} + + \ No newline at end of file From 55df17060c65e4ff36389e3fd036abcc92ce599f Mon Sep 17 00:00:00 2001 From: wangxianzhang Date: Wed, 19 Jan 2022 15:10:14 +0800 Subject: [PATCH 05/15] =?UTF-8?q?=E6=96=B0=E5=A2=9E=EF=BC=9A=201.=E5=AE=8C?= =?UTF-8?q?=E6=88=90=E5=B1=85=E6=B0=91=E5=AF=BC=E5=85=A5=EF=BC=8C=E4=B8=BB?= =?UTF-8?q?=E8=A1=A8=E7=9A=84=E7=B1=BB=E5=88=AB=E5=8F=98=E6=9B=B4=E8=BF=87?= =?UTF-8?q?=E6=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/result/ResiCategoryItemResultDTO.java | 17 ++ .../feign/OperCustomizeOpenFeignClient.java | 7 + .../OperCustomizeOpenFeignClientFallback.java | 5 + .../controller/IcFormItemController.java | 17 +- .../com/epmet/service/IcFormItemService.java | 12 +- .../service/impl/IcFormItemServiceImpl.java | 32 ++- .../epmet/bean/ResiImportCategoryData.java | 51 ++++ .../com/epmet/bean/ResiImportChangedData.java | 20 ++ .../ResiImportResiCategoryChangedCache.java | 30 +++ .../java/com/epmet/dao/IcResiUserDao.java | 2 + .../impl/IcResiUserImportServiceImpl.java | 239 ++++++++++++++++-- .../main/resources/mapper/IcResiUserDao.xml | 10 + 12 files changed, 408 insertions(+), 34 deletions(-) create mode 100644 epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/ResiCategoryItemResultDTO.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/bean/ResiImportCategoryData.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/bean/ResiImportChangedData.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/bean/ResiImportResiCategoryChangedCache.java diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/ResiCategoryItemResultDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/ResiCategoryItemResultDTO.java new file mode 100644 index 0000000000..8ab985676e --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/ResiCategoryItemResultDTO.java @@ -0,0 +1,17 @@ +package com.epmet.dto.result; + +import lombok.Data; + +/** + * @ClassName ResiCategoryItemResultDTO + * @Description 居民类别item查询结果 + * @Author wangxianzhang + * @Date 2022/1/18 4:43 下午 + */ +@Data +public class ResiCategoryItemResultDTO { + + private String columnName; + private String label; + +} diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/OperCustomizeOpenFeignClient.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/OperCustomizeOpenFeignClient.java index 8cdf6e39de..0ccbfa1655 100644 --- a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/OperCustomizeOpenFeignClient.java +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/OperCustomizeOpenFeignClient.java @@ -145,4 +145,11 @@ public interface OperCustomizeOpenFeignClient { @PostMapping("/oper/customize/icresicategorywarnconfig/categorywarnconfiglist/{customerId}") Result> categoryWarnConfigList(@PathVariable String customerId); + /** + * 查询客户下的居民类别item列表 + * @param customerId + * @return + */ + @PostMapping("/oper/customize/icformitem/resi-category-items/list") + Result> listResiCategoryItems(@RequestParam("customer-id") String customerId); } diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/fallback/OperCustomizeOpenFeignClientFallback.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/fallback/OperCustomizeOpenFeignClientFallback.java index fde2def25e..9dec3f4afe 100644 --- a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/fallback/OperCustomizeOpenFeignClientFallback.java +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/fallback/OperCustomizeOpenFeignClientFallback.java @@ -119,4 +119,9 @@ public class OperCustomizeOpenFeignClientFallback implements OperCustomizeOpenFe public Result> categoryWarnConfigList(String customerId) { return ModuleUtils.feignConError(ServiceConstant.OPER_CUSTOMIZE_SERVER, "categoryWarnConfigList", customerId); } + + @Override + public Result> listResiCategoryItems(String customerId) { + return ModuleUtils.feignConError(ServiceConstant.OPER_CUSTOMIZE_SERVER, "listResiCategoryItems", customerId); + } } diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcFormItemController.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcFormItemController.java index 1cfe0d4276..f38a16f323 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcFormItemController.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcFormItemController.java @@ -19,12 +19,10 @@ package com.epmet.controller; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.result.ColumnTableNameResultDTO; +import com.epmet.dto.result.ResiCategoryItemResultDTO; import com.epmet.service.IcFormItemService; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; import java.util.List; @@ -51,4 +49,15 @@ public class IcFormItemController { return new Result>().ok(icFormItemService.getMustColumn(customerId)); } + /** + * 查询客户下的居民类别item列表 + * @param customerId + * @return + */ + @PostMapping("resi-category-items/list") + public Result> listResiCategoryItems(@RequestParam("customer-id") String customerId) { + List r = icFormItemService.listResiCategoryItems(customerId); + return new Result().ok(r); + } + } diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/IcFormItemService.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/IcFormItemService.java index 575e31d6b1..f9eb17f8e3 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/IcFormItemService.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/IcFormItemService.java @@ -19,10 +19,7 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.dto.form.CustomerFormQueryDTO; -import com.epmet.dto.result.ColumnTableNameResultDTO; -import com.epmet.dto.result.ConditionResultDTO; -import com.epmet.dto.result.IcFormResColumnDTO; -import com.epmet.dto.result.TableHeaderResultDTO; +import com.epmet.dto.result.*; import com.epmet.entity.IcFormItemEntity; import java.util.List; @@ -58,4 +55,11 @@ public interface IcFormItemService extends BaseService { * @Description 居民信息新增查询各表必填字段 **/ List getMustColumn(String customerId); + + /** + * 查询 + * @param customerId + * @return + */ + List listResiCategoryItems(String customerId); } diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcFormItemServiceImpl.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcFormItemServiceImpl.java index 00c79db52c..697aaca89e 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcFormItemServiceImpl.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcFormItemServiceImpl.java @@ -17,6 +17,7 @@ package com.epmet.service.impl; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; @@ -27,10 +28,7 @@ import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.dao.IcFormItemDao; import com.epmet.dto.IcFormItemDTO; import com.epmet.dto.form.CustomerFormQueryDTO; -import com.epmet.dto.result.ColumnTableNameResultDTO; -import com.epmet.dto.result.ConditionResultDTO; -import com.epmet.dto.result.IcFormResColumnDTO; -import com.epmet.dto.result.TableHeaderResultDTO; +import com.epmet.dto.result.*; import com.epmet.entity.IcFormItemEntity; import com.epmet.service.IcFormItemService; import org.apache.commons.lang3.StringUtils; @@ -39,6 +37,8 @@ import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; import java.util.*; +import java.util.function.Function; +import java.util.stream.Collectors; /** * 表单项 @@ -118,4 +118,28 @@ public class IcFormItemServiceImpl extends BaseServiceImpl listResiCategoryItems(String customerId) { + + LambdaQueryWrapper query = new LambdaQueryWrapper<>(); + query.eq(IcFormItemEntity::getCustomerId, customerId); + query.eq(IcFormItemEntity::getDataAnalyse, 1); + + List categoryItems = baseDao.selectList(query); + + // 如果该客户没配置,那么使用默认配置 + if (CollectionUtils.isEmpty(categoryItems)) { + LambdaQueryWrapper query1 = new LambdaQueryWrapper<>(); + query1.eq(IcFormItemEntity::getDataAnalyse, 1); + query1.eq(IcFormItemEntity::getCustomerId, "default"); + categoryItems = baseDao.selectList(query1); + } + + return categoryItems.stream().map((e) -> { + ResiCategoryItemResultDTO d = new ResiCategoryItemResultDTO(); + d.setColumnName(e.getColumnName()); + d.setLabel(e.getLabel()); + return d; + }).collect(Collectors.toList()); + } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/bean/ResiImportCategoryData.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/bean/ResiImportCategoryData.java new file mode 100644 index 0000000000..436be52b29 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/bean/ResiImportCategoryData.java @@ -0,0 +1,51 @@ +package com.epmet.bean; + +import lombok.Data; + +import java.util.HashMap; +import java.util.Map; + +/** + * @ClassName ResiImportTransferOldDim + * @Description TODO + * @Author wangxianzhang + * @Date 2022/1/18 5:53 下午 + */ +@Data +public class ResiImportCategoryData { + + private String agencyId; + private String gridId; + private String villageId; + private String buildId; + private String unitId; + private String homeId; + + /** + * key:居民类别在ic_resi_user表中的列名 + * value:居民类别的值。0:否,1:是 + */ + private Map categories = new HashMap<>(); + + public ResiImportCategoryData() { + } + + public ResiImportCategoryData(String agencyId, String gridId, String villageId, String buildId, String unitId, String homeId, Map categories) { + this.agencyId = agencyId; + this.gridId = gridId; + this.villageId = villageId; + this.buildId = buildId; + this.unitId = unitId; + this.homeId = homeId; + this.categories = categories; + } + + public ResiImportCategoryData(String agencyId, String gridId, String villageId, String buildId, String unitId, String homeId) { + this.agencyId = agencyId; + this.gridId = gridId; + this.villageId = villageId; + this.buildId = buildId; + this.unitId = unitId; + this.homeId = homeId; + } +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/bean/ResiImportChangedData.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/bean/ResiImportChangedData.java new file mode 100644 index 0000000000..ff74a880a0 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/bean/ResiImportChangedData.java @@ -0,0 +1,20 @@ +package com.epmet.bean; + +import lombok.Data; + +/** + * @ClassName ResiImportTransferCache + * @Description TODO + * @Author wangxianzhang + * @Date 2022/1/18 5:51 下午 + */ +@Data +public class ResiImportChangedData { + private ResiImportCategoryData oldData = new ResiImportCategoryData(); + private ResiImportCategoryData newData = new ResiImportCategoryData(); + + public ResiImportChangedData(ResiImportCategoryData oldData, ResiImportCategoryData newData) { + this.oldData = oldData; + this.newData = newData; + } +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/bean/ResiImportResiCategoryChangedCache.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/bean/ResiImportResiCategoryChangedCache.java new file mode 100644 index 0000000000..6203c917a9 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/bean/ResiImportResiCategoryChangedCache.java @@ -0,0 +1,30 @@ +package com.epmet.bean; + +import lombok.Data; + +import java.util.HashMap; +import java.util.Map; + +/** + * 导入操作中,居民信息操作的分类bean + */ +@Data +public class ResiImportResiCategoryChangedCache { + + /** + * 新增居民 + * Map> + */ + private Map newResis = new HashMap<>(); + + /** + * 调动的居民 + */ + private Map transferedResis = new HashMap<>(); + + /** + * 类别变更的居民 + */ + private Map categoryChangedResis = new HashMap<>(); + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java index bc292276a2..482a2f4cc1 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java @@ -232,5 +232,7 @@ public interface IcResiUserDao extends BaseDao { Map getCategoryListMap(@Param("icUserId") String icUserId); + Map selectResiInfoMap(@Param("idCard") String idCard); + List> selectResiUsers(@Param("types")List types,@Param("orgId")String orgId); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserImportServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserImportServiceImpl.java index 0b554c980e..43e3263c94 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserImportServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserImportServiceImpl.java @@ -6,6 +6,9 @@ import cn.afterturn.easypoi.excel.entity.ExportParams; import com.alibaba.excel.EasyExcel; import com.alibaba.excel.EasyExcelFactory; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.epmet.bean.ResiImportCategoryData; +import com.epmet.bean.ResiImportResiCategoryChangedCache; +import com.epmet.bean.ResiImportChangedData; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.dto.result.OptionResultDTO; @@ -22,12 +25,14 @@ import com.epmet.dto.form.LoginUserDetailsFormDTO; import com.epmet.dto.result.FormItemResult; import com.epmet.dto.result.LoginUserDetailsResultDTO; import com.epmet.dto.result.OptionDTO; +import com.epmet.dto.result.ResiCategoryItemResultDTO; import com.epmet.entity.IcResiUserEntity; import com.epmet.enums.IcResiUserTableEnum; import com.epmet.excel.handler.DynamicEasyExcelListener; import com.epmet.feign.EpmetAdminOpenFeignClient; import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.feign.GovOrgOpenFeignClient; +import com.epmet.feign.OperCustomizeOpenFeignClient; import com.epmet.service.IcResiUserImportService; import com.google.common.cache.Cache; import com.google.common.cache.CacheBuilder; @@ -61,6 +66,16 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res public static final ThreadLocal>> errorRows = new ThreadLocal<>(); public static final ThreadLocal>> skipedRows = new ThreadLocal<>(); + /** + * 类别发生变更的居民 + */ + public static final ThreadLocal categoryChangedResi = new ThreadLocal<>(); + + /** + * 居民类别items列表 + */ + public static final ThreadLocal> resiCategoryItemsCache = new ThreadLocal<>(); + /** * key: itemId * value: @@ -85,6 +100,9 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res @Autowired private IcResiUserDao icResiUserDao; + @Autowired + private OperCustomizeOpenFeignClient operCustomizeOpenFeignClient; + /** * @description 列信息封装 * @@ -168,6 +186,7 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res */ @Override public void importIcResiInfoFromExcel(List formItemList, String excelPathName, HttpServletResponse response) { + String loginUserId = loginUserUtil.getLoginUserId(); String loginUserApp = loginUserUtil.getLoginUserApp(); String loginUserClient = loginUserUtil.getLoginUserClient(); @@ -185,7 +204,7 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res String customerId = agencyInfo.getCustomerId(); try { - initThreadLocalRowsStorage(); + initImportThreadLocal(customerId); // 上传主表信息 importIcResiBaseInfoFromExcel(formItemList,excelPathName, IcResiUserTableEnum.IC_RESI_USER.getSheetNo(), IcResiUserTableEnum.IC_RESI_USER.getHeadRowNo(), @@ -209,11 +228,10 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res } } - //String errors = JSON.toJSONString(errorRows.get()); - //String skipeds = JSON.toJSONString(skipedRows.get()); - - //log.error(errors); - //log.error(skipeds); + // 执行人员类别变更记录 + Map newResis = categoryChangedResi.get().getNewResis(); + Map categoryChangedResis = categoryChangedResi.get().getCategoryChangedResis(); + Map transferedResis = categoryChangedResi.get().getTransferedResis(); try { downLoadResults(response); @@ -223,25 +241,42 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res } finally { skipedRows.remove(); errorRows.remove(); + categoryChangedResi.remove(); + resiCategoryItemsCache.remove(); itemIdAndOptionsCache.invalidateAll(); } } /** - * 暂存rows信息初始化 + * threadLocal初始化 */ - private void initThreadLocalRowsStorage() { + private void initImportThreadLocal(String customerId) { + // 跳过的,不导入的行 Map> skipedRowsMap = new LinkedHashMap<>(); for (IcResiUserTableEnum e : IcResiUserTableEnum.values()) { skipedRowsMap.put(e.getTableName(), new LinkedList<>()); } skipedRows.set(skipedRowsMap); + // 错误信息 Map> errorRowsMap = new LinkedHashMap<>(); for (IcResiUserTableEnum e : IcResiUserTableEnum.values()) { errorRowsMap.put(e.getTableName(), new LinkedList<>()); } errorRows.set(errorRowsMap); + + // 居民类别信息 + ResiImportResiCategoryChangedCache c = new ResiImportResiCategoryChangedCache(); + categoryChangedResi.set(c); + + List resiCategoryItems = getResultDataOrThrowsException(operCustomizeOpenFeignClient.listResiCategoryItems(customerId), + ServiceConstant.OPER_CUSTOMIZE_SERVER, + EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), + String.format("【居民信息导入】查询居民类别items失败,customerId:%s", customerId), + "居民信息导入失败"); + + List l = resiCategoryItems.stream().map(ResiCategoryItemResultDTO::getColumnName).collect(Collectors.toList()); + resiCategoryItemsCache.set(l); } /** @@ -374,26 +409,45 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res String idCard = columnAndValues.get("ID_CARD"); LambdaQueryWrapper idCardQuery = new LambdaQueryWrapper<>(); idCardQuery.eq(IcResiUserEntity::getIdCard, idCard); - IcResiUserEntity resiBaseInfo = icResiUserDao.selectOne(idCardQuery); + //IcResiUserEntity resiBaseInfo = icResiUserDao.selectOne(idCardQuery); + + Map existingResiMap = icResiUserDao.selectResiInfoMap(idCard); + + if (existingResiMap != null) { + // 修改居民信息 + icResiUserDao.upTable(tableName, existingResiMap.get("ID"), columnAndValues); - if (resiBaseInfo != null) { - icResiUserDao.upTable(tableName, resiBaseInfo.getId(), columnAndValues); + // 任意组织维度一个发生变化,则放到调动居民缓存中 + ResiImportChangedData transferData; + if ((transferData = this.getResiImportTrasferData(existingResiMap, columnAndValues)) != null) { + categoryChangedResi.get().getTransferedResis().put(existingResiMap.get("ID"), transferData); + } else { + // 组织维度没有发生变化,看是否有居民类型变更 + ResiImportChangedData d = getResiImportCategoryChangedData(existingResiMap, columnAndValues); + if (d != null) { + categoryChangedResi.get().getCategoryChangedResis().put(existingResiMap.get("ID"), d); + } + } } else { + // 新增居民 columnAndValues.put("CREATED_BY", currentUserId); columnAndValues.put("ID", UUID.randomUUID().toString().replace("-", "")); icResiUserDao.add(tableName, columnAndValues); - } - //if (icResiUserDao.selectCount(idCardQuery) > 0) { - // //log.info("身份证号为【{}】的居民信息已存在,跳过导入", idCard); - // SkipedRow skipedRow = new SkipedRow(); - // skipedRow.setName(columnAndValues.get("NAME")); - // skipedRow.setIdCard(idCard); - // skipedRow.setInfo("身份证号已存在,跳过导入"); - // skipedRow.setTableName(tableName); - // skipedRows.get().get(IcResiUserTableEnums.IC_RESI_USER.getTableName()).add(skipedRow); - // continue; - //} + Map categories = resiCategoryItemsCache.get() + .stream() + .filter((categoryColumnName) -> "1".equals(columnAndValues.get(categoryColumnName))) + .collect(Collectors.toMap((k) -> k, (k) -> columnAndValues.get(k))); + + categoryChangedResi.get().getNewResis().put(columnAndValues.get("ID"), + new ResiImportCategoryData(columnAndValues.get("AGENCY_ID"), + columnAndValues.get("GRID_ID"), + columnAndValues.get("VILLAGE_ID"), + columnAndValues.get("BUILD_ID"), + columnAndValues.get("UNIT_ID"), + columnAndValues.get("HOME_ID"), + categories)); + } } catch (Exception e) { String errorMsg; @@ -950,4 +1004,145 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res workbook.write(response.getOutputStream()); } + + public ResiImportCategoryData generateResiImportChangeData(String agencyId, String gridId, String villageId, String buildId, String unitId, + String homeId , Map categories) { + ResiImportCategoryData ricd = new ResiImportCategoryData(); + ricd.setAgencyId(agencyId); + ricd.setBuildId(buildId); + ricd.setGridId(gridId); + ricd.setVillageId(villageId); + ricd.setUnitId(unitId); + ricd.setHomeId(homeId); + ricd.setCategories(categories); + return ricd; + } + + ///** + // * 判断是否有组织维度的变化 + // * @param existingResiMap + // * @param newResiMap + // * @return + // */ + //public boolean isOrgDimChanged(Map existingResiMap, Map newResiMap) { + // return !existingResiMap.get("AGENCY_ID").equals(newResiMap.get("AGENCY_ID")) + // || !existingResiMap.get("GRID_ID").equals(newResiMap.get("GRID_ID")) + // || !existingResiMap.get("VILLAGE_ID").equals(newResiMap.get("VILLAGE_ID")) + // || !existingResiMap.get("BUILD_ID").equals(newResiMap.get("BUILD_ID")) + // || !existingResiMap.get("UNIT_ID").equals(newResiMap.get("UNIT_ID")) + // || !existingResiMap.get("HOME_ID").equals(newResiMap.get("HOME_ID")) + //} + + /** + * 生成导入调动数据 + * @param existingResiMap + * @param newResiMap + * @return + */ + private ResiImportChangedData getResiImportTrasferData(Map existingResiMap, Map newResiMap) { + + // 维度未变化,则返回null + if (existingResiMap.get("AGENCY_ID").equals(newResiMap.get("AGENCY_ID")) + && existingResiMap.get("GRID_ID").equals(newResiMap.get("GRID_ID")) + && existingResiMap.get("VILLAGE_ID").equals(newResiMap.get("VILLAGE_ID")) + && existingResiMap.get("BUILD_ID").equals(newResiMap.get("BUILD_ID")) + && existingResiMap.get("UNIT_ID").equals(newResiMap.get("UNIT_ID")) + && existingResiMap.get("HOME_ID").equals(newResiMap.get("HOME_ID"))) { + + return null; + } + + HashMap existingResiCategories = new HashMap<>(); + HashMap newResiCategories = new HashMap<>(); + + for (String categoryColumnName : resiCategoryItemsCache.get()) { + String oldCategoryValue = existingResiMap.get(categoryColumnName); + String newCategoryValue = newResiMap.get(categoryColumnName); + + if (StringUtils.isNotBlank(oldCategoryValue) && "1".equals(oldCategoryValue)) { + existingResiCategories.put(categoryColumnName, oldCategoryValue); + } + + if (StringUtils.isNotBlank(newCategoryValue) && "1".equals(newCategoryValue)) { + newResiCategories.put(categoryColumnName, newResiMap.get(categoryColumnName)); + } + } + + ResiImportCategoryData oldOne = new ResiImportCategoryData( + existingResiMap.get("AGENCY_ID"), + existingResiMap.get("GRID_ID"), + existingResiMap.get("VILLAGE_ID"), + existingResiMap.get("BUILD_ID"), + existingResiMap.get("UNIT_ID"), + existingResiMap.get("HOME_ID"), + existingResiCategories); + + ResiImportCategoryData newOne = new ResiImportCategoryData(existingResiMap.get("AGENCY_ID"), + newResiMap.get("GRID_ID"), + newResiMap.get("VILLAGE_ID"), + newResiMap.get("BUILD_ID"), + newResiMap.get("UNIT_ID"), + newResiMap.get("HOME_ID"), + newResiCategories); + + return new ResiImportChangedData(oldOne, newOne); + } + + /** + * 类别变更的居民信息封装 + * @param existingResiMap + * @param newResiMap + * @return + */ + private ResiImportChangedData getResiImportCategoryChangedData(Map existingResiMap, Map newResiMap) { + // 发生变化的类别列明 + HashMap oldCategories = new HashMap<>(); + HashMap newCategories = new HashMap<>(); + + List categoryColumnNames = resiCategoryItemsCache.get(); + for (String categoryColumnName : categoryColumnNames) { + String existingColumnValue = existingResiMap.get(categoryColumnName); + String newColumnValue = newResiMap.get(categoryColumnName); + + if (StringUtils.isAllBlank(existingColumnValue, newColumnValue)) { + // 都为空,则没发生变化 + continue; + } else if (StringUtils.isNoneBlank(existingColumnValue, newColumnValue)) { + // 都不为空,则执行比较 + if (!existingColumnValue.equals(newColumnValue)) { + oldCategories.put(categoryColumnName, existingColumnValue); + newCategories.put(categoryColumnName, newColumnValue); + continue; + } + } else { + // 一个为空一个不为空,则发生变化 + oldCategories.put(categoryColumnName, existingColumnValue); + newCategories.put(categoryColumnName, newColumnValue); + } + + } + + if (oldCategories.size() == 0) { + return null; + } + + ResiImportCategoryData oldOne = new ResiImportCategoryData( + existingResiMap.get("AGENCY_ID"), + existingResiMap.get("GRID_ID"), + existingResiMap.get("VILLAGE_ID"), + existingResiMap.get("BUILD_ID"), + existingResiMap.get("UNIT_ID"), + existingResiMap.get("HOME_ID"), + oldCategories); + + ResiImportCategoryData newOne = new ResiImportCategoryData(existingResiMap.get("AGENCY_ID"), + newResiMap.get("GRID_ID"), + newResiMap.get("VILLAGE_ID"), + newResiMap.get("BUILD_ID"), + newResiMap.get("UNIT_ID"), + newResiMap.get("HOME_ID"), + newCategories); + + return new ResiImportChangedData(oldOne, newOne); + } } diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml index dbba0456fc..157471a680 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml @@ -560,4 +560,14 @@ ORDER BY CREATED_TIME DESC + + + From ba8461dd33889b2ac4b66bf6439938d9a2532170 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 19 Jan 2022 15:48:41 +0800 Subject: [PATCH 06/15] =?UTF-8?q?-10=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/user/UserDao.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/UserDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/UserDao.xml index 11d9e4aaef..0c8a18627c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/UserDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/UserDao.xml @@ -1152,7 +1152,7 @@ and temp.result=1 - and temp.result !=1 + and temp.result = -1 group by temp.orgId,temp.FIELD_NAME From 4bda9cc7829baab33d7289f3c393ef735d90bab3 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Thu, 20 Jan 2022 09:55:32 +0800 Subject: [PATCH 07/15] =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=8C=96=E5=B1=85?= =?UTF-8?q?=E6=B0=91=E5=8F=98=E6=9B=B4=E8=AE=B0=E5=BD=95=E5=92=8C=E5=8F=98?= =?UTF-8?q?=E6=9B=B4=E6=98=8E=E7=BB=86=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/IcUserChangeRecordServiceImpl.java | 2 +- .../main/resources/mapper/IcResiUserDao.xml | 73 ++++++++++--------- 2 files changed, 39 insertions(+), 36 deletions(-) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserChangeRecordServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserChangeRecordServiceImpl.java index 7a882e807e..4241e3428b 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserChangeRecordServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcUserChangeRecordServiceImpl.java @@ -180,7 +180,7 @@ public class IcUserChangeRecordServiceImpl extends BaseServiceImpl hash = new HashMap<>(); - //2.分批处理客户下居民数据 + //2.分批处理客户下居民数据【只查询在变更记录表不存在新增节点的居民】 int pageNo = NumConstant.ONE; List> icUserList = new ArrayList<>(); do { diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml index 99031d8f5e..5ef3c54d15 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml @@ -576,43 +576,46 @@ From 1ac84de0ffb12c44b66bd42859bc4f90f5ae34a7 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Thu, 20 Jan 2022 10:30:56 +0800 Subject: [PATCH 08/15] =?UTF-8?q?=E5=8A=A0=E4=BA=86=E4=B8=AAID?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/dto/result/IndividualCategoryListResultDTO.java | 2 ++ .../main/resources/mapper/IcIndividualCategoryManageDao.xml | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/IndividualCategoryListResultDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/IndividualCategoryListResultDTO.java index 4089a151df..cbfc8b5718 100644 --- a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/IndividualCategoryListResultDTO.java +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/IndividualCategoryListResultDTO.java @@ -33,4 +33,6 @@ public class IndividualCategoryListResultDTO implements Serializable { * 排序 */ private Integer sort; + + private String id; } diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcIndividualCategoryManageDao.xml b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcIndividualCategoryManageDao.xml index 926e0a8baf..68036233b5 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcIndividualCategoryManageDao.xml +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcIndividualCategoryManageDao.xml @@ -14,7 +14,8 @@ cm.SORT, sc.LABEL, sc.MANAGEMENT_ICON, - sc.COLUMN_NAME + sc.COLUMN_NAME, + sc.id AS id FROM ic_individual_category_manage cm INNER JOIN ic_resi_category_stats_config sc ON (sc.ID = cm.COLUMN_ID AND sc.DEL_FLAG = '0' AND `STATUS` = 'show') WHERE cm.DEL_FLAG = 0 From 833521d1d4ff06c41bac3f185623f5e5cfb51c7d Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 20 Jan 2022 10:32:04 +0800 Subject: [PATCH 09/15] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E8=81=94=E5=BB=BA?= =?UTF-8?q?=E5=8D=95=E4=BD=8D=E6=97=B6=EF=BC=8C=E6=9C=8D=E5=8A=A1=E4=BA=8B?= =?UTF-8?q?=E9=A1=B9=E5=88=97=E8=A1=A8=EF=BC=8C=E6=8E=A5=E5=8F=A3=E6=94=B9?= =?UTF-8?q?=E4=B8=BA=EF=BC=9A/api/heart/serviceitem/dict-list?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../IcServiceItemDictController.java | 14 +++++++++++ .../service/IcServiceItemDictService.java | 10 ++++++++ .../impl/IcServiceItemDictServiceImpl.java | 25 +++++++++++++++++++ 3 files changed, 49 insertions(+) diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceItemDictController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceItemDictController.java index d2f9f6d412..d6234d4a2c 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceItemDictController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceItemDictController.java @@ -9,6 +9,7 @@ import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.form.demand.ServiceItemAddFormDTO; import com.epmet.dto.form.demand.ServiceItemPageFormDTO; import com.epmet.dto.form.demand.StatusFormDTO; +import com.epmet.dto.result.demand.OptionDTO; import com.epmet.dto.result.demand.ServiceItemResultDTO; import com.epmet.service.IcServiceItemDictService; import org.springframework.beans.factory.annotation.Autowired; @@ -17,6 +18,8 @@ import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; +import java.util.List; + /** * 服务事项分类字典表 * @@ -68,4 +71,15 @@ public class IcServiceItemDictController { icServiceItemDictService.updateStatus(formDTO); return new Result(); } + + /** + * 新增联建单位,查询服务事项列表 + * + * @param tokenDto + * @return + */ + @PostMapping("dict-list") + public Result> queryDictList(@LoginUser TokenDto tokenDto){ + return new Result>().ok(icServiceItemDictService.queryDictList(tokenDto.getCustomerId())); + } } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceItemDictService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceItemDictService.java index a93e50aaff..fc671c3cdc 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceItemDictService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceItemDictService.java @@ -22,9 +22,12 @@ import com.epmet.commons.tools.page.PageData; import com.epmet.dto.form.demand.ServiceItemAddFormDTO; import com.epmet.dto.form.demand.ServiceItemPageFormDTO; import com.epmet.dto.form.demand.StatusFormDTO; +import com.epmet.dto.result.demand.OptionDTO; import com.epmet.dto.result.demand.ServiceItemResultDTO; import com.epmet.entity.IcServiceItemDictEntity; +import java.util.List; + /** * 服务事项分类字典表 * @@ -52,4 +55,11 @@ public interface IcServiceItemDictService extends BaseService queryDictList(String customerId); } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceItemDictServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceItemDictServiceImpl.java index 4235d282c5..1868076ade 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceItemDictServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceItemDictServiceImpl.java @@ -28,6 +28,7 @@ import com.epmet.dao.IcServiceItemDictDao; import com.epmet.dto.form.demand.ServiceItemAddFormDTO; import com.epmet.dto.form.demand.ServiceItemPageFormDTO; import com.epmet.dto.form.demand.StatusFormDTO; +import com.epmet.dto.result.demand.OptionDTO; import com.epmet.dto.result.demand.ServiceItemResultDTO; import com.epmet.entity.IcServiceItemDictEntity; import com.epmet.service.IcServiceItemDictService; @@ -37,6 +38,7 @@ import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import java.util.ArrayList; import java.util.Date; import java.util.List; @@ -122,5 +124,28 @@ public class IcServiceItemDictServiceImpl extends BaseServiceImpl queryDictList(String customerId) { + List resultList=new ArrayList<>(); + LambdaQueryWrapper query = new LambdaQueryWrapper<>(); + query.eq(IcServiceItemDictEntity::getCustomerId, customerId) + .orderByAsc(IcServiceItemDictEntity::getSort); + List list=baseDao.selectList(query); + for(IcServiceItemDictEntity entity:list){ + OptionDTO optionDTO=new OptionDTO(); + optionDTO.setLabel(entity.getCategoryName()); + optionDTO.setValue(entity.getCategoryCode()); + optionDTO.setAwardPoint(entity.getAwardPoint()); + resultList.add(optionDTO); + } + return resultList; + } + } \ No newline at end of file From a286d4030f09887a9189a8514afaa5c26ee169ab Mon Sep 17 00:00:00 2001 From: wangxianzhang Date: Thu, 20 Jan 2022 10:55:32 +0800 Subject: [PATCH 10/15] =?UTF-8?q?=E4=BF=AE=E6=94=B9=EF=BC=9A=201.=E5=8C=BA?= =?UTF-8?q?=E5=9D=97=E9=93=BE=E7=94=A8=E6=88=B7=E8=BA=AB=E4=BB=BD=E8=AE=A4?= =?UTF-8?q?=E8=AF=81=E8=B0=83=E6=95=B4=EF=BC=8C=E5=A2=9E=E5=8A=A0=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=EF=BC=8Curl=E5=8F=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- epmet-auth-client/pom.xml | 7 ++++ .../result/BlockChainStaffAuthResultDTO.java | 25 +++++++++++ .../epmet/controller/GovLoginController.java | 21 ---------- .../epmet/controller/GovWebController.java | 20 +++++++++ .../com/epmet/service/GovLoginService.java | 8 ---- .../java/com/epmet/service/GovWebService.java | 9 ++++ .../service/impl/GovLoginServiceImpl.java | 25 ----------- .../epmet/service/impl/GovWebServiceImpl.java | 41 ++++++++++++++++++- 8 files changed, 101 insertions(+), 55 deletions(-) create mode 100644 epmet-auth-client/src/main/java/com/epmet/auth/dto/result/BlockChainStaffAuthResultDTO.java diff --git a/epmet-auth-client/pom.xml b/epmet-auth-client/pom.xml index 1aee53c24e..d84ead3ff5 100644 --- a/epmet-auth-client/pom.xml +++ b/epmet-auth-client/pom.xml @@ -11,4 +11,11 @@ epmet-auth-client + + + com.epmet + epmet-commons-tools + 2.0.0 + + \ No newline at end of file diff --git a/epmet-auth-client/src/main/java/com/epmet/auth/dto/result/BlockChainStaffAuthResultDTO.java b/epmet-auth-client/src/main/java/com/epmet/auth/dto/result/BlockChainStaffAuthResultDTO.java new file mode 100644 index 0000000000..2a1ca0dfcc --- /dev/null +++ b/epmet-auth-client/src/main/java/com/epmet/auth/dto/result/BlockChainStaffAuthResultDTO.java @@ -0,0 +1,25 @@ +package com.epmet.auth.dto.result; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * @ClassName BlockChainStaffAuthResultDTO + * @Description 区块链用户认证结果 + * @Author wangxianzhang + * @Date 2022/1/20 10:41 上午 + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +public class BlockChainStaffAuthResultDTO { + + private String userId; + private String realName; + private String phone; + private String headUrl; + private String agencyId; + private String agencyName; + +} diff --git a/epmet-auth/src/main/java/com/epmet/controller/GovLoginController.java b/epmet-auth/src/main/java/com/epmet/controller/GovLoginController.java index deaa719859..8745418f90 100644 --- a/epmet-auth/src/main/java/com/epmet/controller/GovLoginController.java +++ b/epmet-auth/src/main/java/com/epmet/controller/GovLoginController.java @@ -122,26 +122,5 @@ public class GovLoginController { List staffOrgs = govLoginService.getMyOrgByPassword(formDTO); return new Result>().ok(staffOrgs); } - - /** - * 区块链web 系统身份认证 - * @param input - * @return - */ - @PostMapping("/blockchain/authentication") - public Result blockChainGetStaffInfoByPwd(@RequestBody BcStaffAuthenticationFormDTO input) { - ValidatorUtils.validateEntity(input); - - String customerId = input.getCustomerId(); - String mobile = input.getMobile(); - String password = input.getPassword(); - - String userId = govLoginService.blockChainStaffAuthenticationByPwd(customerId, mobile, password); - - HashMap m = new HashMap<>(); - m.put("userId", userId); - return new Result().ok(m); - } - } diff --git a/epmet-auth/src/main/java/com/epmet/controller/GovWebController.java b/epmet-auth/src/main/java/com/epmet/controller/GovWebController.java index 8a85cb9da4..9320b5f140 100644 --- a/epmet-auth/src/main/java/com/epmet/controller/GovWebController.java +++ b/epmet-auth/src/main/java/com/epmet/controller/GovWebController.java @@ -1,8 +1,10 @@ package com.epmet.controller; +import com.epmet.auth.dto.result.BlockChainStaffAuthResultDTO; import com.epmet.commons.tools.utils.RSASignature; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.dto.form.BcStaffAuthenticationFormDTO; import com.epmet.dto.form.GovWebLoginFormDTO; import com.epmet.dto.result.UserTokenResultDTO; import com.epmet.service.GovWebService; @@ -13,6 +15,8 @@ import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; +import java.util.HashMap; + /** * @author sun @@ -63,5 +67,21 @@ public class GovWebController { return new Result().ok(publicKey); } + /** + * 区块链web 系统身份认证 + * @param input + * @return + */ + @PostMapping("/blockchain/authentication") + public Result blockChainGetStaffInfoByPwd(@RequestBody BcStaffAuthenticationFormDTO input) { + ValidatorUtils.validateEntity(input); + String customerId = input.getCustomerId(); + String mobile = input.getMobile(); + String password = input.getPassword(); + + BlockChainStaffAuthResultDTO r = govWebService.blockChainStaffAuthenticationByPwd(customerId, mobile, password); + + return new Result().ok(r); + } } diff --git a/epmet-auth/src/main/java/com/epmet/service/GovLoginService.java b/epmet-auth/src/main/java/com/epmet/service/GovLoginService.java index 2a493fd54c..ea6329ceda 100644 --- a/epmet-auth/src/main/java/com/epmet/service/GovLoginService.java +++ b/epmet-auth/src/main/java/com/epmet/service/GovLoginService.java @@ -76,12 +76,4 @@ public interface GovLoginService { * @Date 2020/6/30 22:43 **/ List getMyOrgByPassword(StaffOrgsFormDTO formDTO); - - /** - * 区块链系统通过用户密码认证身份 - * @param mobile - * @param password - * @return - */ - String blockChainStaffAuthenticationByPwd(String customerId, String mobile, String password); } diff --git a/epmet-auth/src/main/java/com/epmet/service/GovWebService.java b/epmet-auth/src/main/java/com/epmet/service/GovWebService.java index 30f8d8ae4c..10d86c20b4 100644 --- a/epmet-auth/src/main/java/com/epmet/service/GovWebService.java +++ b/epmet-auth/src/main/java/com/epmet/service/GovWebService.java @@ -1,5 +1,6 @@ package com.epmet.service; +import com.epmet.auth.dto.result.BlockChainStaffAuthResultDTO; import com.epmet.dto.form.GovWebLoginFormDTO; import com.epmet.dto.result.UserTokenResultDTO; @@ -16,4 +17,12 @@ public interface GovWebService { * @Description PC工作端-工作人员登录 **/ UserTokenResultDTO login(GovWebLoginFormDTO formDTO); + + /** + * 区块链系统通过用户密码认证身份 + * @param mobile + * @param password + * @return + */ + BlockChainStaffAuthResultDTO blockChainStaffAuthenticationByPwd(String customerId, String mobile, String password); } diff --git a/epmet-auth/src/main/java/com/epmet/service/impl/GovLoginServiceImpl.java b/epmet-auth/src/main/java/com/epmet/service/impl/GovLoginServiceImpl.java index 8a36124e4d..8d78665550 100644 --- a/epmet-auth/src/main/java/com/epmet/service/impl/GovLoginServiceImpl.java +++ b/epmet-auth/src/main/java/com/epmet/service/impl/GovLoginServiceImpl.java @@ -492,30 +492,5 @@ public class GovLoginServiceImpl implements GovLoginService, ResultDataResolver } return result.getData(); } - - @Override - public String blockChainStaffAuthenticationByPwd(String customerId, String mobile, String password) { - - GovWebOperLoginFormDTO form = new GovWebOperLoginFormDTO(); - form.setCustomerId(customerId); - form.setMobile(mobile); - - GovWebOperLoginResultDTO staff = getResultDataOrThrowsException(epmetUserFeignClient.getStaffIdAndPwd(form), ServiceConstant.EPMET_USER_SERVER, - EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), - String.format("【区块链获取用户信息】根据手机号%s和指定客户ID:%s查找用户信息失败", mobile, customerId), - "查询用户失败"); - - if (staff == null) { - throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), - String.format("【区块链获取用户信息】根据手机号%s和指定客户ID:%s查找用户信息失败", mobile, customerId)); - } - - if (!PasswordUtils.matches(password, staff.getPassWord())) { - // 密码不匹配 - throw new EpmetException(EpmetErrorCode.ERR10004.getCode(), String.format("【区块链获取用户信息】密码不匹配,手机号:%s", mobile)); - } - - return staff.getUserId(); - } } diff --git a/epmet-auth/src/main/java/com/epmet/service/impl/GovWebServiceImpl.java b/epmet-auth/src/main/java/com/epmet/service/impl/GovWebServiceImpl.java index 9d455af694..d6edfb8657 100644 --- a/epmet-auth/src/main/java/com/epmet/service/impl/GovWebServiceImpl.java +++ b/epmet-auth/src/main/java/com/epmet/service/impl/GovWebServiceImpl.java @@ -1,13 +1,21 @@ package com.epmet.service.impl; +import com.epmet.auth.dto.result.BlockChainStaffAuthResultDTO; import com.epmet.common.token.constant.LoginConstant; +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; 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.feign.ResultDataResolver; +import com.epmet.commons.tools.redis.common.CustomerStaffRedis; import com.epmet.commons.tools.security.dto.GovTokenDto; import com.epmet.commons.tools.security.password.PasswordUtils; import com.epmet.commons.tools.utils.CpUserDetailRedis; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.CustomerStaffDTO; +import com.epmet.dto.form.CustomerStaffFormDTO; import com.epmet.dto.form.GovWebLoginFormDTO; import com.epmet.dto.form.GovWebOperLoginFormDTO; import com.epmet.dto.result.GovWebOperLoginResultDTO; @@ -32,7 +40,7 @@ import java.util.Map; */ @Slf4j @Service -public class GovWebServiceImpl implements GovWebService { +public class GovWebServiceImpl implements GovWebService, ResultDataResolver { private static final Logger logger = LoggerFactory.getLogger(GovWebServiceImpl.class); @Autowired @@ -131,5 +139,36 @@ public class GovWebServiceImpl implements GovWebService { return token; } + @Override + public BlockChainStaffAuthResultDTO blockChainStaffAuthenticationByPwd(String customerId, String mobile, String password) { + + GovWebOperLoginFormDTO form = new GovWebOperLoginFormDTO(); + form.setCustomerId(customerId); + form.setMobile(mobile); + + // 用户认证 + GovWebOperLoginResultDTO staff = getResultDataOrThrowsException(epmetUserFeignClient.getStaffIdAndPwd(form), ServiceConstant.EPMET_USER_SERVER, + EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), + String.format("【区块链用户认证】根据手机号%s和指定客户ID:%s认证用户失败", mobile, customerId), + "认证失败"); + + if (staff == null) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), + String.format("【区块链用户认证】根据手机号%s和指定客户ID:%s认证用户失败", mobile, customerId)); + } + + if (!PasswordUtils.matches(password, staff.getPassWord())) { + // 密码不匹配 + throw new EpmetException(EpmetErrorCode.ERR10004.getCode(), String.format("【区块链用户认证】密码不匹配,手机号:%s", mobile)); + } + + // 用户基础信息 + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(customerId, staff.getUserId()); + + BlockChainStaffAuthResultDTO r = new BlockChainStaffAuthResultDTO(staff.getUserId(), staffInfo.getRealName(), + staffInfo.getMobile(), staffInfo.getHeadPhoto(), staffInfo.getAgencyId(), staffInfo.getAgencyName()); + + return r; + } } From f9c71352f288d0634d1788176aa866a14dcaa1bc Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 20 Jan 2022 11:05:04 +0800 Subject: [PATCH 11/15] =?UTF-8?q?=E8=81=94=E5=BB=BA=E6=B4=BB=E5=8A=A8?= =?UTF-8?q?=E7=94=A8=E5=88=B0=E6=9C=8D=E5=8A=A1=E4=BA=8B=E9=A1=B9=E7=9A=84?= =?UTF-8?q?=E5=9C=B0=E6=96=B9=EF=BC=8C=E7=BB=9F=E4=B8=80=E6=94=B9=E4=B8=BA?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2ic=5Fservice=5Fitem=5Fdict?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/constant/ActConstant.java | 5 --- .../service/impl/ActInfoServiceImpl.java | 19 ++++----- .../impl/IcPartyActivityServiceImpl.java | 29 +++++--------- .../service/impl/IcPartyUnitServiceImpl.java | 26 ++++++------ .../service/impl/WorkActDraftServiceImpl.java | 13 ++---- .../service/impl/WorkActServiceImpl.java | 40 ++++++++----------- 6 files changed, 48 insertions(+), 84 deletions(-) diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/ActConstant.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/ActConstant.java index ce1d187bf2..9855cee625 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/ActConstant.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/ActConstant.java @@ -169,9 +169,4 @@ public interface ActConstant { * 活动类型-联建活动 */ String PARTY = "party"; - - /** - * 服务事项code - */ - String SERVICE_MATTER_CODE = "1010"; } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActInfoServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActInfoServiceImpl.java index 983c4834a2..e595bdd0c6 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActInfoServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActInfoServiceImpl.java @@ -35,17 +35,14 @@ import com.epmet.dao.ActUserRelationDao; import com.epmet.dao.HeartUserInfoDao; import com.epmet.dto.ActInfoDTO; import com.epmet.dto.IcPartyUnitDTO; -import com.epmet.dto.form.demand.SubCodeFormDTO; import com.epmet.dto.form.resi.*; import com.epmet.dto.result.demand.OptionDTO; import com.epmet.dto.result.resi.*; import com.epmet.entity.ActInfoEntity; import com.epmet.entity.ActUserRelationEntity; -import com.epmet.service.ActInfoService; -import com.epmet.service.ActUserRelationService; -import com.epmet.service.IcPartyUnitService; -import com.epmet.service.IcResiDemandDictService; +import com.epmet.service.*; import com.epmet.utils.CaculateDistance; +import org.apache.commons.collections4.MapUtils; import org.apache.commons.lang3.StringUtils; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -77,9 +74,9 @@ public class ActInfoServiceImpl extends BaseServiceImpl page(Map params) { @@ -260,11 +257,9 @@ public class ActInfoServiceImpl extends BaseServiceImpl categoryMap = icResiDemandDictService.querySubCodeList(codeFormDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); - detailResultDTO.setServiceMatterName(categoryMap.get(detailResultDTO.getServiceMatter())); + List serviceItemList=icServiceItemDictService.queryDictList(tokenDto.getCustomerId()); + Map categoryMap=serviceItemList.stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); + detailResultDTO.setServiceMatterName(MapUtils.isNotEmpty(categoryMap) && categoryMap.containsKey(detailResultDTO.getServiceMatter()) ? categoryMap.get(detailResultDTO.getServiceMatter()) : StrConstant.EPMETY_STR); } if (StringUtils.isNotBlank(detailResultDTO.getUnitId())) { //获取单位名称 diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyActivityServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyActivityServiceImpl.java index 67391ef70c..cdfa84d5e2 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyActivityServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyActivityServiceImpl.java @@ -35,14 +35,13 @@ import com.epmet.dao.IcPartyActivityDao; import com.epmet.dto.IcPartyActivityDTO; import com.epmet.dto.IcPartyUnitDTO; import com.epmet.dto.form.PartyActivityFormDTO; -import com.epmet.dto.form.demand.SubCodeFormDTO; import com.epmet.dto.result.ActivityStatisticsDTO; import com.epmet.dto.result.demand.OptionDTO; import com.epmet.entity.IcPartyActivityEntity; import com.epmet.excel.IcPartyActivityImportExcel; import com.epmet.service.IcPartyActivityService; import com.epmet.service.IcPartyUnitService; -import com.epmet.service.IcResiDemandDictService; +import com.epmet.service.IcServiceItemDictService; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import lombok.extern.slf4j.Slf4j; @@ -71,11 +70,8 @@ public class IcPartyActivityServiceImpl extends BaseServiceImpl search(PartyActivityFormDTO formDTO) { @@ -159,10 +155,9 @@ public class IcPartyActivityServiceImpl extends BaseServiceImpl categoryMap = icResiDemandDictService.querySubCodeList(codeFormDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); + List serviceItemList=icServiceItemDictService.queryDictList(entity.getCustomerId()); + Map categoryMap=serviceItemList.stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); + IcPartyActivityDTO dto = ConvertUtils.sourceToTarget(entity, IcPartyActivityDTO.class); dto.setServiceMatterName(categoryMap.get(dto.getServiceMatter())); //获取单位名称 @@ -225,10 +220,8 @@ public class IcPartyActivityServiceImpl extends BaseServiceImpl categoryMap = icResiDemandDictService.querySubCodeList(codeFormDTO).stream().collect(Collectors.toMap(OptionDTO::getLabel, OptionDTO::getValue)); + List serviceItemList=icServiceItemDictService.queryDictList(tokenDto.getCustomerId()); + Map categoryMap=serviceItemList.stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); //获取联建单位 IcPartyUnitDTO unitDTO = new IcPartyUnitDTO(); unitDTO.setAgencyId(staffInfoCache.getAgencyId()); @@ -369,10 +362,8 @@ public class IcPartyActivityServiceImpl extends BaseServiceImpl option = icPartyUnitService.options(unitDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); //获取服务事项字典 - SubCodeFormDTO codeFormDTO = new SubCodeFormDTO(); - codeFormDTO.setCustomerId(tokenDto.getCustomerId()); - codeFormDTO.setParentCategoryCode(SERVICE_MATTER_CODE); - Map categoryMap = icResiDemandDictService.querySubCodeList(codeFormDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); + List serviceItemList=icServiceItemDictService.queryDictList(tokenDto.getCustomerId()); + Map categoryMap=serviceItemList.stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); //数据组装 dtoList.forEach(dto -> { dto.setServiceMatterName(categoryMap.get(dto.getServiceMatter())); diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java index 3850acd354..383b5e58fa 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java @@ -45,7 +45,6 @@ import com.epmet.dto.IcPartyUnitDTO; import com.epmet.dto.form.PartyActivityFormDTO; import com.epmet.dto.form.PartyUnitFormDTO; import com.epmet.dto.form.demand.ServiceQueryFormDTO; -import com.epmet.dto.form.demand.SubCodeFormDTO; import com.epmet.dto.result.PartyUnitDistributionResultDTO; import com.epmet.dto.result.demand.OptionDTO; import com.epmet.dto.result.demand.ServiceStatDTO; @@ -54,6 +53,7 @@ import com.epmet.excel.IcPartyUnitImportExcel; import com.epmet.feign.EpmetAdminOpenFeignClient; import com.epmet.service.IcPartyUnitService; import com.epmet.service.IcResiDemandDictService; +import com.epmet.service.IcServiceItemDictService; import com.epmet.service.IcUserDemandRecService; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; @@ -87,7 +87,8 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl search(PartyUnitFormDTO formDTO) { @@ -104,10 +105,10 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl pageInfo = new PageInfo<>(list); List dtoList = ConvertUtils.sourceToTarget(list, IcPartyUnitDTO.class); Result> unitTypeMap = epmetAdminOpenFeignClient.dictMap(DictTypeEnum.PARTY_UNIT_TYPE.getCode()); - SubCodeFormDTO codeFormDTO = new SubCodeFormDTO(); - codeFormDTO.setCustomerId(formDTO.getCustomerId()); - codeFormDTO.setParentCategoryCode("1010"); - Map categoryMap = icResiDemandDictService.querySubCodeList(codeFormDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); + //服务事项列表从需求分类中抽离出来,改为查询ic_service_item_dict表 + List serviceItemList=icServiceItemDictService.queryDictList(formDTO.getCustomerId()); + Map categoryMap=serviceItemList.stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); + dtoList.forEach(item -> { item.setType(unitTypeMap.getData().get(item.getType())); if (StringUtils.isNotBlank(item.getServiceMatter())) { @@ -138,10 +139,9 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl list = baseDao.selectList(wrapper); List dtoList = ConvertUtils.sourceToTarget(list, IcPartyUnitDTO.class); Result> unitTypeMap = epmetAdminOpenFeignClient.dictMap(DictTypeEnum.PARTY_UNIT_TYPE.getCode()); - SubCodeFormDTO codeFormDTO = new SubCodeFormDTO(); - codeFormDTO.setCustomerId(formDTO.getCustomerId()); - codeFormDTO.setParentCategoryCode("1010"); - Map categoryMap = icResiDemandDictService.querySubCodeList(codeFormDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); + //服务事项列表从需求分类中抽离出来,改为查询ic_service_item_dict表 + List serviceItemList=icServiceItemDictService.queryDictList(formDTO.getCustomerId()); + Map categoryMap=serviceItemList.stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); dtoList.forEach(item -> { item.setType(unitTypeMap.getData().get(item.getType())); if (StringUtils.isNotBlank(item.getServiceMatter())) { @@ -312,10 +312,8 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl categoryMap = icResiDemandDictService.querySubCodeList(codeFormDTO).stream().collect(Collectors.toMap(OptionDTO::getLabel, OptionDTO::getValue)); + List serviceItemList=icServiceItemDictService.queryDictList(tokenDto.getCustomerId()); + Map categoryMap=serviceItemList.stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); //1.数据校验 Iterator iterator = result.iterator(); while (iterator.hasNext()) { diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActDraftServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActDraftServiceImpl.java index 6e2a67aa17..5572a48f48 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActDraftServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActDraftServiceImpl.java @@ -6,7 +6,6 @@ import com.epmet.commons.tools.utils.DateUtils; import com.epmet.dto.IcPartyUnitDTO; import com.epmet.dto.LatestActContentDTO; import com.epmet.dto.LatestActInfoDTO; -import com.epmet.dto.form.demand.SubCodeFormDTO; import com.epmet.dto.form.work.ActPreviewFormDTO; import com.epmet.dto.form.work.DraftActContentFormDTO; import com.epmet.dto.form.work.DraftActInfoFormDTO; @@ -43,14 +42,10 @@ public class WorkActDraftServiceImpl implements WorkActDraftService { @Autowired private LatestActContentService latestActContentService; @Resource - private IcResiDemandDictService icResiDemandDictService; + private IcServiceItemDictService icServiceItemDictService; @Resource private IcPartyUnitService icPartyUnitService; - /** - * 服务事项code - */ - private static final String SERVICE_MATTER_CODE = "1010"; /** * @return com.epmet.dto.form.work.PublishActInitResultDTO @@ -142,10 +137,8 @@ public class WorkActDraftServiceImpl implements WorkActDraftService { if (StringUtils.isNotBlank(actPreviewResultDTO.getServiceMatter())) { //获取服务事项 - SubCodeFormDTO codeFormDTO = new SubCodeFormDTO(); - codeFormDTO.setCustomerId(formDTO.getCustomerId()); - codeFormDTO.setParentCategoryCode(SERVICE_MATTER_CODE); - Map categoryMap = icResiDemandDictService.querySubCodeList(codeFormDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); + List serviceItemList=icServiceItemDictService.queryDictList(formDTO.getCustomerId()); + Map categoryMap=serviceItemList.stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); actPreviewResultDTO.setServiceMatterName(categoryMap.get(actPreviewResultDTO.getServiceMatter())); } if (StringUtils.isNotBlank(actPreviewResultDTO.getUnitId())) { diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java index e113d72019..7b076059b9 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java @@ -25,7 +25,6 @@ import com.epmet.dto.*; import com.epmet.dto.form.SystemMsgFormDTO; import com.epmet.dto.form.UserMessageFormDTO; import com.epmet.dto.form.WxSubscribeMessageFormDTO; -import com.epmet.dto.form.demand.SubCodeFormDTO; import com.epmet.dto.form.work.*; import com.epmet.dto.result.ActSponsorResultDTO; import com.epmet.dto.result.demand.OptionDTO; @@ -34,6 +33,7 @@ import com.epmet.entity.*; import com.epmet.feign.EpmetMessageOpenFeignClient; import com.epmet.feign.GovOrgOpenFeignClient; import com.epmet.service.*; +import org.apache.commons.collections4.MapUtils; import org.apache.commons.lang3.StringUtils; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -99,10 +99,9 @@ public class WorkActServiceImpl implements WorkActService { @Resource private IcPartyActivityService icPartyActivityService; @Resource - private IcResiDemandDictService icResiDemandDictService; - @Resource private IcPartyUnitService icPartyUnitService; - + @Resource + private IcServiceItemDictService icServiceItemDictService; /** @@ -782,11 +781,10 @@ public class WorkActServiceImpl implements WorkActService { if (StringUtils.isNotBlank(canceledActDetailResultDTO.getServiceMatter())) { //获取服务事项 - SubCodeFormDTO codeFormDTO = new SubCodeFormDTO(); - codeFormDTO.setCustomerId(customerId); - codeFormDTO.setParentCategoryCode(ActConstant.SERVICE_MATTER_CODE); - Map categoryMap = icResiDemandDictService.querySubCodeList(codeFormDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); - canceledActDetailResultDTO.setServiceMatterName(categoryMap.get(canceledActDetailResultDTO.getServiceMatter())); + List serviceItemList = icServiceItemDictService.queryDictList(customerId); + Map categoryMap = serviceItemList.stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); + canceledActDetailResultDTO.setServiceMatterName(MapUtils.isNotEmpty(categoryMap) && categoryMap.containsKey(canceledActDetailResultDTO.getServiceMatter()) ? + categoryMap.get(canceledActDetailResultDTO.getServiceMatter()) : StrConstant.EPMETY_STR); } if (StringUtils.isNotBlank(canceledActDetailResultDTO.getUnitId())) { //获取单位名称 @@ -840,11 +838,9 @@ public class WorkActServiceImpl implements WorkActService { if (StringUtils.isNotBlank(resultDTO.getServiceMatter())) { //获取服务事项 - SubCodeFormDTO codeFormDTO = new SubCodeFormDTO(); - codeFormDTO.setCustomerId(formDTO.getCustomerId()); - codeFormDTO.setParentCategoryCode(ActConstant.SERVICE_MATTER_CODE); - Map categoryMap = icResiDemandDictService.querySubCodeList(codeFormDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); - resultDTO.setServiceMatterName(categoryMap.get(resultDTO.getServiceMatter())); + List serviceItemList = icServiceItemDictService.queryDictList(formDTO.getCustomerId()); + Map categoryMap = serviceItemList.stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); + resultDTO.setServiceMatterName(MapUtils.isNotEmpty(categoryMap) && categoryMap.containsKey(resultDTO.getServiceMatter()) ? categoryMap.get(resultDTO.getServiceMatter()) : StrConstant.EPMETY_STR); } if (StringUtils.isNotBlank(resultDTO.getUnitId())) { //获取单位名称 @@ -921,11 +917,9 @@ public class WorkActServiceImpl implements WorkActService { } if (StringUtils.isNotBlank(resultDTO.getServiceMatter())) { //获取服务事项 - SubCodeFormDTO codeFormDTO = new SubCodeFormDTO(); - codeFormDTO.setCustomerId(customerId); - codeFormDTO.setParentCategoryCode(ActConstant.SERVICE_MATTER_CODE); - Map categoryMap = icResiDemandDictService.querySubCodeList(codeFormDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); - resultDTO.setServiceMatterName(categoryMap.get(resultDTO.getServiceMatter())); + List serviceItemList=icServiceItemDictService.queryDictList(customerId); + Map categoryMap=serviceItemList.stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); + resultDTO.setServiceMatterName(MapUtils.isNotEmpty(categoryMap) && categoryMap.containsKey(resultDTO.getServiceMatter()) ? categoryMap.get(resultDTO.getServiceMatter()) : StrConstant.EPMETY_STR); } if (StringUtils.isNotBlank(resultDTO.getUnitId())) { //获取单位名称 @@ -1317,11 +1311,9 @@ public class WorkActServiceImpl implements WorkActService { if (StringUtils.isNotBlank(resultDTO.getServiceMatter())) { //获取服务事项 - SubCodeFormDTO codeFormDTO = new SubCodeFormDTO(); - codeFormDTO.setCustomerId(customerId); - codeFormDTO.setParentCategoryCode(ActConstant.SERVICE_MATTER_CODE); - Map categoryMap = icResiDemandDictService.querySubCodeList(codeFormDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); - resultDTO.setServiceMatterName(categoryMap.get(resultDTO.getServiceMatter())); + List serviceItemList=icServiceItemDictService.queryDictList(customerId); + Map categoryMap=serviceItemList.stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); + resultDTO.setServiceMatterName(MapUtils.isNotEmpty(categoryMap) && categoryMap.containsKey(resultDTO.getServiceMatter()) ? categoryMap.get(resultDTO.getServiceMatter()) : StrConstant.EPMETY_STR); } if (StringUtils.isNotBlank(resultDTO.getUnitId())) { //获取单位名称 From 11162c3cd902aed6279722c299c188f5cbcb7c68 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 20 Jan 2022 14:10:33 +0800 Subject: [PATCH 12/15] =?UTF-8?q?=E6=9C=8D=E5=8A=A1=E4=BA=8B=E9=A1=B9?= =?UTF-8?q?=E5=8E=86=E5=8F=B2=E6=95=B0=E6=8D=AE=E4=BF=AE=E6=94=B9=EF=BC=9A?= =?UTF-8?q?=E8=81=94=E5=BB=BA=E5=8D=95=E4=BD=8D=E7=BD=AE=E7=A9=BA=EF=BC=8C?= =?UTF-8?q?=E8=81=94=E5=BB=BA=E6=B4=BB=E5=8A=A8=EF=BC=88=E6=80=BB=E7=BB=93?= =?UTF-8?q?=EF=BC=89=E4=BF=AE=E6=94=B9=E4=B8=BA=E6=96=B0=E7=9A=84=E7=BC=96?= =?UTF-8?q?=E7=A0=81=EF=BC=8C=E5=8F=91=E5=B8=83=E7=9A=84=E8=81=94=E5=BB=BA?= =?UTF-8?q?=E6=B4=BB=E5=8A=A8=E6=94=B9=E4=B8=BA=E6=96=B0=E7=9A=84=E7=BC=96?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../V0.0.10__update_service_item.sql | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.10__update_service_item.sql diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.10__update_service_item.sql b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.10__update_service_item.sql new file mode 100644 index 0000000000..e07a359452 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.10__update_service_item.sql @@ -0,0 +1,49 @@ +-- 服务事项从需求分类字典表中抽离出来了,对应历史数据修改如下 +-- 1、联建单位的服务事项置空 +update ic_party_unit set SERVICE_MATTER =''; +-- 2、联建活动的服务事项修改为新的编码 +update ic_party_activity set SERVICE_MATTER='1006' where SERVICE_MATTER = '10100006'; +update ic_party_activity set SERVICE_MATTER='1008' where SERVICE_MATTER = '10100008'; +update ic_party_activity set SERVICE_MATTER='1002' where SERVICE_MATTER = '10100002'; +update ic_party_activity set SERVICE_MATTER='1009' where SERVICE_MATTER = '10100009'; +update ic_party_activity set SERVICE_MATTER='1017' where SERVICE_MATTER = '10100017'; +update ic_party_activity set SERVICE_MATTER='1021' where SERVICE_MATTER = '10100021'; +update ic_party_activity set SERVICE_MATTER='1015' where SERVICE_MATTER = '10100015'; +update ic_party_activity set SERVICE_MATTER='1011' where SERVICE_MATTER = '10100011'; +update ic_party_activity set SERVICE_MATTER='1018' where SERVICE_MATTER = '10100018'; +update ic_party_activity set SERVICE_MATTER='1005' where SERVICE_MATTER = '10100005'; +update ic_party_activity set SERVICE_MATTER='1010' where SERVICE_MATTER = '10100010'; +update ic_party_activity set SERVICE_MATTER='1003' where SERVICE_MATTER = '10100003'; +update ic_party_activity set SERVICE_MATTER='1020' where SERVICE_MATTER = '10100020'; +update ic_party_activity set SERVICE_MATTER='1022' where SERVICE_MATTER = '10100022'; +update ic_party_activity set SERVICE_MATTER='1014' where SERVICE_MATTER = '10100014'; +update ic_party_activity set SERVICE_MATTER='1007' where SERVICE_MATTER = '10100007'; +update ic_party_activity set SERVICE_MATTER='1001' where SERVICE_MATTER = '10100001'; +update ic_party_activity set SERVICE_MATTER='1004' where SERVICE_MATTER = '10100004'; +update ic_party_activity set SERVICE_MATTER='1016' where SERVICE_MATTER = '10100016'; +update ic_party_activity set SERVICE_MATTER='1013' where SERVICE_MATTER = '10100013'; +update ic_party_activity set SERVICE_MATTER='1012' where SERVICE_MATTER = '10100012'; +update ic_party_activity set SERVICE_MATTER='1019' where SERVICE_MATTER = '10100019'; +-- 3、爱心互助-活动类型为联建活动,对应的服务事项编码改为新的 +update act_info set SERVICE_MATTER='1006' where ACT_TYPE='party' and SERVICE_MATTER='10100006' ; +update act_info set SERVICE_MATTER='1008' where ACT_TYPE='party' and SERVICE_MATTER='10100008' ; +update act_info set SERVICE_MATTER='1002' where ACT_TYPE='party' and SERVICE_MATTER='10100002' ; +update act_info set SERVICE_MATTER='1009' where ACT_TYPE='party' and SERVICE_MATTER='10100009' ; +update act_info set SERVICE_MATTER='1017' where ACT_TYPE='party' and SERVICE_MATTER='10100017' ; +update act_info set SERVICE_MATTER='1021' where ACT_TYPE='party' and SERVICE_MATTER='10100021' ; +update act_info set SERVICE_MATTER='1015' where ACT_TYPE='party' and SERVICE_MATTER='10100015' ; +update act_info set SERVICE_MATTER='1011' where ACT_TYPE='party' and SERVICE_MATTER='10100011' ; +update act_info set SERVICE_MATTER='1018' where ACT_TYPE='party' and SERVICE_MATTER='10100018' ; +update act_info set SERVICE_MATTER='1005' where ACT_TYPE='party' and SERVICE_MATTER='10100005' ; +update act_info set SERVICE_MATTER='1010' where ACT_TYPE='party' and SERVICE_MATTER='10100010' ; +update act_info set SERVICE_MATTER='1003' where ACT_TYPE='party' and SERVICE_MATTER='10100003' ; +update act_info set SERVICE_MATTER='1020' where ACT_TYPE='party' and SERVICE_MATTER='10100020' ; +update act_info set SERVICE_MATTER='1022' where ACT_TYPE='party' and SERVICE_MATTER='10100022' ; +update act_info set SERVICE_MATTER='1014' where ACT_TYPE='party' and SERVICE_MATTER='10100014' ; +update act_info set SERVICE_MATTER='1007' where ACT_TYPE='party' and SERVICE_MATTER='10100007' ; +update act_info set SERVICE_MATTER='1001' where ACT_TYPE='party' and SERVICE_MATTER='10100001' ; +update act_info set SERVICE_MATTER='1004' where ACT_TYPE='party' and SERVICE_MATTER='10100004' ; +update act_info set SERVICE_MATTER='1016' where ACT_TYPE='party' and SERVICE_MATTER='10100016' ; +update act_info set SERVICE_MATTER='1013' where ACT_TYPE='party' and SERVICE_MATTER='10100013' ; +update act_info set SERVICE_MATTER='1012' where ACT_TYPE='party' and SERVICE_MATTER='10100012' ; +update act_info set SERVICE_MATTER='1019' where ACT_TYPE='party' and SERVICE_MATTER='10100019' ; \ No newline at end of file From 68e48b972ea2074b3cf6c4a04cf775c00de6811a Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Thu, 20 Jan 2022 14:37:03 +0800 Subject: [PATCH 13/15] =?UTF-8?q?=E4=BA=BA=E5=91=98=E5=88=86=E7=B1=BB?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../IndividualCategoryAllListResultDTO.java | 43 +++++++++++++ .../IndividualCategoryListResultDTO.java | 3 + .../IcIndividualCategoryManageController.java | 12 ++++ .../IcIndividualCategoryManageService.java | 9 +++ ...IcIndividualCategoryManageServiceImpl.java | 64 ++++++++++++++++++- .../epmet/dto/form/StatsResiListFormDTO.java | 2 + .../epmet/feign/EpmetUserOpenFeignClient.java | 8 ++- .../EpmetUserOpenFeignClientFallback.java | 5 ++ .../controller/StatsResiWarnController.java | 15 ++++- .../epmet/service/StatsResiWarnService.java | 3 + .../impl/StatsResiWarnServiceImpl.java | 6 ++ 11 files changed, 165 insertions(+), 5 deletions(-) create mode 100644 epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/IndividualCategoryAllListResultDTO.java diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/IndividualCategoryAllListResultDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/IndividualCategoryAllListResultDTO.java new file mode 100644 index 0000000000..0251e83f7f --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/IndividualCategoryAllListResultDTO.java @@ -0,0 +1,43 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2022/1/17 10:52 上午 + * @DESC + */ +@Data +public class IndividualCategoryAllListResultDTO implements Serializable { + + private static final long serialVersionUID = -3294223041221531203L; + + /** + * 标签 + */ + private String label; + + /** + * 图片 + */ + private String managementIcon; + + /** + * 字段名 + */ + private String columnName; + + /** + * 排序 + */ + private Integer sort; + + private String id; + + /** + * 是否选中 true:是;false:否 + */ + private boolean isSelected = false; +} diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/IndividualCategoryListResultDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/IndividualCategoryListResultDTO.java index cbfc8b5718..7a7f7d51cc 100644 --- a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/IndividualCategoryListResultDTO.java +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/IndividualCategoryListResultDTO.java @@ -1,5 +1,6 @@ package com.epmet.dto.result; +import com.epmet.commons.tools.constant.NumConstant; import lombok.Data; import java.io.Serializable; @@ -35,4 +36,6 @@ public class IndividualCategoryListResultDTO implements Serializable { private Integer sort; private String id; + + private Integer count = NumConstant.ZERO; } diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcIndividualCategoryManageController.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcIndividualCategoryManageController.java index 5a902c2c99..9c90d1bb9b 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcIndividualCategoryManageController.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcIndividualCategoryManageController.java @@ -10,6 +10,7 @@ import com.epmet.commons.tools.validator.group.DefaultGroup; import com.epmet.dto.IcIndividualCategoryManageDTO; import com.epmet.dto.form.EditIndividualCategoryFormDTO; import com.epmet.dto.form.PackageEditIndividualCategoryFormDTO; +import com.epmet.dto.result.IndividualCategoryAllListResultDTO; import com.epmet.dto.result.IndividualCategoryListResultDTO; import com.epmet.service.IcIndividualCategoryManageService; import org.springframework.beans.factory.annotation.Autowired; @@ -56,4 +57,15 @@ public class IcIndividualCategoryManageController { return new Result(); } + /** + * @Description 查询客户下人员分类,并且赋值本人选中的 + * @param tokenDto + * @author zxc + * @date 2022/1/20 10:44 上午 + */ + @PostMapping("individualcategoryalllist") + public Result> individualCategoryAllList(@LoginUser TokenDto tokenDto){ + return new Result>().ok(icIndividualCategoryManageService.individualCategoryAllList(tokenDto)); + } + } \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/IcIndividualCategoryManageService.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/IcIndividualCategoryManageService.java index 4b15339377..f688fea29d 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/IcIndividualCategoryManageService.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/IcIndividualCategoryManageService.java @@ -5,6 +5,7 @@ import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.dto.IcIndividualCategoryManageDTO; import com.epmet.dto.form.EditIndividualCategoryFormDTO; +import com.epmet.dto.result.IndividualCategoryAllListResultDTO; import com.epmet.dto.result.IndividualCategoryListResultDTO; import com.epmet.entity.IcIndividualCategoryManageEntity; @@ -36,4 +37,12 @@ public interface IcIndividualCategoryManageService extends BaseService formDTOS, TokenDto tokenDto); + /** + * @Description 查询客户下人员分类,并且赋值本人选中的 + * @param tokenDto + * @author zxc + * @date 2022/1/20 10:44 上午 + */ + List individualCategoryAllList(TokenDto tokenDto); + } \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcIndividualCategoryManageServiceImpl.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcIndividualCategoryManageServiceImpl.java index c684c8c36e..68529e158c 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcIndividualCategoryManageServiceImpl.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcIndividualCategoryManageServiceImpl.java @@ -1,14 +1,27 @@ package com.epmet.service.impl; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; +import com.epmet.commons.tools.redis.common.CustomerStaffRedis; +import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.Result; import com.epmet.dao.IcIndividualCategoryManageDao; +import com.epmet.dto.IcResiCategoryStatsConfigDTO; import com.epmet.dto.form.EditIndividualCategoryFormDTO; +import com.epmet.dto.form.IcResiCategoryStatsConfigFormDTO; +import com.epmet.dto.form.StatsResiListFormDTO; +import com.epmet.dto.result.IcStatsResiResultDTO; +import com.epmet.dto.result.IcStatsResiWarnBuildingResultDTO; +import com.epmet.dto.result.IndividualCategoryAllListResultDTO; import com.epmet.dto.result.IndividualCategoryListResultDTO; import com.epmet.entity.IcIndividualCategoryManageEntity; +import com.epmet.feign.EpmetUserOpenFeignClient; +import com.epmet.feign.OperCustomizeOpenFeignClient; import com.epmet.service.IcIndividualCategoryManageService; import org.apache.commons.collections4.CollectionUtils; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -24,6 +37,11 @@ import java.util.List; @Service public class IcIndividualCategoryManageServiceImpl extends BaseServiceImpl implements IcIndividualCategoryManageService { + @Autowired + private OperCustomizeOpenFeignClient operCustomizeOpenFeignClient; + @Autowired + private EpmetUserOpenFeignClient userOpenFeignClient; + /** * @Description 【人员分类管理】查询个人分类列表 * @param tokenDto @@ -32,10 +50,30 @@ public class IcIndividualCategoryManageServiceImpl extends BaseServiceImpl individualCategoryList(TokenDto tokenDto) { + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId()); + if (null == staffInfo){ + throw new EpmetException(String.format("查询工作人员%s信息失败...",tokenDto.getUserId())); + } + StatsResiListFormDTO formDTO = new StatsResiListFormDTO(); + formDTO.setId(staffInfo.getAgencyId()); + formDTO.setLevel("agency"); + formDTO.setCustomerId(tokenDto.getCustomerId()); + Result> list = userOpenFeignClient.getPersonCategoryList(formDTO); + if (!list.success()){ + throw new EpmetException("查询人员分类下人数失败..."); + } + List datas = list.getData(); List result = baseDao.individualCategoryList(tokenDto.getUserId()); - if (CollectionUtils.isNotEmpty(result)){ + if (CollectionUtils.isNotEmpty(datas) && CollectionUtils.isNotEmpty(result)){ + result.forEach( r -> datas.stream().filter( d -> d.getId().equals(r.getId())).forEach(d -> r.setCount(d.getCount()))); + return result; + } + if (CollectionUtils.isEmpty(datas) && CollectionUtils.isNotEmpty(result)){ return result; } + if (CollectionUtils.isEmpty(result)){ + return new ArrayList<>(); + } return new ArrayList<>(); } @@ -59,4 +97,28 @@ public class IcIndividualCategoryManageServiceImpl extends BaseServiceImpl individualCategoryAllList(TokenDto tokenDto) { + IcResiCategoryStatsConfigFormDTO formDTO = new IcResiCategoryStatsConfigFormDTO(); + Result> listResult = operCustomizeOpenFeignClient.resiCategoryStatsListShowd(formDTO); + if (!listResult.success()){ + throw new EpmetException("查询客户下的人员类别失败..."); + } + if (CollectionUtils.isEmpty(listResult.getData())){ + return new ArrayList<>(); + } + List result = ConvertUtils.sourceToTarget(listResult.getData(), IndividualCategoryAllListResultDTO.class); + List configs = baseDao.individualCategoryList(tokenDto.getUserId()); + if (CollectionUtils.isNotEmpty(configs)){ + result.forEach(r -> configs.stream().filter(c -> c.getColumnName().equals(r.getColumnName())).forEach(c -> r.setSelected(true))); + } + return result; + } } \ No newline at end of file diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/StatsResiListFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/StatsResiListFormDTO.java index 1bb20c647a..131322a8a6 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/StatsResiListFormDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/StatsResiListFormDTO.java @@ -43,4 +43,6 @@ public class StatsResiListFormDTO implements Serializable { @NotBlank(message = "level不能为空") private String level; + private String customerId; + } \ No newline at end of file diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java index 9c57423628..1b9ac976c6 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java @@ -1,6 +1,7 @@ package com.epmet.feign; +import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.dto.result.OptionResultDTO; import com.epmet.commons.tools.security.dto.TokenDto; @@ -24,8 +25,8 @@ import java.util.Set; * @author yinzuomei@elink-cn.com * @date 2020/6/4 13:09 */ -// @FeignClient(name = ServiceConstant.EPMET_USER_SERVER, fallbackFactory = EpmetUserOpenFeignClientFallbackFactory.class, url = "localhost:8087") -@FeignClient(name = ServiceConstant.EPMET_USER_SERVER, fallbackFactory = EpmetUserOpenFeignClientFallbackFactory.class) + @FeignClient(name = ServiceConstant.EPMET_USER_SERVER, fallbackFactory = EpmetUserOpenFeignClientFallbackFactory.class, url = "localhost:8087") +//@FeignClient(name = ServiceConstant.EPMET_USER_SERVER, fallbackFactory = EpmetUserOpenFeignClientFallbackFactory.class) public interface EpmetUserOpenFeignClient { /** @@ -708,4 +709,7 @@ public interface EpmetUserOpenFeignClient { @PostMapping("/epmetuser/userbaseinfo/resirelationinfo") Result resiRelationInfo(@RequestParam("userId")String userId); + @PostMapping("/epmetuser/statsresiwarn/list2") + Result> getPersonCategoryList(@RequestBody StatsResiListFormDTO formDTO); + } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java index b434b30806..bde8bf2e8c 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java @@ -522,4 +522,9 @@ public class EpmetUserOpenFeignClientFallback implements EpmetUserOpenFeignClien public Result resiRelationInfo(String userId) { return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "resiRelationInfo", userId); } + + @Override + public Result> getPersonCategoryList(StatsResiListFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getPersonCategoryList", formDTO); + } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StatsResiWarnController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StatsResiWarnController.java index 8e36190cf0..1be35d69b5 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StatsResiWarnController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StatsResiWarnController.java @@ -60,12 +60,23 @@ public class StatsResiWarnController { private StatsResiWarnService statsResiWarnService; @PostMapping("list") - public Result list(@LoginUser TokenDto tokenDto,@RequestBody StatsResiListFormDTO formDTO){ + public Result> list(@LoginUser TokenDto tokenDto,@RequestBody StatsResiListFormDTO formDTO){ ValidatorUtils.validateEntity(formDTO); String customerId = tokenDto.getCustomerId(); List icStatsResiResultDTOList = statsResiWarnService.list(customerId,formDTO.getId(),formDTO.getLevel()); - return new Result().ok(icStatsResiResultDTOList); + return new Result>().ok(icStatsResiResultDTOList); + } + /** + * @Description 内部调了list + * @param formDTO + * @author zxc + * @date 2022/1/20 2:11 下午 + */ + @PostMapping("list2") + public Result> list2(@RequestBody StatsResiListFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO); + return new Result>().ok(statsResiWarnService.list2(formDTO)); } @PostMapping("buildingwarnlist") diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StatsResiWarnService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StatsResiWarnService.java index 37a85105bb..941421fc33 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StatsResiWarnService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StatsResiWarnService.java @@ -17,6 +17,7 @@ package com.epmet.service; +import com.epmet.dto.form.StatsResiListFormDTO; import com.epmet.dto.result.IcStatsResiResultDTO; import com.epmet.dto.result.IcStatsResiWarnBuildingResultDTO; import com.epmet.dto.result.IcStatsResiWarnUserResultDTO; @@ -38,6 +39,8 @@ public interface StatsResiWarnService{ List list(String customerId,String id, String level); + List list2(StatsResiListFormDTO formDTO); + void resiWarn(String customerId); void resiWarnByOne(String customerId,String userId); diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StatsResiWarnServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StatsResiWarnServiceImpl.java index 3b12bcd10d..122fca634e 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StatsResiWarnServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StatsResiWarnServiceImpl.java @@ -10,6 +10,7 @@ import com.epmet.dao.IcStatsResiWarnDao; import com.epmet.dto.IcResiCategoryStatsConfigDTO; import com.epmet.dto.IcResiCategoryWarnConfigDTO; import com.epmet.dto.form.IcResiCategoryStatsConfigFormDTO; +import com.epmet.dto.form.StatsResiListFormDTO; import com.epmet.dto.result.*; import com.epmet.entity.IcResiUserEntity; import com.epmet.entity.IcStatsResiWarnEntity; @@ -193,6 +194,11 @@ public class StatsResiWarnServiceImpl implements StatsResiWarnService { return result; } + @Override + public List list2(StatsResiListFormDTO formDTO) { + return this.list(formDTO.getCustomerId(), formDTO.getId(), formDTO.getLevel()); + } + /** * 统计 */ From 786c30f0f79e5b3a41fa240595077002d9fa46f5 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Thu, 20 Jan 2022 15:17:07 +0800 Subject: [PATCH 14/15] . --- .../resources/db/migration/V0.0.24__alter_change_detailed.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.24__alter_change_detailed.sql b/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.24__alter_change_detailed.sql index 69dda6d4de..bf2a78fe05 100644 --- a/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.24__alter_change_detailed.sql +++ b/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.24__alter_change_detailed.sql @@ -1,3 +1,3 @@ ALTER TABLE `ic_user_change_detailed` -ADD COLUMN `PIDS` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT ''组织的所有上级Id'' AFTER `IC_USER_CHANGE_RECORD_ID`; +ADD COLUMN `PIDS` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '组织的所有上级Id' AFTER `IC_USER_CHANGE_RECORD_ID`; From 918811e179d0244e54fcc230b9987e90ad80090c Mon Sep 17 00:00:00 2001 From: jianjun Date: Thu, 20 Jan 2022 15:41:19 +0800 Subject: [PATCH 15/15] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=A1=A8=E5=8D=95?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E6=9E=9A=E4=B8=BE=E7=B1=BB=20IcFormCodeEnum?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../commons/tools/enums/IcFormCodeEnum.java | 46 +++++++++++++++++++ .../epmet/dto/form/CustomerFormQueryDTO.java | 3 ++ .../entity/IcFormQueryBuilderEntity.java | 2 + .../epmet/dto/form/DelIcResiUserFormDTO.java | 3 +- .../epmet/dto/form/DynamicQueryFormDTO.java | 3 +- .../controller/IcResiUserController.java | 16 +++---- .../service/impl/IcResiUserServiceImpl.java | 2 +- .../service/impl/VolunteerServiceImpl.java | 6 +-- .../test/IcResiUserControllerTest.java | 3 +- 9 files changed, 69 insertions(+), 15 deletions(-) create mode 100644 epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/IcFormCodeEnum.java diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/IcFormCodeEnum.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/IcFormCodeEnum.java new file mode 100644 index 0000000000..9ed48a90e4 --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/IcFormCodeEnum.java @@ -0,0 +1,46 @@ +package com.epmet.commons.tools.enums; + +/** + * desc:数字社区平台-表单配置枚举类 + * + * @author jianjun liu + * @date 2020-07-03 11:14 + **/ +public enum IcFormCodeEnum { + /** + * 表单code枚举 + */ + RESI_BASE_INFO("resi_base_info", "居民信息"), + + ; + + private String code; + private String name; + + + + IcFormCodeEnum(String code, String name) { + this.code = code; + this.name = name; + } + + public static IcFormCodeEnum getEnum(String code) { + IcFormCodeEnum[] values = IcFormCodeEnum.values(); + for (IcFormCodeEnum value : values) { + if (value.getCode().equals(code)) { + return value; + } + } + return null; + } + + + public String getCode() { + return code; + } + + public String getName() { + return name; + } + +} diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/CustomerFormQueryDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/CustomerFormQueryDTO.java index 8759909f38..1978e3660d 100644 --- a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/CustomerFormQueryDTO.java +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/CustomerFormQueryDTO.java @@ -16,6 +16,9 @@ public class CustomerFormQueryDTO implements Serializable { // 获取表单相关信息 public interface GetFormInfoGroup {} + /** + * @see com.epmet.commons.tools.enums.IcFormCodeEnum + */ @NotBlank(message = "formCode不能为空,居民信息默认传:resi_base_info",groups = { AddUserInternalGroup.class, GetFormInfoGroup.class} ) private String formCode; diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/IcFormQueryBuilderEntity.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/IcFormQueryBuilderEntity.java index f8255baa01..4713b01dd3 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/IcFormQueryBuilderEntity.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/IcFormQueryBuilderEntity.java @@ -47,6 +47,8 @@ public class IcFormQueryBuilderEntity extends BaseEpmetEntity { /** * ic_form.form_code,举例:resi_base_info + * @see com.epmet.commons.tools.enums.IcFormCodeEnum + * */ private String formCode; diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/DelIcResiUserFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/DelIcResiUserFormDTO.java index 3b6ff7d195..558bb88b7f 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/DelIcResiUserFormDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/DelIcResiUserFormDTO.java @@ -1,5 +1,6 @@ package com.epmet.dto.form; +import com.epmet.commons.tools.enums.IcFormCodeEnum; import lombok.Data; import javax.validation.constraints.NotBlank; @@ -21,6 +22,6 @@ public class DelIcResiUserFormDTO implements Serializable { private String icResiUserId; @NotBlank(message = "token获取的customerId不能为空", groups = IdGroup.class) private String customerId; - private String formCode="resi_base_info"; + private String formCode= IcFormCodeEnum.RESI_BASE_INFO.getCode(); } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/DynamicQueryFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/DynamicQueryFormDTO.java index 42e163838b..809c00be18 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/DynamicQueryFormDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/DynamicQueryFormDTO.java @@ -1,5 +1,6 @@ package com.epmet.dto.form; +import com.epmet.commons.tools.enums.IcFormCodeEnum; import lombok.Data; import javax.validation.constraints.NotBlank; @@ -14,7 +15,7 @@ import java.util.List; @Data public class DynamicQueryFormDTO implements Serializable { private String customerId; - private String formCode="resi_base_info"; + private String formCode= IcFormCodeEnum.RESI_BASE_INFO.getCode(); @NotBlank(message = "resultTableName不能为空") private String resultTableName; private List conditions; diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java index 0c573c1049..4abb7124ac 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java @@ -28,6 +28,7 @@ import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; import com.epmet.commons.tools.dto.result.OptionDataResultDTO; +import com.epmet.commons.tools.enums.IcFormCodeEnum; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.exception.ExceptionUtils; @@ -91,9 +92,6 @@ import java.util.stream.Collectors; @RequestMapping("icresiuser") public class IcResiUserController { - //todo 枚举吧 - private static final String IC_RESI_FORM_CODE = "resi_base_info"; - /** * 居民上传临时目录 */ @@ -312,7 +310,7 @@ public class IcResiUserController { Set stopSearchSet = new HashSet<>(); //获取表单项 - List resiFormAllItems = icResiUserService.listFormItems(customerId, IC_RESI_FORM_CODE); + List resiFormAllItems = icResiUserService.listFormItems(customerId, IcFormCodeEnum.RESI_BASE_INFO.getCode()); Map allItemMap = resiFormAllItems.stream().collect(Collectors.toMap(FormItemResult::getItemId, o -> o)); Map map = new HashMap<>(); allItemMap.values().forEach(item->{ @@ -436,7 +434,7 @@ public class IcResiUserController { savePath = IC_RESI_UPLOAD_DIR.resolve(fileName); IOUtils.copy(file.getInputStream(), new FileOutputStream(savePath.toString())); - List formItemList = icResiUserService.listFormItems(customerId,IC_RESI_FORM_CODE); + List formItemList = icResiUserService.listFormItems(customerId,IcFormCodeEnum.RESI_BASE_INFO.getCode()); icResiUserImportService.importIcResiInfoFromExcel(formItemList, savePath.toString(), response); } catch (IOException e) { String errorMsg = ExceptionUtils.getErrorStackTrace(e); @@ -444,7 +442,9 @@ public class IcResiUserController { throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); } finally { try { - Files.delete(savePath); + if (savePath != null){ + Files.delete(savePath); + } } catch (IOException e) { log.error("【导入居民信息失败】清理上传的文件失败:{}", ExceptionUtils.getErrorStackTrace(e)); } @@ -491,7 +491,7 @@ public class IcResiUserController { @NotNull private CustomerFormResultDTO getResiFormAddItems(String customerId) { CustomerFormQueryDTO queryDTO = new CustomerFormQueryDTO(); - queryDTO.setFormCode("resi_base_info"); + queryDTO.setFormCode(IcFormCodeEnum.RESI_BASE_INFO.getCode()); queryDTO.setCustomerId(customerId); Result resultForm = operCustomizeOpenFeignClient.getCustomerForm(queryDTO); if (resultForm == null || !resultForm.success() || resultForm.getData() == null) { @@ -656,7 +656,7 @@ public class IcResiUserController { input.setKeyword(input.getKeyword().trim()); input.setCustomerId(loginUser.getCustomerId()); input.setStaffId(loginUser.getUserId()); - input.setFormCode("resi_base_info"); + input.setFormCode(IcFormCodeEnum.RESI_BASE_INFO.getCode()); if (input.getPageNo() == null) { input.setPageNo(1); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java index 28036d3a59..62c9bc2cff 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java @@ -1181,7 +1181,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl getVolunteerCategoryOptions(String customerId) { IcFormOptionsQueryFormDTO optionsQuery = new IcFormOptionsQueryFormDTO(); optionsQuery.setCustomerId(customerId); - optionsQuery.setFormCode("resi_base_info"); + optionsQuery.setFormCode(IcFormCodeEnum.RESI_BASE_INFO.getCode()); optionsQuery.setLabel("志愿者类别"); List categorieDtos = getResultDataOrThrowsException(operCustomizeOpenFeignClient.listOptionsByItemConditions(optionsQuery), ServiceConstant.OPER_CUSTOMIZE_SERVER, diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/VolunteerServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/VolunteerServiceImpl.java index a25f7d2ad7..1272b57629 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/VolunteerServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/VolunteerServiceImpl.java @@ -1,6 +1,7 @@ package com.epmet.service.impl; import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.enums.IcFormCodeEnum; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.ExceptionUtils; import com.epmet.commons.tools.feign.ResultDataResolver; @@ -16,13 +17,12 @@ import com.epmet.feign.EpmetHeartOpenFeignClient; import com.epmet.feign.GovOrgOpenFeignClient; import com.epmet.feign.OperCustomizeOpenFeignClient; import com.epmet.service.VolunteerService; +import com.google.common.collect.Lists; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; -import com.google.common.collect.Lists; - import java.util.*; import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutionException; @@ -68,7 +68,7 @@ public class VolunteerServiceImpl implements VolunteerService, ResultDataResolve // 2.补充图例 IcFormOptionsQueryFormDTO optionsForm = new IcFormOptionsQueryFormDTO(); optionsForm.setCustomerId(customerId); - optionsForm.setFormCode("resi_base_info"); + optionsForm.setFormCode(IcFormCodeEnum.RESI_BASE_INFO.getCode()); optionsForm.setLabel("志愿者类别"); String errorMsg = "【志愿者分布】查询志愿者图例失败"; diff --git a/epmet-user/epmet-user-server/src/test/java/com/epmet/epmetuser/test/IcResiUserControllerTest.java b/epmet-user/epmet-user-server/src/test/java/com/epmet/epmetuser/test/IcResiUserControllerTest.java index 4bf7b1c16c..9afcaf00d0 100644 --- a/epmet-user/epmet-user-server/src/test/java/com/epmet/epmetuser/test/IcResiUserControllerTest.java +++ b/epmet-user/epmet-user-server/src/test/java/com/epmet/epmetuser/test/IcResiUserControllerTest.java @@ -5,6 +5,7 @@ import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity; import cn.afterturn.easypoi.excel.export.ExcelExportService; import com.alibaba.fastjson.JSON; import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; +import com.epmet.commons.tools.enums.IcFormCodeEnum; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.utils.Result; @@ -61,7 +62,7 @@ public class IcResiUserControllerTest { @NotNull private CustomerFormResultDTO getResiFormItems(String customerId) { CustomerFormQueryDTO queryDTO = new CustomerFormQueryDTO(); - queryDTO.setFormCode("resi_base_info"); + queryDTO.setFormCode(IcFormCodeEnum.RESI_BASE_INFO.getCode()); queryDTO.setCustomerId(customerId); Result resultForm = operCustomizeOpenFeignClient.getCustomerForm(queryDTO); if (resultForm == null || !resultForm.success() ||resultForm.getData() == null){