diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aop/NoRepeatSubmitAop.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aop/NoRepeatSubmitAop.java index 2c391d6b81..e1716469f2 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aop/NoRepeatSubmitAop.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aop/NoRepeatSubmitAop.java @@ -49,19 +49,16 @@ public class NoRepeatSubmitAop { long leaseTime = noRepeatSubmit.leaseTime(); //如果获取不到锁等待0秒直接返回 持锁时间为leaseTime lock = distributedLock.getLock(RedisKeys.getNoRepeatSubmitKey(key), leaseTime, NumConstant.ZERO_L, TimeUnit.MILLISECONDS); + //因为getLock如果获取失败抛异常 所以不做锁状态的判断 + result = pjp.proceed(); } catch (Exception e) { log.warn("noRepeatSubmit key:{},msg:{}", key, e.getMessage()); //"未获取到锁,重复提交了 throw new RenException(EpmetErrorCode.REPEAT_SUBMIT.getCode()); - } - try { - //因为getLock如果获取失败抛异常 所以不做锁状态的判断 - result = pjp.proceed(); } finally { distributedLock.unLock(lock); } - return result; } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/DemandAnalysisLegendEnum.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/DemandAnalysisLegendEnum.java new file mode 100644 index 0000000000..0b7a0bc5f4 --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/DemandAnalysisLegendEnum.java @@ -0,0 +1,43 @@ +package com.epmet.commons.tools.enums; + +public enum DemandAnalysisLegendEnum { + + /** + * 环境变量枚举 + */ + VOLUNTEER("ic_user_volunteer", "志愿者"), + PARTY_UNIT("party_unit", "联建单位"), + COMMUNITY_ORG("community_org", "社区自组织"), + UNFINISHED("unfinished", "未完成"), + ; + + private String code; + private String name; + + + + DemandAnalysisLegendEnum(String code, String name) { + this.code = code; + this.name = name; + } + + public static DemandAnalysisLegendEnum getEnum(String code) { + DemandAnalysisLegendEnum[] values = DemandAnalysisLegendEnum.values(); + for (DemandAnalysisLegendEnum 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-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/GridInfoCache.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/GridInfoCache.java index c55e61513e..17a55e8b17 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/GridInfoCache.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/GridInfoCache.java @@ -115,7 +115,7 @@ public class GridInfoCache implements Serializable { private String coordinates; /** - * 弃用标记 + * 弃用标记 弃用:1;正常使用:0 */ private Integer abandonFlag; diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/UserDemandConstant.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/UserDemandConstant.java index 2f449f9201..b0a3d20fd7 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/UserDemandConstant.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/UserDemandConstant.java @@ -47,11 +47,13 @@ public interface UserDemandConstant { String EVALUATE="evaluate"; // 服务方类型:志愿者:volunteer;社会组织:social_org;社区自组织:community_org;区域党建单位:party_unit; + + //volunteer是指的居民信息的志愿者 String VOLUNTEER="volunteer"; String SOCIAL_ORG="social_org"; String COMMUNITY_ORG="community_org"; String PARTY_UNIT="party_unit"; - + String IC_USER_VOLUNTEER="ic_user_volunteer"; /** * 个人档案:personal-data diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcUserDemandRecController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcUserDemandRecController.java index 3405c0c019..25db823b01 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcUserDemandRecController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcUserDemandRecController.java @@ -98,6 +98,7 @@ public class IcUserDemandRecController implements ResultDataResolver { formDTO.setStaffId(tokenDto.getUserId()); ValidatorUtils.validateEntity(formDTO, ServiceQueryFormDTO.AddUserInternalGroup.class); if (UserDemandConstant.VOLUNTEER.equals(formDTO.getServiceType())) { + //应该查询爱心互助的志愿者 return new Result>().ok(volunteerInfoService.queryListVolunteer(tokenDto.getCustomerId(), formDTO.getStaffId(),formDTO.getServiceName())); } else if (UserDemandConstant.SOCIAL_ORG.equals(formDTO.getServiceType())) { ValidatorUtils.validateEntity(formDTO, ServiceQueryFormDTO.AddUserInternalGroup.class, ServiceQueryFormDTO.SocietyOrgInternalGroup.class); @@ -106,6 +107,8 @@ public class IcUserDemandRecController implements ResultDataResolver { return new Result>().ok(icCommunitySelfOrganizationService.queryServiceList(formDTO)); } else if (UserDemandConstant.PARTY_UNIT.equals(formDTO.getServiceType())) { return new Result>().ok(icPartyUnitService.queryServiceList(formDTO)); + }else if (UserDemandConstant.IC_USER_VOLUNTEER.equals(formDTO.getServiceType())) { + return new Result>().ok(volunteerInfoService.queryListVolunteer(tokenDto.getCustomerId(), formDTO.getStaffId(),formDTO.getServiceName())); } return new Result<>(); } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java index 2d04bec434..d27c32445e 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java @@ -25,13 +25,16 @@ import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; +import com.epmet.commons.tools.enums.DemandAnalysisLegendEnum; import com.epmet.commons.tools.enums.DictTypeEnum; 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.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.scan.param.TextScanParamDTO; import com.epmet.commons.tools.scan.param.TextTaskDTO; import com.epmet.commons.tools.scan.result.SyncScanResult; @@ -260,6 +263,10 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl pageInfo= PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.pageSelect(formDTO)); List list=pageInfo.getList(); @@ -275,18 +282,22 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl dictList=demandDictService.listByCodes(formDTO.getCustomerId(),categoryCodes); Map dictMap = dictList.stream().collect(Collectors.toMap(IcResiDemandDictEntity::getCategoryCode, IcResiDemandDictEntity::getCategoryName)); - //3、查询志愿者 + //3、查询爱心互助志愿者 // 服务方类型:志愿者:volunteer;社会组织:social_org;社区自组织:community_org;区域党建单位:party_unit; Map userInfoMap=new HashMap<>(); Set userIdList=list.stream().filter(item->null!=item.getServiceType()&&item.getServiceType().equals(UserDemandConstant.VOLUNTEER)).map(DemandRecResultDTO::getServerId).collect(Collectors.toSet()); if(CollectionUtils.isNotEmpty(userIdList)){ Result> userInfoRes = epmetUserOpenFeignClient.queryUserBaseInfo(new ArrayList<>(userIdList)); if(!userInfoRes.success()||CollectionUtils.isEmpty(userInfoRes.getData())){ - throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(),"查询志愿者信息异常"); + throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(),"查询爱心互助志愿者信息异常"); } userInfoMap=userInfoRes.getData().stream().collect(Collectors.toMap(UserBaseInfoResultDTO::getUserId, UserBaseInfoResultDTO::getRealName)); } + //4、居民信息的志愿者 + Set icUserIdList = list.stream().filter(item -> null != item.getServiceType() && item.getServiceType().equals(UserDemandConstant.IC_USER_VOLUNTEER)).map(DemandRecResultDTO::getServerId).collect(Collectors.toSet()); + Map icUserInfoMap =getIcVolunteerMap(icUserIdList); + //查询字典表 Result> reportTypeRes=adminOpenFeignClient.dictMap(DictTypeEnum.USER_DEMAND_REPORT_TYPE.getCode()); Map reportTypeMap=reportTypeRes.success()&& MapUtils.isNotEmpty(reportTypeRes.getData())?reportTypeRes.getData():new HashMap<>(); @@ -306,15 +317,29 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl> userInfoRes = epmetUserOpenFeignClient.queryUserBaseInfo(Arrays.asList(serverId)); if (!userInfoRes.success() || CollectionUtils.isEmpty(userInfoRes.getData())) { - throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), "查询志愿者信息异常","志愿者信息查询异常"); + throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), "查询爱心互助志愿者信息异常","志愿者信息查询异常"); } serviceName=userInfoRes.getData().get(NumConstant.ZERO).getRealName(); break; + case UserDemandConstant.IC_USER_VOLUNTEER: + //居民信息的志愿者 ic_resi_user + Result icUserInfoRes = epmetUserOpenFeignClient.getIcResiUserDTO(serverId); + if (!icUserInfoRes.success() || null==icUserInfoRes.getData()) { + throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), "查询居民信息志愿者信息异常","查询居民信息志愿者信息异常"); + } + serviceName=icUserInfoRes.getData().getName(); + break; default: log.warn("serviceType 错误"); break; @@ -633,9 +667,16 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl userIdList = Arrays.asList(res.getServerId()); Result> userInfoRes = epmetUserOpenFeignClient.queryUserBaseInfo(userIdList); if (!userInfoRes.success() || CollectionUtils.isEmpty(userInfoRes.getData())) { - throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), "查询志愿者信息异常"); + throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), "查询爱心互助志愿者信息异常"); } res.setServiceName(userInfoRes.getData().get(NumConstant.ZERO).getRealName()); + }else if(UserDemandConstant.IC_USER_VOLUNTEER.equals(res.getServiceType())){ + // 如果服务方是居民信息的志愿者,需要查询ic_resi_user.姓名 + Result userInfoRes = epmetUserOpenFeignClient.getIcResiUserDTO(res.getServerId()); + if (!userInfoRes.success() || null == userInfoRes.getData()) { + throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), "查询居民信息志愿者信息异常"); + } + res.setServiceName(userInfoRes.getData().getName()); } //查询字典表 Result> reportTypeRes = adminOpenFeignClient.dictMap(DictTypeEnum.USER_DEMAND_REPORT_TYPE.getCode()); @@ -654,7 +695,11 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl dictList=demandDictService.listByCodes(customerId,categoryCodes); Map dictMap = dictList.stream().collect(Collectors.toMap(IcResiDemandDictEntity::getCategoryCode, IcResiDemandDictEntity::getCategoryName)); - //3、查询志愿者 + //3、查询爱心互助志愿者 // 服务方类型:志愿者:volunteer;社会组织:social_org;社区自组织:community_org;区域党建单位:party_unit; Map userInfoMap=new HashMap<>(); Set userIdList=demandList.stream().filter(item->null!=item.getServiceType()&&item.getServiceType().equals(UserDemandConstant.VOLUNTEER)).map(DemandRecResultDTO::getServerId).collect(Collectors.toSet()); @@ -850,6 +895,10 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl icUserIdList = demandList.stream().filter(item -> null != item.getServiceType() && item.getServiceType().equals(UserDemandConstant.IC_USER_VOLUNTEER)).map(DemandRecResultDTO::getServerId).collect(Collectors.toSet()); + Map icUserInfoMap=getIcVolunteerMap(icUserIdList); + for(DemandRecResultDTO res:demandList){ if (null != gridInfoMap && gridInfoMap.containsKey(res.getGridId())) { res.setGridName(gridInfoMap.get(res.getGridId()).getGridName()); @@ -859,9 +908,6 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl firstCategoryList=demandDictService.querySubCodeList(subCodeFormDTO); if(CollectionUtils.isEmpty(firstCategoryList)){ return new CategoryAnalysisResDTO(Collections.EMPTY_LIST,Collections.EMPTY_LIST); } //2、没有服务类型直接退出 - Result> serviceTypeRes=adminOpenFeignClient.dictMap(DictTypeEnum.USER_DEMAND_SERVICE_TYPE.getCode()); + /*Result> serviceTypeRes=adminOpenFeignClient.dictMap(DictTypeEnum.USER_DEMAND_SERVICE_TYPE.getCode()); if(!serviceTypeRes.success()||MapUtils.isEmpty(serviceTypeRes.getData())){ throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(),"查询服务方类型异常,请检查是否已经配置字典信息"); } - List legend=new ArrayList<>(); serviceTypeRes.getData().forEach((code,name)->{ LegendDTO legendDTO=new LegendDTO(code,name); legend.add(legendDTO); }); LegendDTO unfinishLegend = new LegendDTO("unfinished", "未完成"); - legend.add(unfinishLegend); - - log.info("阶段性胜利1:"+ JSON.toJSONString(legend)); + legend.add(unfinishLegend);*/ + List legend=new ArrayList<>(); + DemandAnalysisLegendEnum[] values = DemandAnalysisLegendEnum.values(); + for (DemandAnalysisLegendEnum value : values) { + LegendDTO legendDTO=new LegendDTO(); + legendDTO.setLegendCode(value.getCode()); + legendDTO.setLegendName(value.getName()); + legend.add(legendDTO); + } + // log.info("阶段性胜利1:"+ JSON.toJSONString(legend)); // 3、传进来的是组织id的话,查询出全路径 if("agency".equals(formDTO.getOrgType())){ //找到当前组织的所有上级,再拼接上自己 - Result customerAgencyDTOResult=govOrgOpenFeignClient.getAgencyById(formDTO.getOrgId()); + /*Result customerAgencyDTOResult=govOrgOpenFeignClient.getAgencyById(formDTO.getOrgId()); if(!customerAgencyDTOResult.success()||null==customerAgencyDTOResult.getData()){ throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), "获取组织信息异常govOrgOpenFeignClient.getAgencyById"); - } - if(NumConstant.ZERO_STR.equals(customerAgencyDTOResult.getData().getPid())){ + }*/ + AgencyInfoCache agencyInfoCache=CustomerOrgRedis.getAgencyInfo(formDTO.getOrgId()); + if(NumConstant.ZERO_STR.equals(agencyInfoCache.getPid())||StringUtils.isBlank(agencyInfoCache.getPid())){ //当前传入的组织id=客户的根组织 formDTO.setGridPids(formDTO.getOrgId()); }else{ - formDTO.setGridPids(customerAgencyDTOResult.getData().getPids().concat(StrConstant.COLON).concat(formDTO.getOrgId())); + formDTO.setGridPids(agencyInfoCache.getPids().concat(StrConstant.COLON).concat(formDTO.getOrgId())); } } @@ -1241,6 +1304,9 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl userIdList=list.stream().filter(item->null!=item.getServiceType()&&item.getServiceType().equals(UserDemandConstant.VOLUNTEER)).map(ResiClientMyDemandResDTO::getServerId).collect(Collectors.toSet()); Map userInfoMap=getVolunteerMap(userIdList); + //3、居民信息志愿者 + Set icUserIdList=list.stream().filter(item->null!=item.getServiceType()&&item.getServiceType().equals(UserDemandConstant.IC_USER_VOLUNTEER)).map(ResiClientMyDemandResDTO::getServerId).collect(Collectors.toSet()); + Map icUerInfoMap=getIcVolunteerMap(icUserIdList); for (ResiClientMyDemandResDTO resDto : list) { //3、查询分类名称 @@ -1269,6 +1335,11 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl getIcVolunteerMap(Set icUserIdList) { + Map icUserInfoMap = new HashMap<>(); + if (CollectionUtils.isNotEmpty(icUserIdList)) { + Result> icUserInfoRes = epmetUserOpenFeignClient.getListIcResiUserDTO(new ArrayList<>(icUserIdList)); + if (!icUserInfoRes.success() || CollectionUtils.isEmpty(icUserInfoRes.getData())) { + throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), "查询居民信息志愿者信息异常"); + } + icUserInfoMap = icUserInfoRes.getData().stream().collect(Collectors.toMap(IcResiUserDTO::getId, o -> o, (o1, o2) -> o1)); + } + return icUserInfoMap; + } + /** * 我的需求-需求详情(待处理,处理中,已完成,已取消) * @@ -1374,6 +1462,12 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl icUserInfoMap = getIcVolunteerMap(new HashSet<>(Arrays.asList(resDto.getServerId()))); + resDto.setServiceUnitName(StrConstant.EPMETY_STR); + resDto.setServiceUserName(icUserInfoMap.get(resDto.getServerId()).getName()); + resDto.setServiceUserMobile(icUserInfoMap.get(resDto.getServerId()).getMobile()); + break; default: log.warn("serviceType 错误"); break; diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml index 158dcb1b7d..4fe2195446 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml @@ -120,7 +120,7 @@ and r.STATUS=#{status} - and s.SERVICE_TYPE=#{serviceType} + and s.SERVICE_TYPE like concat('%',#{serviceType},'%') and s.SERVER_ID=#{serverId} @@ -389,6 +389,7 @@ when s.SERVICE_TYPE='social_org' then '社会组织' when s.SERVICE_TYPE='community_org' then '社区自组织' when s.SERVICE_TYPE='party_unit' then '区域化党建单位' + when s.SERVICE_TYPE='ic_user_volunteer' then '志愿者' end )as legendName, count(s.DEMAND_REC_ID) as serviceDemandTotal, @@ -406,6 +407,7 @@ and m.GRID_PIDS like concat(#{gridPids},'%') + and s.SERVICE_TYPE not like '%volunteer%' and DATE_FORMAT(m.REPORT_TIME,'%Y-%m-%d') >= #{startDateId} and DATE_FORMAT(m.REPORT_TIME,'%Y-%m-%d') <= #{endDateId} and m.CATEGORY_CODE like concat(#{categoryCode},'%') @@ -413,6 +415,32 @@ union all + select + #{categoryCode} as categoryCode, + 'ic_user_volunteer' as legendCode, + '志愿者' as legendName, + count(s.DEMAND_REC_ID) as serviceDemandTotal, + count(distinct s.SERVER_ID) as totalService + from ic_user_demand_service s + inner join ic_user_demand_rec m + on(s.DEMAND_REC_ID=m.ID) + where s.DEL_FLAG='0' + and m.DEL_FLAG='0' + and m.`STATUS`='finished' + and m.CUSTOMER_ID=#{customerId} + + and m.GRID_ID=#{orgId} + + + and m.GRID_PIDS like concat(#{gridPids},'%') + + and s.SERVICE_TYPE like '%volunteer%' + and DATE_FORMAT(m.REPORT_TIME,'%Y-%m-%d') >= #{startDateId} + and DATE_FORMAT(m.REPORT_TIME,'%Y-%m-%d') <= #{endDateId} + and m.CATEGORY_CODE like concat(#{categoryCode},'%') + + union all + select #{categoryCode} as categoryCode, 'unfinished' as legendCode, diff --git a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/grid/service/impl/ResiMineGridServiceImpl.java b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/grid/service/impl/ResiMineGridServiceImpl.java index 78a32b482f..11f20c2f0c 100644 --- a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/grid/service/impl/ResiMineGridServiceImpl.java +++ b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/grid/service/impl/ResiMineGridServiceImpl.java @@ -3,6 +3,7 @@ package com.epmet.modules.grid.service.impl; import com.alibaba.fastjson.JSON; import com.epmet.commons.tools.constant.AppClientConstant; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.redis.common.CustomerOrgRedis; @@ -107,7 +108,7 @@ public class ResiMineGridServiceImpl implements ResiMineGridService { **/ @Override public LatestGridInfoResultDTO latestGridInfo(LatestGridInfoFormDTO formDTO) { - logger.info(String.format("居民端获取用户最近访问网格入参%s", JSON.toJSONString(formDTO))); + // logger.info(String.format("居民端获取用户最近访问网格入参%s", JSON.toJSONString(formDTO))); // 查询注册网格的弃用状态 LatestGridInfoResultDTO result = new LatestGridInfoResultDTO(); @@ -160,6 +161,19 @@ public class ResiMineGridServiceImpl implements ResiMineGridService { } result.setGridId(StringUtils.isNotBlank(userResult.getData().getGridId()) ? userResult.getData().getGridId() : ""); result.setCustomerId(StringUtils.isNotBlank(userResult.getData().getCustomerId()) ? userResult.getData().getCustomerId() : ""); + //判断下最后一次访问的网格是否已经被删除或者被弃用 + if (StringUtils.isNotBlank(userResult.getData().getGridId())) { + GridInfoCache gridInfoCache=CustomerOrgRedis.getGridInfo(result.getGridId()); + if (null == gridInfoCache || (null != gridInfoCache.getAbandonFlag() && NumConstant.ONE == gridInfoCache.getAbandonFlag())) { + result.setGridId(StrConstant.EPMETY_STR); + result.setCustomerId(StrConstant.EPMETY_STR); + logger.error(String.format("获取用户最近访问网格异常,网格可能被删除或者被弃用,参数%s",JSON.toJSONString(formDTO))); + return result; + } + result.setGridId(userResult.getData().getGridId()); + } else { + result.setGridId(StrConstant.EPMETY_STR); + } return result; } 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 90b0359881..7aa527475e 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 @@ -697,6 +697,14 @@ public interface EpmetUserOpenFeignClient { @PostMapping(value = "/epmetuser/icresiuser/geticresiuser/{icResiUserId}") Result getIcResiUserDTO(@PathVariable("icResiUserId") String icResiUserId); + /** + * 获取ic_resi_user + * @param icResiUserIdList + * @return + */ + @PostMapping(value = "/epmetuser/icresiuser/list-icresiuser") + Result> getListIcResiUserDTO(@RequestBody List icResiUserIdList); + /** * @Description 查询居民注册关系 * @param userId 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 55083de3a2..cf8c53d1b2 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 @@ -515,6 +515,17 @@ public class EpmetUserOpenFeignClientFallback implements EpmetUserOpenFeignClien return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getIcResiUserDTO", icResiUserId); } + /** + * 获取ic_resi_user + * + * @param icResiUserIdList + * @return + */ + @Override + public Result> getListIcResiUserDTO(List icResiUserIdList) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getListIcResiUserDTO", icResiUserIdList); + } + @Override public Result resiRelationInfo(String userId) { return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "resiRelationInfo", userId); 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 b166ceca92..7b890db270 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 @@ -957,6 +957,20 @@ public class IcResiUserController implements ResultDataResolver { return new Result<>(); } + /** + * 获取ic_resi_user + * 目前只返回id, name + * @param icResiUserIdList + * @return + */ + @PostMapping(value = "list-icresiuser") + public Result> getListIcResiUserDTO(@RequestBody List icResiUserIdList) { + if (CollectionUtils.isEmpty(icResiUserIdList)) { + return new Result<>(); + } + return new Result>().ok(icResiUserService.getListIcResiUserDTO(icResiUserIdList)); + } + /** * 【社区查询】搜索居民们 * 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 1fca7a2582..e8125a06f9 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 @@ -394,11 +394,13 @@ public interface IcResiUserDao extends BaseDao { @Param("customerId") String customerId); /** - * @return com.epmet.entity.IcResiUserEntity - * @describe: 通过身份证号查询实体类 - * @author wangtong - * @date 2022/6/13 17:32 - * @params [idCard, customerId] - */ - IcResiUserEntity selectResiUserEntityByIdCard(@Param("idCard") String idCard, @Param("customerId") String customerId); + * @describe: 通过身份证号查询实体类 + * @author wangtong + * @date 2022/6/13 17:32 + * @params [idCard, customerId] + * @return com.epmet.entity.IcResiUserEntity + */ + IcResiUserEntity selectResiUserEntityByIdCard(@Param("idCard") String idCard,@Param("customerId") String customerId); + + List getListIcResiUserDTO(@Param("icResiUserIdList") List icResiUserIdList); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java index 92b38e3f9a..fdf3a11d6f 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java @@ -446,4 +446,6 @@ public interface IcResiUserService extends BaseService { * @Date 2022/6/16 15:30 */ List getUserId(String icResiUserId); + + List getListIcResiUserDTO(List icResiUserIdList); } 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 1ce1560050..1d279cd321 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 @@ -2566,6 +2566,19 @@ public class IcResiUserServiceImpl extends BaseServiceImpl getListIcResiUserDTO(List icResiUserIdList) { + if(CollectionUtils.isEmpty(icResiUserIdList)){ + return new ArrayList<>(); + } + return baseDao.getListIcResiUserDTO(icResiUserIdList); + } + /** * 根据身份证获取居民角色(目前只有是否是志愿者) * 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 46a101db60..a72e8caa59 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 @@ -1164,4 +1164,13 @@ AND customer_id = #{customerId} AND DEL_FLAG = '0' + +