diff --git a/doc/epmet-cloud.md b/doc/epmet-cloud.md index 43cd0d2f63..e47ddfc70e 100644 --- a/doc/epmet-cloud.md +++ b/doc/epmet-cloud.md @@ -10,4 +10,11 @@ 例如:有A、B2个服务,并且A调用B,如果我们只需要开发A服务,那本地只启动A服务即可,A调用B的时候,会调用服务器的B服务。 如果需要开发AB2个服务,那么将A中的FeignClient的url属性指向localhost。 PS:目前正在测试通过负载均衡器和本地环境变量实现动态修改目标服务IP,成功之后就不需要再修改FeignClient的url,配置一下环境变量即可,到时候具体说 -``` \ No newline at end of file +``` + + +## 私有化部署 +##### 需要开放哪些域名 + +- epmet-cloud.elinkservice.cn 微信交互代理 +- dysmsapi.aliyuncs.com 阿里云短信 \ No newline at end of file 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 10b1be7d14..9e9e0fa801 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 @@ -272,10 +272,10 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver { houseChangeRecordCollect(formDTO.getId(), formDTO.getCustomerId(), icHouseDTO); icHouseDao.updateById(entity); - IcHouseDTO houseDTO = icHouseService.get(formDTO.getId()); + // IcHouseDTO houseDTO = icHouseService.get(formDTO.getId()); //删除房屋缓存 - icHouseRedis.delHouseInfo(formDTO.getId(), houseDTO.getCustomerId()); + icHouseRedis.delHouseInfo(formDTO.getId(), formDTO.getCustomerId()); } /** diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/GuideDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/GuideDTO.java index f5fe57d143..db7177a3fa 100644 --- a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/GuideDTO.java +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/GuideDTO.java @@ -66,6 +66,7 @@ public class GuideDTO implements Serializable { /** * 所有上级组织ID,英文:隔开 + * orgId的orgIdPath */ private String pids; diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideServiceImpl.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideServiceImpl.java index eadca17c92..b02baa9609 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideServiceImpl.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideServiceImpl.java @@ -25,23 +25,24 @@ import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.dto.form.PageFormDTO; import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; +import com.epmet.commons.tools.enums.OrgTypeEnum; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.redis.common.CustomerOrgRedis; import com.epmet.commons.tools.redis.common.CustomerStaffRedis; +import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache; +import com.epmet.commons.tools.redis.common.bean.GridInfoCache; 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.commons.tools.utils.PidUtils; import com.epmet.commons.tools.utils.SpringContextUtils; -import com.epmet.constant.OrgInfoConstant; import com.epmet.dao.GuideDao; import com.epmet.dto.GuideDTO; import com.epmet.dto.form.*; import com.epmet.dto.result.GuideDetailResultDTO; import com.epmet.dto.result.GuideListResultDTO; -import com.epmet.dto.result.OrgResultDTO; import com.epmet.entity.*; -import com.epmet.feign.GovOrgOpenFeignClient; import com.epmet.service.*; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; @@ -66,8 +67,6 @@ import java.util.stream.Collectors; @Service public class GuideServiceImpl extends BaseServiceImpl implements GuideService { - @Resource - private GovOrgOpenFeignClient govOrgOpenFeignClient; @Resource private GuideModuleService guideModuleService; @Resource @@ -184,7 +183,7 @@ public class GuideServiceImpl extends BaseServiceImpl imp orgFormDTO.setOrgId(formDTO.getOrgId()); orgFormDTO.setOrgType(formDTO.getOrgType()); //获取组织的pId和pIds - Result result = govOrgOpenFeignClient.getAgencyInfo(orgFormDTO); + /*Result result = govOrgOpenFeignClient.getAgencyInfo(orgFormDTO); if (!result.success() || null == result.getData()) { throw new RenException(result.getCode(), result.getMsg()); } @@ -193,7 +192,16 @@ public class GuideServiceImpl extends BaseServiceImpl imp } else { guideDTO.setPid(result.getData().getAgencyId()); } - guideDTO.setPids(result.getData().getPids().concat(":").concat(result.getData().getAgencyId())); + guideDTO.setPids(result.getData().getPids().concat(":").concat(result.getData().getAgencyId()));*/ + if(OrgTypeEnum.GRID.getCode().equals(formDTO.getOrgType())){ + GridInfoCache gridInfoCache=CustomerOrgRedis.getGridInfo(formDTO.getOrgId()); + guideDTO.setPid(gridInfoCache.getPid()); + guideDTO.setPids(gridInfoCache.getPids().concat(StrConstant.COLON).concat(gridInfoCache.getId())); + }else{ + AgencyInfoCache agencyInfoCache=CustomerOrgRedis.getAgencyInfo(formDTO.getOrgId()); + guideDTO.setPid(agencyInfoCache.getPid()); + guideDTO.setPids(PidUtils.convertPid2OrgIdPath(agencyInfoCache.getId(),agencyInfoCache.getPids())); + } insert(guideDTO); //保存办事指南内容模块 if (CollectionUtils.isNotEmpty(formDTO.getModuleList())) { @@ -273,7 +281,7 @@ public class GuideServiceImpl extends BaseServiceImpl imp orgFormDTO.setOrgType(formDTO.getOrgType()); guideDTO.setOrgName(formDTO.getOrgName()); //获取组织的pId和pIds - Result result = govOrgOpenFeignClient.getAgencyInfo(orgFormDTO); + /*Result result = govOrgOpenFeignClient.getAgencyInfo(orgFormDTO); if (!result.success() || null == result.getData()) { throw new RenException(result.getCode(), result.getMsg()); } @@ -282,7 +290,17 @@ public class GuideServiceImpl extends BaseServiceImpl imp } else { guideDTO.setPid(result.getData().getAgencyId()); } - guideDTO.setPids(result.getData().getPids().concat(":").concat(result.getData().getAgencyId())); + guideDTO.setPids(result.getData().getPids().concat(":").concat(result.getData().getAgencyId()));*/ + + if(OrgTypeEnum.GRID.getCode().equals(formDTO.getOrgType())){ + GridInfoCache gridInfoCache=CustomerOrgRedis.getGridInfo(formDTO.getOrgId()); + guideDTO.setPid(gridInfoCache.getPid()); + guideDTO.setPids(gridInfoCache.getPids().concat(StrConstant.COLON).concat(gridInfoCache.getId())); + }else{ + AgencyInfoCache agencyInfoCache=CustomerOrgRedis.getAgencyInfo(formDTO.getOrgId()); + guideDTO.setPid(agencyInfoCache.getPid()); + guideDTO.setPids(PidUtils.convertPid2OrgIdPath(agencyInfoCache.getId(),agencyInfoCache.getPids())); + } update(guideDTO); //保存办事指南内容模块 if (CollectionUtils.isNotEmpty(formDTO.getModuleList())) { diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiCollectServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiCollectServiceImpl.java index bfecfa4671..ee5d24e8a1 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiCollectServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiCollectServiceImpl.java @@ -9,10 +9,12 @@ import com.epmet.commons.tools.enums.RelationshipEnum; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.redis.common.CustomerIcHouseRedis; import com.epmet.commons.tools.redis.common.CustomerOrgRedis; import com.epmet.commons.tools.redis.common.CustomerStaffRedis; import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache; import com.epmet.commons.tools.redis.common.bean.GridInfoCache; +import com.epmet.commons.tools.redis.common.bean.HouseInfoCache; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.PidUtils; @@ -43,6 +45,7 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.function.Function; @@ -421,6 +424,7 @@ public class IcResiCollectServiceImpl extends BaseServiceImpl resultDTOResult = govOrgFeignClient.getHouseInfoToCollect(getHouseInfoToCollectFormDTO); IcHouseInfoCollectResultDTO icHouseInfoCollectResultDTO = resultDTOResult.getData(); - + if(null==icHouseInfoCollectResultDTO){ + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"房屋不存在","房屋不存在,请先新建同名房屋"); + } // 新增房屋后需要collect更新上房屋ID // log icResiCollectEntity.setHomeId(icHouseInfoCollectResultDTO.getId()); @@ -462,7 +468,9 @@ public class IcResiCollectServiceImpl extends BaseServiceImpl wrapper = new LambdaQueryWrapper<>(); wrapper.eq(IcResiUserEntity::getHomeId, icResiCollectEntity.getHomeId()); - wrapper.eq(IcResiUserEntity::getYhzgx, RelationshipEnum.SELF.getCode()); + wrapper.eq(IcResiUserEntity::getYhzgx, RelationshipEnum.SELF.getCode()) + .ne(IcResiUserEntity::getIdCard,icResiCollectMemDetailDTO.getIdNum()); List entityList = icResiUserDao.selectList(wrapper); if (CollectionUtils.isNotEmpty(entityList)) { - String errorMsg = "房屋下已存在户主"; - throw new EpmetException(EpmetErrorCode.ORG_ADD_FAILED.getCode(), errorMsg, errorMsg); + String errorMsg = "当前房屋下已存在户主"; + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), errorMsg, errorMsg); } } - AgencyInfoCache agencyInfoCache = CustomerOrgRedis.getAgencyInfo(icResiCollectEntity.getAgencyId()); - if (null == agencyInfoCache) { - throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "所属组织查询异常,agencyId:" + icResiCollectEntity.getAgencyId(), "所属组织查询异常"); - } - // userEntity.setPids(icResiCollectEntity.getPids() + ":" + icResiCollectEntity.getAgencyId()); // ic_resi_user表的组织的pids 含agencyId本身 - userEntity.setPids(PidUtils.convertPid2OrgIdPath(icResiCollectEntity.getAgencyId(), agencyInfoCache.getPids())); - userEntity.setAgencyId(icResiCollectEntity.getAgencyId()); - userEntity.setGridId(icResiCollectEntity.getGridId()); - userEntity.setVillageId(icResiCollectEntity.getVillageId()); - userEntity.setBuildId(icResiCollectEntity.getBuildId()); - userEntity.setUnitId(icResiCollectEntity.getUnitId()); - userEntity.setHomeId(icResiCollectEntity.getHomeId()); - userEntity.setName(icResiCollectMemDetailDTO.getName()); - userEntity.setMobile(icResiCollectMemDetailDTO.getMobile()); - userEntity.setIdCard(icResiCollectMemDetailDTO.getIdNum()); - userEntity.setYhzgx(icResiCollectMemDetailDTO.getRelationship()); - userEntity.setGzdw(icResiCollectMemDetailDTO.getWorkPlace()); - userEntity.setRemarks(icResiCollectMemDetailDTO.getRemark()); - userEntity.setHjszd(icResiCollectMemDetailDTO.getDomicilePlace()); - icResiUserDao.updateById(userEntity); - // 判断是否需要更新记录 if(isUpdateLog){ //变更记录表 IcUserChangeRecordEntity changeRecordEntity = new IcUserChangeRecordEntity(); changeRecordEntity.setCustomerId(icResiCollectEntity.getCustomerId()); changeRecordEntity.setOperatorId(formDTO.getUserId()); - changeRecordEntity.setIcUserId(userEntity.getId()); + changeRecordEntity.setIcUserId(existedUserEntity.getId()); changeRecordEntity.setOperatorName(formDTO.getRealName()); - changeRecordEntity.setIcUserName(userEntity.getName()); - changeRecordEntity.setType("update"); - changeRecordEntity.setTypeName("修改"); + changeRecordEntity.setIcUserName(existedUserEntity.getName()); + changeRecordEntity.setType("transfer"); + changeRecordEntity.setTypeName("调动"); changeRecordEntity.setBeforeChangeName("-"); + HouseInfoCache originHouseInfoCache= CustomerIcHouseRedis.getHouseInfo(icResiCollectEntity.getCustomerId(),existedUserEntity.getHomeId()); + if(null!=originHouseInfoCache){ + changeRecordEntity.setBeforeChangeName(originHouseInfoCache.getAgencyPathName().concat(StrConstant.HYPHEN).concat(originHouseInfoCache.getGridName()).concat(StrConstant.HYPHEN).concat(originHouseInfoCache.getAllName())); + } changeRecordEntity.setAfterChangeName("-"); + HouseInfoCache newHouseInfoCache = CustomerIcHouseRedis.getHouseInfo(icResiCollectEntity.getCustomerId(), icResiCollectEntity.getHomeId()); + if (null != newHouseInfoCache) { + //信息采集时居民自己填写的房屋 以他填写的为准!!!!!! + changeRecordEntity.setAfterChangeName(newHouseInfoCache.getAgencyPathName().concat(StrConstant.HYPHEN).concat(newHouseInfoCache.getGridName()).concat(StrConstant.HYPHEN).concat(newHouseInfoCache.getAllName())); + } changeRecordEntity.setChangeTime(new java.util.Date()); + changeRecordEntity.setReason("来源于信息采集:更新居民所属房屋信息"); icUserChangeRecordService.insert(changeRecordEntity); } + AgencyInfoCache agencyInfoCache = CustomerOrgRedis.getAgencyInfo(icResiCollectEntity.getAgencyId()); + if (null == agencyInfoCache) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "所属组织查询异常,agencyId:" + icResiCollectEntity.getAgencyId(), "所属组织查询异常"); + } + // userEntity.setPids(icResiCollectEntity.getPids() + ":" + icResiCollectEntity.getAgencyId()); // ic_resi_user表的组织的pids 含agencyId本身 + existedUserEntity.setPids(PidUtils.convertPid2OrgIdPath(icResiCollectEntity.getAgencyId(), agencyInfoCache.getPids())); + // 组织Id + existedUserEntity.setAgencyId(icResiCollectEntity.getAgencyId()); + // 网格id + existedUserEntity.setGridId(icResiCollectEntity.getGridId()); + // 小区id + existedUserEntity.setVillageId(icResiCollectEntity.getVillageId()); + // 楼栋id + existedUserEntity.setBuildId(icResiCollectEntity.getBuildId()); + // 单元id + existedUserEntity.setUnitId(icResiCollectEntity.getUnitId()); + // 房屋id + existedUserEntity.setHomeId(icResiCollectEntity.getHomeId()); + // 姓名 + existedUserEntity.setName(icResiCollectMemDetailDTO.getName()); + // 手机号 + existedUserEntity.setMobile(icResiCollectMemDetailDTO.getMobile()); + // 身份证号 + existedUserEntity.setIdCard(icResiCollectMemDetailDTO.getIdNum()); + // 与户主关系 + existedUserEntity.setYhzgx(icResiCollectMemDetailDTO.getRelationship()); + // 工作单位 + existedUserEntity.setGzdw(icResiCollectMemDetailDTO.getWorkPlace()); + // 备注 + existedUserEntity.setRemarks(icResiCollectMemDetailDTO.getRemark()); + // 户籍所在地 + existedUserEntity.setHjszd(icResiCollectMemDetailDTO.getDomicilePlace()); + icResiUserDao.updateById(existedUserEntity); } /** @@ -542,49 +576,65 @@ public class IcResiCollectServiceImpl extends BaseServiceImpl wrapper = new LambdaQueryWrapper<>(); wrapper.eq(IcResiUserEntity::getHomeId, icResiCollectEntity.getHomeId()); - wrapper.eq(IcResiUserEntity::getYhzgx, RelationshipEnum.SELF.getCode()); + wrapper.eq(IcResiUserEntity::getYhzgx, RelationshipEnum.SELF.getCode()) + .ne(IcResiUserEntity::getIdCard,icResiCollectMemDetailDTO.getIdNum()); List entityList = icResiUserDao.selectList(wrapper); + // 已经存在户主了,当前成员填写的也是户主... 暂不处理 if (CollectionUtils.isNotEmpty(entityList)) { - String errorMsg = "房屋下已存在户主"; - throw new EpmetException(EpmetErrorCode.ORG_ADD_FAILED.getCode(), errorMsg, errorMsg); + String errorMsg = "当前房屋下已存在户主"; + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), errorMsg, errorMsg); } } // 新增人员 - IcResiUserEntity userEntity = new IcResiUserEntity(); + IcResiUserEntity insertUserEntity = new IcResiUserEntity(); AgencyInfoCache agencyInfoCache = CustomerOrgRedis.getAgencyInfo(icResiCollectEntity.getAgencyId()); if (null == agencyInfoCache) { throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "所属组织查询异常,agencyId:" + icResiCollectEntity.getAgencyId(), "所属组织查询异常"); } + // 组织的pids 含agencyId本身 // userEntity.setPids(icResiCollectEntity.getPids() + ":" + icResiCollectEntity.getAgencyId()); // ic_resi_user表的组织的pids 含agencyId本身 !!! - userEntity.setPids(PidUtils.convertPid2OrgIdPath(icResiCollectEntity.getAgencyId(), agencyInfoCache.getPids())); - userEntity.setAgencyId(icResiCollectEntity.getAgencyId()); - userEntity.setGridId(icResiCollectEntity.getGridId()); - userEntity.setVillageId(icResiCollectEntity.getVillageId()); - userEntity.setBuildId(icResiCollectEntity.getBuildId()); - userEntity.setUnitId(icResiCollectEntity.getUnitId()); - userEntity.setHomeId(icResiCollectEntity.getHomeId()); - userEntity.setName(icResiCollectMemDetailDTO.getName()); - userEntity.setMobile(icResiCollectMemDetailDTO.getMobile()); - userEntity.setIdCard(icResiCollectMemDetailDTO.getIdNum()); - userEntity.setYhzgx(icResiCollectMemDetailDTO.getRelationship()); - userEntity.setGzdw(icResiCollectMemDetailDTO.getWorkPlace()); - userEntity.setRemarks(icResiCollectMemDetailDTO.getRemark()); - userEntity.setCustomerId(icResiCollectMemDetailDTO.getCustomerId()); - userEntity.setHjszd(icResiCollectMemDetailDTO.getDomicilePlace()); - icResiUserDao.insert(userEntity); + insertUserEntity.setPids(PidUtils.convertPid2OrgIdPath(icResiCollectEntity.getAgencyId(), agencyInfoCache.getPids())); + // 网格所属组织id + insertUserEntity.setAgencyId(icResiCollectEntity.getAgencyId()); + // 网格id + insertUserEntity.setGridId(icResiCollectEntity.getGridId()); + // 小区id + insertUserEntity.setVillageId(icResiCollectEntity.getVillageId()); + // 楼栋id + insertUserEntity.setBuildId(icResiCollectEntity.getBuildId()); + //单元id + insertUserEntity.setUnitId(icResiCollectEntity.getUnitId()); + //房屋id + insertUserEntity.setHomeId(icResiCollectEntity.getHomeId()); + //姓名 + insertUserEntity.setName(icResiCollectMemDetailDTO.getName()); + //手机号 + insertUserEntity.setMobile(icResiCollectMemDetailDTO.getMobile()); + insertUserEntity.setIdCard(icResiCollectMemDetailDTO.getIdNum()); + //与户主关系 + insertUserEntity.setYhzgx(icResiCollectMemDetailDTO.getRelationship()); + //工作单位 + insertUserEntity.setGzdw(icResiCollectMemDetailDTO.getWorkPlace()); + // 备注 + insertUserEntity.setRemarks(icResiCollectMemDetailDTO.getRemark()); + insertUserEntity.setCustomerId(icResiCollectMemDetailDTO.getCustomerId()); + // 户籍所在地 + insertUserEntity.setHjszd(icResiCollectMemDetailDTO.getDomicilePlace()); + icResiUserDao.insert(insertUserEntity); //变更记录表 IcUserChangeRecordEntity changeRecordEntity = new IcUserChangeRecordEntity(); changeRecordEntity.setCustomerId(icResiCollectEntity.getCustomerId()); changeRecordEntity.setOperatorId(formDTO.getUserId()); - changeRecordEntity.setIcUserId(userEntity.getId()); + changeRecordEntity.setIcUserId(insertUserEntity.getId()); changeRecordEntity.setOperatorName(formDTO.getRealName()); - changeRecordEntity.setIcUserName(userEntity.getName()); + changeRecordEntity.setIcUserName(insertUserEntity.getName()); changeRecordEntity.setType("add"); changeRecordEntity.setTypeName("新增"); changeRecordEntity.setBeforeChangeName("-"); changeRecordEntity.setAfterChangeName("-"); + changeRecordEntity.setReason("来源于信息采集"); changeRecordEntity.setChangeTime(new java.util.Date()); icUserChangeRecordService.insert(changeRecordEntity); @@ -602,11 +652,21 @@ public class IcResiCollectServiceImpl extends BaseServiceImpl queryOriginUserByHomeId(String homeId,String customerId) { LambdaQueryWrapper query = new LambdaQueryWrapper<>(); query.eq(IcResiUserEntity::getHomeId, homeId); query.eq(IcResiUserEntity::getCustomerId, customerId); List originUserList = icResiUserDao.selectList(query); + if(CollectionUtils.isEmpty(originUserList)){ + return new HashMap<>(); + } Map memMap = originUserList.stream().collect(Collectors.toMap(IcResiUserEntity::getIdCard, Function.identity())); return memMap; } 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 1d9b9a8a25..0efe4acdb8 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 @@ -712,7 +712,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl", resiUserId)); } //2022-1-18 信息修改判断基础信息表人员网格、小区、楼栋、单元、房屋维度数据以及十八类的类别数据是否变化,相应生成变更记录和变更明细数据 sun start - icUserChangeRecord(tokenDto, entity, map); + icUserChangeRecord(entity, map); //2022-1-18 sun end //2.更新主表数据 if (map.size() > NumConstant.ONE) { @@ -793,10 +793,16 @@ public class IcResiUserServiceImpl extends BaseServiceImpl map) { + * @description: 生成居民变更记录 + * @param null: + * @return + * @author: sun + */ + public void icUserChangeRecord(IcResiUserEntity entity, LinkedHashMap map) { + // prepare + String customerId = EpmetRequestHolder.getLoginUserCustomerId(); + String staffId = EpmetRequestHolder.getLoginUserId(); + java.util.Date date = new java.util.Date(); //1.判断维度数据是否修改【网格、小区、楼栋、单元、房间有变化则先走人员调动逻辑】 if ((map.containsKey("GRID_ID") && !entity.getGridId().equals(map.get("GRID_ID"))) || (map.containsKey("VILLAGE_ID") && !entity.getVillageId().equals(map.get("VILLAGE_ID"))) @@ -813,13 +819,13 @@ public class IcResiUserServiceImpl extends BaseServiceImpl> categoryListResult = operCustomizeOpenFeignClient.getCategoryList(sfdto); if (!categoryListResult.success()) { throw new RenException("居民信息修改,获取客户居民类别预警配置表数据失败"); @@ -844,7 +850,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl NumConstant.ZERO) { //变更记录 - CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId()); - changeRecordEntity.setCustomerId(tokenDto.getCustomerId()); - changeRecordEntity.setOperatorId(tokenDto.getUserId()); + CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(customerId, staffId); + changeRecordEntity.setCustomerId(customerId); + changeRecordEntity.setOperatorId(staffId); changeRecordEntity.setIcUserId(entity.getId()); changeRecordEntity.setOperatorName(staffInfoCache.getRealName()); changeRecordEntity.setIcUserName(map.containsKey("NAME") ? map.get("NAME") : entity.getName());