From 99591acd969e67638ae6fb717d91f9c03eccf3d9 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 30 Dec 2021 10:44:39 +0800 Subject: [PATCH 01/12] monthId --- .../main/resources/mapper/screen/ScreenGovernRankDataDao.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenGovernRankDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenGovernRankDataDao.xml index 6f040d326b..ca3642230b 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenGovernRankDataDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenGovernRankDataDao.xml @@ -91,7 +91,8 @@ rankData.RESOLVED_RATIO, rankData.GOVERN_RATIO, rankData.SATISFACTION_RATIO, - agency.AGENCY_NAME AS parentAgencyName + agency.AGENCY_NAME AS parentAgencyName, + rankData.MONTH_ID as monthId FROM screen_govern_rank_data rankData LEFT JOIN From a9a5826695932c65d5b4a69d87fce5406a72eb19 Mon Sep 17 00:00:00 2001 From: jianjun Date: Thu, 30 Dec 2021 10:47:49 +0800 Subject: [PATCH 02/12] =?UTF-8?q?Revert=20"=E4=B8=B4=E6=97=B6=E8=A7=A3?= =?UTF-8?q?=E5=86=B3=E6=96=B9=E6=A1=88=20=E7=BB=84=E7=BB=87=E6=A0=91=20?= =?UTF-8?q?=E5=85=88=E7=BC=93=E5=AD=98"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit d69fd238 --- .../java/com/epmet/controller/CustomerAgencyController.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java index 704b9b66b6..43108f3706 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java @@ -369,8 +369,8 @@ public class CustomerAgencyController { * @Date 2021/9/8 15:20 */ @PostMapping("agencygridtree") - public Result getOrgTreeData(@LoginUser TokenDto tokenDTO) { - //tokenDTO.setUserId("dffe71e021a61b900f9025f4f07f6955"); + public Result getOrgTreeData(/*@LoginUser */TokenDto tokenDTO) { + tokenDTO.setUserId("dffe71e021a61b900f9025f4f07f6955"); String orgTreeCacheKey = RedisKeys.getOrgTreeCacheKey(tokenDTO.getUserId()); Object o = redisUtils.get(orgTreeCacheKey); AgencyTreeResultDTO result = null; From 22474ae651ce3088fa2c1c341848abbae8726bbd Mon Sep 17 00:00:00 2001 From: jianjun Date: Thu, 30 Dec 2021 10:54:31 +0800 Subject: [PATCH 03/12] =?UTF-8?q?=E4=B8=B4=E6=97=B6=E8=A7=A3=E5=86=B3?= =?UTF-8?q?=E6=96=B9=E6=A1=88=20=E7=BB=84=E7=BB=87=E6=A0=91=20=E5=85=88?= =?UTF-8?q?=E7=BC=93=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/commons/tools/redis/RedisKeys.java | 6 +++--- .../controller/CustomerAgencyController.java | 19 +++--------------- .../impl/CustomerAgencyServiceImpl.java | 20 ++++++++++++++++--- 3 files changed, 23 insertions(+), 22 deletions(-) diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java index 57630deaaf..970f72801a 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java @@ -630,10 +630,10 @@ public class RedisKeys { /** * desc:临时方案 - * @param userId + * @param agencyId * @return */ - public static String getOrgTreeCacheKey(String userId) { - return rootPrefix.concat("ic:temp:orgtree").concat("userId"); + public static String getOrgTreeCacheKey(String agencyId) { + return rootPrefix.concat("ic:temp:orgtree").concat(agencyId); } } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java index 43108f3706..64660eec85 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java @@ -20,8 +20,6 @@ package com.epmet.controller; import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; -import com.epmet.commons.tools.redis.RedisKeys; -import com.epmet.commons.tools.redis.RedisUtils; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ExcelUtils; import com.epmet.commons.tools.utils.Result; @@ -55,8 +53,6 @@ import java.util.Set; @RestController @RequestMapping("customeragency") public class CustomerAgencyController { - @Autowired - private RedisUtils redisUtils; @Autowired private CustomerAgencyService customerAgencyService; @@ -369,18 +365,9 @@ public class CustomerAgencyController { * @Date 2021/9/8 15:20 */ @PostMapping("agencygridtree") - public Result getOrgTreeData(/*@LoginUser */TokenDto tokenDTO) { - tokenDTO.setUserId("dffe71e021a61b900f9025f4f07f6955"); - String orgTreeCacheKey = RedisKeys.getOrgTreeCacheKey(tokenDTO.getUserId()); - Object o = redisUtils.get(orgTreeCacheKey); - AgencyTreeResultDTO result = null; - if (o == null){ - result = customerAgencyService.getOrgTreeData(tokenDTO.getUserId()); - redisUtils.set(orgTreeCacheKey,result,RedisUtils.MINUTE_THIRTY_EXPIRE); - }else { - result = (AgencyTreeResultDTO) o; - } - return new Result().ok(result); + public Result getOrgTreeData(@LoginUser TokenDto tokenDTO) { + //tokenDTO.setUserId("dffe71e021a61b900f9025f4f07f6955"); + return new Result().ok(customerAgencyService.getOrgTreeData(tokenDTO.getUserId())); } } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java index f70fdd035a..5e0dc73b52 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java @@ -16,6 +16,7 @@ */ package com.epmet.service.impl; + import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; @@ -24,6 +25,8 @@ import com.epmet.commons.tools.constant.NumConstant; 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.RedisKeys; +import com.epmet.commons.tools.redis.RedisUtils; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.constant.CustomerAgencyConstant; @@ -81,6 +84,8 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl page(Map params) { @@ -1122,8 +1127,17 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl getStaffOrgListByStaffId(String staffId) { return baseDao.getStaffOrgListByStaffId(staffId); } -} \ No newline at end of file +} From 72c8e0ea25e5d73421d55c828051cea2f9b3260a Mon Sep 17 00:00:00 2001 From: jianjun Date: Thu, 30 Dec 2021 10:55:27 +0800 Subject: [PATCH 04/12] =?UTF-8?q?=E4=B8=B4=E6=97=B6=E8=A7=A3=E5=86=B3?= =?UTF-8?q?=E6=96=B9=E6=A1=88=20=E7=BB=84=E7=BB=87=E6=A0=91=20=E5=85=88?= =?UTF-8?q?=E7=BC=93=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/commons/tools/redis/RedisKeys.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java index 970f72801a..f3c669d7cd 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java @@ -634,6 +634,6 @@ public class RedisKeys { * @return */ public static String getOrgTreeCacheKey(String agencyId) { - return rootPrefix.concat("ic:temp:orgtree").concat(agencyId); + return rootPrefix.concat("org:temp:orgtree").concat(agencyId); } } From 4d9404affd37715934f03592b9145bea3e9ebe0c Mon Sep 17 00:00:00 2001 From: jianjun Date: Thu, 30 Dec 2021 12:19:39 +0800 Subject: [PATCH 05/12] =?UTF-8?q?=E5=B7=A1=E6=9F=A5=E7=9A=84=E5=BB=B6?= =?UTF-8?q?=E8=BF=9F1s=20=E6=B6=88=E8=B4=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BaseGridDailyworkController.java | 2 +- .../OpenDataPatrolChangeEventListener.java | 4 +++- .../service/BaseGridDailyworkService.java | 2 +- .../impl/BaseGridDailyworkServiceImpl.java | 10 ++++++---- .../impl/UserPatrolRecordServiceImpl.java | 18 ++++++++++-------- 5 files changed, 21 insertions(+), 15 deletions(-) diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/controller/BaseGridDailyworkController.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/controller/BaseGridDailyworkController.java index 4b27f0c0a3..1efda7b0b3 100644 --- a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/controller/BaseGridDailyworkController.java +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/controller/BaseGridDailyworkController.java @@ -50,7 +50,7 @@ public class BaseGridDailyworkController { @PostMapping("sync") public Result getStaffBaseInfo(@RequestBody(required = false) UpsertPatrolRecordForm formDTO) { ValidatorUtils.validateEntity(formDTO, DefaultGroup.class); - baseGridDailyworkService.insertPatrolRecord(formDTO); + baseGridDailyworkService.insertBaseGridWorkRecord(formDTO); return new Result(); } diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/mq/listener/OpenDataPatrolChangeEventListener.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/mq/listener/OpenDataPatrolChangeEventListener.java index e13b8d01b7..682185ca8a 100644 --- a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/mq/listener/OpenDataPatrolChangeEventListener.java +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/mq/listener/OpenDataPatrolChangeEventListener.java @@ -3,6 +3,7 @@ package com.epmet.opendata.mq.listener; import com.alibaba.fastjson.JSON; import com.epmet.commons.rocketmq.constants.MQUserPropertys; import com.epmet.commons.rocketmq.messages.StaffPatrolMQMsg; +import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.distributedlock.DistributedLock; import com.epmet.commons.tools.exception.ExceptionUtils; @@ -53,6 +54,7 @@ public class OpenDataPatrolChangeEventListener implements MessageListenerConcurr } try { + Thread.sleep(NumConstant.ONE_THOUSAND); msgs.forEach(this::consumeMessage); } catch (Exception e) { logger.error(ExceptionUtils.getErrorStackTrace(e)); @@ -96,7 +98,7 @@ public class OpenDataPatrolChangeEventListener implements MessageListenerConcurr aBoolean = SpringContextUtils.getBean(UserPatrolRecordService.class).updatePatrolRecord(patrolRecordForm); break; case SystemMessageType.PATROL_ROUTINE_WORK_ADD: - aBoolean = SpringContextUtils.getBean(BaseGridDailyworkService.class).insertPatrolRecord(patrolRecordForm); + aBoolean = SpringContextUtils.getBean(BaseGridDailyworkService.class).insertBaseGridWorkRecord(patrolRecordForm); break; default: log.error("错误的消息类型:{}", tags); diff --git a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/BaseGridDailyworkService.java b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/BaseGridDailyworkService.java index 0d40bb6aea..010b698d63 100644 --- a/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/BaseGridDailyworkService.java +++ b/epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/BaseGridDailyworkService.java @@ -34,7 +34,7 @@ public interface BaseGridDailyworkService extends BaseService> record = epmetUserOpenFeignClient.getPatrolRoutineWorkList(midPatrolFormDTO); if (record == null || !record.success()) { log.error("获取例行工作记录失败,param:{}", JSON.toJSONString(midPatrolFormDTO)); - return false; + throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode()); } Map deptMap = exDeptService.getDeptDTOMap(patrolRecordForm.getCustomerId()); Map userMap = exUserService.getUserDTOMap(patrolRecordForm.getCustomerId()); @@ -82,7 +84,7 @@ public class BaseGridDailyworkServiceImpl extends BaseServiceImpl> record = dataStatisticalOpenFeignClient.getPatrolRecordList(midPatrolFormDTO); if (record == null || !record.success()) { - log.error("获取巡查记录失败,param:{}", JSON.toJSONString(midPatrolFormDTO)); - return false; + log.error("insertPatrolRecord 获取巡查记录失败,param:{}", JSON.toJSONString(midPatrolFormDTO)); + throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode()); } List data = record.getData(); if (CollectionUtils.isEmpty(data)) { //数据已被删除了 //暂时设置error 用于排错 - log.error("获取巡查记录返回为空,param:{}", JSON.toJSONString(midPatrolFormDTO)); + log.error("insertPatrolRecord获取巡查记录返回为空,param:{}", JSON.toJSONString(midPatrolFormDTO)); int effectRow = baseDao.deleteById(patrolRecordForm.getId()); log.warn("del effectRow:{}", effectRow); - return true; + throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode()); } List insertList = new ArrayList<>(); data.forEach(o-> insertList.add(buildEntity(o))); @@ -94,17 +96,17 @@ public class UserPatrolRecordServiceImpl extends BaseServiceImpl> record = dataStatisticalOpenFeignClient.getPatrolRecordList(midPatrolFormDTO); if (record == null || !record.success()) { - log.error("获取巡查记录失败,param:{}", JSON.toJSONString(midPatrolFormDTO)); - return false; + log.error("updatePatrolRecord 获取巡查记录失败,param:{}", JSON.toJSONString(midPatrolFormDTO)); + throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode()); } List data = record.getData(); if (CollectionUtils.isEmpty(data)) { //数据已被删除了 //暂时设置error 用于排错 - log.error("获取巡查记录返回为空,param:{}", JSON.toJSONString(midPatrolFormDTO)); + log.error("updatePatrolRecord 获取巡查记录返回为空,param:{}", JSON.toJSONString(midPatrolFormDTO)); int effectRow = baseDao.deleteById(patrolRecordForm.getId()); log.warn("del effectRow:{}", effectRow); - return true; + throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode()); } data.forEach(o->{ UserPatrolRecordEntity recordEntity = buildEntity(o); From d7b446e9d12f630eb1a7723efcf48d0c2fe2cc2a Mon Sep 17 00:00:00 2001 From: wangxianzhang Date: Thu, 30 Dec 2021 12:22:18 +0800 Subject: [PATCH 06/12] =?UTF-8?q?=E4=BF=AE=E6=94=B9=EF=BC=9A=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E5=BF=97=E6=84=BF=E8=80=85=E5=88=86=E5=B8=83=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../VolunteerDistributionResultDTO.java | 2 + .../java/com/epmet/dao/IcResiUserDao.java | 2 + .../service/impl/VolunteerServiceImpl.java | 122 +++++++++++------- .../main/resources/mapper/IcResiUserDao.xml | 17 +++ 4 files changed, 99 insertions(+), 44 deletions(-) diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/VolunteerDistributionResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/VolunteerDistributionResultDTO.java index 94a4d4ac88..99f04a4b8d 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/VolunteerDistributionResultDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/VolunteerDistributionResultDTO.java @@ -28,6 +28,8 @@ public class VolunteerDistributionResultDTO { @Data public static class Distribution { private Set volunteerCategories; + private String volunteerCategoriesStr; + private String buildingId; private String epmetUserId; private String icResiUserId; private String longitude; 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 c3f1da8654..f1822e93f2 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 @@ -226,4 +226,6 @@ public interface IcResiUserDao extends BaseDao { */ List getPartyMemberEducationList(@Param("orgType") String orgType, @Param("orgId") String orgId, @Param("code") String code); + + List listIcResiInfosByUserIds(@Param("userIds") List userIds); } 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 917268c8cb..e383f91664 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 @@ -7,10 +7,8 @@ import com.epmet.dao.IcResiUserDao; import com.epmet.dao.UserBaseInfoDao; import com.epmet.dto.IcBuildingDTO; import com.epmet.dto.IcFormItemOptionsDTO; -import com.epmet.dto.IcResiUserDTO; import com.epmet.dto.form.IcFormOptionsQueryFormDTO; import com.epmet.dto.form.resi.VolunteerCommonFormDTO; -import com.epmet.dto.result.ResiUserBaseInfoResultDTO; import com.epmet.dto.result.VolunteerDistributionResultDTO; import com.epmet.dto.result.resi.PageVolunteerInfoResultDTO; import com.epmet.feign.EpmetHeartOpenFeignClient; @@ -18,10 +16,11 @@ import com.epmet.feign.GovOrgOpenFeignClient; import com.epmet.feign.OperCustomizeOpenFeignClient; import com.epmet.service.VolunteerService; 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.stream.Collectors; @@ -100,7 +99,7 @@ public class VolunteerServiceImpl implements VolunteerService, ResultDataResolve int pageSize = 100; // 志愿者epmet user id - Set volunteerEpmetUserIds = new HashSet<>(); + List volunteerEpmetUserIds = new ArrayList<>(); // 分页查询志愿者的epmet user id while (true) { @@ -131,54 +130,89 @@ public class VolunteerServiceImpl implements VolunteerService, ResultDataResolve VolunteerDistributionResultDTO r = new VolunteerDistributionResultDTO(); + log.info("【志愿者分布】查询到志愿者userId公{}个", volunteerEpmetUserIds.size()); + // 2.填充ic居民信息 - for (String volunteerEpmetUserId : volunteerEpmetUserIds) { - - VolunteerDistributionResultDTO.Distribution distribution = new VolunteerDistributionResultDTO.Distribution(); - - ResiUserBaseInfoResultDTO userBaseInfo = userBaseInfoDao.selecUserBaseInfoByUserId(volunteerEpmetUserId); - if (userBaseInfo == null || StringUtils.isBlank(userBaseInfo.getIdNum())){ - log.warn("getVolunteerDistribution selecUserBaseInfoByUserId return null or idCard is null,volunteerEpmetUserId:{}", volunteerEpmetUserId); - continue; - } - //使用身份证号查询ic resi信息 - IcResiUserDTO icResiUserInfo = icResiUserDao.selectIdByIdCard(customerId, userBaseInfo.getIdNum(), null); - if (icResiUserInfo == null) { - continue; - } - - // 查询志愿者类别 - List volunteerCategories = icResiUserDao.selectVolunteerByUserId(icResiUserInfo.getId()); - //if (CollectionUtils.isEmpty(volunteerCategories)) { - // // 此人没有志愿者信息 - // continue; - //} - - // 将志愿者类型列表字符串,切割放到set中 - Set volunteerTypes = new HashSet(); - for (String vTypesString : volunteerCategories) { - String[] vTypes = vTypesString.split(","); + List> volunteerEpmetUserIdParts = Lists.partition(volunteerEpmetUserIds, 100); + for (List volunteerEpmetUserIdPart : volunteerEpmetUserIdParts) { + + List icResiInfos = icResiUserDao.listIcResiInfosByUserIds(volunteerEpmetUserIdPart); + + // 填充志愿者类型 + for (VolunteerDistributionResultDTO.Distribution icResiInfo : icResiInfos) { + // 将志愿者类型列表字符串,切割放到set中 + Set volunteerTypes = new HashSet(); + String[] vTypes = icResiInfo.getVolunteerCategoriesStr().split(","); if (vTypes != null && vTypes.length > 0) { volunteerTypes.addAll(Arrays.asList(vTypes)); } - } + icResiInfo.setVolunteerCategories(volunteerTypes); + // 填充建筑坐标 + String msg = "【志愿者分布】查询楼栋信息失败"; + IcBuildingDTO building = getResultDataOrThrowsException(govOrgOpenFeignClient.getBuildingById(icResiInfo.getBuildingId()), + ServiceConstant.GOV_ORG_SERVER, + EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), msg, msg); - String msg = "【志愿者分布】查询楼栋信息失败"; - IcBuildingDTO building = getResultDataOrThrowsException(govOrgOpenFeignClient.getBuildingById(icResiUserInfo.getBuildId()), - ServiceConstant.GOV_ORG_SERVER, - EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), msg, msg); + icResiInfo.setEpmetUserId(icResiInfo.getEpmetUserId()); + icResiInfo.setIcResiUserId(icResiInfo.getIcResiUserId()); + Optional.of(building).ifPresent(b -> { + icResiInfo.setLongitude(b.getLongitude()); + icResiInfo.setLatitude(b.getLatitude()); + }); - distribution.setVolunteerCategories(volunteerTypes); - distribution.setEpmetUserId(userBaseInfo.getUserId()); - distribution.setIcResiUserId(icResiUserInfo.getId()); - Optional.of(building).ifPresent(b -> { - distribution.setLongitude(b.getLongitude()); - distribution.setLatitude(b.getLatitude()); - }); - - r.getDistributions().add(distribution); + } + r.getDistributions().addAll(icResiInfos); } + + // 就有代码,稳定之后可以删掉 + //for (String volunteerEpmetUserId : volunteerEpmetUserIds) { + // + // VolunteerDistributionResultDTO.Distribution distribution = new VolunteerDistributionResultDTO.Distribution(); + // + // ResiUserBaseInfoResultDTO userBaseInfo = userBaseInfoDao.selecUserBaseInfoByUserId(volunteerEpmetUserId); + // if (userBaseInfo == null || StringUtils.isBlank(userBaseInfo.getIdNum())){ + // log.warn("getVolunteerDistribution selecUserBaseInfoByUserId return null or idCard is null,volunteerEpmetUserId:{}", volunteerEpmetUserId); + // continue; + // } + // //使用身份证号查询ic resi信息 + // IcResiUserDTO icResiUserInfo = icResiUserDao.selectIdByIdCard(customerId, userBaseInfo.getIdNum(), null); + // if (icResiUserInfo == null) { + // continue; + // } + // + // // 查询志愿者类别 + // List volunteerCategories = icResiUserDao.selectVolunteerByUserId(icResiUserInfo.getId()); + // //if (CollectionUtils.isEmpty(volunteerCategories)) { + // // // 此人没有志愿者信息 + // // continue; + // //} + // + // // 将志愿者类型列表字符串,切割放到set中 + // Set volunteerTypes = new HashSet(); + // for (String vTypesString : volunteerCategories) { + // String[] vTypes = vTypesString.split(","); + // if (vTypes != null && vTypes.length > 0) { + // volunteerTypes.addAll(Arrays.asList(vTypes)); + // } + // } + // + // + // String msg = "【志愿者分布】查询楼栋信息失败"; + // IcBuildingDTO building = getResultDataOrThrowsException(govOrgOpenFeignClient.getBuildingById(icResiUserInfo.getBuildId()), + // ServiceConstant.GOV_ORG_SERVER, + // EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), msg, msg); + // + // distribution.setVolunteerCategories(volunteerTypes); + // distribution.setEpmetUserId(userBaseInfo.getUserId()); + // distribution.setIcResiUserId(icResiUserInfo.getId()); + // Optional.of(building).ifPresent(b -> { + // distribution.setLongitude(b.getLongitude()); + // distribution.setLatitude(b.getLatitude()); + // }); + // + // r.getDistributions().add(distribution); + //} return r; } 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 b10e6e259f..6b07136f1c 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 @@ -489,4 +489,21 @@ GROUP BY CULTURE + + From cc08e57c942820ffaa00308d9bddc1700fe75870 Mon Sep 17 00:00:00 2001 From: jianjun Date: Thu, 30 Dec 2021 12:46:01 +0800 Subject: [PATCH 07/12] =?UTF-8?q?=E6=B3=A8=E6=8E=89=E8=BF=99=E4=B8=AA?= =?UTF-8?q?=E6=8C=A8=E5=8D=83=E5=88=80=E7=9A=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/controller/IssueVoteStatisticalController.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueVoteStatisticalController.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueVoteStatisticalController.java index 7a7c4530f1..5265af8079 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueVoteStatisticalController.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueVoteStatisticalController.java @@ -35,6 +35,7 @@ import com.epmet.dto.result.VoteResultDTO; import com.epmet.dto.result.VotingTrendResultDTO; import com.epmet.excel.IssueVoteStatisticalExcel; import com.epmet.service.IssueVoteStatisticalService; +import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -49,10 +50,11 @@ import java.util.Map; * @author generator generator@elink-cn.com * @since v1.0.0 2020-05-11 */ +@Slf4j @RestController @RequestMapping("issuevotestatistical") public class IssueVoteStatisticalController { - + @Autowired private IssueVoteStatisticalService issueVoteStatisticalService; @@ -129,7 +131,8 @@ public class IssueVoteStatisticalController { **/ @PostMapping("syncvotingcacheanddb") public Result syncVotingCacheAndDb(){ - issueVoteStatisticalService.syncVotingCacheToDb(); + //issueVoteStatisticalService.syncVotingCacheToDb(); + log.error("syncvotingcacheanddb 又执行了"); return new Result(); } @@ -159,4 +162,4 @@ public class IssueVoteStatisticalController { return new Result>().ok(issueVoteStatisticalService.myPartIssues(myPartIssuesFormDTO)); } -} \ No newline at end of file +} From bc242593ce2c7d96206db50d5fb6bd6420d9f3bf Mon Sep 17 00:00:00 2001 From: wangxianzhang Date: Thu, 30 Dec 2021 13:20:27 +0800 Subject: [PATCH 08/12] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=BF=97=E6=84=BF?= =?UTF-8?q?=E8=80=85=E5=88=86=E5=B8=83=E6=9F=A5=E8=AF=A2=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/VolunteerServiceImpl.java | 18 +++++++++++++----- .../main/resources/mapper/IcResiUserDao.xml | 2 +- 2 files changed, 14 insertions(+), 6 deletions(-) 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 e383f91664..2d5e776c8f 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 @@ -16,6 +16,8 @@ import com.epmet.feign.GovOrgOpenFeignClient; import com.epmet.feign.OperCustomizeOpenFeignClient; import com.epmet.service.VolunteerService; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -96,7 +98,7 @@ public class VolunteerServiceImpl implements VolunteerService, ResultDataResolve // 1.分页查询出所有志愿者列表 int pageNo = 1; - int pageSize = 100; + int pageSize = 200; // 志愿者epmet user id List volunteerEpmetUserIds = new ArrayList<>(); @@ -142,11 +144,17 @@ public class VolunteerServiceImpl implements VolunteerService, ResultDataResolve for (VolunteerDistributionResultDTO.Distribution icResiInfo : icResiInfos) { // 将志愿者类型列表字符串,切割放到set中 Set volunteerTypes = new HashSet(); - String[] vTypes = icResiInfo.getVolunteerCategoriesStr().split(","); - if (vTypes != null && vTypes.length > 0) { - volunteerTypes.addAll(Arrays.asList(vTypes)); + String volunteerCategoriesStr = icResiInfo.getVolunteerCategoriesStr(); + + if (StringUtils.isNotEmpty(volunteerCategoriesStr)) { + String[] vTypes = volunteerCategoriesStr.split(","); + if (vTypes != null && vTypes.length > 0) { + volunteerTypes.addAll(Arrays.asList(vTypes)); + } + icResiInfo.setVolunteerCategories(volunteerTypes); + } else { + icResiInfo.setVolunteerCategories(new HashSet<>()); } - icResiInfo.setVolunteerCategories(volunteerTypes); // 填充建筑坐标 String msg = "【志愿者分布】查询楼栋信息失败"; 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 6b07136f1c..784a2b1427 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 @@ -498,7 +498,7 @@ icvol.VOLUNTEER_CATEGORY as volunteerCategoriesStr from user_base_info userbaseinfo inner join ic_resi_user icuser on (userbaseinfo.ID_NUM = icuser.ID_CARD and icuser.DEL_FLAG = '0') - inner join ic_volunteer icvol on (icuser.ID = icvol.IC_RESI_USER and icvol.DEL_FLAG = '0') + left join ic_volunteer icvol on (icuser.ID = icvol.IC_RESI_USER and icvol.DEL_FLAG = '0') where userbaseinfo.DEL_FLAG = '0' and userbaseinfo.ID_NUM is not null and userbaseinfo.USER_ID in From f1afa6550d7912ed65bdbabad46625f4920f90a5 Mon Sep 17 00:00:00 2001 From: jianjun Date: Thu, 30 Dec 2021 13:26:33 +0800 Subject: [PATCH 09/12] =?UTF-8?q?=E5=AD=98=E4=BB=96=E4=B8=AA=2024=E5=B0=8F?= =?UTF-8?q?=E6=97=B6=20=E7=BB=99=E6=88=91=E7=82=B9=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/CustomerAgencyController.java | 4 +- .../java/com/epmet/dao/CustomerAgencyDao.java | 59 ++++++++++++------- .../impl/CustomerAgencyServiceImpl.java | 4 +- .../resources/mapper/CustomerAgencyDao.xml | 34 +++++++++++ 4 files changed, 75 insertions(+), 26 deletions(-) diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java index 64660eec85..2125390944 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java @@ -365,8 +365,8 @@ public class CustomerAgencyController { * @Date 2021/9/8 15:20 */ @PostMapping("agencygridtree") - public Result getOrgTreeData(@LoginUser TokenDto tokenDTO) { - //tokenDTO.setUserId("dffe71e021a61b900f9025f4f07f6955"); + public Result getOrgTreeData(/*@LoginUser*/ TokenDto tokenDTO) { + tokenDTO.setUserId("dffe71e021a61b900f9025f4f07f6955"); return new Result().ok(customerAgencyService.getOrgTreeData(tokenDTO.getUserId())); } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java index d1a49f7ba3..f379824aae 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java @@ -58,6 +58,7 @@ public interface CustomerAgencyDao extends BaseDao { * @Description 组织首页-下级机关列表 **/ List selectSubAgencyById(@Param("pId") String pId, @Param("agencyNum") Integer agencyNum); + List selectSubAgencyByAgencyId(@Param("pId") String pId); /** @@ -79,8 +80,8 @@ public interface CustomerAgencyDao extends BaseDao { CustomerAgencyEntity getAgencyByStaffId(@Param("staffId") String staffId); /** - * @Description 根据agencyId查询地区编码 * @param agencyId 所属机关id + * @Description 根据agencyId查询地区编码 * @author zxc * @date 2020/4/28 15:50 */ @@ -104,6 +105,7 @@ public interface CustomerAgencyDao extends BaseDao { /** * 查询客户根级组织 + * * @param customerId * @return */ @@ -111,10 +113,11 @@ public interface CustomerAgencyDao extends BaseDao { /** * 获取所属机关单位名称(上级-所属) - * @author zhaoqifeng - * @date 2020/5/22 17:53 + * * @param agencyId * @return java.lang.String + * @author zhaoqifeng + * @date 2020/5/22 17:53 */ String selectAgencyName(@Param("agencyId") String agencyId); @@ -127,46 +130,48 @@ public interface CustomerAgencyDao extends BaseDao { List selectAllSubAgency(@Param("subAgencyPids") String subAgencyPids); /** - * @Description 查询一个工作人员最近登录的网格以及机关信息 * @param gridId * @return + * @Description 查询一个工作人员最近登录的网格以及机关信息 * @author wangc * @date 2020.08.17 09:50 - **/ + **/ ExtStaffInfoResultDTO selectAgencyAndGridInfoExt(@Param("gridId") String gridId); + /** - * @Description 当没有工作人员最近访问的gridId时查询该用户所属的组织机关信息 * @param staffId * @return + * @Description 当没有工作人员最近访问的gridId时查询该用户所属的组织机关信息 * @author wangc * @date 2020.08.17 09:50 **/ - ExtStaffInfoResultDTO selectAgencyInfoWhenGridIdIsNull(@Param("staffId")String staffId); + ExtStaffInfoResultDTO selectAgencyInfoWhenGridIdIsNull(@Param("staffId") String staffId); + /** - * @Description 根据agencyId查找指定机构的信息,直属网格、部门 * @param agencyId * @return + * @Description 根据agencyId查找指定机构的信息,直属网格、部门 * @author wangc * @date 2020.08.18 13:41 - **/ - ExtStaffPermissionResultDTO selectAgencyById(@Param("agencyId")String agencyId); + **/ + ExtStaffPermissionResultDTO selectAgencyById(@Param("agencyId") String agencyId); /** - * @Description 根绝agencyId查找其下属机构的信息 * @param pid * @return + * @Description 根绝agencyId查找其下属机构的信息 * @author wangc * @date 2020.08.18 13:42 - **/ + **/ List selectSubAgencyByPid(@Param("pid") String pid); /** - * @Description 根据agencyId查找指定机构直属的部门,将grid与dept分开是因为grid与dept的数量可能不等,造成重复数据无法去重 * @param agencyId * @return + * @Description 根据agencyId查找指定机构直属的部门,将grid与dept分开是因为grid与dept的数量可能不等,造成重复数据无法去重 * @author wangc * @date 2020.08.18 13:42 - **/ + **/ List selectDeptList(@Param("agencyId") String agencyId); /** @@ -186,30 +191,33 @@ public interface CustomerAgencyDao extends BaseDao { AgencyResultDTO selectAgencyByStaffId(@Param("staffId") String staffId); /** - * @Description 返回elementTree结构的agency树 * @param customerId * @param pid * @return java.util.List + * @Description 返回elementTree结构的agency树 * @Author liushaowen * @Date 2020/11/6 14:57 */ - List getAgencyElementTree(@Param("customerId") String customerId,@Param("pid") String pid); + List getAgencyElementTree(@Param("customerId") String customerId, @Param("pid") String pid); /** * @Description 外挂-获取当前组织及部门、网格数据,递归查询所有下级数据 * @author sun **/ OrganizeTreeResultDTO selectorganizeTree(@Param("agencyId") String agencyId); + /** * @Description 外挂-获取当前组织及部门、网格数据,递归查询所有下级数据 * @author sun **/ List selectAgencyGridList(@Param("agencyId") String agencyId); + /** * @Description 外挂-获取当前组织及部门、网格数据,递归查询所有下级数据 * @author sun **/ List selectAgencyDeptList(@Param("agencyId") String agencyId); + /** * @Description 外挂-获取当前组织及部门、网格数据,递归查询所有下级数据 * @author sun @@ -236,6 +244,7 @@ public interface CustomerAgencyDao extends BaseDao { /** * 根据新增人员类型判断查询机关信息 + * * @author sun */ OrgResultDTO selectAgencyDetail(@Param("orgId") String orgId, @Param("orgType") String orgType); @@ -247,40 +256,46 @@ public interface CustomerAgencyDao extends BaseDao { List getStaffOrgListByStaffId(@Param("staffId") String staffId); /** - * @Description 【地图配置】删除 * @param orgId * @param level + * @Description 【地图配置】删除 * @author zxc * @date 2021/10/25 9:39 上午 */ void delMapArea(@Param("orgId") String orgId, @Param("level") String level); /** - * @Description 【地图配置】新增 * @param orgId * @param level * @param coordinates + * @Description 【地图配置】新增 * @author zxc * @date 2021/10/25 9:59 上午 */ - void addMapArea(@Param("orgId") String orgId, @Param("level") String level,@Param("coordinates")String coordinates); + void addMapArea(@Param("orgId") String orgId, @Param("level") String level, @Param("coordinates") String coordinates); /** - * @Description 地图查询下级组织 * @param pid * @param type + * @Description 地图查询下级组织 * @author zxc * @date 2021/10/25 2:30 下午 */ - List selectSonOrg(@Param("pid")String pid,@Param("type")String type); + List selectSonOrg(@Param("pid") String pid, @Param("type") String type); /** - * @Description 查询下级agencyId * @param orgId + * @Description 查询下级agencyId * @author zxc * @date 2021/12/9 4:42 下午 */ List getSonAgencyId(@Param("orgId") String orgId); + /** + * desc:获取组织和网格的数据 树形sql + * @param agencyId + * @return + */ + ExtStaffPermissionResultDTO selectAgencyAndGridById(@Param("agencyId") String agencyId); } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java index 5e0dc73b52..a1024cead5 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java @@ -1131,9 +1131,9 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl + + + + + + + + + + + + + + + + + + + + From bcdb455099b884542df707cdea150ffbe8ae1bbd Mon Sep 17 00:00:00 2001 From: wangxianzhang Date: Thu, 30 Dec 2021 13:31:20 +0800 Subject: [PATCH 10/12] fix --- .../src/main/resources/mapper/IcResiUserDao.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 784a2b1427..6b07136f1c 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 @@ -498,7 +498,7 @@ icvol.VOLUNTEER_CATEGORY as volunteerCategoriesStr from user_base_info userbaseinfo inner join ic_resi_user icuser on (userbaseinfo.ID_NUM = icuser.ID_CARD and icuser.DEL_FLAG = '0') - left join ic_volunteer icvol on (icuser.ID = icvol.IC_RESI_USER and icvol.DEL_FLAG = '0') + inner join ic_volunteer icvol on (icuser.ID = icvol.IC_RESI_USER and icvol.DEL_FLAG = '0') where userbaseinfo.DEL_FLAG = '0' and userbaseinfo.ID_NUM is not null and userbaseinfo.USER_ID in From 4f52fcc85da4c5cd919cc3b91bc2bbcb66d72175 Mon Sep 17 00:00:00 2001 From: jianjun Date: Thu, 30 Dec 2021 13:33:03 +0800 Subject: [PATCH 11/12] =?UTF-8?q?=E5=AD=98=E4=BB=96=E4=B8=AA=2024=E5=B0=8F?= =?UTF-8?q?=E6=97=B6=20=E7=BB=99=E6=88=91=E7=82=B9=E6=97=B6=E9=97=B4=20up?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/controller/CustomerAgencyController.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java index 2125390944..64660eec85 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java @@ -365,8 +365,8 @@ public class CustomerAgencyController { * @Date 2021/9/8 15:20 */ @PostMapping("agencygridtree") - public Result getOrgTreeData(/*@LoginUser*/ TokenDto tokenDTO) { - tokenDTO.setUserId("dffe71e021a61b900f9025f4f07f6955"); + public Result getOrgTreeData(@LoginUser TokenDto tokenDTO) { + //tokenDTO.setUserId("dffe71e021a61b900f9025f4f07f6955"); return new Result().ok(customerAgencyService.getOrgTreeData(tokenDTO.getUserId())); } From e6da73bb661097f21f72fef619e219367570f288 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Thu, 30 Dec 2021 15:28:38 +0800 Subject: [PATCH 12/12] =?UTF-8?q?=E5=B1=85=E6=B0=91=E9=A2=84=E7=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../constant/PartyServiceCenterConstant.java | 1 + .../impl/IcPartyServiceCenterServiceImpl.java | 32 ++++++++++++------- .../epmet/feign/EpmetUserOpenFeignClient.java | 10 ++++++ .../EpmetUserOpenFeignClientFallback.java | 5 +++ .../controller/UserBaseInfoController.java | 12 +++++++ .../com/epmet/dao/RegisterRelationDao.java | 9 ++++++ .../epmet/service/UserBaseInfoService.java | 9 ++++++ .../service/impl/UserBaseInfoServiceImpl.java | 14 ++++++++ .../resources/mapper/RegisterRelationDao.xml | 5 +++ 9 files changed, 86 insertions(+), 11 deletions(-) diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/constant/PartyServiceCenterConstant.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/constant/PartyServiceCenterConstant.java index ced0df2da5..a733afaa2f 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/constant/PartyServiceCenterConstant.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/constant/PartyServiceCenterConstant.java @@ -8,6 +8,7 @@ package com.epmet.constant; public interface PartyServiceCenterConstant { String ORG_TYPE_AGENCY = "agency"; + String ORG_TYPE_GRID = "grid"; String APPOINTMENT_STATUS_APPOINTING = "appointing"; String APPOINTMENT_STATUS_CANCEL = "cancel"; diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPartyServiceCenterServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPartyServiceCenterServiceImpl.java index 092aace05f..a2f543d0c3 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPartyServiceCenterServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPartyServiceCenterServiceImpl.java @@ -40,6 +40,7 @@ import com.epmet.constant.PartyServiceCenterConstant; import com.epmet.dao.IcMatterAppointmentRecordDao; import com.epmet.dao.IcPartyServiceCenterDao; import com.epmet.dto.IcPartyServiceCenterDTO; +import com.epmet.dto.RegisterRelationDTO; import com.epmet.dto.TimeDTO; import com.epmet.dto.form.*; import com.epmet.dto.result.*; @@ -347,13 +348,9 @@ public class IcPartyServiceCenterServiceImpl extends BaseServiceImpl registerRelation = userOpenFeignClient.resiRelationInfo(tokenDto.getUserId()); + if (!registerRelation.success()){ + throw new EpmetException(String.format("查询居民{%s}信息失败",tokenDto.getUserId())); } IcMatterAppointmentRecordEntity e = ConvertUtils.sourceToTarget(formDTO, IcMatterAppointmentRecordEntity.class); e.setCustomerId(customerId); @@ -361,11 +358,24 @@ public class IcPartyServiceCenterServiceImpl extends BaseServiceImpl getIcResiUserDTO(@PathVariable("icResiUserId") String icResiUserId); + + /** + * @Description 查询居民注册关系 + * @param userId + * @author zxc + * @date 2021/12/30 3:12 下午 + */ + @PostMapping("/epmetuser/userbaseinfo/resirelationinfo") + Result resiRelationInfo(@RequestParam("userId")String 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 38916e1b2a..b434b30806 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 @@ -517,4 +517,9 @@ public class EpmetUserOpenFeignClientFallback implements EpmetUserOpenFeignClien public Result getIcResiUserDTO(String icResiUserId) { return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getIcResiUserDTO", icResiUserId); } + + @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/UserBaseInfoController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserBaseInfoController.java index 2438eae9c6..adc98f7a08 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserBaseInfoController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserBaseInfoController.java @@ -27,6 +27,7 @@ import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.commons.tools.validator.group.AddGroup; import com.epmet.commons.tools.validator.group.DefaultGroup; import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.dto.RegisterRelationDTO; import com.epmet.dto.UserBaseInfoDTO; import com.epmet.dto.form.CommonUserIdFormDTO; import com.epmet.dto.form.IssueInitiatorFormDTO; @@ -203,5 +204,16 @@ public class UserBaseInfoController { ValidatorUtils.validateEntity(param, CommonUserIdFormDTO.CommonUserIdGroup.class); return new Result().ok(userBaseInfoService.extUserInfo(param)); } + + /** + * @Description 查询居民注册关系 + * @param userId + * @author zxc + * @date 2021/12/30 3:12 下午 + */ + @PostMapping("resirelationinfo") + public Result resiRelationInfo(@RequestParam("userId")String userId){ + return new Result().ok(userBaseInfoService.resiRelationInfo(userId)); + } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/RegisterRelationDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/RegisterRelationDao.java index 160e1a4afc..480c8b52fa 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/RegisterRelationDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/RegisterRelationDao.java @@ -18,6 +18,7 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.RegisterRelationDTO; import com.epmet.entity.RegisterRelationEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -55,4 +56,12 @@ public interface RegisterRelationDao extends BaseDao { * @date 2021/3/16 下午3:05 */ String selectRegisterGridIdByUserId(@Param("userId")String userId); + + /** + * @Description 居民注册关系 + * @param userId + * @author zxc + * @date 2021/12/30 3:14 下午 + */ + RegisterRelationDTO resiRelationInfo(@Param("userId")String userId); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserBaseInfoService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserBaseInfoService.java index efa3b0cda3..01bac74fc2 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserBaseInfoService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserBaseInfoService.java @@ -20,6 +20,7 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.RegisterRelationDTO; import com.epmet.dto.UserBaseInfoDTO; import com.epmet.dto.form.CommonUserIdFormDTO; import com.epmet.dto.form.VolunteerRegResiFormDTO; @@ -194,4 +195,12 @@ public interface UserBaseInfoService extends BaseService { @Deprecated Integer checkIdNum(String idNum, String customerId, String excludeUserId); + + /** + * @Description 查询居民注册关系 + * @param userId + * @author zxc + * @date 2021/12/30 3:12 下午 + */ + RegisterRelationDTO resiRelationInfo(String userId); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBaseInfoServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBaseInfoServiceImpl.java index 6adada9a2b..898a7735d2 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBaseInfoServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBaseInfoServiceImpl.java @@ -30,6 +30,7 @@ import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.dao.*; +import com.epmet.dto.RegisterRelationDTO; import com.epmet.dto.UserBaseInfoDTO; import com.epmet.dto.UserResiInfoDTO; import com.epmet.dto.UserWechatDTO; @@ -86,6 +87,8 @@ public class UserBaseInfoServiceImpl extends BaseServiceImpl page(Map params) { @@ -490,4 +493,15 @@ public class UserBaseInfoServiceImpl extends BaseServiceImpl + + +