From 59d5d5c8c94a4ae2521b4eee8879a1014fda88be Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Mon, 12 Jul 2021 16:53:22 +0800 Subject: [PATCH 01/71] bug --- epmet-user/epmet-user-server/src/main/resources/bootstrap.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/epmet-user/epmet-user-server/src/main/resources/bootstrap.yml b/epmet-user/epmet-user-server/src/main/resources/bootstrap.yml index 667b9ba7c2..8ea743c87e 100644 --- a/epmet-user/epmet-user-server/src/main/resources/bootstrap.yml +++ b/epmet-user/epmet-user-server/src/main/resources/bootstrap.yml @@ -61,6 +61,7 @@ spring: password: @spring.datasource.druid.password@ baseline-on-migrate: true baseline-version: 0 + validate-on-migrate: false cloud: nacos: discovery: From 716a8edf67564d8ca64a708c04d0ba9438079e6b Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 24 Aug 2021 15:01:38 +0800 Subject: [PATCH 02/71] ? --- .../src/main/resources/mapper/ResiEventDao.xml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ResiEventDao.xml b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ResiEventDao.xml index 1dabf75712..41ad872a2a 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ResiEventDao.xml +++ b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ResiEventDao.xml @@ -52,8 +52,7 @@ LEFT JOIN resi_event_attachment rea ON (rea.RESI_EVENT_ID = t.eventId AND rea.DEL_FLAG = '0' - AND rea.ATTACHMENT_TYPE = 'image' - AND (rea.SORT = 3 OR rea.SORT = 1 OR rea.SORT = 2)) + AND rea.ATTACHMENT_TYPE = 'image') order by rea.sort asc From 18bfe54860162d5c4256385ee4a90a6fadb57503 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 24 Aug 2021 15:05:04 +0800 Subject: [PATCH 03/71] ? --- .../src/main/resources/mapper/ResiEventDao.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ResiEventDao.xml b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ResiEventDao.xml index 41ad872a2a..0f74c3a701 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ResiEventDao.xml +++ b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ResiEventDao.xml @@ -50,9 +50,9 @@ )t LEFT JOIN resi_event_attachment rea - ON (rea.RESI_EVENT_ID = t.eventId - AND rea.DEL_FLAG = '0' - AND rea.ATTACHMENT_TYPE = 'image') + ON (rea.RESI_EVENT_ID = t.eventId) + where rea.DEL_FLAG = '0' + AND rea.ATTACHMENT_TYPE = 'image' order by rea.sort asc From d272d7dccf4419ef2ed4971f7b5262d80cd54fc0 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Thu, 11 Nov 2021 11:56:20 +0800 Subject: [PATCH 04/71] =?UTF-8?q?=E6=9C=8D=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/service/impl/NeighborHoodServiceImpl.java | 1 + 1 file changed, 1 insertion(+) diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/NeighborHoodServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/NeighborHoodServiceImpl.java index d7558cd110..00ea72af58 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/NeighborHoodServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/NeighborHoodServiceImpl.java @@ -253,6 +253,7 @@ public class NeighborHoodServiceImpl implements NeighborHoodService { if (!obj.getAgencyName().trim().equals(staffInfoCache.getAgencyName())) { numList.add(obj.getRowNum()); iterator.remove(); + continue; } //当前组织下网格名不存在的也不允许导入 AtomicBoolean br = new AtomicBoolean(true); From c018da0803921ec25ae8911a60656c9b10ae464d Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Thu, 11 Nov 2021 12:01:25 +0800 Subject: [PATCH 05/71] =?UTF-8?q?=E5=88=86=E6=94=AF=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/service/impl/NeighborHoodServiceImpl.java | 1 - 1 file changed, 1 deletion(-) diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/NeighborHoodServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/NeighborHoodServiceImpl.java index 00ea72af58..d7558cd110 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/NeighborHoodServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/NeighborHoodServiceImpl.java @@ -253,7 +253,6 @@ public class NeighborHoodServiceImpl implements NeighborHoodService { if (!obj.getAgencyName().trim().equals(staffInfoCache.getAgencyName())) { numList.add(obj.getRowNum()); iterator.remove(); - continue; } //当前组织下网格名不存在的也不允许导入 AtomicBoolean br = new AtomicBoolean(true); From bd6b6482dbd3e9811357a0ca92de56750348d657 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 9 Dec 2021 19:24:59 +0800 Subject: [PATCH 06/71] =?UTF-8?q?=E5=AE=B6=E5=B1=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../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 c9af6f06e4..8414cf5e4b 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 @@ -357,7 +357,7 @@ ic_resi_user m WHERE m.DEL_FLAG = '0' - AND m.id != #{isResiUserId} + AND m.id != #{currentIcResiUserId} and m.HOME_ID=#{homeId} order by m.CREATED_TIME asc From 60c455b39a7080c83b54c02205dadf3467d97298 Mon Sep 17 00:00:00 2001 From: wangxianzhang Date: Fri, 10 Dec 2021 15:49:55 +0800 Subject: [PATCH 07/71] =?UTF-8?q?=E4=BF=AE=E6=94=B9=EF=BC=9A=20=E5=BF=97?= =?UTF-8?q?=E6=84=BF=E8=80=85=E6=8E=AA=E6=96=BD=E6=B8=85=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../result/DemandServiceCountResultDTO.java | 15 ++ .../epmet/controller/DemandController.java | 38 ++++ .../dao/heart/IcUserDemandServiceDao.java | 44 +++++ .../com/epmet/dao/heart/VolunteerInfoDao.java | 33 ++++ .../stats/FactVolunteerServiceDailyDao.java | 42 ++++ .../main/java/com/epmet/dao/user/UserDao.java | 2 + .../heart/IcUserDemandServiceEntity.java | 75 +++++++ .../entity/heart/VolunteerInfoEntity.java | 71 +++++++ .../FactVolunteerServiceDailyEntity.java | 86 ++++++++ .../java/com/epmet/service/DemandService.java | 20 ++ .../service/heart/HeartDemandService.java | 15 ++ .../service/heart/HeartVolunteerService.java | 15 ++ .../heart/impl/HeartDemandServiceImpl.java | 40 ++++ .../heart/impl/HeartVolunteerServiceImpl.java | 40 ++++ .../epmet/service/impl/DemandServiceImpl.java | 184 ++++++++++++++++++ .../service/stats/DemandStatsService.java | 18 ++ .../stats/impl/DemandStatsServiceImpl.java | 36 ++++ .../com/epmet/service/user/UserService.java | 2 + .../service/user/impl/UserServiceImpl.java | 4 + ...0.0.26__create_volunteer_service_daily.sql | 21 ++ .../mapper/heart/IcUserDemandServiceDao.xml | 33 ++++ .../mapper/heart/VolunteerInfoDao.xml | 23 +++ .../stats/FactVolunteerServiceDailyDao.xml | 37 ++++ .../main/resources/mapper/user/UserDao.xml | 13 ++ 24 files changed, 907 insertions(+) create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/heart/result/DemandServiceCountResultDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemandController.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/heart/IcUserDemandServiceDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/heart/VolunteerInfoDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactVolunteerServiceDailyDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/heart/IcUserDemandServiceEntity.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/heart/VolunteerInfoEntity.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactVolunteerServiceDailyEntity.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/DemandService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/HeartDemandService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/HeartVolunteerService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/impl/HeartDemandServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/impl/HeartVolunteerServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/DemandServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DemandStatsService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DemandStatsServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.26__create_volunteer_service_daily.sql create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/heart/IcUserDemandServiceDao.xml create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/heart/VolunteerInfoDao.xml create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactVolunteerServiceDailyDao.xml diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/heart/result/DemandServiceCountResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/heart/result/DemandServiceCountResultDTO.java new file mode 100644 index 0000000000..57cc894ae4 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/heart/result/DemandServiceCountResultDTO.java @@ -0,0 +1,15 @@ +package com.epmet.dto.heart.result; + +import lombok.Data; + +/** + * @Description 描述 + * @Author wangxianzhang + * @Date 2021/12/8 4:39 下午 + * @Version 1.0 + */ +@Data +public class DemandServiceCountResultDTO { + private String serverId; + private String serviceType; +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemandController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemandController.java new file mode 100644 index 0000000000..cd77d2b25a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemandController.java @@ -0,0 +1,38 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.service.DemandService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +/** + * @Description 描述 + * @Author wangxianzhang + * @Date 2021/12/8 10:44 上午 + * @Version 1.0 + */ +@RestController +@RequestMapping("demand") +public class DemandController { + + @Autowired + private DemandService demandStatsService; + + /** + * wangxianzhang + * + * 计算客户下志愿者服务相关数据 + * + * @param customerId 客户ID,可以为空,为空则计算所有客户 + * @return + */ + @PostMapping("volunteer/daily") + public Result statsVolunteerDemandServicesDaily(@RequestParam(value = "customer-id", required = false) String customerId) { + + demandStatsService.statsVolunteerDemandServicesDaily(customerId); + + return new Result(); + } + + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/heart/IcUserDemandServiceDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/heart/IcUserDemandServiceDao.java new file mode 100644 index 0000000000..602c04da5e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/heart/IcUserDemandServiceDao.java @@ -0,0 +1,44 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.heart; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.heart.result.DemandServiceCountResultDTO; +import com.epmet.entity.heart.IcUserDemandServiceEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.Date; +import java.util.List; + +/** + * 居民需求服务记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-19 + */ +@Mapper +public interface IcUserDemandServiceDao extends BaseDao { + + /** + * 需求服务次数查询 + * @param customerId 客户id + * @param serviceType 服务者类型 + */ + List listDemandServiceCountPage(@Param("customerId") String customerId, @Param("endTime") Date endTime, @Param("serviceType") String serviceType); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/heart/VolunteerInfoDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/heart/VolunteerInfoDao.java new file mode 100644 index 0000000000..11b5aad534 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/heart/VolunteerInfoDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.heart; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.heart.VolunteerInfoEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 志愿者信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-12-08 + */ +@Mapper +public interface VolunteerInfoDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactVolunteerServiceDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactVolunteerServiceDailyDao.java new file mode 100644 index 0000000000..605364c820 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactVolunteerServiceDailyDao.java @@ -0,0 +1,42 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.stats; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.stats.FactVolunteerServiceDailyEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 志愿者服务情况统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-12-08 + */ +@Mapper +public interface FactVolunteerServiceDailyDao extends BaseDao { + + /** + * 删除指定客户,指定dateId的志愿者服务统计记录 + * @param customerIds + * @param dateDimId + */ + void clearVolunteerDemandServiceDailyStats(@Param("customerIds") List customerIds, @Param("dateDimId") String dateDimId); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/user/UserDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/user/UserDao.java index 2c8f46ea9b..584bfdf64c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/user/UserDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/user/UserDao.java @@ -264,5 +264,7 @@ public interface UserDao { List getPatrolRecordList(MidPatrolFormDTO formDTO); List getPatrolDetailList(MidPatrolFormDTO formDTO); + + List filterUserIds(@Param("userIds") List userIds, @Param("roleKey") String roleKey); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/heart/IcUserDemandServiceEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/heart/IcUserDemandServiceEntity.java new file mode 100644 index 0000000000..002b1db875 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/heart/IcUserDemandServiceEntity.java @@ -0,0 +1,75 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.heart; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 居民需求服务记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-11-19 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("ic_user_demand_service") +public class IcUserDemandServiceEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 需求id + */ + private String demandRecId; + + /** + * 服务方类型:志愿者:volunteer;社会组织:social_org;社区自组织:community_org;区域党建单位:party_unit; + */ + private String serviceType; + + /** + * 志愿者:居民端爱心互助的志愿者userId; + */ + private String serverId; + + /** + * 实际服务开始时间 + */ + private Date serviceStartTime; + + /** + * 实际服务结束时间 + */ + private Date serviceEndTime; + + /** + * 完成情况 + */ + private String finishDesc; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/heart/VolunteerInfoEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/heart/VolunteerInfoEntity.java new file mode 100644 index 0000000000..60f41bd0fa --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/heart/VolunteerInfoEntity.java @@ -0,0 +1,71 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.heart; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 志愿者信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-12-08 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("volunteer_info") +public class VolunteerInfoEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 用户id + */ + private String userId; + + /** + * 客户id + */ + private String customerId; + + /** + * 志愿者自我介绍 + */ + private String volunteerIntroduce; + + /** + * 志愿者签名 + */ + private String volunteerSignature; + + /** + * 网格id + */ + private String gridId; + + /** + * 网格名称 + */ + private String gridName; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactVolunteerServiceDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactVolunteerServiceDailyEntity.java new file mode 100644 index 0000000000..f2b473bfe9 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactVolunteerServiceDailyEntity.java @@ -0,0 +1,86 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.stats; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 志愿者服务情况统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-12-08 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_volunteer_service_daily") +public class FactVolunteerServiceDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * yyyyMMdd + */ + private String dateId; + + /** + * yyyyMM + */ + private String monthId; + + /** + * 截止到当前dateId,当前客户下,共有多少个爱心互助的志愿者 + */ + private Integer volunteerTotal; + + /** + * 截止到当前dateId,当前客户下,XX个爱心互助志愿者中,党员有多少个 + */ + private Integer partyTotal; + + /** + * 截止到当前dateId,当前客户下,XX个爱心互助志愿者中,居民有多少个 + */ + private Integer resiTotal; + + /** + * 服务总次数 + */ + private Integer serviceTotal; + + /** + * 党员服务总次数 + */ + private Integer partyServiceTotal; + + /** + * 居民服务总次数 + */ + private Integer resiServiceTotal; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/DemandService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/DemandService.java new file mode 100644 index 0000000000..a5baf1a613 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/DemandService.java @@ -0,0 +1,20 @@ +package com.epmet.service; + +/** + * @Description 需求service + * @Author wangxianzhang + * @Date 2021/12/8 12:14 下午 + * @Version 1.0 + */ +public interface DemandService { + + /** + * wangxianzhang + * + * 按日统计 + * + * @param customerId 客户ID,可为空,为空计算所有 + */ + void statsVolunteerDemandServicesDaily(String customerId); + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/HeartDemandService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/HeartDemandService.java new file mode 100644 index 0000000000..1a106fa881 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/HeartDemandService.java @@ -0,0 +1,15 @@ +package com.epmet.service.heart; + +import com.epmet.dto.heart.result.DemandServiceCountResultDTO; + +import java.util.Date; +import java.util.List; + +/** + *@Description 爱心互助,需求service + *@Author wangxianzhang + *@Date 2021/12/8 + */ +public interface HeartDemandService { + List listDemandServiceCountPage(String customerId, Date endTime, int serviceCountPageNo, int serviceCountPageSize); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/HeartVolunteerService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/HeartVolunteerService.java new file mode 100644 index 0000000000..abccaae1e6 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/HeartVolunteerService.java @@ -0,0 +1,15 @@ +package com.epmet.service.heart; + +import com.epmet.entity.heart.VolunteerInfoEntity; + +import java.util.Date; +import java.util.List; + +/** + *@Description heart 志愿者service + *@Author wangxianzhang + *@Date 2021/12/8 + */ +public interface HeartVolunteerService { + List listVolunteersPage(String customerId, Date endCreateTime, Integer pageNum, Integer pageSize); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/impl/HeartDemandServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/impl/HeartDemandServiceImpl.java new file mode 100644 index 0000000000..a4192fcd30 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/impl/HeartDemandServiceImpl.java @@ -0,0 +1,40 @@ +package com.epmet.service.heart.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.constant.DataSourceConstant; +import com.epmet.dao.heart.IcUserDemandServiceDao; +import com.epmet.dto.heart.result.DemandServiceCountResultDTO; +import com.epmet.service.heart.HeartDemandService; +import com.github.pagehelper.ISelect; +import com.github.pagehelper.Page; +import com.github.pagehelper.PageHelper; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.Date; +import java.util.List; + +/** + * @Description 爱心互助,需求service + * @Author wangxianzhang + * @Date 2021/12/8 12:33 下午 + * @Version 1.0 + */ +@Service +@DataSource(DataSourceConstant.EPMET_HEART) +public class HeartDemandServiceImpl implements HeartDemandService { + + @Autowired + private IcUserDemandServiceDao demandServiceDao; + + @Override + public List listDemandServiceCountPage(String customerId, Date endTime, int serviceCountPageNo, int serviceCountPageSize) { + return PageHelper.startPage(serviceCountPageNo, serviceCountPageSize).doSelectPage(new ISelect() { + @Override + public void doSelect() { + demandServiceDao.listDemandServiceCountPage(customerId, endTime, "volunteer"); + } + }); + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/impl/HeartVolunteerServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/impl/HeartVolunteerServiceImpl.java new file mode 100644 index 0000000000..c95fd094fe --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/impl/HeartVolunteerServiceImpl.java @@ -0,0 +1,40 @@ +package com.epmet.service.heart.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.constant.DataSourceConstant; +import com.epmet.dao.heart.VolunteerInfoDao; +import com.epmet.entity.heart.VolunteerInfoEntity; +import com.epmet.service.heart.HeartVolunteerService; +import com.github.pagehelper.ISelect; +import com.github.pagehelper.Page; +import com.github.pagehelper.PageHelper; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.Date; +import java.util.List; + +/** + * @Description 描述 + * @Author wangxianzhang + * @Date 2021/12/8 1:35 下午 + * @Version 1.0 + */ +@Service +@DataSource(DataSourceConstant.EPMET_HEART) +public class HeartVolunteerServiceImpl implements HeartVolunteerService { + + @Autowired + private VolunteerInfoDao volunteerInfoDao; + + @Override + public List listVolunteersPage(String customerId, Date endCreateTime, Integer pageNum, Integer pageSize) { + return PageHelper.startPage(pageNum, pageSize).doSelectPage(() -> { + LambdaQueryWrapper query = new LambdaQueryWrapper<>(); + query.eq(VolunteerInfoEntity::getCustomerId, customerId); + query.lt(VolunteerInfoEntity::getCreatedTime, endCreateTime); + volunteerInfoDao.selectList(query); + }); + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/DemandServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/DemandServiceImpl.java new file mode 100644 index 0000000000..7782226923 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/DemandServiceImpl.java @@ -0,0 +1,184 @@ +package com.epmet.service.impl; + +import com.epmet.commons.tools.constant.EpmetRoleKeyConstant; +import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.dto.heart.result.DemandServiceCountResultDTO; +import com.epmet.entity.crm.CustomerEntity; +import com.epmet.entity.heart.VolunteerInfoEntity; +import com.epmet.entity.stats.FactVolunteerServiceDailyEntity; +import com.epmet.service.DemandService; +import com.epmet.service.crm.CustomerService; +import com.epmet.service.heart.HeartDemandService; +import com.epmet.service.heart.HeartVolunteerService; +import com.epmet.service.stats.DemandStatsService; +import com.epmet.service.user.UserService; +import com.epmet.util.DimIdGenerator; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * @Description 需求service + * @Author wangxianzhang + * @Date 2021/12/8 12:14 下午 + * @Version 1.0 + */ +@Service +public class DemandServiceImpl implements DemandService { + + @Autowired + private HeartDemandService heartDemandService; + + @Autowired + private HeartVolunteerService heartVolunteerService; + + @Autowired + private UserService userService; + + @Autowired + private DemandStatsService demandStatsService; + + @Autowired + private CustomerService customerService; + + @Override + public void statsVolunteerDemandServicesDaily(String customerId) { + + Date now = new Date(); + Date today = DateUtils.integrate(now, "yyyy-MM-dd"); + Date yestoday = DateUtils.addDateDays(today, -1); + + if (StringUtils.isNotBlank(customerId)) { + // 只计算单个客户 + clearOldDatas(Arrays.asList(customerId), yestoday); + statsVolunteerDemandServicesDaily4Customer(customerId, today, yestoday); + } else { + // 查询所有客户ID + List customerIds = customerService.listValidCustomersByCreateTime(null, null).stream().map(c -> c.getId()).collect(Collectors.toList()); + clearOldDatas(customerIds, yestoday); + customerIds.stream().forEach(cId -> { + statsVolunteerDemandServicesDaily4Customer(cId, today, yestoday); + }); + } + } + + /** + * 清理旧数据 + * @param yestoday + */ + private void clearOldDatas(List customerIds, Date yestoday) { + + String dateDimId = DimIdGenerator.getDateDimId(yestoday); + + demandStatsService.clearVolunteerDemandServiceDailyStats(customerIds, dateDimId); + + } + + /** + * 统计单个客户的志愿者服务情况 + * @param customerId 客户ID + * @param endTime 统计截止时间( partymemberVolunteerUserIds = new ArrayList<>(16); + + int pageNum = 1; + int volunteerPageSize = 5; + + while (true) { + + int shardingStartIndex = 0; + int shardingSize = 2; + + List volunteersPage = heartVolunteerService.listVolunteersPage(customerId, endTime, pageNum, volunteerPageSize); + + // 如果查询结果为0,说明没有更多的志愿者了 + if (volunteersPage.size() == 0) { + break; + } + + volunteerTotalCount += volunteersPage.size(); + + // 分片去确定党员身份 + while (true) { + int realShardingSize = Math.min(shardingSize, volunteersPage.size() - shardingStartIndex); + + if (realShardingSize == 0) { + break; + } + + int shardingEndIndex = shardingStartIndex + realShardingSize; + List volunteerUserIds = volunteersPage.subList(shardingStartIndex, shardingEndIndex) + .stream() + .map((volunteerInfoEntity) -> volunteerInfoEntity.getUserId()) + .collect(Collectors.toList()); + + List tempPartymemberUserIds = userService.filterUserIds(volunteerUserIds, EpmetRoleKeyConstant.PARTYMEMBER); + + partymemberVolunteerUserIds.addAll(tempPartymemberUserIds); + + shardingStartIndex = shardingEndIndex; + } + + pageNum++; + } + + partymemberVolunteerCount += partymemberVolunteerUserIds.size(); + resiVolunteerCount = volunteerTotalCount - partymemberVolunteerCount; + + //2. 查询志愿者服务次数 + + // 总服务次数 + int totalDemandServiceCount = 0; + // 党员服务次数 + int partymemberDemandServiceCount = 0; + // 居民服务次数 + int resiDemandServiceCount = 0; + + int serviceCountPageNo = 0; + int serviceCountPageSize = 1000; + while (true) { + + List damendServiceCounts = heartDemandService.listDemandServiceCountPage(customerId, endTime, serviceCountPageNo, serviceCountPageSize); + + for (DemandServiceCountResultDTO damendServiceCount : damendServiceCounts) { + String serverId = damendServiceCount.getServerId(); + if (partymemberVolunteerUserIds.contains(serverId)) { + partymemberDemandServiceCount++; + } else { + resiDemandServiceCount++; + } + } + + totalDemandServiceCount += damendServiceCounts.size(); + + if (damendServiceCounts.size() <= serviceCountPageSize) { + break; + } + } + + // 3.持久化 + FactVolunteerServiceDailyEntity insert = new FactVolunteerServiceDailyEntity(); + insert.setDateId(DimIdGenerator.getDateDimId(belongTime)); + insert.setCustomerId(customerId); + insert.setMonthId(DimIdGenerator.getMonthDimId(belongTime)); + insert.setPartyServiceTotal(partymemberDemandServiceCount); + insert.setServiceTotal(totalDemandServiceCount); + insert.setPartyTotal(partymemberVolunteerCount); + insert.setResiServiceTotal(resiDemandServiceCount); + insert.setResiTotal(resiVolunteerCount); + insert.setVolunteerTotal(volunteerTotalCount); + + demandStatsService.addVolunteerServiceDaily(insert); + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DemandStatsService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DemandStatsService.java new file mode 100644 index 0000000000..dec4ed26ef --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DemandStatsService.java @@ -0,0 +1,18 @@ +package com.epmet.service.stats; + +import com.epmet.entity.stats.FactVolunteerServiceDailyEntity; + +import java.util.List; + +/** + *@Description 统计客户下的志愿者需求服务数据 + *@Author wangxianzhang + *@Date 2021/12/8 + */ +public interface DemandStatsService { + + + void addVolunteerServiceDaily(FactVolunteerServiceDailyEntity entity); + + void clearVolunteerDemandServiceDailyStats(List customerIds, String dateDimId); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DemandStatsServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DemandStatsServiceImpl.java new file mode 100644 index 0000000000..54a8525877 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DemandStatsServiceImpl.java @@ -0,0 +1,36 @@ +package com.epmet.service.stats.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.constant.DataSourceConstant; +import com.epmet.dao.stats.FactVolunteerServiceDailyDao; +import com.epmet.entity.stats.FactVolunteerServiceDailyEntity; +import com.epmet.service.stats.DemandStatsService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * @Description 描述 + * @Author wangxianzhang + * @Date 2021/12/8 10:54 上午 + * @Version 1.0 + */ +@Service +@DataSource(DataSourceConstant.STATS) +public class DemandStatsServiceImpl implements DemandStatsService { + + @Autowired + private FactVolunteerServiceDailyDao factVolunteerServiceDailyDao; + + @Override + public void addVolunteerServiceDaily(FactVolunteerServiceDailyEntity entity) { + factVolunteerServiceDailyDao.insert(entity); + } + + @Override + public void clearVolunteerDemandServiceDailyStats(List customerIds, String dateDimId) { + factVolunteerServiceDailyDao.clearVolunteerDemandServiceDailyStats(customerIds, dateDimId); + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/UserService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/UserService.java index ffa464d4fa..1d0a500b0a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/UserService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/UserService.java @@ -146,4 +146,6 @@ public interface UserService { List getPatrolRecordList(MidPatrolFormDTO formDTO); List getPatrolDetailList(MidPatrolFormDTO formDTO); + + List filterUserIds(List userIds, String roleKey); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java index a8bf95d7f0..a2d56125a6 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java @@ -1109,4 +1109,8 @@ public class UserServiceImpl implements UserService { return userDao.getPatrolDetailList(formDTO); } + @Override + public List filterUserIds(List userIds, String roleKey) { + return userDao.filterUserIds(userIds, roleKey); + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.26__create_volunteer_service_daily.sql b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.26__create_volunteer_service_daily.sql new file mode 100644 index 0000000000..7eade2a679 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.26__create_volunteer_service_daily.sql @@ -0,0 +1,21 @@ +CREATE TABLE epmet_data_statistical.`fact_volunteer_service_daily` +( + `ID` varchar(64) NOT NULL COMMENT '主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户id', + `DATE_ID` varchar(8) NOT NULL COMMENT 'yyyyMMdd', + `MONTH_ID` varchar(6) NOT NULL COMMENT 'yyyyMM', + `VOLUNTEER_TOTAL` int(11) NOT NULL COMMENT '截止到当前dateId,当前客户下,共有多少个爱心互助的志愿者', + `PARTY_TOTAL` int(11) NOT NULL COMMENT '截止到当前dateId,当前客户下,XX个爱心互助志愿者中,党员有多少个', + `RESI_TOTAL` int(11) NOT NULL COMMENT '截止到当前dateId,当前客户下,XX个爱心互助志愿者中,居民有多少个', + `SERVICE_TOTAL` int(11) NOT NULL COMMENT '服务总次数', + `PARTY_SERVICE_TOTAL` int(11) NOT NULL COMMENT '党员服务总次数', + `RESI_SERVICE_TOTAL` int(11) NOT NULL COMMENT '居民服务总次数', + `DEL_FLAG` int(11) NOT NULL COMMENT '删除标识:0.未删除 1.已删除', + `REVISION` int(11) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`), + UNIQUE KEY `uni_vsd` (`CUSTOMER_ID`,`DATE_ID`,`DEL_FLAG`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='志愿者服务情况统计' \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/heart/IcUserDemandServiceDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/heart/IcUserDemandServiceDao.xml new file mode 100644 index 0000000000..1c13f56e87 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/heart/IcUserDemandServiceDao.xml @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/heart/VolunteerInfoDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/heart/VolunteerInfoDao.xml new file mode 100644 index 0000000000..a426712a22 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/heart/VolunteerInfoDao.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactVolunteerServiceDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactVolunteerServiceDailyDao.xml new file mode 100644 index 0000000000..59dfd96c12 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactVolunteerServiceDailyDao.xml @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + delete + from fact_volunteer_service_daily + where DATE_ID=#{dateDimId} + and CUSTOMER_ID in + + #{customerId} + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/UserDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/UserDao.xml index 4715f23c2a..6542440fb8 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/UserDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/UserDao.xml @@ -1052,5 +1052,18 @@ order by created_time LIMIT #{offset},#{pageSize} + + + From 48e64d6161cdc6886780d8aefccac6d1909eff02 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Fri, 10 Dec 2021 15:55:26 +0800 Subject: [PATCH 08/71] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=88=86=E7=B1=BB?= =?UTF-8?q?=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/dto/result/ResiBuzzDTO.java | 13 ++++++-- .../result/ResiBuzzLeftPieChartResultDTO.java | 2 ++ .../src/main/java/com/epmet/dao/IssueDao.java | 2 +- .../epmet/service/impl/IssueServiceImpl.java | 3 +- .../src/main/resources/mapper/IssueDao.xml | 33 ++++++++++++++----- 5 files changed, 41 insertions(+), 12 deletions(-) diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/ResiBuzzDTO.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/ResiBuzzDTO.java index 72da12a996..c2c0960c0a 100644 --- a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/ResiBuzzDTO.java +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/ResiBuzzDTO.java @@ -5,6 +5,8 @@ import com.fasterxml.jackson.annotation.JsonIgnore; import lombok.Data; import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; /** * @Author zxc @@ -72,7 +74,7 @@ public class ResiBuzzDTO implements Serializable { /** * 分类名字 */ - private String categoryName; + private List categoryName; public ResiBuzzDTO() { this.createdBy = ""; @@ -86,6 +88,13 @@ public class ResiBuzzDTO implements Serializable { this.oppositionCount = NumConstant.ZERO; this.voteAccount = ""; this.issueOriginator = ""; - this.categoryName = "其他"; + this.categoryName = getDefaultCategoryName(); + } + + @JsonIgnore + public List getDefaultCategoryName(){ + List list = new ArrayList<>(); + list.add("其他"); + return list; } } diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/ResiBuzzLeftPieChartResultDTO.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/ResiBuzzLeftPieChartResultDTO.java index 7349b7967b..c55641f333 100644 --- a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/ResiBuzzLeftPieChartResultDTO.java +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/ResiBuzzLeftPieChartResultDTO.java @@ -1,6 +1,7 @@ package com.epmet.dto.result; import com.epmet.commons.tools.constant.NumConstant; +import com.fasterxml.jackson.annotation.JsonIgnore; import lombok.Data; import java.io.Serializable; @@ -23,6 +24,7 @@ public class ResiBuzzLeftPieChartResultDTO implements Serializable { /** * 分类编码 */ + @JsonIgnore private String categoryCode; /** diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueDao.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueDao.java index d81143c74c..a853364839 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueDao.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueDao.java @@ -234,7 +234,7 @@ public interface IssueDao extends BaseDao { * @author zxc * @date 2021/12/8 4:08 下午 */ - List selectIssueLimit50(@Param("orgId")String orgId,@Param("orgType")String orgType,@Param("status")String status); + List selectIssueLimit50(@Param("orgId")String orgId,@Param("orgType")String orgType,@Param("status")String status,@Param("length")Integer length); /** * @Description 查询客户下1级分类的长度 diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java index 3111b567b0..4e7a09fd26 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java @@ -1586,7 +1586,8 @@ public class IssueServiceImpl extends BaseServiceImpl imp formDTO.setOrgId(staffInfo.getAgencyId()); formDTO.setOrgType(IssueConstant.ISSUE_AGENCY); } - PageInfo pageInfo = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.selectIssueLimit50(formDTO.getOrgId(), formDTO.getOrgType(), formDTO.getStatus())); + Integer length = baseDao.selectOneLevelCategoryLength(tokenDto.getCustomerId()); + PageInfo pageInfo = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.selectIssueLimit50(formDTO.getOrgId(), formDTO.getOrgType(), formDTO.getStatus(),length)); List list = pageInfo.getList(); if (CollectionUtils.isEmpty(list)){ return new ResiBuzzResultDTO(); diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueDao.xml b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueDao.xml index 827f52b774..8a81f0ab47 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueDao.xml +++ b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueDao.xml @@ -579,22 +579,39 @@ - SELECT i.ID AS issueId, - i.ISSUE_TITLE, - i.SUGGESTION, - i.CREATED_BY, + i.ISSUE_TITLE AS issueTitle, + i.SUGGESTION AS suggestion, + i.CREATED_BY AS createdBy, (CASE WHEN i.ISSUE_STATUS = 'shift_project' THEN '已转项目' WHEN i.ISSUE_STATUS = 'voting' THEN '表决中' WHEN i.ISSUE_STATUS = 'closed' THEN '已关闭' ELSE '表决中' END ) AS `status`, - i.CREATED_TIME, - s.SUPPORT_COUNT, - s.OPPOSITION_COUNT, - CONCAT(s.SUPPORT_COUNT + s.OPPOSITION_COUNT,'/',s.VOTABLE_COUNT) AS voteAccount + i.CREATED_TIME AS createdTime, + s.SUPPORT_COUNT AS supportCount, + s.OPPOSITION_COUNT AS oppositionCount, + CONCAT(s.SUPPORT_COUNT + s.OPPOSITION_COUNT,'/',s.VOTABLE_COUNT) AS voteAccount, + cd.CATEGORY_NAME as cn FROM issue i LEFT JOIN issue_vote_statistical s ON (s.ISSUE_ID = i.ID AND s.DEL_FLAG = '0') + LEFT JOIN issue_category ic ON (ic.ISSUE_ID = i.ID AND ic.DEL_FLAG = '0' AND ic.CUSTOMER_ID = i.CUSTOMER_ID) + LEFT JOIN issue_project_category_dict cd ON (cd.CATEGORY_CODE = LEFT(ic.CATEGORY_CODE,#{length}) AND cd.DEL_FLAG = '0' AND cd.CUSTOMER_ID = ic.CUSTOMER_ID) WHERE i.DEL_FLAG = '0' AND i.ISSUE_STATUS = #{status} From 200d2849c8c1c537cb5b3a3db5ad5b3c99f50081 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Fri, 10 Dec 2021 16:34:56 +0800 Subject: [PATCH 09/71] =?UTF-8?q?=E5=BE=AE=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/service/impl/ProjectServiceImpl.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java index 59e08ee55a..22cceba501 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java @@ -2878,9 +2878,10 @@ public class ProjectServiceImpl extends BaseServiceImpl allCount = orgList.stream().map(m -> m.getCount()).collect(Collectors.toList()); Integer max = Collections.max(allCount); Integer min = Collections.min(allCount); From e331619802ffbbe7339a25c6456b229006a02e4f Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Fri, 10 Dec 2021 16:46:54 +0800 Subject: [PATCH 10/71] =?UTF-8?q?=E5=AD=97=E6=AE=B5=E8=A1=A5=E5=85=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/dto/issue/IssueProjectCategoryDictDTO.java | 5 +++++ .../epmet/entity/issue/IssueProjectCategoryDictEntity.java | 5 +++++ .../main/java/com/epmet/dto/IssueProjectCategoryDictDTO.java | 5 +++++ .../com/epmet/entity/IssueProjectCategoryDictEntity.java | 5 +++++ 4 files changed, 20 insertions(+) diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/issue/IssueProjectCategoryDictDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/issue/IssueProjectCategoryDictDTO.java index c07037ee92..d99c772f8b 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/issue/IssueProjectCategoryDictDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/issue/IssueProjectCategoryDictDTO.java @@ -113,4 +113,9 @@ public class IssueProjectCategoryDictDTO implements Serializable { */ private Date updatedTime; + /** + * 颜色 + */ + private String colour; + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/issue/IssueProjectCategoryDictEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/issue/IssueProjectCategoryDictEntity.java index 67c82fee00..a029bb6f00 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/issue/IssueProjectCategoryDictEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/issue/IssueProjectCategoryDictEntity.java @@ -80,4 +80,9 @@ public class IssueProjectCategoryDictEntity extends BaseEpmetEntity { */ private String isDisable; + /** + * 颜色 + */ + private String colour; + } diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/IssueProjectCategoryDictDTO.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/IssueProjectCategoryDictDTO.java index a93a616cbf..83920372a1 100644 --- a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/IssueProjectCategoryDictDTO.java +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/IssueProjectCategoryDictDTO.java @@ -113,4 +113,9 @@ public class IssueProjectCategoryDictDTO implements Serializable { */ private Date updatedTime; + /** + * 颜色 + */ + private String colour; + } \ No newline at end of file diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/entity/IssueProjectCategoryDictEntity.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/entity/IssueProjectCategoryDictEntity.java index b99f37a2bf..7481f4f4ed 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/entity/IssueProjectCategoryDictEntity.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/entity/IssueProjectCategoryDictEntity.java @@ -83,4 +83,9 @@ public class IssueProjectCategoryDictEntity extends BaseEpmetEntity { */ private String isDisable; + /** + * 颜色 + */ + private String colour; + } From 2536b86b3ff29982a18ab5f4b9fd04e3308449d9 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Fri, 10 Dec 2021 17:12:37 +0800 Subject: [PATCH 11/71] =?UTF-8?q?=E6=A0=BC=E5=BC=8F=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ProjectDistributionAnalysisRightResultDTO.java | 13 ++++--------- .../com/epmet/service/impl/ProjectServiceImpl.java | 11 ++++------- 2 files changed, 8 insertions(+), 16 deletions(-) diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectDistributionAnalysisRightResultDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectDistributionAnalysisRightResultDTO.java index 5b52084e9d..fb56a9f178 100644 --- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectDistributionAnalysisRightResultDTO.java +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectDistributionAnalysisRightResultDTO.java @@ -19,23 +19,18 @@ public class ProjectDistributionAnalysisRightResultDTO implements Serializable { /** * ..以上 */ - private String under; + private Integer under; - /** - * 中间区间 - */ - private String middle; /** * ..以下 */ - private String above; + private Integer above; private List list; public ProjectDistributionAnalysisRightResultDTO() { - this.under = ""; - this.middle = ""; - this.above = ""; + this.under = null; + this.above = null; this.list = new ArrayList<>(); } } diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java index 22cceba501..13b710ec7f 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java @@ -2830,7 +2830,7 @@ public class ProjectServiceImpl extends BaseServiceImpl Date: Fri, 10 Dec 2021 18:02:44 +0800 Subject: [PATCH 12/71] =?UTF-8?q?=E7=A4=BE=E5=8C=BA=E5=85=9A=E5=BB=BA?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=88=86=E6=9E=90-=E5=85=9A=E5=91=98?= =?UTF-8?q?=E7=9B=B8=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../commons/tools/enums/DictTypeEnum.java | 3 +- .../service/impl/IcPartyUnitServiceImpl.java | 10 +- .../dto/form/PartyMemberListFormDTO.java | 24 ++++ .../form/PartyMemberStatisticsFormDTO.java | 20 +++ .../dto/result/PartyMemberAgeResultDTO.java | 19 +++ .../result/PartyMemberEducationResultDTO.java | 19 +++ .../controller/IcResiUserController.java | 53 ++++++++ .../java/com/epmet/dao/IcResiUserDao.java | 47 +++++++ .../com/epmet/service/IcResiUserService.java | 37 +++++ .../service/impl/IcResiUserServiceImpl.java | 117 ++++++++++++++-- .../main/resources/mapper/IcResiUserDao.xml | 128 ++++++++++++++++++ 11 files changed, 467 insertions(+), 10 deletions(-) create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/PartyMemberListFormDTO.java create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/PartyMemberStatisticsFormDTO.java create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/PartyMemberAgeResultDTO.java create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/PartyMemberEducationResultDTO.java diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/DictTypeEnum.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/DictTypeEnum.java index 478e7d4376..e1fa6b1456 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/DictTypeEnum.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/DictTypeEnum.java @@ -18,7 +18,8 @@ public enum DictTypeEnum { GENDER("gender", "性别", 8), USER_DEMAND_STATUS("user_demand_status", "居民需求状态",8), USER_DEMAND_REPORT_TYPE("user_demand_report_type","居民需求上报类型",9), - USER_DEMAND_SERVICE_TYPE("user_demand_service_type","居民需求服务方类型",10) + USER_DEMAND_SERVICE_TYPE("user_demand_service_type","居民需求服务方类型",10), + AGE_GROUP("age_group", "年龄范围", 11), ; private final String code; diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java index 336c60f7be..10aa4239a9 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java @@ -415,7 +415,15 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl distribution(PartyActivityFormDTO formDTO) { - return baseDao.getDistribution(formDTO.getAgencyId()); + Result> unitTypeMap = epmetAdminOpenFeignClient.dictMap(DictTypeEnum.PARTY_UNIT_TYPE.getCode()); + List list = baseDao.getDistribution(formDTO.getAgencyId()); + if (CollectionUtils.isEmpty(list)) { + return Collections.emptyList(); + } + list.forEach(item -> { + item.setType(unitTypeMap.getData().get(item.getType())); + }); + return list; } private String getServiceMatter(Map map, String matter) { diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/PartyMemberListFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/PartyMemberListFormDTO.java new file mode 100644 index 0000000000..a6ffad6477 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/PartyMemberListFormDTO.java @@ -0,0 +1,24 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2021/12/10 15:49 + */ +@Data +public class PartyMemberListFormDTO implements Serializable { + + private static final long serialVersionUID = -6085134769034337175L; + @NotBlank(message = "组织类型不能为空") + private String orgType; + @NotBlank(message = "组织ID不能为空") + private String orgId; + private String code; + private Integer pageNo = 1; + private Integer pageSize = 20; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/PartyMemberStatisticsFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/PartyMemberStatisticsFormDTO.java new file mode 100644 index 0000000000..a5bb86915f --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/PartyMemberStatisticsFormDTO.java @@ -0,0 +1,20 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2021/12/10 15:46 + */ +@Data +public class PartyMemberStatisticsFormDTO implements Serializable { + private static final long serialVersionUID = 1027174449735636944L; + @NotBlank(message = "组织类型不能为空") + private String orgType; + @NotBlank(message = "组织ID不能为空") + private String orgId; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/PartyMemberAgeResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/PartyMemberAgeResultDTO.java new file mode 100644 index 0000000000..85b0ced524 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/PartyMemberAgeResultDTO.java @@ -0,0 +1,19 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2021/12/10 17:05 + */ +@Data +public class PartyMemberAgeResultDTO implements Serializable { + private static final long serialVersionUID = 3421162784157903637L; + private String userId; + private String name; + private String age; + private String mobile; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/PartyMemberEducationResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/PartyMemberEducationResultDTO.java new file mode 100644 index 0000000000..421d0139a3 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/PartyMemberEducationResultDTO.java @@ -0,0 +1,19 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2021/12/10 17:07 + */ +@Data +public class PartyMemberEducationResultDTO implements Serializable { + private static final long serialVersionUID = -5042362121277863249L; + private String userId; + private String name; + private String education; + private String mobile; +} 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 5c76d8e578..aa88bf73ab 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 @@ -27,6 +27,7 @@ import com.epmet.commons.tools.aop.NoRepeatSubmit; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; +import com.epmet.commons.tools.dto.result.OptionDataResultDTO; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.ExceptionUtils; import com.epmet.commons.tools.exception.RenException; @@ -505,4 +506,56 @@ public class IcResiUserController { ValidatorUtils.validateEntity(formDTO, DemandUserFormDTO.InternalGroup.class); return new Result>().ok(icResiUserService.queryDemandUsers(formDTO)); } + + /** + * 党员年龄范围统计 + * @Param formDTO + * @Return {@link Result< List< OptionDataResultDTO >>} + * @Author zhaoqifeng + * @Date 2021/12/10 15:52 + */ + @PostMapping("partymemberagestatistics") + public Result> partyMemberAgeStatistics(@RequestBody PartyMemberStatisticsFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO); + return new Result>().ok(icResiUserService.partyMemberAgeStatistics(formDTO)); + } + + /** + * 党员年龄列表 + * @Param formDTO + * @Return {@link Result< PageData< PartyMemberEducationResultDTO>>} + * @Author zhaoqifeng + * @Date 2021/12/10 17:54 + */ + @PostMapping("partymemberagelist") + public Result> partyMemberAgelist(@RequestBody PartyMemberListFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO); + return new Result>().ok(icResiUserService.getPartyMemberAgeList(formDTO)); + } + + /** + * 党员学历统计 + * @Param formDTO + * @Return {@link Result< List< OptionDataResultDTO>>} + * @Author zhaoqifeng + * @Date 2021/12/10 17:58 + */ + @PostMapping("partymembereducationstatistics") + public Result> partyMemberEducationStatistics(@RequestBody PartyMemberStatisticsFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO); + return new Result>().ok(icResiUserService.partyMemberEducationStatistics(formDTO)); + } + + /** + * 党员学历列表 + * @Param formDTO + * @Return {@link Result< PageData< PartyMemberEducationResultDTO>>} + * @Author zhaoqifeng + * @Date 2021/12/10 17:58 + */ + @PostMapping("partymembereducationlist") + public Result> partyMemberEducationlist(@RequestBody PartyMemberListFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO); + return new Result>().ok(icResiUserService.getPartyMemberEducationList(formDTO)); + } } 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 09f467f6bf..c3f1da8654 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 @@ -18,6 +18,7 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.commons.tools.dto.result.OptionDataResultDTO; import com.epmet.dto.IcResiUserDTO; import com.epmet.dto.form.ResiUserQueryValueDTO; import com.epmet.dto.result.*; @@ -179,4 +180,50 @@ public interface IcResiUserDao extends BaseDao { * @return */ List selectListFamilyMember(@Param("currentIcResiUserId") String currentIcResiUserId, @Param("homeId") String homeId); + + /** + * 组织内党员年龄范围统计 + * @Param orgType + * @Param orgId + * @Return {@link List< OptionDataResultDTO>} + * @Author zhaoqifeng + * @Date 2021/12/10 17:11 + */ + List getPartyMemberAgeStatistics(@Param("orgType") String orgType, @Param("orgId") String orgId); + + /** + * 获取年龄范围内党员列表 + * @Param orgType + * @Param orgId + * @Param min + * @Param max + * @Return {@link List< PartyMemberAgeResultDTO>} + * @Author zhaoqifeng + * @Date 2021/12/10 17:11 + */ + List getPartyMemberAgeList(@Param("orgType") String orgType, @Param("orgId") String orgId, + @Param("code") String code); + + + /** + * 党员文化程度统计 + * @Param orgType + * @Param orgId + * @Return {@link List< OptionDataResultDTO>} + * @Author zhaoqifeng + * @Date 2021/12/10 17:29 + */ + List getPartyMemberEducationStatistics(@Param("orgType") String orgType, @Param("orgId") String orgId); + + /** + * 按教育程度获取党员列表 + * @Param orgType + * @Param orgId + * @Param code + * @Return {@link List< PartyMemberAgeResultDTO>} + * @Author zhaoqifeng + * @Date 2021/12/10 17:24 + */ + List getPartyMemberEducationList(@Param("orgType") String orgType, @Param("orgId") String orgId, + @Param("code") String code); } 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 450ee74c70..db5ad290cf 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 @@ -18,6 +18,7 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.dto.result.OptionDataResultDTO; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.dto.IcResiUserDTO; @@ -153,4 +154,40 @@ public interface IcResiUserService extends BaseService { IcResiUserDTO getByIdCard(String customerId, String idNum,String icResiUserId); IcResiUserBriefDTO findFamilyMem(String icResiUserId); + + /** + * 党员年龄范围统计 + * @Param formDTO + * @Return {@link List< OptionDataResultDTO >} + * @Author zhaoqifeng + * @Date 2021/12/10 15:54 + */ + List partyMemberAgeStatistics(PartyMemberStatisticsFormDTO formDTO); + + /** + * 获取年龄范围内党员列表 + * @Param formDTO + * @Return {@link PageData< PartyMemberAgeResultDTO>} + * @Author zhaoqifeng + * @Date 2021/12/10 17:40 + */ + PageData getPartyMemberAgeList(PartyMemberListFormDTO formDTO); + + /** + * 党员文化程度统计 + * @Param formDTO + * @Return {@link List< OptionDataResultDTO>} + * @Author zhaoqifeng + * @Date 2021/12/10 17:40 + */ + List partyMemberEducationStatistics(PartyMemberStatisticsFormDTO formDTO); + + /** + * 按教育程度获取党员列表 + * @Param formDTO + * @Return {@link PageData< PartyMemberEducationResultDTO>} + * @Author zhaoqifeng + * @Date 2021/12/10 17:40 + */ + PageData getPartyMemberEducationList(PartyMemberListFormDTO formDTO); } 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 d045c08f3d..0a697f0093 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 @@ -25,11 +25,11 @@ import com.epmet.commons.tools.constant.FieldConstant; 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.form.DictListFormDTO; import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; -import com.epmet.commons.tools.enums.FormItemTypeEnum; -import com.epmet.commons.tools.enums.GenderEnum; -import com.epmet.commons.tools.enums.HouseTypeEnum; -import com.epmet.commons.tools.enums.RelationshipEnum; +import com.epmet.commons.tools.dto.result.DictListResultDTO; +import com.epmet.commons.tools.dto.result.OptionDataResultDTO; +import com.epmet.commons.tools.enums.*; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.exception.RenException; @@ -54,10 +54,7 @@ import com.epmet.dto.form.demand.UserDemandNameQueryFormDTO; import com.epmet.dto.result.*; import com.epmet.entity.IcResiUserEntity; import com.epmet.excel.support.ExportResiUserItemDTO; -import com.epmet.feign.EpmetHeartOpenFeignClient; -import com.epmet.feign.EpmetMessageOpenFeignClient; -import com.epmet.feign.GovOrgOpenFeignClient; -import com.epmet.feign.OperCustomizeOpenFeignClient; +import com.epmet.feign.*; import com.epmet.service.IcResiUserService; import com.epmet.service.UserService; import com.github.pagehelper.Page; @@ -102,6 +99,8 @@ public class IcResiUserServiceImpl extends BaseServiceImpl getWrapper(Map params){ String id = (String)params.get(FieldConstant.ID_HUMP); @@ -883,4 +882,106 @@ public class IcResiUserServiceImpl extends BaseServiceImpl} + * @Author zhaoqifeng + * @Date 2021/12/10 15:54 + */ + @Override + public List partyMemberAgeStatistics(PartyMemberStatisticsFormDTO formDTO) { + //获取年龄范围字典 + DictListFormDTO dictFormDTO = new DictListFormDTO(); + dictFormDTO.setDictType(DictTypeEnum.AGE_GROUP.getCode()); + Result> dictResult = epmetAdminOpenFeignClient.dictList(dictFormDTO); + Map map = new HashMap<>(); + //统计组织下各年龄范围人数 + List list = baseDao.getPartyMemberAgeStatistics(formDTO.getOrgType(), formDTO.getOrgId()); + if (CollectionUtils.isNotEmpty(list)) { + map = list.stream().collect(Collectors.toMap(OptionDataResultDTO::getCode, OptionDataResultDTO::getValue)); + } + Map finalMap = map; + return dictResult.getData().stream().map(item -> { + OptionDataResultDTO dto = new OptionDataResultDTO(); + dto.setCode(item.getValue()); + dto.setLabel(item.getLabel()); + dto.setValue(null == finalMap.get(item.getValue())?NumConstant.ZERO_STR:finalMap.get(item.getValue())); + return dto; + }).collect(Collectors.toList()); + } + + /** + * 获取年龄范围内党员列表 + * + * @param formDTO + * @Param formDTO + * @Return {@link List< PartyMemberAgeResultDTO>} + * @Author zhaoqifeng + * @Date 2021/12/10 17:40 + */ + @Override + public PageData getPartyMemberAgeList(PartyMemberListFormDTO formDTO) { + PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()); + List list = baseDao.getPartyMemberAgeList(formDTO.getOrgType(), formDTO.getOrgId(), formDTO.getCode()); + PageInfo pageInfo = new PageInfo<>(list); + return new PageData<>(list, pageInfo.getTotal()); + } + + /** + * 党员文化程度统计 + * + * @param formDTO + * @Param formDTO + * @Return {@link List< OptionDataResultDTO>} + * @Author zhaoqifeng + * @Date 2021/12/10 17:40 + */ + @Override + public List partyMemberEducationStatistics(PartyMemberStatisticsFormDTO formDTO) { + //获取文化程度字典 + DictListFormDTO dictFormDTO = new DictListFormDTO(); + dictFormDTO.setDictType(DictTypeEnum.EDUCATION.getCode()); + Result> dictResult = epmetAdminOpenFeignClient.dictList(dictFormDTO); + Map map = new HashMap<>(); + //统计组织下文化程度党员人数 + List list = baseDao.getPartyMemberEducationStatistics(formDTO.getOrgType(), formDTO.getOrgId()); + if (CollectionUtils.isNotEmpty(list)) { + map = list.stream().collect(Collectors.toMap(OptionDataResultDTO::getCode, OptionDataResultDTO::getValue)); + } + Map finalMap = map; + return dictResult.getData().stream().map(item -> { + OptionDataResultDTO dto = new OptionDataResultDTO(); + dto.setCode(item.getValue()); + dto.setLabel(item.getLabel()); + dto.setValue(null == finalMap.get(item.getValue())?NumConstant.ZERO_STR:finalMap.get(item.getValue())); + return dto; + }).collect(Collectors.toList()); + } + + /** + * 按教育程度获取党员列表 + * + * @param formDTO + * @Param formDTO + * @Return {@link List< PartyMemberEducationResultDTO>} + * @Author zhaoqifeng + * @Date 2021/12/10 17:40 + */ + @Override + public PageData getPartyMemberEducationList(PartyMemberListFormDTO formDTO) { + PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()); + List list = baseDao.getPartyMemberEducationList(formDTO.getOrgType(), formDTO.getOrgId(), formDTO.getCode()); + Result> mapResult = epmetAdminOpenFeignClient.dictMap(DictTypeEnum.EDUCATION.getCode()); + PageInfo pageInfo = new PageInfo<>(list); + if (CollectionUtils.isNotEmpty(list)) { + list.forEach(item -> { + item.setEducation(null == mapResult.getData().get(item.getEducation()) ? "" : mapResult.getData().get(item.getEducation())); + }); + } + return new PageData<>(list, pageInfo.getTotal()); + } } 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 8414cf5e4b..b10e6e259f 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 @@ -361,4 +361,132 @@ and m.HOME_ID=#{homeId} order by m.CREATED_TIME asc + + + + + From 6185d0bb7274df6e70a4fe2105766552a91a1ba7 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Sat, 11 Dec 2021 10:03:52 +0800 Subject: [PATCH 13/71] bugfix --- .../form/demand/CategoryAnalysisFormDTO.java | 42 +++++++++ .../result/demand/CategoryAnalysisDTO.java | 19 +++++ .../result/demand/CategoryAnalysisDetail.java | 32 +++++++ .../result/demand/CategoryAnalysisResDTO.java | 17 ++++ .../epmet/dto/result/demand/LegendDTO.java | 26 ++++++ .../controller/IcUserDemandRecController.java | 14 +++ .../com/epmet/dao/IcUserDemandRecDao.java | 11 +++ .../epmet/service/IcUserDemandRecService.java | 8 ++ .../impl/IcUserDemandRecServiceImpl.java | 85 +++++++++++++++++-- .../resources/mapper/IcUserDemandRecDao.xml | 22 +++++ 10 files changed, 269 insertions(+), 7 deletions(-) create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/CategoryAnalysisFormDTO.java create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/CategoryAnalysisDTO.java create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/CategoryAnalysisDetail.java create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/CategoryAnalysisResDTO.java create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/LegendDTO.java diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/CategoryAnalysisFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/CategoryAnalysisFormDTO.java new file mode 100644 index 0000000000..f4e792f75e --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/CategoryAnalysisFormDTO.java @@ -0,0 +1,42 @@ +package com.epmet.dto.form.demand; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + + + +/** + * 服务措施分析-柱状图入参 + */ +@Data +public class CategoryAnalysisFormDTO implements Serializable { + + public interface AddUserInternalGroup { + } + + public interface AddUserShowGroup extends CustomerClientShowGroup { + } + + @NotBlank(message = "先选择组织或网格", groups = AddUserShowGroup.class) + private String orgId; + @NotBlank(message = "组织或网格的上级", groups = PageListAnalysisFormDTO.AddUserShowGroup.class) + private String pid; + @NotBlank(message = "组织:agency,网格:grid", groups = AddUserShowGroup.class) + private String orgType; + @NotBlank(message = "起止日期不能为空,格式yyyyMMdd", groups = AddUserShowGroup.class) + private String startDateId; + @NotBlank(message = "截止日期不能为空,格式yyyyMMdd", groups = AddUserShowGroup.class) + private String endDateId; + + @NotBlank(message = "先选择组织或网格", groups = AddUserInternalGroup.class) + private String cusotmerId; + + + /** + * orgType=agency时pid拼接上orgId + */ + private String gridPids; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/CategoryAnalysisDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/CategoryAnalysisDTO.java new file mode 100644 index 0000000000..fc7a8eaad8 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/CategoryAnalysisDTO.java @@ -0,0 +1,19 @@ +package com.epmet.dto.result.demand; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; +import java.util.List; + +@Data +@AllArgsConstructor +@NoArgsConstructor +public class CategoryAnalysisDTO implements Serializable { + private static final long serialVersionUID = 3007202497989446585L; + private String categoryCode; + private String categoryName; + private Integer total; + private List detail; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/CategoryAnalysisDetail.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/CategoryAnalysisDetail.java new file mode 100644 index 0000000000..c082d11074 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/CategoryAnalysisDetail.java @@ -0,0 +1,32 @@ +package com.epmet.dto.result.demand; + +import lombok.Data; + +import java.io.Serializable; + +@Data +public class CategoryAnalysisDetail implements Serializable { + private static final long serialVersionUID = -4606305611297470078L; + /** + * 区域党建单位:party_unit; + * 社会组织:social_org; + * 社区自组织:community_org; + * 志愿者:volunteer; + * 未完成:unfinished + */ + private String legendCode; + + /** + * 服务方类型名称 + */ + private String legendName; + + /** + * 服务方的个数 + */ + private Integer totalService; + /** + * 需求个数 + */ + private Integer serviceDemandTotal; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/CategoryAnalysisResDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/CategoryAnalysisResDTO.java new file mode 100644 index 0000000000..1b39a2befd --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/CategoryAnalysisResDTO.java @@ -0,0 +1,17 @@ +package com.epmet.dto.result.demand; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; +import java.util.List; + +@Data +@AllArgsConstructor +@NoArgsConstructor +public class CategoryAnalysisResDTO implements Serializable { + private static final long serialVersionUID = -3112952115061180189L; + private List legend; + private List categoryList; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/LegendDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/LegendDTO.java new file mode 100644 index 0000000000..e1f6c9b282 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/LegendDTO.java @@ -0,0 +1,26 @@ +package com.epmet.dto.result.demand; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * 服务措施分析-柱状图 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +public class LegendDTO implements Serializable { + private static final long serialVersionUID = 7205666632591639499L; + /** + * 区域党建单位:party_unit; + * 社会组织:social_org; + * 社区自组织:community_org; + * 志愿者:volunteer; + * 未完成:unfinished + */ + private String legendCode; + private String legendName; +} 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 666243eee0..08a28e2f25 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 @@ -257,4 +257,18 @@ public class IcUserDemandRecController { } return new Result(); } + + /** + * 数据分析-服务措施分析-柱状图 + * + * @return + */ + @PostMapping("category-analysis") + public Result categoryAnalysis(@LoginUser TokenDto tokenDto,@RequestBody CategoryAnalysisFormDTO formDTO){ + formDTO.setCusotmerId(tokenDto.getCustomerId()); + ValidatorUtils.validateEntity(formDTO,CategoryAnalysisFormDTO.AddUserShowGroup.class,CategoryAnalysisFormDTO.AddUserInternalGroup.class); + return new Result().ok(icUserDemandRecService.categoryAnalysis(formDTO)); + } + + } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcUserDemandRecDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcUserDemandRecDao.java index aa7c3c68c1..299576cfcf 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcUserDemandRecDao.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcUserDemandRecDao.java @@ -21,8 +21,10 @@ import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.form.demand.IcResiUserDemandFromDTO; import com.epmet.dto.form.demand.PageListAnalysisFormDTO; import com.epmet.dto.form.demand.UserDemandPageFormDTO; +import com.epmet.dto.result.demand.CategoryAnalysisDTO; import com.epmet.dto.result.demand.DemandRecResultDTO; import com.epmet.dto.result.demand.IcResiUserReportDemandRes; +import com.epmet.dto.result.demand.OptionDTO; import com.epmet.entity.IcUserDemandRecEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -65,4 +67,13 @@ public interface IcUserDemandRecDao extends BaseDao { * @return */ List pageListAnalysis(PageListAnalysisFormDTO formDTO); + + + List selectListCategoryAnalysisDTO(@Param("firstCategoryList") List firstCategoryList, + @Param("customerId") String customerId, + @Param("orgId") String orgId, + @Param("orgType") String orgType, + @Param("gridPids") String gridPids, + @Param("startDateId") String startDateId, + @Param("endDateId") String endDateId); } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcUserDemandRecService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcUserDemandRecService.java index 685261ec33..1ffeca3931 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcUserDemandRecService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcUserDemandRecService.java @@ -21,6 +21,7 @@ import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; import com.epmet.dto.IcUserDemandRecDTO; import com.epmet.dto.form.demand.*; +import com.epmet.dto.result.demand.CategoryAnalysisResDTO; import com.epmet.dto.result.demand.DemandRecResultDTO; import com.epmet.dto.result.demand.DemandResearchAnalysisResultDTO; import com.epmet.dto.result.demand.IcResiUserReportDemandRes; @@ -161,4 +162,11 @@ public interface IcUserDemandRecService extends BaseService pageListAnalysis(PageListAnalysisFormDTO formDTO); + + /** + * 数据分析-服务措施分析-柱状图 + * + * @return + */ + CategoryAnalysisResDTO categoryAnalysis(CategoryAnalysisFormDTO formDTO); } \ No newline at end of file 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 51bc5fc35c..8a8e9280af 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 @@ -45,9 +45,7 @@ import com.epmet.dto.form.demand.*; import com.epmet.dto.result.AllGridsByUserIdResultDTO; import com.epmet.dto.result.IcResiUserBriefDTO; import com.epmet.dto.result.UserBaseInfoResultDTO; -import com.epmet.dto.result.demand.DemandRecResultDTO; -import com.epmet.dto.result.demand.DemandResearchAnalysisResultDTO; -import com.epmet.dto.result.demand.IcResiUserReportDemandRes; +import com.epmet.dto.result.demand.*; import com.epmet.entity.*; import com.epmet.feign.EpmetAdminOpenFeignClient; import com.epmet.feign.EpmetUserOpenFeignClient; @@ -239,9 +237,9 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl userInfoMap=new HashMap<>(); - List userIdList=list.stream().filter(item->item.getServiceType().equals(UserDemandConstant.VOLUNTEER)).map(DemandRecResultDTO::getServerId).collect(Collectors.toList()); + Set userIdList=list.stream().filter(item->item.getServiceType().equals(UserDemandConstant.VOLUNTEER)).map(DemandRecResultDTO::getServerId).collect(Collectors.toSet()); if(CollectionUtils.isNotEmpty(userIdList)){ - Result> userInfoRes = epmetUserOpenFeignClient.queryUserBaseInfo(userIdList); + Result> userInfoRes = epmetUserOpenFeignClient.queryUserBaseInfo(new ArrayList<>(userIdList)); if(!userInfoRes.success()||CollectionUtils.isEmpty(userInfoRes.getData())){ throw new RenException("查询志愿者信息异常"); } @@ -654,9 +652,9 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl userInfoMap=new HashMap<>(); - List userIdList=list.stream().filter(item->item.getServiceType().equals(UserDemandConstant.VOLUNTEER)).map(DemandRecResultDTO::getServerId).collect(Collectors.toList()); + Set userIdList=list.stream().filter(item->item.getServiceType().equals(UserDemandConstant.VOLUNTEER)).map(DemandRecResultDTO::getServerId).collect(Collectors.toSet()); if(CollectionUtils.isNotEmpty(userIdList)){ - Result> userInfoRes = epmetUserOpenFeignClient.queryUserBaseInfo(userIdList); + Result> userInfoRes = epmetUserOpenFeignClient.queryUserBaseInfo(new ArrayList<>(userIdList)); if(!userInfoRes.success()||CollectionUtils.isEmpty(userInfoRes.getData())){ throw new RenException("查询志愿者信息异常"); } @@ -696,6 +694,79 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl(list, total); } + /** + * 数据分析-服务措施分析-柱状图 + * + * @param formDTO + * @return + */ + @Override + public CategoryAnalysisResDTO categoryAnalysis(CategoryAnalysisFormDTO formDTO) { + //1、一级分类字典,没有分类直接退出 + SubCodeFormDTO subCodeFormDTO=new SubCodeFormDTO(); + subCodeFormDTO.setCustomerId(formDTO.getCusotmerId()); + subCodeFormDTO.setParentCategoryCode(NumConstant.ZERO_STR); + List 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()); + if(!serviceTypeRes.success()||MapUtils.isEmpty(serviceTypeRes.getData())){ + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.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); + // 3、传进来的是组织id的话,查询出全路径 + if("agency".equals(formDTO.getOrgType())){ + if(NumConstant.ZERO_STR.equals(formDTO.getPid())){ + //当前传入的组织id=客户的根组织 + formDTO.setGridPids(formDTO.getOrgId()); + }else{ + //找到当前组织的所有上级,再拼接上自己 + Result customerAgencyDTOResult=govOrgOpenFeignClient.getAgencyById(formDTO.getOrgId()); + if(!customerAgencyDTOResult.success()||null==customerAgencyDTOResult.getData()){ + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取组织信息异常govOrgOpenFeignClient.getAgencyById"); + } + formDTO.setGridPids(customerAgencyDTOResult.getData().getPids().concat(StrConstant.COLON).concat(formDTO.getOrgId())); + } + } + + // 4、查询出有数据的一级分类 + // 4、sql计算出detail + List haveDemandList=baseDao.selectListCategoryAnalysisDTO(firstCategoryList, + formDTO.getCusotmerId(), + formDTO.getOrgId(), + formDTO.getOrgType(), + formDTO.getGridPids(), + formDTO.getStartDateId(), + formDTO.getEndDateId()); + if(!CollectionUtils.isEmpty(haveDemandList)){ + for(CategoryAnalysisDTO analysisRes:haveDemandList){ + //todo + //List detail= + } + } + + + //构造最后的反参 + List list=new ArrayList<>(); + // firstCategoryList是所有的一级分类字典 + firstCategoryList.forEach(firstCategory->{ + CategoryAnalysisDTO categoryAnalysisDTO=new CategoryAnalysisDTO(firstCategory.getValue(),firstCategory.getLabel(),NumConstant.ZERO,Collections.EMPTY_LIST); + list.add(categoryAnalysisDTO); + }); + + CategoryAnalysisResDTO result=new CategoryAnalysisResDTO(); + result.setLegend(legend); + result.setCategoryList(list); + return null; + } } \ No newline at end of file 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 804ddac6d6..ffc3aa454f 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 @@ -261,4 +261,26 @@ order by r.WANT_SERVICE_TIME desc,r.REPORT_TIME asc + + + \ No newline at end of file From 7f604ce4ad92992f9532b390e37cbdbe4c002632 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Sat, 11 Dec 2021 10:07:45 +0800 Subject: [PATCH 14/71] =?UTF-8?q?=E6=9C=8D=E5=8A=A1=E6=8E=AA=E6=96=BD?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E6=9F=A5=E8=AF=A2bugfix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/service/impl/IcUserDemandRecServiceImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 3a0f278b10..cc318638b6 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 @@ -236,9 +236,9 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl userInfoMap=new HashMap<>(); - List userIdList=list.stream().filter(item->item.getServiceType().equals(UserDemandConstant.VOLUNTEER)).map(DemandRecResultDTO::getServerId).collect(Collectors.toList()); + Set userIdList=list.stream().filter(item->item.getServiceType().equals(UserDemandConstant.VOLUNTEER)).map(DemandRecResultDTO::getServerId).collect(Collectors.toSet()); if(CollectionUtils.isNotEmpty(userIdList)){ - Result> userInfoRes = epmetUserOpenFeignClient.queryUserBaseInfo(userIdList); + Result> userInfoRes = epmetUserOpenFeignClient.queryUserBaseInfo(new ArrayList<>(userIdList)); if(!userInfoRes.success()||CollectionUtils.isEmpty(userInfoRes.getData())){ throw new RenException("查询志愿者信息异常"); } From a021aefa0327ad260fb377cbb87eed45a5140e00 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Sat, 11 Dec 2021 11:09:25 +0800 Subject: [PATCH 15/71] test --- .../dto/result/demand/CategoryDetailDTO.java | 11 +++ .../com/epmet/dao/IcUserDemandRecDao.java | 13 ++- .../impl/IcUserDemandRecServiceImpl.java | 52 ++++++++---- .../resources/mapper/IcUserDemandRecDao.xml | 81 ++++++++++++++++++- 4 files changed, 134 insertions(+), 23 deletions(-) create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/CategoryDetailDTO.java diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/CategoryDetailDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/CategoryDetailDTO.java new file mode 100644 index 0000000000..9e2802362a --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/CategoryDetailDTO.java @@ -0,0 +1,11 @@ +package com.epmet.dto.result.demand; + +import lombok.Data; + +import java.io.Serializable; + +@Data +public class CategoryDetailDTO extends CategoryAnalysisDetail implements Serializable { + private static final long serialVersionUID = 4459219163308113201L; + private String categoryCode; +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcUserDemandRecDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcUserDemandRecDao.java index 299576cfcf..1dfaf2cb85 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcUserDemandRecDao.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcUserDemandRecDao.java @@ -21,10 +21,7 @@ import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.form.demand.IcResiUserDemandFromDTO; import com.epmet.dto.form.demand.PageListAnalysisFormDTO; import com.epmet.dto.form.demand.UserDemandPageFormDTO; -import com.epmet.dto.result.demand.CategoryAnalysisDTO; -import com.epmet.dto.result.demand.DemandRecResultDTO; -import com.epmet.dto.result.demand.IcResiUserReportDemandRes; -import com.epmet.dto.result.demand.OptionDTO; +import com.epmet.dto.result.demand.*; import com.epmet.entity.IcUserDemandRecEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -69,6 +66,14 @@ public interface IcUserDemandRecDao extends BaseDao { List pageListAnalysis(PageListAnalysisFormDTO formDTO); + List selectDetail(@Param("categoryCode") String categoryCode, + @Param("orgType") String orgType, + @Param("orgId") String orgId, + @Param("gridPids") String gridPids, + @Param("customerId") String customerId, + @Param("startDateId") String startDateId, + @Param("endDateId") String endDateId); + List selectListCategoryAnalysisDTO(@Param("firstCategoryList") List firstCategoryList, @Param("customerId") String customerId, @Param("orgId") String orgId, 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 8a8e9280af..89d464e3fe 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 @@ -17,6 +17,7 @@ package com.epmet.service.impl; +import com.alibaba.fastjson.JSON; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; @@ -54,6 +55,7 @@ import com.epmet.service.IcResiDemandDictService; import com.epmet.service.IcUserDemandRecService; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; +import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.MapUtils; import org.apache.commons.lang3.StringUtils; @@ -71,6 +73,7 @@ import java.util.stream.Collectors; * @author generator generator@elink-cn.com * @since v1.0.0 2021-11-19 */ +@Slf4j @Service public class IcUserDemandRecServiceImpl extends BaseServiceImpl implements IcUserDemandRecService { @Autowired @@ -722,6 +725,8 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl list=new ArrayList<>(); + // firstCategoryList是所有的一级分类字典 + firstCategoryList.forEach(firstCategory->{ + CategoryAnalysisDTO categoryAnalysisDTO=new CategoryAnalysisDTO(firstCategory.getValue(),firstCategory.getLabel(),NumConstant.ZERO,Collections.EMPTY_LIST); + categoryAnalysisDTO.setDetail(constructDefaultDetail(legend)); + list.add(categoryAnalysisDTO); + }); + + log.info("阶段性胜利2:"+ JSON.toJSONString(list)); + + // 5、查询出有数据的一级分类,sql计算出detail List haveDemandList=baseDao.selectListCategoryAnalysisDTO(firstCategoryList, formDTO.getCusotmerId(), formDTO.getOrgId(), @@ -747,25 +762,32 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl detail= + log.info("阶段性胜利3:"+ JSON.toJSONString(haveDemandList)); + Map map = haveDemandList.stream().filter(temp -> CollectionUtils.isNotEmpty(temp.getDetail())).collect(Collectors.toMap(CategoryAnalysisDTO::getCategoryCode, dto -> dto)); + if(MapUtils.isNotEmpty(map)){ + for(CategoryAnalysisDTO result:list){ + if (map.containsKey(result.getCategoryCode()) && null != map.get(result.getCategoryCode())) { + result.setDetail(map.get(result.getCategoryCode()).getDetail()); + } + } } } - - //构造最后的反参 - List list=new ArrayList<>(); - // firstCategoryList是所有的一级分类字典 - firstCategoryList.forEach(firstCategory->{ - CategoryAnalysisDTO categoryAnalysisDTO=new CategoryAnalysisDTO(firstCategory.getValue(),firstCategory.getLabel(),NumConstant.ZERO,Collections.EMPTY_LIST); - list.add(categoryAnalysisDTO); - }); - + //返回结果,也不知道对不对 CategoryAnalysisResDTO result=new CategoryAnalysisResDTO(); result.setLegend(legend); result.setCategoryList(list); - return null; + return result; + } + + private List constructDefaultDetail(List legend) { + List l = new ArrayList<>(); + legend.forEach(legendDTO -> { + CategoryAnalysisDetail d = ConvertUtils.sourceToTarget(legendDTO, CategoryAnalysisDetail.class); + d.setServiceDemandTotal(NumConstant.ZERO); + d.setTotalService(NumConstant.ZERO); + }); + return l; } 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 ffc3aa454f..eff843c279 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 @@ -263,12 +263,29 @@ - select - #{category.value} as categoryCode, - #{category.label} as categoryName, - count(m.id) as total + #{category.value} as category_code, + #{category.label} as category_name, + count(m.id) as TOTAL, + #{orgType} as org_type, + #{orgId} as org_id, + #{gridPids} as grid_pids, + #{customerId} as customer_id, + #{startDateId} as start_date_id, + #{endDateId} as end_date_id from ic_user_demand_rec m where m.DEL_FLAG='0' and m.CUSTOMER_ID=#{customerId} @@ -281,6 +298,62 @@ 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(#{category.value},'%') + and m.status !='canceled' + + \ No newline at end of file From 0ceaf6c5d00626bef4bfd9e6dac0ec5b1718c718 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Sat, 11 Dec 2021 11:29:26 +0800 Subject: [PATCH 16/71] test2 --- .../impl/IcUserDemandRecServiceImpl.java | 23 ++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) 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 89d464e3fe..d80ea3de6e 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 @@ -767,10 +767,31 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl resDetailList=tempDto.getDetail(); + Map detailMap = resDetailList.stream().collect(Collectors.toMap(CategoryAnalysisDetail::getLegendCode, dto -> dto)); + + //遍历之前构造好的图例 + for(CategoryAnalysisDetail resultDetail:result.getDetail()){ + if(detailMap.containsKey(resultDetail.getLegendCode())&&null!=detailMap.get(resultDetail.getLegendCode())){ + resultDetail.setTotalService(detailMap.get(resultDetail.getLegendCode()).getTotalService()); + resultDetail.setServiceDemandTotal(detailMap.get(resultDetail.getLegendCode()).getServiceDemandTotal()); + } + } + + } + } + } + } + } //返回结果,也不知道对不对 From 9a4e5e6b20c9b4aa8cb06d2297323a753b27e6e8 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Sat, 11 Dec 2021 11:40:54 +0800 Subject: [PATCH 17/71] test2.1 --- .../java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java | 2 ++ 1 file changed, 2 insertions(+) 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 d80ea3de6e..8446c84103 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 @@ -765,6 +765,7 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl map = haveDemandList.stream().filter(temp -> CollectionUtils.isNotEmpty(temp.getDetail())).collect(Collectors.toMap(CategoryAnalysisDTO::getCategoryCode, dto -> dto)); if(MapUtils.isNotEmpty(map)){ + log.info("阶段性胜利4:"+ JSON.toJSONString(map)); for(CategoryAnalysisDTO result:list){ if (map.containsKey(result.getCategoryCode()) && null != map.get(result.getCategoryCode())) { //如果当前分类下有上报的需求,将原来的0改为实际的需求数量 @@ -807,6 +808,7 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl Date: Sun, 12 Dec 2021 18:23:19 +0800 Subject: [PATCH 18/71] CalPartyUnitSatisfactionFormDTO --- .../messages/CalPartyUnitSatisfactionFormDTO.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/CalPartyUnitSatisfactionFormDTO.java diff --git a/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/CalPartyUnitSatisfactionFormDTO.java b/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/CalPartyUnitSatisfactionFormDTO.java new file mode 100644 index 0000000000..f852b2285a --- /dev/null +++ b/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/CalPartyUnitSatisfactionFormDTO.java @@ -0,0 +1,15 @@ +package com.epmet.commons.rocketmq.messages; + + +import lombok.Data; + +import java.io.Serializable; + +/** + * 需求完成,如果服务方是区域化党建单位,重新计算这个单位的满意度,或者直接计算整个客户 + */ +@Data +public class CalPartyUnitSatisfactionFormDTO implements Serializable { + private String customerId; + private String partyUnitId; +} From 87f1cbdd37ac68f35ffab7390a20329df51dd586 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Sun, 12 Dec 2021 18:34:48 +0800 Subject: [PATCH 19/71] cal_party_unit_satisfaction --- .../commons/rocketmq/constants/ConsomerGroupConstants.java | 4 ++++ .../com/epmet/commons/rocketmq/constants/TopicConstants.java | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/ConsomerGroupConstants.java b/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/ConsomerGroupConstants.java index 93894c0bdb..400eca1d51 100644 --- a/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/ConsomerGroupConstants.java +++ b/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/ConsomerGroupConstants.java @@ -70,4 +70,8 @@ public interface ConsomerGroupConstants { */ String IC_WARN_STATS_EVENT_LISTENER_GROUP = "ic_warn_stats_event_listener_group"; + /** + * 需求完成,如果服务方是区域化党建单位,重新计算这个单位的满意度 + */ + String CAL_PARTY_UNIT_SATISFACTION = "cal_party_unit_satisfaction"; } diff --git a/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/TopicConstants.java b/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/TopicConstants.java index 13217da550..e11400fef3 100644 --- a/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/TopicConstants.java +++ b/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/TopicConstants.java @@ -53,4 +53,9 @@ public interface TopicConstants { * 项目 */ String IC_RESI_USER = "ic_resi_user"; + + /** + * 需求完成,如果服务方是区域化党建单位,重新计算这个单位的满意度 + */ + String CAL_PARTY_UNIT_SATISFACTION = "cal_party_unit_satisfaction"; } From cd43854e7bb7092eddfbf3e31b03198cfaf78c6c Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Sun, 12 Dec 2021 18:38:39 +0800 Subject: [PATCH 20/71] SystemMessageType.CAL_PARTY_UNIT_SATISFACTION --- .../src/main/java/com/epmet/constant/SystemMessageType.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/SystemMessageType.java b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/SystemMessageType.java index 5d6cd6190c..284be1cb95 100644 --- a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/SystemMessageType.java +++ b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/SystemMessageType.java @@ -100,4 +100,8 @@ public interface SystemMessageType { */ String IC_RESI_USER_DEL = "ic_resi_user_del"; + /** + * 需求完成,如果服务方是区域化党建单位,重新计算这个单位的满意度 + */ + String CAL_PARTY_UNIT_SATISFACTION = "cal_party_unit_satisfaction"; } From 8fcd4a2a7282c86e9744f0b5aa3492ddf4c58cee Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Sun, 12 Dec 2021 19:04:16 +0800 Subject: [PATCH 21/71] SystemMessageType.CAL_PARTY_UNIT_SATISFACTION --- .../java/com/epmet/service/impl/SystemMessageServiceImpl.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/SystemMessageServiceImpl.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/SystemMessageServiceImpl.java index c57bd798f6..ca4f862049 100644 --- a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/SystemMessageServiceImpl.java +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/SystemMessageServiceImpl.java @@ -192,6 +192,9 @@ public class SystemMessageServiceImpl implements SystemMessageService { case SystemMessageType.IC_RESI_USER_DEL: topic = TopicConstants.IC_RESI_USER; break; + case SystemMessageType.CAL_PARTY_UNIT_SATISFACTION: + topic=TopicConstants.CAL_PARTY_UNIT_SATISFACTION; + break; } return topic; } From 990031cbf00a5eb78ca7cd16aff55b1291c5ef68 Mon Sep 17 00:00:00 2001 From: wangxianzhang Date: Sun, 12 Dec 2021 21:45:10 +0800 Subject: [PATCH 22/71] =?UTF-8?q?=E6=96=B0=E5=A2=9E=EF=BC=9A=201.=E5=BF=97?= =?UTF-8?q?=E6=84=BF=E8=80=85=E5=9D=90=E6=A0=87=E5=88=86=E5=B8=83=202.?= =?UTF-8?q?=E5=BF=97=E6=84=BF=E8=80=85=E4=BF=A1=E6=81=AF=E7=AE=80=E4=BB=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../VolunteerDemandServiceStatsResultDTO.java | 41 ++++ .../DataReportHeartDemandController.java | 38 ++++ .../fact/FactVolunteerServiceDailyDao.java | 43 +++++ .../FactVolunteerServiceDailyEntity.java | 83 ++++++++ .../service/heart/DemandService.java | 13 ++ .../service/heart/impl/DemandServiceImpl.java | 29 +++ .../fact/FactVolunteerServiceDailyDao.xml | 36 ++++ .../dto/form/resi/VolunteerCommonFormDTO.java | 26 +++ .../resi/PageVolunteerInfoResultDTO.java | 14 ++ .../feign/EpmetHeartOpenFeignClient.java | 10 + .../EpmetHeartOpenFeignClientFallback.java | 7 + .../controller/ResiVolunteerController.java | 19 ++ .../epmet/service/VolunteerInfoService.java | 3 + .../impl/VolunteerInfoServiceImpl.java | 20 ++ .../epmet/feign/GovOrgOpenFeignClient.java | 18 ++ .../GovOrgOpenFeignClientFallback.java | 9 + .../dto/form/IcFormOptionsQueryFormDTO.java | 27 +++ .../feign/OperCustomizeOpenFeignClient.java | 9 + .../OperCustomizeOpenFeignClientFallback.java | 6 + .../IcFormItemOptionsController.java | 20 ++ .../service/IcFormItemOptionsService.java | 9 + .../impl/IcFormItemOptionsServiceImpl.java | 47 ++++- .../dto/form/VolunteerCommonFormDTO.java | 26 +++ .../epmet/dto/result/IcResiUserBriefDTO.java | 61 ++++++ .../VolunteerDistributionResultDTO.java | 36 ++++ .../controller/IcResiUserController.java | 13 ++ .../epmet/controller/VolunteerController.java | 55 ++++++ .../com/epmet/service/IcResiUserService.java | 2 + .../com/epmet/service/VolunteerService.java | 15 ++ .../service/impl/IcResiUserServiceImpl.java | 73 +++++++ .../service/impl/VolunteerServiceImpl.java | 179 ++++++++++++++++++ 31 files changed, 981 insertions(+), 6 deletions(-) create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/heart/VolunteerDemandServiceStatsResultDTO.java create mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/heart/DataReportHeartDemandController.java create mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactVolunteerServiceDailyDao.java create mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/entity/heart/FactVolunteerServiceDailyEntity.java create mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/heart/DemandService.java create mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/heart/impl/DemandServiceImpl.java create mode 100644 epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactVolunteerServiceDailyDao.xml create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/VolunteerCommonFormDTO.java create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/PageVolunteerInfoResultDTO.java create mode 100644 epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/IcFormOptionsQueryFormDTO.java create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/VolunteerCommonFormDTO.java create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/VolunteerDistributionResultDTO.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/controller/VolunteerController.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/service/VolunteerService.java create mode 100644 epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/VolunteerServiceImpl.java diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/heart/VolunteerDemandServiceStatsResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/heart/VolunteerDemandServiceStatsResultDTO.java new file mode 100644 index 0000000000..2dfcb5426a --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/heart/VolunteerDemandServiceStatsResultDTO.java @@ -0,0 +1,41 @@ +package com.epmet.dto.result.heart; + +import lombok.Data; + +/** + * @Description 描述 + * @Author wangxianzhang + * @Date 2021/12/10 4:24 下午 + * @Version 1.0 + */ +@Data +public class VolunteerDemandServiceStatsResultDTO { + + private String customerId; + private String dateId; + /** + * 客户下志愿者总数 + */ + private Integer volunteerTotal; + /** + * 客户下志愿者中,党员数量 + */ + private Integer partyTotal; + /** + * 客户下志愿者中,居民数量 + */ + private Integer resiTotal; + /** + * 客户下志愿者服务总次数 + */ + private Integer serviceTotal; + /** + * 客户下党员志愿者服务次数 + */ + private Integer partyServiceTotal; + /** + * 客户下居民志愿者服务次数 + */ + private Integer resiServiceTotal; + +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/heart/DataReportHeartDemandController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/heart/DataReportHeartDemandController.java new file mode 100644 index 0000000000..86eabe2b3c --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/heart/DataReportHeartDemandController.java @@ -0,0 +1,38 @@ +package com.epmet.datareport.controller.heart; + +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.Result; +import com.epmet.datareport.service.heart.DemandService; +import com.epmet.dto.result.heart.VolunteerDemandServiceStatsResultDTO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * @Description 描述 + * @Author wangxianzhang + * @Date 2021/12/10 3:55 下午 + * @Version 1.0 + */ +@RestController +@RequestMapping("heart/demand") +public class DataReportHeartDemandController { + + @Autowired + private DemandService demandService; + + /** + * 查询志愿者需求服务统计信息 + * @param loginUser + * @return + */ + @PostMapping("volunteer/service") + public Result getVolunteerServiceStats(@LoginUser TokenDto loginUser) { + String customerId = loginUser.getCustomerId(); + VolunteerDemandServiceStatsResultDTO r = demandService.getVolunteerServiceStats(customerId); + return new Result().ok(r); + } + +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactVolunteerServiceDailyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactVolunteerServiceDailyDao.java new file mode 100644 index 0000000000..fd4d28afb0 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactVolunteerServiceDailyDao.java @@ -0,0 +1,43 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.datareport.dao.fact; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.datareport.entity.heart.FactVolunteerServiceDailyEntity; +import com.epmet.dto.result.heart.VolunteerDemandServiceStatsResultDTO; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 志愿者服务情况统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-12-08 + */ +@Mapper +public interface FactVolunteerServiceDailyDao extends BaseDao { + + /** + * 查询最新一条"志愿者需求服务统计信息" + * @param customerId + * @return + */ + VolunteerDemandServiceStatsResultDTO getLatestVolunteerDemandServiceStats(@Param("customerId") String customerId); +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/entity/heart/FactVolunteerServiceDailyEntity.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/entity/heart/FactVolunteerServiceDailyEntity.java new file mode 100644 index 0000000000..a668e52a63 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/entity/heart/FactVolunteerServiceDailyEntity.java @@ -0,0 +1,83 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.datareport.entity.heart; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 志愿者服务情况统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-12-08 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_volunteer_service_daily") +public class FactVolunteerServiceDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * yyyyMMdd + */ + private String dateId; + + /** + * yyyyMM + */ + private String monthId; + + /** + * 截止到当前dateId,当前客户下,共有多少个爱心互助的志愿者 + */ + private Integer volunteerTotal; + + /** + * 截止到当前dateId,当前客户下,XX个爱心互助志愿者中,党员有多少个 + */ + private Integer partyTotal; + + /** + * 截止到当前dateId,当前客户下,XX个爱心互助志愿者中,居民有多少个 + */ + private Integer resiTotal; + + /** + * 服务总次数 + */ + private Integer serviceTotal; + + /** + * 党员服务总次数 + */ + private Integer partyServiceTotal; + + /** + * 居民服务总次数 + */ + private Integer resiServiceTotal; + +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/heart/DemandService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/heart/DemandService.java new file mode 100644 index 0000000000..ccbbb319a1 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/heart/DemandService.java @@ -0,0 +1,13 @@ +package com.epmet.datareport.service.heart; + +import com.epmet.dto.result.heart.VolunteerDemandServiceStatsResultDTO; + +/** + * @Description 需求服务 + * @Author wangxianzhang + * @Date 2021/12/10 4:18 下午 + * @Version 1.0 + */ +public interface DemandService { + VolunteerDemandServiceStatsResultDTO getVolunteerServiceStats(String customerId); +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/heart/impl/DemandServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/heart/impl/DemandServiceImpl.java new file mode 100644 index 0000000000..79ba0274ea --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/heart/impl/DemandServiceImpl.java @@ -0,0 +1,29 @@ +package com.epmet.datareport.service.heart.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.constant.DataSourceConstant; +import com.epmet.datareport.dao.fact.FactVolunteerServiceDailyDao; +import com.epmet.datareport.entity.heart.FactVolunteerServiceDailyEntity; +import com.epmet.datareport.service.heart.DemandService; +import com.epmet.dto.result.heart.VolunteerDemandServiceStatsResultDTO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +/** + * @Description 需求服务 + * @Author wangxianzhang + * @Date 2021/12/10 4:20 下午 + * @Version 1.0 + */ +@Service +public class DemandServiceImpl implements DemandService { + + @Autowired + private FactVolunteerServiceDailyDao factVolunteerServiceDailyDao; + + @Override + public VolunteerDemandServiceStatsResultDTO getVolunteerServiceStats(String customerId) { + return factVolunteerServiceDailyDao.getLatestVolunteerDemandServiceStats(customerId); + } +} diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactVolunteerServiceDailyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactVolunteerServiceDailyDao.xml new file mode 100644 index 0000000000..fbe645deb3 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactVolunteerServiceDailyDao.xml @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/VolunteerCommonFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/VolunteerCommonFormDTO.java new file mode 100644 index 0000000000..c8893697a8 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/VolunteerCommonFormDTO.java @@ -0,0 +1,26 @@ +package com.epmet.dto.form.resi; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; + +/** + * @Description + * @Author wangxianzhang + * @Date 2021/12/10 6:10 下午 + * @Version 1.0 + */ +@Data +public class VolunteerCommonFormDTO { + + public interface VolunteerPage { + } + + @NotBlank(message = "客户ID不能为空", groups = {VolunteerPage.class}) + private String customerId; + + private Integer pageNo = 0; + + private Integer pageSize = 20; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/PageVolunteerInfoResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/PageVolunteerInfoResultDTO.java new file mode 100644 index 0000000000..d23f2023da --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/PageVolunteerInfoResultDTO.java @@ -0,0 +1,14 @@ +package com.epmet.dto.result.resi; + +import lombok.Data; + +/** + * @Description 志愿者信息分页查询结果 + * @Author wangxianzhang + * @Date 2021/12/10 6:17 下午 + * @Version 1.0 + */ +@Data +public class PageVolunteerInfoResultDTO { + private String userId; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetHeartOpenFeignClient.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetHeartOpenFeignClient.java index 7a4a6c8ad5..4bad8f25d7 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetHeartOpenFeignClient.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetHeartOpenFeignClient.java @@ -6,6 +6,8 @@ import com.epmet.dto.ActInfoDTO; import com.epmet.dto.VolunteerInfoDTO; import com.epmet.dto.form.CommonCustomerFormDTO; import com.epmet.dto.form.demand.UserDemandNameQueryFormDTO; +import com.epmet.dto.form.resi.VolunteerCommonFormDTO; +import com.epmet.dto.result.resi.PageVolunteerInfoResultDTO; import com.epmet.feign.fallback.EpmetHeartOpenFeignClientFallbackFactory; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.PathVariable; @@ -56,4 +58,12 @@ public interface EpmetHeartOpenFeignClient { @PostMapping("/heart/icresidemanddict/demangnames") Result queryDemandNames(@RequestBody UserDemandNameQueryFormDTO formDTO); + + /** + * 分页查询志愿者列表 + * @param input + * @return + */ + @PostMapping("/heart/resi/volunteer/page") + Result> queryVolunteerPage(@RequestBody VolunteerCommonFormDTO input); } diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/fallback/EpmetHeartOpenFeignClientFallback.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/fallback/EpmetHeartOpenFeignClientFallback.java index e0e140b02e..27c2c9bdc8 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/fallback/EpmetHeartOpenFeignClientFallback.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/fallback/EpmetHeartOpenFeignClientFallback.java @@ -7,6 +7,8 @@ import com.epmet.dto.ActInfoDTO; import com.epmet.dto.VolunteerInfoDTO; import com.epmet.dto.form.CommonCustomerFormDTO; import com.epmet.dto.form.demand.UserDemandNameQueryFormDTO; +import com.epmet.dto.form.resi.VolunteerCommonFormDTO; +import com.epmet.dto.result.resi.PageVolunteerInfoResultDTO; import com.epmet.feign.EpmetHeartOpenFeignClient; import java.util.List; @@ -53,4 +55,9 @@ public class EpmetHeartOpenFeignClientFallback implements EpmetHeartOpenFeignCli public Result queryDemandNames(UserDemandNameQueryFormDTO formDTO) { return ModuleUtils.feignConError(ServiceConstant.EPMET_HEART_SERVER, "queryDemandNames", formDTO); } + + @Override + public Result> queryVolunteerPage(VolunteerCommonFormDTO input) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_HEART_SERVER, "queryVolunteerPage", input); + } } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiVolunteerController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiVolunteerController.java index e144e9c11f..e1d18e5536 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiVolunteerController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiVolunteerController.java @@ -26,7 +26,9 @@ import com.epmet.dto.form.CommonCustomerFormDTO; import com.epmet.dto.form.demand.ServiceQueryFormDTO; import com.epmet.dto.form.resi.ResiSendSmsCodeFormDTO; import com.epmet.dto.form.resi.ResiVolunteerAuthenticateFormDTO; +import com.epmet.dto.form.resi.VolunteerCommonFormDTO; import com.epmet.dto.result.demand.OptionDTO; +import com.epmet.dto.result.resi.PageVolunteerInfoResultDTO; import com.epmet.dto.result.resi.ResiVolunteerInfoResultDTO; import com.epmet.service.VolunteerInfoService; import org.springframework.beans.factory.annotation.Autowired; @@ -125,4 +127,21 @@ public class ResiVolunteerController { public Result> queryListVolunteer(@LoginUser TokenDto tokenDto,@RequestBody ServiceQueryFormDTO formDTO){ return new Result>().ok(volunteerInfoService.queryListVolunteer(tokenDto.getCustomerId(),formDTO.getServiceName())); } + + /** + * 分页查询志愿者列表 + * @param input + * @return + */ + @PostMapping("page") + public Result> queryVolunteerPage(@RequestBody VolunteerCommonFormDTO input) { + + ValidatorUtils.validateEntity(input, VolunteerCommonFormDTO.VolunteerPage.class); + + Integer pageNo = input.getPageNo(); + Integer pageSize = input.getPageSize(); + String customerId = input.getCustomerId(); + List l = volunteerInfoService.queryVolunteerPage(customerId, pageNo, pageSize); + return new Result>().ok(l); + } } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/VolunteerInfoService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/VolunteerInfoService.java index 850c4367de..6a84fb67a1 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/VolunteerInfoService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/VolunteerInfoService.java @@ -25,6 +25,7 @@ import com.epmet.dto.form.CommonCustomerFormDTO; import com.epmet.dto.form.resi.ResiSendSmsCodeFormDTO; import com.epmet.dto.form.resi.ResiVolunteerAuthenticateFormDTO; import com.epmet.dto.result.demand.OptionDTO; +import com.epmet.dto.result.resi.PageVolunteerInfoResultDTO; import com.epmet.dto.result.resi.ResiVolunteerInfoResultDTO; import com.epmet.entity.VolunteerInfoEntity; @@ -94,4 +95,6 @@ public interface VolunteerInfoService extends BaseService { * @return */ List queryListVolunteer(String customerId,String userRealName); + + List queryVolunteerPage(String customerId, Integer pageNo, Integer pageSize); } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/VolunteerInfoServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/VolunteerInfoServiceImpl.java index a0ac541131..ac87cc6b4c 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/VolunteerInfoServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/VolunteerInfoServiceImpl.java @@ -18,6 +18,7 @@ package com.epmet.service.impl; import com.alibaba.fastjson.JSON; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.MqConstant; import com.epmet.commons.tools.constant.NumConstant; @@ -44,12 +45,14 @@ import com.epmet.dto.result.ResiUserBaseInfoResultDTO; import com.epmet.dto.result.SendVerificationCodeResultDTO; import com.epmet.dto.result.UserBaseInfoResultDTO; import com.epmet.dto.result.demand.OptionDTO; +import com.epmet.dto.result.resi.PageVolunteerInfoResultDTO; import com.epmet.dto.result.resi.ResiVolunteerInfoResultDTO; import com.epmet.entity.VolunteerInfoEntity; import com.epmet.feign.EpmetMessageOpenFeignClient; import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.service.HeartUserInfoService; import com.epmet.service.VolunteerInfoService; +import com.github.pagehelper.PageHelper; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.apache.logging.log4j.LogManager; @@ -258,4 +261,21 @@ public class VolunteerInfoServiceImpl extends BaseServiceImpl queryVolunteerPage(String customerId, Integer pageNo, Integer pageSize) { + LambdaQueryWrapper query = new LambdaQueryWrapper<>(); + query.eq(VolunteerInfoEntity::getCustomerId, customerId); + + PageHelper.startPage(pageNo, pageSize); + List volunteerInfoEntities = baseDao.selectList(query); + + List list = volunteerInfoEntities.stream().map(vi -> { + PageVolunteerInfoResultDTO p = new PageVolunteerInfoResultDTO(); + p.setUserId(vi.getUserId()); + return p; + }).collect(Collectors.toList()); + + return list; + } } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java index 5d713f13e4..f09e1f6ccf 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java @@ -540,4 +540,22 @@ public interface GovOrgOpenFeignClient { */ @PostMapping("/gov/org/agency/getsonagencyid") Result> getSonAgencyId(@RequestParam("orgId")String orgId); + +// /icbuilding/{id}?id=demoData + + /** + * 根据ID查询楼栋信息 + * @param id + * @return + */ + @GetMapping("/gov/org/icbuilding/{id}") + Result getBuildingById(@PathVariable("id") String id); + + /** + * 通过ID查询小区信息 + * @param id + * @return + */ + @GetMapping("/gov/org/icneighborhood/{id}") + Result getIcNeighbordhoodById(@PathVariable("id") String id); } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java index 46fcb2506c..f85e3471e6 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java @@ -344,4 +344,13 @@ public class GovOrgOpenFeignClientFallback implements GovOrgOpenFeignClient { return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "selectPidsByGridId", gridId); } + @Override + public Result getBuildingById(String id) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getBuildingById", id); + } + + @Override + public Result getIcNeighbordhoodById(String id) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getIcNeighbordhoodById", id); + } } diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/IcFormOptionsQueryFormDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/IcFormOptionsQueryFormDTO.java new file mode 100644 index 0000000000..f7fa5bb1da --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/IcFormOptionsQueryFormDTO.java @@ -0,0 +1,27 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; + +/** + * @Description ic 表单options查询通用dto + * @Author wangxianzhang + * @Date 2021/12/12 1:07 下午 + * @Version 1.0 + */ +@Data +public class IcFormOptionsQueryFormDTO { + + public interface QueryByLabelAndCustomerIdForForm {} + + @NotBlank(message = "客户ID必填", groups = { QueryByLabelAndCustomerIdForForm.class }) + private String customerId; + + @NotBlank(message = "FormCode必填", groups = { QueryByLabelAndCustomerIdForForm.class }) + private String formCode; + + @NotBlank(message = "OptionsLabel必填", groups = { QueryByLabelAndCustomerIdForForm.class }) + private String label; + +} diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/OperCustomizeOpenFeignClient.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/OperCustomizeOpenFeignClient.java index 2882f9977f..9cda858533 100644 --- a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/OperCustomizeOpenFeignClient.java +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/OperCustomizeOpenFeignClient.java @@ -3,6 +3,7 @@ package com.epmet.feign; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.CustomerFootBarDTO; +import com.epmet.dto.IcFormItemOptionsDTO; import com.epmet.dto.IcResiCategoryStatsConfigDTO; import com.epmet.dto.IcResiCategoryWarnConfigDTO; import com.epmet.dto.form.*; @@ -120,4 +121,12 @@ public interface OperCustomizeOpenFeignClient { @PostMapping("/oper/customize/icformitemoptions/volunteerlabelbyvalues") Result> volunteerLabelByValues(@RequestBody List volunteers,@RequestParam("customerId") String customerId); + /** + * 使用item相关条件查询关联的options + * @param input + * @return + */ + @PostMapping("/oper/customize/icformitemoptions/list-by-item-conditions") + Result> listOptionsByItemConditions(@RequestBody IcFormOptionsQueryFormDTO input); + } diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/fallback/OperCustomizeOpenFeignClientFallback.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/fallback/OperCustomizeOpenFeignClientFallback.java index a75999eb0e..da282124bb 100644 --- a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/fallback/OperCustomizeOpenFeignClientFallback.java +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/fallback/OperCustomizeOpenFeignClientFallback.java @@ -4,6 +4,7 @@ import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.ModuleUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.CustomerFootBarDTO; +import com.epmet.dto.IcFormItemOptionsDTO; import com.epmet.dto.IcResiCategoryStatsConfigDTO; import com.epmet.dto.IcResiCategoryWarnConfigDTO; import com.epmet.dto.form.*; @@ -103,4 +104,9 @@ public class OperCustomizeOpenFeignClientFallback implements OperCustomizeOpenFe public Result> volunteerLabelByValues(List volunteers,String customerId) { return ModuleUtils.feignConError(ServiceConstant.OPER_CUSTOMIZE_SERVER, "volunteerLabelByValues",volunteers,customerId); } + + @Override + public Result> listOptionsByItemConditions(IcFormOptionsQueryFormDTO input) { + return ModuleUtils.feignConError(ServiceConstant.OPER_CUSTOMIZE_SERVER, "listOptionsByItemConditions", input); + } } diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcFormItemOptionsController.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcFormItemOptionsController.java index 262255826a..ed22604272 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcFormItemOptionsController.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcFormItemOptionsController.java @@ -26,14 +26,17 @@ import com.epmet.commons.tools.validator.group.AddGroup; import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.commons.tools.validator.group.DefaultGroup; import com.epmet.dto.IcFormItemOptionsDTO; +import com.epmet.dto.form.IcFormOptionsQueryFormDTO; import com.epmet.excel.IcFormItemOptionsExcel; import com.epmet.service.IcFormItemOptionsService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; +import org.springframework.web.servlet.tags.form.InputTag; import javax.servlet.http.HttpServletResponse; import java.util.List; import java.util.Map; +import java.util.function.IntUnaryOperator; /** @@ -102,4 +105,21 @@ public class IcFormItemOptionsController { return new Result>().ok(icFormItemOptionsService.volunteerLabelByValues(volunteers,customerId)); } + /** + * 使用item相关条件查询关联的options + * @param input + * @return + */ + @PostMapping("list-by-item-conditions") + public Result> listOptionsByItemConditions(@RequestBody IcFormOptionsQueryFormDTO input) { + ValidatorUtils.validateEntity(input, IcFormOptionsQueryFormDTO.QueryByLabelAndCustomerIdForForm.class); + String customerId = input.getCustomerId(); + String formCode = input.getFormCode(); + String label = input.getLabel(); + + List r = icFormItemOptionsService.getOptionsByItemConditions(customerId, formCode, label); + return new Result>().ok(r); + } + + } \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/IcFormItemOptionsService.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/IcFormItemOptionsService.java index 387cc05412..7423f85289 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/IcFormItemOptionsService.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/IcFormItemOptionsService.java @@ -100,4 +100,13 @@ public interface IcFormItemOptionsService extends BaseService volunteerLabelByValues(List volunteers, String customerId); + + /** + * 使用item相关条件查询options + * @param customerId + * @param formCode + * @param label + * @return + */ + List getOptionsByItemConditions(String customerId, String formCode, String label); } \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcFormItemOptionsServiceImpl.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcFormItemOptionsServiceImpl.java index 144e56e568..970845cbee 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcFormItemOptionsServiceImpl.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcFormItemOptionsServiceImpl.java @@ -17,23 +17,30 @@ package com.epmet.service.impl; +import cn.hutool.core.bean.BeanUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.dao.IcFormItemDao; import com.epmet.dao.IcFormItemOptionsDao; import com.epmet.dto.IcFormItemOptionsDTO; +import com.epmet.entity.IcFormItemEntity; import com.epmet.entity.IcFormItemOptionsEntity; import com.epmet.service.IcFormItemOptionsService; import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Map; +import java.util.stream.Collectors; /** * 表单项的选项 @@ -44,7 +51,9 @@ import java.util.Map; @Service public class IcFormItemOptionsServiceImpl extends BaseServiceImpl implements IcFormItemOptionsService { - + @Autowired + private IcFormItemDao icFormItemDao; + @Override public PageData page(Map params) { IPage page = baseDao.selectPage( @@ -61,8 +70,8 @@ public class IcFormItemOptionsServiceImpl extends BaseServiceImpl getWrapper(Map params){ - String id = (String)params.get(FieldConstant.ID_HUMP); + private QueryWrapper getWrapper(Map params) { + String id = (String) params.get(FieldConstant.ID_HUMP); QueryWrapper wrapper = new QueryWrapper<>(); wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); @@ -98,14 +107,40 @@ public class IcFormItemOptionsServiceImpl extends BaseServiceImpl volunteerLabelByValues(List volunteers,String customerId) { - return baseDao.volunteerLabelByValues(volunteers,customerId); + public List volunteerLabelByValues(List volunteers, String customerId) { + return baseDao.volunteerLabelByValues(volunteers, customerId); } + @Override + public List getOptionsByItemConditions(String customerId, String formCode, String label) { + + // 查询item + LambdaQueryWrapper formItemQuery = new LambdaQueryWrapper<>(); + formItemQuery.eq(IcFormItemEntity::getCustomerId, customerId); + formItemQuery.eq(IcFormItemEntity::getFormCode, formCode); + formItemQuery.eq(IcFormItemEntity::getLabel, label); + IcFormItemEntity item = icFormItemDao.selectOne(formItemQuery); + + if (item == null) { + return new ArrayList<>(); + } + + // 通过item查询options + LambdaQueryWrapper query = new LambdaQueryWrapper<>(); + query.eq(IcFormItemOptionsEntity::getItemId, item.getId()); + query.orderByAsc(IcFormItemOptionsEntity::getSort); + + // 属性拷贝 + return baseDao.selectList(query).stream().map(o -> { + IcFormItemOptionsDTO oDTO = new IcFormItemOptionsDTO(); + BeanUtil.copyProperties(o, oDTO); + return oDTO; + }).collect(Collectors.toList()); + } } \ No newline at end of file diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/VolunteerCommonFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/VolunteerCommonFormDTO.java new file mode 100644 index 0000000000..a2c8dff5a1 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/VolunteerCommonFormDTO.java @@ -0,0 +1,26 @@ +package com.epmet.dto.form; + +import lombok.Data; +import lombok.Value; + +import javax.validation.constraints.NotBlank; + +/** + * @Description + * @Author wangxianzhang + * @Date 2021/12/10 5:47 下午 + * @Version 1.0 + */ +@Data +public class VolunteerCommonFormDTO { + + /** + * 查询志愿者分布 + */ + public interface GetVolunteerDistribution { + } + + @NotBlank(message = "客户ID不能为空", groups = {GetVolunteerDistribution.class}) + private String customerId; + +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/IcResiUserBriefDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/IcResiUserBriefDTO.java index ce955f1a56..9d5f1453d3 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/IcResiUserBriefDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/IcResiUserBriefDTO.java @@ -3,7 +3,10 @@ package com.epmet.dto.result; import lombok.Data; import java.io.Serializable; +import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; /** * 案件居民、家属列表 @@ -12,8 +15,66 @@ import java.util.List; @Data public class IcResiUserBriefDTO extends HouseUserDTO implements Serializable { private String houseId; + + private String gridId; + + private String gridName; + + /** + * 小区id + */ + private String villageId; + + /** + * 小区名 + */ + private String villageName; + + /** + * 是否本地户籍 + */ + private String isBdhj; + + /** + * 手机号 + */ + private String mobile; + + /** + * 性别 + */ + private String gender; + + /** + * 身份证号 + */ + private String idCard; + + /** + * 出生日期 + */ + private String birthday; + + /** + * 联系人 + */ + private String contacts; + + /** + * 联系人电话 + */ + private String contactsMobile; + + /** + * 志愿者类别 + * key:志愿者类型英文 + * value:志愿者类型中文 + */ + private Map volunteerCategories = new HashMap<>(); + /** * 同屋的其他人 */ private List houseUserList; + } 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 new file mode 100644 index 0000000000..c1bb3d866c --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/VolunteerDistributionResultDTO.java @@ -0,0 +1,36 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; +import java.util.Set; + +/** + * @Description + * @Author wangxianzhang + * @Date 2021/12/10 5:49 下午 + * @Version 1.0 + */ +@Data +public class VolunteerDistributionResultDTO { + + private List legends = new ArrayList<>(); + + private List distributions = new ArrayList<>(); + + @Data + public static class Legend { + private String optionLabel; + private String optionValue; + } + + @Data + public static class Distribution { + private Set volunteerTypes; + private String epmetUserId; + private String icResiUserId; + private String longitude; + private String latitude; + } +} 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 5c76d8e578..d89449515e 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 @@ -505,4 +505,17 @@ public class IcResiUserController { ValidatorUtils.validateEntity(formDTO, DemandUserFormDTO.InternalGroup.class); return new Result>().ok(icResiUserService.queryDemandUsers(formDTO)); } + + /** + * 根据居民id查询居民信息简介 + * @param resiUserId + * @return + */ + @PostMapping("resi-brief/{resi-user-id}") + public Result getResiBrief(@PathVariable("resi-user-id") String resiUserId, @LoginUser TokenDto loginUser) { + String customerId = loginUser.getCustomerId(); + IcResiUserBriefDTO r = icResiUserService.getResiBrief(resiUserId, customerId); + return new Result().ok(r); + } + } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/VolunteerController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/VolunteerController.java new file mode 100644 index 0000000000..40ea2d8807 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/VolunteerController.java @@ -0,0 +1,55 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.dao.IcResiUserDao; +import com.epmet.dto.form.VolunteerCommonFormDTO; +import com.epmet.dto.result.VolunteerDistributionResultDTO; +import com.epmet.feign.GovOrgOpenFeignClient; +import com.epmet.service.VolunteerService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * @Description 志愿者controller + * @Author wangxianzhang + * @Date 2021/12/10 5:45 下午 + * @Version 1.0 + */ +@RestController +@RequestMapping("volunteer") +public class VolunteerController { + + /** + * 不知道为何用注解 注入不进来,暂时用构造方法注入 + */ + @Autowired + private VolunteerService volunteerService; + + //public VolunteerController(VolunteerService volunteerService, IcResiUserDao icResiUserDao, GovOrgOpenFeignClient govOrgOpenFeignClient) { + // this.volunteerService = volunteerService; + // System.out.println(this); + //} + + /** + * 志愿者分布查询 + * + * @param input + * @return + */ + @PostMapping("distribution") + public Result getVolunteerDistribution(@RequestBody VolunteerCommonFormDTO input) { + System.out.println(this); + ValidatorUtils.validateEntity(input, VolunteerCommonFormDTO.GetVolunteerDistribution.class); + + String customerId = input.getCustomerId(); + + VolunteerDistributionResultDTO r = volunteerService.getVolunteerDistributionAndLegends(customerId); + + return new Result().ok(r); + } + +} 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 450ee74c70..ee16cd596a 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 @@ -153,4 +153,6 @@ public interface IcResiUserService extends BaseService { IcResiUserDTO getByIdCard(String customerId, String idNum,String icResiUserId); IcResiUserBriefDTO findFamilyMem(String icResiUserId); + + IcResiUserBriefDTO getResiBrief(String resiUserId, String customerId); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/VolunteerService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/VolunteerService.java new file mode 100644 index 0000000000..cd87cf7dd5 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/VolunteerService.java @@ -0,0 +1,15 @@ +package com.epmet.service; + +import com.epmet.dto.result.VolunteerDistributionResultDTO; + +/** + * @Description 志愿者service + * @Author wangxianzhang + * @Date 2021/12/10 5:48 下午 + * @Version 1.0 + */ +public interface VolunteerService { + + VolunteerDistributionResultDTO getVolunteerDistributionAndLegends(String customerId); + +} 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 d045c08f3d..6fe81d27aa 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 @@ -17,6 +17,7 @@ package com.epmet.service.impl; +import cn.hutool.core.bean.BeanUtil; import com.alibaba.fastjson.JSON; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; @@ -102,6 +103,8 @@ public class IcResiUserServiceImpl extends BaseServiceImpl getWrapper(Map params){ String id = (String)params.get(FieldConstant.ID_HUMP); @@ -883,4 +886,74 @@ public class IcResiUserServiceImpl extends BaseServiceImpl query = new LambdaQueryWrapper<>(); + query.eq(IcResiUserEntity::getId, resiUserId); + IcResiUserEntity resiEntity = baseDao.selectOne(query); + + IcResiUserBriefDTO r = new IcResiUserBriefDTO(); + + BeanUtil.copyProperties(resiEntity, r); + + r.setHouseId(resiEntity.getHomeId()); + r.setIcResiUserId(resiEntity.getId()); + r.setIcUserName(resiEntity.getName()); + + // 填充网格、小区名称 + String errorMsg = "【居民信息简介】查询网格、小区信息失败"; + IcNeighborHoodDTO neighborHood = getResultDataOrThrowsException(govOrgOpenFeignClient.getIcNeighbordhoodById(resiEntity.getVillageId()), + ServiceConstant.GOV_ORG_SERVER, + EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), + errorMsg, + errorMsg); + + CustomerGridFormDTO gridInfoForm = new CustomerGridFormDTO(); + gridInfoForm.setGridId(resiEntity.getGridId()); + CustomerGridDTO gridInfo = getResultDataOrThrowsException(govOrgOpenFeignClient.getCustomerGridByGridId(gridInfoForm), + ServiceConstant.GOV_ORG_SERVER, + EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), + errorMsg, + errorMsg); + + r.setGridName(gridInfo.getGridName()); + r.setVillageName(neighborHood.getNeighborHoodName()); + + // 2.志愿者类型填充 + List volunteers = icResiUserDao.selectVolunteerByUserId(resiEntity.getId()); + if (CollectionUtils.isNotEmpty(volunteers)) { + String[] vCategories = volunteers.get(0).split(","); + + // 志愿者类型字典 + Map categories = getVolunteerCategoryOptions(customerId); + + for (int i = 0; i < vCategories.length; i++) { + r.getVolunteerCategories().put(vCategories[i], categories.get(vCategories[i])); + } + } + + return r; + } + + /** + * 查询志愿者类别options + * @param customerId + * @return + */ + private Map getVolunteerCategoryOptions(String customerId) { + IcFormOptionsQueryFormDTO optionsQuery = new IcFormOptionsQueryFormDTO(); + optionsQuery.setCustomerId(customerId); + optionsQuery.setFormCode("resi_base_info"); + optionsQuery.setLabel("志愿者类别"); + List categorieDtos = getResultDataOrThrowsException(operCustomizeOpenFeignClient.listOptionsByItemConditions(optionsQuery), + ServiceConstant.OPER_CUSTOMIZE_SERVER, + EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), + "【志愿者分布】志愿者简介-查询志愿者类别失败", + "【志愿者分布】志愿者简介-查询志愿者类别失败"); + + return categorieDtos.stream() + .collect(Collectors.toMap(IcFormItemOptionsDTO::getOptionValue, IcFormItemOptionsDTO::getOptionLabel)); + + } } 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 new file mode 100644 index 0000000000..f0e2796a98 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/VolunteerServiceImpl.java @@ -0,0 +1,179 @@ +package com.epmet.service.impl; + +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.feign.ResultDataResolver; +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; +import com.epmet.feign.GovOrgOpenFeignClient; +import com.epmet.feign.OperCustomizeOpenFeignClient; +import com.epmet.service.VolunteerService; +import org.apache.commons.collections4.CollectionUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * @Description + * @Author wangxianzhang + * @Date 2021/12/10 5:48 下午 + * @Version 1.0 + */ +@Service +public class VolunteerServiceImpl implements VolunteerService, ResultDataResolver { + + @Autowired + private EpmetHeartOpenFeignClient epmetHeartOpenFeignClient; + + @Autowired + private UserBaseInfoDao userBaseInfoDao; + + @Autowired + private IcResiUserDao icResiUserDao; + + @Autowired + private GovOrgOpenFeignClient govOrgOpenFeignClient; + + @Autowired + private OperCustomizeOpenFeignClient operCustomizeOpenFeignClient; + + /** + * 查询志愿者分布以及志愿者图例 + * + * @param customerId + * @return + */ + public VolunteerDistributionResultDTO getVolunteerDistributionAndLegends(String customerId) { + + // 1.查询分布 + VolunteerDistributionResultDTO volunteerDistribution = getVolunteerDistribution(customerId); + + // 2.补充图例 + IcFormOptionsQueryFormDTO optionsForm = new IcFormOptionsQueryFormDTO(); + optionsForm.setCustomerId(customerId); + optionsForm.setFormCode("resi_base_info"); + optionsForm.setLabel("志愿者类别"); + + String errorMsg = "【志愿者分布】查询志愿者图例失败"; + List options = getResultDataOrThrowsException(operCustomizeOpenFeignClient.listOptionsByItemConditions(optionsForm), + ServiceConstant.OPER_CUSTOMIZE_SERVER, + EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), + errorMsg, + errorMsg); + + List legends = options.stream().map(o -> { + VolunteerDistributionResultDTO.Legend legend = new VolunteerDistributionResultDTO.Legend(); + legend.setOptionLabel(o.getOptionLabel()); + legend.setOptionValue(o.getOptionValue()); + return legend; + }).collect(Collectors.toList()); + + volunteerDistribution.setLegends(legends); + return volunteerDistribution; + } + + /** + * 查询志愿者分布 + * + * @param customerId + * @return + */ + public VolunteerDistributionResultDTO getVolunteerDistribution(String customerId) { + //epmetHeartOpenFeignClient.queryVolunteerPage() + + // 1.分页查询出所有志愿者列表 + int pageNo = 1; + int pageSize = 100; + + // 志愿者epmet user id + Set volunteerEpmetUserIds = new HashSet<>(); + + // 分页查询志愿者的epmet user id + while (true) { + + VolunteerCommonFormDTO volunteerForm = new VolunteerCommonFormDTO(); + volunteerForm.setCustomerId(customerId); + volunteerForm.setPageNo(pageNo); + volunteerForm.setPageSize(pageSize); + + String errorMsg = "【志愿者分布】分页查询志愿者列表失败"; + List volunteerPage = getResultDataOrThrowsException(epmetHeartOpenFeignClient.queryVolunteerPage(volunteerForm), + ServiceConstant.EPMET_HEART_SERVER, + EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), + errorMsg, + errorMsg); + + // 将本页userId添加到总集中去 + volunteerEpmetUserIds.addAll(volunteerPage.stream().map(v -> v.getUserId()).collect(Collectors.toSet())); + + if (volunteerPage.size() < pageSize) { + // 说明是最后一页了 + break; + } + + pageNo++; + } + + + VolunteerDistributionResultDTO r = new VolunteerDistributionResultDTO(); + + // 2.填充ic居民信息 + for (String volunteerEpmetUserId : volunteerEpmetUserIds) { + + VolunteerDistributionResultDTO.Distribution distribution = new VolunteerDistributionResultDTO.Distribution(); + + ResiUserBaseInfoResultDTO userBaseInfo = userBaseInfoDao.selecUserBaseInfoByUserId(volunteerEpmetUserId); + + //使用身份证号查询ic resi信息 + IcResiUserDTO icResiUserInfo = icResiUserDao.selectIdByIdCard(customerId, userBaseInfo.getIdNum(), null); + if (icResiUserInfo == null) { + continue; + } + + List volunteer = icResiUserDao.selectVolunteerByUserId(icResiUserInfo.getId()); + if (CollectionUtils.isEmpty(volunteer)) { + // 此人没有志愿者信息 + continue; + } + + // 将志愿者类型列表字符串,切割放到set中 + Set volunteerTypes = new HashSet(); + for (String vTypesString : volunteer) { + 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.setVolunteerTypes(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; + } + +} From eb4e4df5e0d200adac13b822f21ce60f37e02c08 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Mon, 13 Dec 2021 08:35:22 +0800 Subject: [PATCH 23/71] =?UTF-8?q?=E8=AE=A1=E7=AE=97=E7=BE=A4=E4=BC=97?= =?UTF-8?q?=E6=BB=A1=E6=84=8F=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CalPartyUnitSatisfactionFormDTO.java | 4 + .../epmet-heart/epmet-heart-server/pom.xml | 22 ++++ .../controller/IcPartyUnitController.java | 15 +++ .../epmet/mq/RocketMQConsumerRegister.java | 31 ++++++ ...PartyUnitSatisfactionCalEventListener.java | 104 ++++++++++++++++++ .../com/epmet/service/IcPartyUnitService.java | 7 ++ .../service/impl/IcPartyUnitServiceImpl.java | 15 +++ .../impl/IcUserDemandRecServiceImpl.java | 18 +++ .../src/main/resources/bootstrap.yml | 5 +- 9 files changed, 220 insertions(+), 1 deletion(-) create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/mq/RocketMQConsumerRegister.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/mq/listener/PartyUnitSatisfactionCalEventListener.java diff --git a/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/CalPartyUnitSatisfactionFormDTO.java b/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/CalPartyUnitSatisfactionFormDTO.java index f852b2285a..bfaf63703a 100644 --- a/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/CalPartyUnitSatisfactionFormDTO.java +++ b/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/CalPartyUnitSatisfactionFormDTO.java @@ -3,6 +3,7 @@ package com.epmet.commons.rocketmq.messages; import lombok.Data; +import javax.validation.constraints.NotBlank; import java.io.Serializable; /** @@ -10,6 +11,9 @@ import java.io.Serializable; */ @Data public class CalPartyUnitSatisfactionFormDTO implements Serializable { + public interface AddUserInternalGroup { + } + @NotBlank(message = "客户id不能为空",groups = AddUserInternalGroup.class) private String customerId; private String partyUnitId; } diff --git a/epmet-module/epmet-heart/epmet-heart-server/pom.xml b/epmet-module/epmet-heart/epmet-heart-server/pom.xml index 648896a0c9..05ff205836 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/pom.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/pom.xml @@ -88,6 +88,12 @@ 2.0.0 compile + + + com.epmet + epmet-commons-rocketmq + 2.0.0 + @@ -152,6 +158,10 @@ https://oapi.dingtalk.com/robot/send?access_token=e894e5690f9d6a527722974c71548ff6c0fe29bd956589a09e21b16442a35ed4 SECfcc020bdc83bb17a2c00f39977b1fbc409ef4188c7beaea11c5caa90eeaf87fd + + + true + 192.168.1.140:9876;192.168.1.141:9876 @@ -195,6 +205,10 @@ https://oapi.dingtalk.com/robot/send?access_token=e894e5690f9d6a527722974c71548ff6c0fe29bd956589a09e21b16442a35ed4 SECfcc020bdc83bb17a2c00f39977b1fbc409ef4188c7beaea11c5caa90eeaf87fd + + + false + 192.168.1.140:9876;192.168.1.141:9876 @@ -238,6 +252,10 @@ https://oapi.dingtalk.com/robot/send?access_token=e894e5690f9d6a527722974c71548ff6c0fe29bd956589a09e21b16442a35ed4 SECfcc020bdc83bb17a2c00f39977b1fbc409ef4188c7beaea11c5caa90eeaf87fd + + + true + 192.168.10.161:9876 @@ -281,6 +299,10 @@ https://oapi.dingtalk.com/robot/send?access_token=a5f66c3374b1642fe2142dbf56d5997e280172d4e8f2b546c9423a68c82ece6c SEC95f4f40b533ad379ea6a6d1af6dd37029383cfe1b7cd96dfac2678be2c1c3ed1 + + + true + 192.168.11.187:9876;192.168.11.184:9876 diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyUnitController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyUnitController.java index ec06c3bf5f..90c500b87d 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyUnitController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyUnitController.java @@ -17,6 +17,7 @@ package com.epmet.controller; +import com.epmet.commons.rocketmq.messages.CalPartyUnitSatisfactionFormDTO; import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.aop.NoRepeatSubmit; import com.epmet.commons.tools.page.PageData; @@ -150,4 +151,18 @@ public class IcPartyUnitController { public Result importData(@LoginUser TokenDto tokenDto, HttpServletResponse response, @RequestPart("file") MultipartFile file) throws IOException { return icPartyUnitService.importData(tokenDto, response, file); } + + + /** + * 计算区域化党建单位的群众满意度 + * + * @param formDTO + * @return + */ + @PostMapping("cal-partyunit-satisfation") + public Result calPartyUnitSatisfation(@RequestBody CalPartyUnitSatisfactionFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO,CalPartyUnitSatisfactionFormDTO.AddUserInternalGroup.class); + icPartyUnitService.calPartyUnitSatisfation(formDTO); + return new Result(); + } } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/mq/RocketMQConsumerRegister.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/mq/RocketMQConsumerRegister.java new file mode 100644 index 0000000000..3f599eefc0 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/mq/RocketMQConsumerRegister.java @@ -0,0 +1,31 @@ +package com.epmet.mq; + +import com.epmet.commons.rocketmq.constants.ConsomerGroupConstants; +import com.epmet.commons.rocketmq.constants.TopicConstants; +import com.epmet.commons.rocketmq.register.MQAbstractRegister; +import com.epmet.commons.rocketmq.register.MQConsumerProperties; +import com.epmet.mq.listener.PartyUnitSatisfactionCalEventListener; +import org.apache.rocketmq.common.protocol.heartbeat.MessageModel; +import org.springframework.stereotype.Component; + +/** + * @Description 如果rocketmq.enable=true,这里必须实现,且 实例化 + * @author wxz + * @date 2021.07.14 17:13:41 +*/ +@Component +public class RocketMQConsumerRegister extends MQAbstractRegister { + + @Override + public void registerAllListeners(String env, MQConsumerProperties consumerProperties) { + // 客户初始化监听器注册 + register(consumerProperties, + ConsomerGroupConstants.CAL_PARTY_UNIT_SATISFACTION, + MessageModel.CLUSTERING, + TopicConstants.CAL_PARTY_UNIT_SATISFACTION, + "*", + new PartyUnitSatisfactionCalEventListener()); + + // ...其他监听器类似 + } +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/mq/listener/PartyUnitSatisfactionCalEventListener.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/mq/listener/PartyUnitSatisfactionCalEventListener.java new file mode 100644 index 0000000000..b7c3abc938 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/mq/listener/PartyUnitSatisfactionCalEventListener.java @@ -0,0 +1,104 @@ +package com.epmet.mq.listener; + +import com.alibaba.fastjson.JSON; +import com.epmet.commons.rocketmq.constants.MQUserPropertys; +import com.epmet.commons.rocketmq.messages.CalPartyUnitSatisfactionFormDTO; +import com.epmet.commons.tools.distributedlock.DistributedLock; +import com.epmet.commons.tools.exception.ExceptionUtils; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.redis.RedisKeys; +import com.epmet.commons.tools.redis.RedisUtils; +import com.epmet.commons.tools.utils.SpringContextUtils; +import com.epmet.service.IcPartyUnitService; +import org.apache.commons.lang.StringUtils; +import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyContext; +import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyStatus; +import org.apache.rocketmq.client.consumer.listener.MessageListenerConcurrently; +import org.apache.rocketmq.common.message.MessageExt; +import org.redisson.api.RLock; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.List; +import java.util.concurrent.TimeUnit; + +/** + * @Description 计算区域化党建单位,群众满意度=分数相加➗ 需求的总个数。 + * @author wxz + * @date 2021.10.13 15:21:48 +*/ +public class PartyUnitSatisfactionCalEventListener implements MessageListenerConcurrently { + + private Logger logger = LoggerFactory.getLogger(getClass()); + + private RedisUtils redisUtils; + + @Override + public ConsumeConcurrentlyStatus consumeMessage(List msgs, ConsumeConcurrentlyContext context) { + + if (redisUtils == null) { + redisUtils = SpringContextUtils.getBean(RedisUtils.class); + } + + try { + msgs.forEach(msg -> consumeMessage(msg)); + } catch (Exception e) { + logger.error(ExceptionUtils.getErrorStackTrace(e)); + return ConsumeConcurrentlyStatus.RECONSUME_LATER; + } + return ConsumeConcurrentlyStatus.CONSUME_SUCCESS; + } + + private void consumeMessage(MessageExt messageExt) { + // msg即为消息体 + // tags为SystemMessageType.java中的项,为具体的操作,此处拿到tags,判断是创建还是变更,来做响应的后续操作即可 + String msg = new String(messageExt.getBody()); + String topic = messageExt.getTopic(); + String tags = messageExt.getTags(); + String pendingMsgLabel = messageExt.getUserProperty(MQUserPropertys.BLOCKED_MSG_LABEL); + + logger.info("【计算区域化党建单位群众满意度事件监听器】-需求完成-收到消息内容:{},操作:{}", msg, tags); + CalPartyUnitSatisfactionFormDTO obj = JSON.parseObject(msg, CalPartyUnitSatisfactionFormDTO.class); + + DistributedLock distributedLock = null; + RLock lock = null; + try { + distributedLock = SpringContextUtils.getBean(DistributedLock.class); + lock = distributedLock.getLock(String.format("lock:ic_warn_stats:%s", obj.getCustomerId()), + 30L, 30L, TimeUnit.SECONDS); + //待执行方法 + SpringContextUtils.getBean(IcPartyUnitService.class).calPartyUnitSatisfation(obj); + } catch (RenException e) { + // 如果是我们手动抛出的异常,说明在业务可控范围内。目前不需要MQ重试 + logger.error("【计算区域化党建单位群众满意度事件监听器】-MQ失败:".concat(ExceptionUtils.getErrorStackTrace(e))); + } catch (Exception e) { + // 不是我们自己抛出的异常,可以让MQ重试 + logger.error("【计算区域化党建单位群众满意度监听器】-MQ失败:".concat(ExceptionUtils.getErrorStackTrace(e))); + throw e; + } finally { + distributedLock.unLock(lock); + } + + if (StringUtils.isNotBlank(pendingMsgLabel)) { + try { + removePendingMqMsgCache(pendingMsgLabel); + } catch (Exception e) { + logger.error("【计算区域化党建单位群众满意度监听器】-删除mq阻塞消息缓存失败:{}", ExceptionUtils.getErrorStackTrace(e)); + } + } + } + + /** + * @description + * + * @param pendingMsgLabel + * @return + * @author wxz + * @date 2021.10.14 16:32:32 + */ + private void removePendingMqMsgCache(String pendingMsgLabel) { + String key = RedisKeys.blockedMqMsgKey(pendingMsgLabel); + redisUtils.delete(key); + //logger.info("【开放数据事件监听器】删除mq阻塞消息缓存成功,blockedMsgLabel:{}", pendingMsgLabel); + } +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPartyUnitService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPartyUnitService.java index 8106d724fe..b303cab184 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPartyUnitService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPartyUnitService.java @@ -18,6 +18,7 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.rocketmq.messages.CalPartyUnitSatisfactionFormDTO; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; @@ -120,4 +121,10 @@ public interface IcPartyUnitService extends BaseService { * @Date 2021/11/29 11:01 */ Result importData(TokenDto tokenDto, HttpServletResponse response, MultipartFile file) throws IOException; + + /** + * 计算区域化党建单位的群众满意度 + * @param formDTO + */ + void calPartyUnitSatisfation(CalPartyUnitSatisfactionFormDTO formDTO); } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java index 4931389ae0..78625590df 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java @@ -18,9 +18,11 @@ package com.epmet.service.impl; import cn.afterturn.easypoi.excel.entity.result.ExcelImportResult; +import com.alibaba.fastjson.JSON; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.rocketmq.messages.CalPartyUnitSatisfactionFormDTO; import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.StrConstant; @@ -370,6 +372,19 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl map, String matter) { List matters = Arrays.asList(matter.split(StrConstant.COLON)); List list = matters.stream().map(map::get).collect(Collectors.toList()); 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 cc318638b6..eec0f484eb 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 @@ -20,6 +20,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; +import com.epmet.commons.rocketmq.messages.CalPartyUnitSatisfactionFormDTO; import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.StrConstant; @@ -32,6 +33,7 @@ import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.redis.common.CustomerStaffRedis; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; +import com.epmet.constant.SystemMessageType; import com.epmet.constant.UserDemandConstant; import com.epmet.dao.IcUserDemandOperateLogDao; import com.epmet.dao.IcUserDemandRecDao; @@ -40,6 +42,7 @@ import com.epmet.dao.IcUserDemandServiceDao; import com.epmet.dto.CustomerGridDTO; import com.epmet.dto.IcUserDemandRecDTO; import com.epmet.dto.form.CustomerGridFormDTO; +import com.epmet.dto.form.SystemMsgFormDTO; import com.epmet.dto.form.demand.*; import com.epmet.dto.result.AllGridsByUserIdResultDTO; import com.epmet.dto.result.UserBaseInfoResultDTO; @@ -47,6 +50,7 @@ import com.epmet.dto.result.demand.DemandRecResultDTO; import com.epmet.dto.result.demand.IcResiUserReportDemandRes; import com.epmet.entity.*; import com.epmet.feign.EpmetAdminOpenFeignClient; +import com.epmet.feign.EpmetMessageOpenFeignClient; import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.feign.GovOrgOpenFeignClient; import com.epmet.service.IcResiDemandDictService; @@ -86,6 +90,8 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl page(Map params) { @@ -455,6 +461,18 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl Date: Mon, 13 Dec 2021 08:51:04 +0800 Subject: [PATCH 24/71] =?UTF-8?q?=E9=9C=80=E6=B1=82=E7=A0=94=E5=88=A4?= =?UTF-8?q?=E5=88=86=E6=9E=90=E8=BF=94=E5=8F=82=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/dto/result/demand/DemandDataDTO.java | 13 +++++++++++++ .../demand/DemandResearchAnalysisResultDTO.java | 3 +-- .../service/impl/IcUserDemandRecServiceImpl.java | 11 ++++++++++- 3 files changed, 24 insertions(+), 3 deletions(-) create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandDataDTO.java diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandDataDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandDataDTO.java new file mode 100644 index 0000000000..f5ca265feb --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandDataDTO.java @@ -0,0 +1,13 @@ +package com.epmet.dto.result.demand; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +@Data +public class DemandDataDTO implements Serializable { + private String firstCategoryCode; + private String firstCategoryName; + private List demandList; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandResearchAnalysisResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandResearchAnalysisResultDTO.java index b8d6dae615..32f0737dc6 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandResearchAnalysisResultDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandResearchAnalysisResultDTO.java @@ -20,8 +20,7 @@ public class DemandResearchAnalysisResultDTO implements Serializable { private String houseId; private List houseUserList; - - private List demandList; + private List demandData; /** * 入参中给的,再返回去 */ 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 8446c84103..152f147f5f 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 @@ -574,6 +574,15 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl demandData=new ArrayList<>(); + DemandDataDTO demandDataDTO=new DemandDataDTO(); + demandDataDTO.setFirstCategoryCode(formDTO.getFirstCategoryCode()); + demandDataDTO.setFirstCategoryName(demandDictService.getCategoryName(formDTO.getCustomerId(),formDTO.getFirstCategoryCode())); + demandDataDTO.setDemandList(new ArrayList<>()); + demandData.add(demandDataDTO); + //获取当前需求人,相同分类的需求列表。不分页,直接返回所有 List userIds=new ArrayList<>(); userIds.add(formDTO.getIcResiUserId()); @@ -604,7 +613,7 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl Date: Mon, 13 Dec 2021 09:29:15 +0800 Subject: [PATCH 25/71] =?UTF-8?q?=E7=BB=84=E7=BB=87=E4=B8=8B=E7=BD=91?= =?UTF-8?q?=E6=A0=BC=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/dto/result/AgencyGridList.java | 12 +++++++++ .../com/epmet/dto/result/AgencyResultDTO.java | 21 +++++++-------- .../controller/CustomerGridController.java | 10 +++++++ .../epmet/service/CustomerGridService.java | 6 +++++ .../service/impl/CustomerGridServiceImpl.java | 12 +++++++-- .../resources/mapper/CustomerAgencyDao.xml | 26 +++++++++++++++---- .../main/resources/mapper/CustomerGridDao.xml | 22 ++++++++++++++-- 7 files changed, 89 insertions(+), 20 deletions(-) diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyGridList.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyGridList.java index ad2c907fd5..ce787e045d 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyGridList.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyGridList.java @@ -40,5 +40,17 @@ public class AgencyGridList implements Serializable { * 机关-网格名称 */ private String agencyGridName = ""; + /** + * 网格名称 + */ + private String gridName = ""; + /** + * 网格经度【网格没有经纬度时获取客户根组织下的】 + */ + private String longitude = ""; + /** + * 网格维度【网格没有经纬度时获取客户根组织下的】 + */ + private String latitude = ""; } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyResultDTO.java index 808e25d791..a7aec4fa28 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyResultDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyResultDTO.java @@ -30,23 +30,22 @@ import java.io.Serializable; */ @Data public class AgencyResultDTO implements Serializable { - private static final long serialVersionUID = 1L; - /** - * 机关组织Id - */ + //机关组织Id private String agencyId = ""; - /** - * 机关组织名称 - */ + //机关组织名称 private String agencyName = ""; - + //上级组织id private String pid; + //组织级别 private String level; - /** - * 所有上级组织机构ID(以英文:隔开) - */ + //所有上级组织机构ID(以英文:隔开) @JsonIgnore private String pids = ""; + //经度【没值则取跟客户的值】 + private String longitude; + //维度【没值则取跟客户的值】 + private String latitude; + } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridController.java index 0b58b4d6f0..9528ff6704 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridController.java @@ -309,4 +309,14 @@ public class CustomerGridController { List resultDTOS = customerGridService.getGridIListByAgency(agencyId); return new Result>().ok(resultDTOS); } + + /** + * @Author sun + * @Description 查询组织直属网格列表 + **/ + @PostMapping("getGridIListByAgency/{agencyId}") + public Result> gridListByAgencyId(@PathVariable("agencyId") String agencyId) { + return new Result>().ok(customerGridService.gridListByAgencyId(agencyId)); + } + } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java index d6ac66d201..2b2624ac54 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java @@ -348,4 +348,10 @@ public interface CustomerGridService extends BaseService { * @Date 2021/11/29 17:00 */ List getGridIListByAgency(String agencyId); + + /** + * @Author sun + * @Description 查询组织直属网格列表 + **/ + List gridListByAgencyId(String agencyId); } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java index 9b6f41daad..b09d46e52b 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java @@ -22,7 +22,6 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; -import com.epmet.commons.rocketmq.messages.OrgOrStaffMQMsg; import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.StrConstant; @@ -47,7 +46,6 @@ import com.epmet.entity.CustomerGridEntity; import com.epmet.feign.EpmetMessageOpenFeignClient; import com.epmet.feign.EpmetUserFeignClient; import com.epmet.feign.OperCrmOpenFeignClient; -import com.epmet.send.SendMqMsgUtil; import com.epmet.service.CustomerAgencyService; import com.epmet.service.CustomerGridService; import com.epmet.util.ModuleConstant; @@ -866,4 +864,14 @@ public class CustomerGridServiceImpl extends BaseServiceImpl gridListByAgencyId(String agencyId) { + List result = baseDao.selectAgencyGridMsgList(agencyId); + return result; + } + } diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml index f35fe34fed..88ad6386d6 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml @@ -340,11 +340,27 @@ SELECT - cg.id AS "gridId", + cg.id gridId, CONCAT( ca.organization_name, "-", cg.grid_name - ) "agencyGridName" + ) agencyGridName, + cg.grid_name gridName, + + ( CASE WHEN cg.longitude is null THEN + ( SELECT longitude FROM customer_agency + WHERE del_flag = '0' AND customer_id = (SELECT customer_id FROM customer_agency WHERE id = ca.id) + ORDER BY pid ASC LIMIT 1 + ) + ELSE cg.longitude + END + ) longitude, + ( CASE WHEN cg.latitude is null THEN + ( SELECT latitude FROM customer_agency + WHERE del_flag = '0' AND customer_id = (SELECT customer_id FROM customer_agency WHERE id = ca.id) + ORDER BY pid ASC LIMIT 1 + ) + ELSE cg.latitude + END + ) latitude FROM customer_grid cg INNER JOIN customer_agency ca ON cg.pid = ca.id From 790862321312e5ff0b57b99679552780704464bb Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Mon, 13 Dec 2021 09:33:27 +0800 Subject: [PATCH 26/71] =?UTF-8?q?=E5=8C=BA=E5=9F=9F=E5=8C=96=E5=85=9A?= =?UTF-8?q?=E5=BB=BA=E5=8D=95=E4=BD=8D=E7=BE=A4=E4=BC=97=E6=BB=A1=E6=84=8F?= =?UTF-8?q?=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/result/demand/ServiceStatDTO.java | 23 +++++++++++++++++++ .../java/com/epmet/dao/IcPartyUnitDao.java | 3 +++ .../com/epmet/dao/IcUserDemandRecDao.java | 3 +++ .../epmet/service/IcUserDemandRecService.java | 10 ++++++++ .../service/impl/IcPartyUnitServiceImpl.java | 19 +++++++++++---- .../impl/IcUserDemandRecServiceImpl.java | 19 +++++++++++---- .../main/resources/mapper/IcPartyUnitDao.xml | 6 +++++ .../resources/mapper/IcUserDemandRecDao.xml | 22 ++++++++++++++++++ 8 files changed, 96 insertions(+), 9 deletions(-) create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/ServiceStatDTO.java diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/ServiceStatDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/ServiceStatDTO.java new file mode 100644 index 0000000000..2393e942d6 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/ServiceStatDTO.java @@ -0,0 +1,23 @@ +package com.epmet.dto.result.demand; + + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +@Data +public class ServiceStatDTO implements Serializable { + /** + * 服务方id + */ + private String serverId; + /** + * 总分 + */ + private BigDecimal totalScore; + /** + * 服务的需求个数 + */ + private Integer demandCount; +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPartyUnitDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPartyUnitDao.java index caf1f6336c..4efaff7d84 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPartyUnitDao.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPartyUnitDao.java @@ -23,6 +23,7 @@ import com.epmet.entity.IcPartyUnitEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; +import java.math.BigDecimal; import java.util.List; /** @@ -43,4 +44,6 @@ public interface IcPartyUnitDao extends BaseDao { List selectListByAgencyId(@Param("agencyIds") List agencyIds, @Param("unitName") String unitName, @Param("customerId")String customerId); + + int updateSatisfaction(@Param("partyUnitId") String serverId, @Param("satisfaction") BigDecimal satisfaction); } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcUserDemandRecDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcUserDemandRecDao.java index a06f831778..3089b64be9 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcUserDemandRecDao.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcUserDemandRecDao.java @@ -22,6 +22,7 @@ import com.epmet.dto.form.demand.IcResiUserDemandFromDTO; import com.epmet.dto.form.demand.UserDemandPageFormDTO; import com.epmet.dto.result.demand.DemandRecResultDTO; import com.epmet.dto.result.demand.IcResiUserReportDemandRes; +import com.epmet.dto.result.demand.ServiceStatDTO; import com.epmet.entity.IcUserDemandRecEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -56,4 +57,6 @@ public interface IcUserDemandRecDao extends BaseDao { * @return */ DemandRecResultDTO selectDemandRecDetail(@Param("customerId") String customerId, @Param("demandRecId") String demandRecId); + + List selectGroupByPartyUnit(@Param("customerId") String customerId, @Param("partyUnitId") String partyUnitId); } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcUserDemandRecService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcUserDemandRecService.java index e3b719615e..0ed62b84be 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcUserDemandRecService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcUserDemandRecService.java @@ -23,6 +23,7 @@ import com.epmet.dto.IcUserDemandRecDTO; import com.epmet.dto.form.demand.*; import com.epmet.dto.result.demand.DemandRecResultDTO; import com.epmet.dto.result.demand.IcResiUserReportDemandRes; +import com.epmet.dto.result.demand.ServiceStatDTO; import com.epmet.entity.IcUserDemandRecEntity; import java.util.List; @@ -144,4 +145,13 @@ public interface IcUserDemandRecService extends BaseService groupByPartyUnit(String customerId, String partyUnitId); } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java index 78625590df..7e2f697833 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java @@ -43,6 +43,7 @@ import com.epmet.dto.form.PartyUnitFormDTO; import com.epmet.dto.form.demand.ServiceQueryFormDTO; import com.epmet.dto.form.demand.SubCodeFormDTO; import com.epmet.dto.result.demand.OptionDTO; +import com.epmet.dto.result.demand.ServiceStatDTO; import com.epmet.entity.IcPartyUnitEntity; import com.epmet.excel.IcPartyUnitImportExcel; import com.epmet.feign.EpmetAdminOpenFeignClient; @@ -61,6 +62,7 @@ import org.springframework.web.multipart.MultipartFile; import javax.annotation.Resource; import javax.servlet.http.HttpServletResponse; import java.io.IOException; +import java.math.BigDecimal; import java.util.*; import java.util.stream.Collectors; @@ -108,6 +110,9 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl()); } + if(StringUtils.isBlank(item.getSatisfaction())){ + item.setSatisfaction(StrConstant.HYPHEN); + } }); PageInfo pageInfo = new PageInfo<>(dtoList); return new PageData<>(dtoList, pageInfo.getTotal()); @@ -374,15 +379,19 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl list = icUserDemandRecService.groupByPartyUnit(formDTO.getCustomerId(), formDTO.getPartyUnitId()); + for (ServiceStatDTO serviceStatDTO : list) { + if (0 != serviceStatDTO.getDemandCount()) { + BigDecimal result = serviceStatDTO.getTotalScore().divide(new BigDecimal(serviceStatDTO.getDemandCount()), 4, BigDecimal.ROUND_HALF_UP); + baseDao.updateSatisfaction(serviceStatDTO.getServerId(),result); + } + } } private String getServiceMatter(Map map, String matter) { 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 eec0f484eb..7f55c2ecfd 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 @@ -48,6 +48,7 @@ import com.epmet.dto.result.AllGridsByUserIdResultDTO; import com.epmet.dto.result.UserBaseInfoResultDTO; import com.epmet.dto.result.demand.DemandRecResultDTO; import com.epmet.dto.result.demand.IcResiUserReportDemandRes; +import com.epmet.dto.result.demand.ServiceStatDTO; import com.epmet.entity.*; import com.epmet.feign.EpmetAdminOpenFeignClient; import com.epmet.feign.EpmetMessageOpenFeignClient; @@ -569,10 +570,20 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl groupByPartyUnit(String customerId, String partyUnitId) { + if(StringUtils.isBlank(customerId)&&StringUtils.isBlank(partyUnitId)){ + return new ArrayList<>(); + } + return baseDao.selectGroupByPartyUnit(customerId,partyUnitId); + } } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPartyUnitDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPartyUnitDao.xml index a346765fd8..024b33adf6 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPartyUnitDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPartyUnitDao.xml @@ -46,4 +46,10 @@ + + update ic_party_unit + set SATISFACTION=#{satisfaction},UPDATED_TIME=NOW() + where del_flag='0' + and id=#{partyUnitId} + \ No newline at end of file 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 33d491e2b4..f352685356 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 @@ -195,4 +195,26 @@ AND r.CUSTOMER_ID = #{customerId} and r.id=#{demandRecId} + + + \ No newline at end of file From 4cbfd6f1a765f801ccd514ff603a3c479c0f39f0 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Mon, 13 Dec 2021 09:35:37 +0800 Subject: [PATCH 27/71] wangle fuzhi --- .../java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java | 1 + 1 file changed, 1 insertion(+) 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 152f147f5f..9e1dcdd59d 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 @@ -615,6 +615,7 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl Date: Mon, 13 Dec 2021 09:45:09 +0800 Subject: [PATCH 28/71] =?UTF-8?q?=E6=96=B0=E5=A2=9E=EF=BC=9A=201.=E5=BF=97?= =?UTF-8?q?=E6=84=BF=E8=80=85=E5=9D=90=E6=A0=87=E5=88=86=E5=B8=83=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1=E5=AE=9A=E6=97=B6=E4=BB=BB=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../feign/DataStatisticalOpenFeignClient.java | 12 ++++++++++ ...ataStatisticalOpenFeignClientFallBack.java | 5 ++++ .../java/com/epmet/task/StatsDemandTask.java | 23 +++++++++++++++++++ 3 files changed, 40 insertions(+) create mode 100644 epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/StatsDemandTask.java diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/DataStatisticalOpenFeignClient.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/DataStatisticalOpenFeignClient.java index 047a16e87b..dab2edf301 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/DataStatisticalOpenFeignClient.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/DataStatisticalOpenFeignClient.java @@ -25,6 +25,7 @@ import com.epmet.feign.impl.DataStatisticalOpenFeignClientFallBackFactory; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestParam; import java.util.List; @@ -341,4 +342,15 @@ public interface DataStatisticalOpenFeignClient { */ @PostMapping("/data/stats/datareporting/eventinfo") Result> getEventInfo(@RequestBody EventInfoFormDTO formDTO); + + /** + * wangxianzhang + * + * 计算客户下志愿者服务相关数据 + * + * @param customerId 客户ID,可以为空,为空则计算所有客户 + * @return + */ + @PostMapping("/data/stats/demand/volunteer/daily") + Result statsVolunteerDemandServicesDaily(@RequestParam(value = "customer-id", required = false) String customerId); } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/DataStatisticalOpenFeignClientFallBack.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/DataStatisticalOpenFeignClientFallBack.java index 43638c894e..56fea9c03f 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/DataStatisticalOpenFeignClientFallBack.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/DataStatisticalOpenFeignClientFallBack.java @@ -334,4 +334,9 @@ public class DataStatisticalOpenFeignClientFallBack implements DataStatisticalOp public Result> getEventInfo(EventInfoFormDTO formDTO) { return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "getEventInfo", formDTO); } + + @Override + public Result statsVolunteerDemandServicesDaily(String customerId) { + return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "statsVolunteerDemandServicesDaily", customerId); + } } diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/StatsDemandTask.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/StatsDemandTask.java new file mode 100644 index 0000000000..81c0be1c3b --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/StatsDemandTask.java @@ -0,0 +1,23 @@ +package com.epmet.task; + +import com.epmet.feign.DataStatisticalOpenFeignClient; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * @Description + * @Author wangxianzhang + * @Date 2021/12/13 9:40 上午 + * @Version 1.0 + */ +@Component("statsDemandTask") +public class StatsDemandTask implements ITask { + + @Autowired + private DataStatisticalOpenFeignClient dataStatisticalOpenFeignClient; + + @Override + public void run(String params) { + dataStatisticalOpenFeignClient.statsVolunteerDemandServicesDaily(null); + } +} From d97ffae9bc771b4f8496bc46e8b7844459d34333 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Mon, 13 Dec 2021 10:01:10 +0800 Subject: [PATCH 29/71] =?UTF-8?q?=E7=9B=B4=E5=B1=9E=E4=B8=8B=E7=BA=A7?= =?UTF-8?q?=E7=BB=84=E7=BB=87=E5=8A=A0=E7=BB=8F=E7=BA=AC=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/dto/result/AgencySubResultDTO.java | 12 +++++++ .../controller/CustomerGridController.java | 2 +- .../resources/mapper/CustomerAgencyDao.xml | 31 ++++++++++++++----- 3 files changed, 37 insertions(+), 8 deletions(-) diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencySubResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencySubResultDTO.java index 117976dee8..08bd0683b1 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencySubResultDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencySubResultDTO.java @@ -49,4 +49,16 @@ public class AgencySubResultDTO implements Serializable { * 当前组织的所有上级组织Id */ private String pids = ""; + /** + * 组织级别 + */ + private String level = ""; + /** + * 组织经度【没值取根组织的值】 + */ + private String longitude = ""; + /** + * 组织维度【没值取根组织的值】 + */ + private String latitude = ""; } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridController.java index 9528ff6704..8422de2c41 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridController.java @@ -314,7 +314,7 @@ public class CustomerGridController { * @Author sun * @Description 查询组织直属网格列表 **/ - @PostMapping("getGridIListByAgency/{agencyId}") + @PostMapping("getgridilistbyagency/{agencyId}") public Result> gridListByAgencyId(@PathVariable("agencyId") String agencyId) { return new Result>().ok(customerGridService.gridListByAgencyId(agencyId)); } diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml index 88ad6386d6..f5bca602f9 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml @@ -178,13 +178,30 @@ - SELECT COUNT(issueId) AS count,categoryCode,categoryName,colour FROM + SELECT COUNT(issueId) AS count,categoryCode,categoryName,color FROM (SELECT i.ID AS issueId, IFNULL(LEFT(ic.CATEGORY_CODE,#{length}),'') AS categoryCode, IFNULL(cd.CATEGORY_NAME,'其他') AS categoryName, - IFNULL(cd.colour,'#0091ed') AS colour + IFNULL(cd.color,'#0091ed') AS color FROM issue i LEFT JOIN issue_vote_statistical s ON (s.ISSUE_ID = i.ID AND s.DEL_FLAG = '0') LEFT JOIN issue_category ic ON (ic.ISSUE_ID = i.ID AND ic.DEL_FLAG = '0' AND ic.CUSTOMER_ID = i.CUSTOMER_ID) diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueProjectCategoryDictDao.xml b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueProjectCategoryDictDao.xml index 7730d467f4..2188bf2ea5 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueProjectCategoryDictDao.xml +++ b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueProjectCategoryDictDao.xml @@ -251,7 +251,7 @@ CATEGORY_CODE, CATEGORY_NAME, LENGTH(CATEGORY_CODE) AS codeLength, - IFNULL(colour,'') AS colour + IFNULL(color,'') AS colour FROM issue_project_category_dict WHERE DEL_FLAG = 0 AND CUSTOMER_ID = #{customerId} From ffb4ce8b7a1141b6b329d6cf7b8df939046cae54 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Mon, 13 Dec 2021 12:05:35 +0800 Subject: [PATCH 34/71] =?UTF-8?q?=E6=97=A7=E6=8E=A5=E5=8F=A3=E5=8A=A0?= =?UTF-8?q?=E8=BF=94=E5=8F=82=20=E7=BB=84=E7=BB=87=E7=BD=91=E6=A0=BC?= =?UTF-8?q?=E8=BF=94=E7=BB=8F=E7=BA=AC=E5=BA=A6=20=E6=B2=A1=E5=80=BC?= =?UTF-8?q?=E5=B0=B1=E5=8F=96=E6=A0=B9=E7=BB=84=E7=BB=87=E7=9A=84=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/dto/result/AgencyTreeResultDTO.java | 4 ++ .../epmet/dto/result/ExtGridResultDTO.java | 4 ++ .../result/ExtStaffPermissionResultDTO.java | 4 ++ .../impl/CustomerAgencyServiceImpl.java | 6 ++ .../resources/mapper/CustomerAgencyDao.xml | 59 ++++++++++++++++++- 5 files changed, 74 insertions(+), 3 deletions(-) diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyTreeResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyTreeResultDTO.java index 3afae3011a..d436feb7c3 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyTreeResultDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyTreeResultDTO.java @@ -26,6 +26,10 @@ public class AgencyTreeResultDTO implements Serializable { private String pid; private String level; + //经度【没值则取跟客户的值】 + private String longitude; + //维度【没值则取跟客户的值】 + private String latitude; /** * 下级机关组织 */ diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ExtGridResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ExtGridResultDTO.java index 90641f29d4..5040a89fde 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ExtGridResultDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ExtGridResultDTO.java @@ -28,4 +28,8 @@ public class ExtGridResultDTO implements Serializable { * 当前gridId所属的客户id add02.03 * */ private String customerId; + //经度【没值则取跟客户的值】 + private String longitude; + //维度【没值则取跟客户的值】 + private String latitude; } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ExtStaffPermissionResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ExtStaffPermissionResultDTO.java index fbaf784c25..1621261359 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ExtStaffPermissionResultDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ExtStaffPermissionResultDTO.java @@ -50,4 +50,8 @@ public class ExtStaffPermissionResultDTO implements Serializable { * 当前agencyId所属的客户id add02.03 * */ private String customerId; + //经度【没值则取跟客户的值】 + private String longitude; + //维度【没值则取跟客户的值】 + private String latitude; } 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 de90539444..af54282dbf 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 @@ -1119,6 +1119,8 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl()); @@ -1153,6 +1157,8 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl()); } diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml index f5bca602f9..eeca702112 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml @@ -275,11 +275,15 @@ + + + + @@ -310,7 +314,23 @@ agency.ID AS agencyId, agency.ORGANIZATION_NAME AS agencyName, agency.LEVEL AS level, - agency.CUSTOMER_ID as customerId + agency.CUSTOMER_ID as customerId, + ( CASE WHEN agency.longitude is null THEN + ( SELECT longitude FROM customer_agency + WHERE del_flag = '0' AND customer_id = (SELECT customer_id FROM customer_agency WHERE id = agency.id) + ORDER BY pid ASC LIMIT 1 + ) + ELSE agency.longitude + END + ) longitude, + ( CASE WHEN agency.latitude is null THEN + ( SELECT latitude FROM customer_agency + WHERE del_flag = '0' AND customer_id = (SELECT customer_id FROM customer_agency WHERE id = agency.id) + ORDER BY pid ASC LIMIT 1 + ) + ELSE agency.latitude + END + ) latitude FROM CUSTOMER_AGENCY agency WHERE @@ -334,9 +354,26 @@ SELECT cg.id AS gridId, cg.GRID_NAME AS gridName, - cg.CUSTOMER_ID AS customerId + cg.CUSTOMER_ID AS customerId, + ( CASE WHEN ca.longitude is null THEN + ( SELECT longitude FROM customer_agency + WHERE del_flag = '0' AND customer_id = (SELECT customer_id FROM customer_agency WHERE id = ca.id) + ORDER BY pid ASC LIMIT 1 + ) + ELSE ca.longitude + END + ) longitude, + ( CASE WHEN ca.latitude is null THEN + ( SELECT latitude FROM customer_agency + WHERE del_flag = '0' AND customer_id = (SELECT customer_id FROM customer_agency WHERE id = ca.id) + ORDER BY pid ASC LIMIT 1 + ) + ELSE ca.latitude + END + ) latitude FROM customer_grid cg + INNER JOIN customer_agency ca ON cg.PID = ca.ID WHERE cg.DEL_FLAG = '0' AND cg.PID =#{agencyId} @@ -347,7 +384,23 @@ agency.ID AS agencyId, agency.ORGANIZATION_NAME AS agencyName, agency.LEVEL AS level, - agency.CUSTOMER_ID as customerId + agency.CUSTOMER_ID as customerId, + ( CASE WHEN agency.longitude is null THEN + ( SELECT longitude FROM customer_agency + WHERE del_flag = '0' AND customer_id = (SELECT customer_id FROM customer_agency WHERE id = agency.id) + ORDER BY pid ASC LIMIT 1 + ) + ELSE agency.longitude + END + ) longitude, + ( CASE WHEN agency.latitude is null THEN + ( SELECT latitude FROM customer_agency + WHERE del_flag = '0' AND customer_id = (SELECT customer_id FROM customer_agency WHERE id = agency.id) + ORDER BY pid ASC LIMIT 1 + ) + ELSE agency.latitude + END + ) latitude FROM CUSTOMER_AGENCY agency WHERE From 2f6a52def7c4aa172a28115bab4559100c869202 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Mon, 13 Dec 2021 13:35:29 +0800 Subject: [PATCH 35/71] =?UTF-8?q?=E5=8C=BA=E5=9F=9F=E5=8C=96=E5=85=9A?= =?UTF-8?q?=E5=BB=BA=E5=8D=95=E4=BD=8D=E6=BB=A1=E6=84=8F=E5=BA=A6=EF=BC=8C?= =?UTF-8?q?=E5=9B=9B=E8=88=8D=E4=BA=94=E5=85=A5=E4=BF=9D=E7=95=99=E4=B8=A4?= =?UTF-8?q?=E4=BD=8D=E5=B0=8F=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/service/impl/IcPartyUnitServiceImpl.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java index 7e2f697833..5b49e3a276 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java @@ -112,6 +112,8 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl pageInfo = new PageInfo<>(dtoList); From 76375c3c7880a47f1442c067cd7dba0b8181a96f Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Mon, 13 Dec 2021 13:41:31 +0800 Subject: [PATCH 36/71] =?UTF-8?q?=E8=8D=89=E4=BB=96=E5=A6=88=E7=9A=84?= =?UTF-8?q?=E9=83=BD=E8=A6=81=E6=9C=8D=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/govproject/result/ProjectStatusListResultDTO.java | 2 +- .../src/main/resources/mapper/govproject/ProjectDao.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/result/ProjectStatusListResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/result/ProjectStatusListResultDTO.java index 81ef72e7b0..bf74adac49 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/result/ProjectStatusListResultDTO.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/result/ProjectStatusListResultDTO.java @@ -23,7 +23,7 @@ public class ProjectStatusListResultDTO implements Serializable { //经度 private String longitude; //纬度 - private String dimension; + private String latitude; //项目标题 private String title; diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govproject/ProjectDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govproject/ProjectDao.xml index 29ccb588ad..0282677e40 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govproject/ProjectDao.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govproject/ProjectDao.xml @@ -163,7 +163,7 @@ origin origin, `status` status, locate_longitude longitude, - locate_dimension dimension, + locate_dimension latitude, title title FROM project From 9268b781f8a3f51962a2de1912f2f8af17cdf77c Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Mon, 13 Dec 2021 14:18:00 +0800 Subject: [PATCH 37/71] =?UTF-8?q?=E5=8A=A0=E4=BA=86=E4=B8=AAorgLevel?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/dto/result/AgencyTreeResultDTO.java | 5 +++++ .../com/epmet/service/impl/CustomerAgencyServiceImpl.java | 3 +++ 2 files changed, 8 insertions(+) diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyTreeResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyTreeResultDTO.java index d436feb7c3..a11739f0a0 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyTreeResultDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyTreeResultDTO.java @@ -30,6 +30,11 @@ public class AgencyTreeResultDTO implements Serializable { private String longitude; //维度【没值则取跟客户的值】 private String latitude; + + /** + * 前端level跟及联组件字段名一样,被覆盖,所以加了个一样的 + */ + private String orgLevel; /** * 下级机关组织 */ 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 af54282dbf..df0330fca5 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 @@ -1119,6 +1119,7 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl()); @@ -1156,6 +1158,7 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl Date: Mon, 13 Dec 2021 14:32:36 +0800 Subject: [PATCH 38/71] =?UTF-8?q?=E9=9C=80=E6=B1=82=E5=88=86=E7=B1=BB?= =?UTF-8?q?=E6=94=B9=E4=B8=AA=E6=8E=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/IcResiDemandDictDao.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcResiDemandDictDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcResiDemandDictDao.xml index be50e98601..d9d79ecaec 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcResiDemandDictDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcResiDemandDictDao.xml @@ -141,7 +141,7 @@ AND m.CATEGORY_CODE =#{firstCategoryCode} ORDER BY - m.CREATED_TIME DESC + m.CREATED_TIME DESC,m.sort desc @@ -163,7 +163,7 @@ AND m.CUSTOMER_ID = #{customerId} AND m.PARENT_CODE = #{parentCode} ORDER BY - m.CREATED_TIME DESC + m.CREATED_TIME DESC,m.sort desc From e901deaff604606824384b472a91a1b13b2e837a Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Mon, 13 Dec 2021 14:45:55 +0800 Subject: [PATCH 39/71] =?UTF-8?q?=E5=8A=A0=E4=BA=86=E4=B8=AAorgLevel?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/dto/result/AgencyTreeResultDTO.java | 2 +- .../com/epmet/service/impl/CustomerAgencyServiceImpl.java | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyTreeResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyTreeResultDTO.java index a11739f0a0..4d48b54960 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyTreeResultDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyTreeResultDTO.java @@ -32,7 +32,7 @@ public class AgencyTreeResultDTO implements Serializable { private String latitude; /** - * 前端level跟及联组件字段名一样,被覆盖,所以加了个一样的 + * orgId-orgLevel */ private String orgLevel; /** 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 df0330fca5..f70fdd035a 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 @@ -1119,7 +1119,7 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl()); @@ -1158,7 +1158,7 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl Date: Mon, 13 Dec 2021 15:19:59 +0800 Subject: [PATCH 40/71] total --- .../src/main/java/com/epmet/service/impl/IssueServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java index 4a2b4821e2..6835ce4b4b 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java @@ -1602,7 +1602,7 @@ public class IssueServiceImpl extends BaseServiceImpl imp throw new EpmetException("查询人员姓名失败..."); } // 默认最多50 产品要求 - Integer total = Integer.valueOf(String.valueOf(pageInfo.getTotal())); + Integer total = pageInfo.getSize(); result.setTotal(total > NumConstant.FIFTY ? NumConstant.FIFTY : total); // 赋值展示名字 list.forEach(l -> { From 08ed2cefce3a4d477b36f218210040276ab5d12c Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Mon, 13 Dec 2021 15:36:22 +0800 Subject: [PATCH 41/71] warn --- .../main/java/com/epmet/service/impl/IcBuildingServiceImpl.java | 2 +- .../java/com/epmet/service/impl/IcBuildingUnitServiceImpl.java | 2 +- .../main/java/com/epmet/service/impl/IcHouseServiceImpl.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcBuildingServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcBuildingServiceImpl.java index c1d5c440e3..ea85e2ce33 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcBuildingServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcBuildingServiceImpl.java @@ -115,7 +115,7 @@ public class IcBuildingServiceImpl extends BaseServiceImpl getBuildingOptions(String neighborHoodId) { if (StringUtils.isBlank(neighborHoodId)) { - log.error("小区ID为空"); + log.warn("小区ID为空"); return Collections.emptyList(); } LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcBuildingUnitServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcBuildingUnitServiceImpl.java index 2a4a325856..4b8cb1f094 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcBuildingUnitServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcBuildingUnitServiceImpl.java @@ -115,7 +115,7 @@ public class IcBuildingUnitServiceImpl extends BaseServiceImpl getUnitOptions(String buildingId) { if (StringUtils.isBlank(buildingId)) { - log.error("楼栋ID为空"); + log.warn("楼栋ID为空"); return Collections.emptyList(); } LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcHouseServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcHouseServiceImpl.java index 914bc68a56..b6d0585694 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcHouseServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcHouseServiceImpl.java @@ -127,7 +127,7 @@ public class IcHouseServiceImpl extends BaseServiceImpl getHouseOption(HouseFormDTO formDTO) { if (StringUtils.isBlank(formDTO.getBuildingId()) && StringUtils.isBlank(formDTO.getUnitId())) { - log.error("楼栋和单元ID为空"); + log.warn("楼栋和单元ID为空"); return Collections.emptyList(); } LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); From 9616152d18c8218dd66d510dfc6457ffaeaec35e Mon Sep 17 00:00:00 2001 From: wangxianzhang Date: Mon, 13 Dec 2021 15:43:02 +0800 Subject: [PATCH 42/71] =?UTF-8?q?=E4=BF=AE=E6=94=B9=EF=BC=9A=201.=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E5=BF=97=E6=84=BF=E8=80=85=E5=88=86=E5=B8=83=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1=E4=BB=BB=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/heart/HeartVolunteerService.java | 2 +- .../heart/impl/HeartVolunteerServiceImpl.java | 12 ++-- .../epmet/service/impl/DemandServiceImpl.java | 59 ++++++++----------- 3 files changed, 31 insertions(+), 42 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/HeartVolunteerService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/HeartVolunteerService.java index abccaae1e6..b8e4414f60 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/HeartVolunteerService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/HeartVolunteerService.java @@ -11,5 +11,5 @@ import java.util.List; *@Date 2021/12/8 */ public interface HeartVolunteerService { - List listVolunteersPage(String customerId, Date endCreateTime, Integer pageNum, Integer pageSize); + List listVolunteers(String customerId, Date endCreateTime); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/impl/HeartVolunteerServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/impl/HeartVolunteerServiceImpl.java index c95fd094fe..d9a931072b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/impl/HeartVolunteerServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/impl/HeartVolunteerServiceImpl.java @@ -29,12 +29,10 @@ public class HeartVolunteerServiceImpl implements HeartVolunteerService { private VolunteerInfoDao volunteerInfoDao; @Override - public List listVolunteersPage(String customerId, Date endCreateTime, Integer pageNum, Integer pageSize) { - return PageHelper.startPage(pageNum, pageSize).doSelectPage(() -> { - LambdaQueryWrapper query = new LambdaQueryWrapper<>(); - query.eq(VolunteerInfoEntity::getCustomerId, customerId); - query.lt(VolunteerInfoEntity::getCreatedTime, endCreateTime); - volunteerInfoDao.selectList(query); - }); + public List listVolunteers(String customerId, Date endCreateTime) { + LambdaQueryWrapper query = new LambdaQueryWrapper<>(); + query.eq(VolunteerInfoEntity::getCustomerId, customerId); + query.lt(VolunteerInfoEntity::getCreatedTime, endCreateTime); + volunteerInfoDao.selectList(query); } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/DemandServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/DemandServiceImpl.java index 7782226923..e165e95a75 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/DemandServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/DemandServiceImpl.java @@ -67,11 +67,12 @@ public class DemandServiceImpl implements DemandService { /** * 清理旧数据 - * @param yestoday + * @param targetDate 要清理哪天的数据 + * @param customerIds 要清理哪些客户的 */ - private void clearOldDatas(List customerIds, Date yestoday) { + private void clearOldDatas(List customerIds, Date targetDate) { - String dateDimId = DimIdGenerator.getDateDimId(yestoday); + String dateDimId = DimIdGenerator.getDateDimId(targetDate); demandStatsService.clearVolunteerDemandServiceDailyStats(customerIds, dateDimId); @@ -90,50 +91,40 @@ public class DemandServiceImpl implements DemandService { // 居民志愿者数量 Integer resiVolunteerCount = 0; + // 党员志愿者用户id列表 List partymemberVolunteerUserIds = new ArrayList<>(16); - int pageNum = 1; - int volunteerPageSize = 5; + List volunteers = heartVolunteerService.listVolunteers(customerId, endTime); - while (true) { - - int shardingStartIndex = 0; - int shardingSize = 2; + volunteerTotalCount = volunteers.size(); - List volunteersPage = heartVolunteerService.listVolunteersPage(customerId, endTime, pageNum, volunteerPageSize); + // 分片开始下标 + int shardingStartIndex = 0; + // 分片大小(条数) + int shardingSize = 2; + + // 分片去确定党员身份,防止in条件过大 + while (true) { + int realShardingSize = Math.min(shardingSize, volunteerTotalCount - shardingStartIndex); - // 如果查询结果为0,说明没有更多的志愿者了 - if (volunteersPage.size() == 0) { + if (realShardingSize <= 0) { break; } - volunteerTotalCount += volunteersPage.size(); - - // 分片去确定党员身份 - while (true) { - int realShardingSize = Math.min(shardingSize, volunteersPage.size() - shardingStartIndex); + int shardingEndIndex = shardingStartIndex + realShardingSize; + List volunteerUserIds = volunteers.subList(shardingStartIndex, shardingEndIndex) + .stream() + .map((volunteerInfoEntity) -> volunteerInfoEntity.getUserId()) + .collect(Collectors.toList()); - if (realShardingSize == 0) { - break; - } - - int shardingEndIndex = shardingStartIndex + realShardingSize; - List volunteerUserIds = volunteersPage.subList(shardingStartIndex, shardingEndIndex) - .stream() - .map((volunteerInfoEntity) -> volunteerInfoEntity.getUserId()) - .collect(Collectors.toList()); - - List tempPartymemberUserIds = userService.filterUserIds(volunteerUserIds, EpmetRoleKeyConstant.PARTYMEMBER); + List tempPartymemberUserIds = userService.filterUserIds(volunteerUserIds, EpmetRoleKeyConstant.PARTYMEMBER); - partymemberVolunteerUserIds.addAll(tempPartymemberUserIds); - - shardingStartIndex = shardingEndIndex; - } + partymemberVolunteerUserIds.addAll(tempPartymemberUserIds); - pageNum++; + shardingStartIndex = shardingEndIndex; } - partymemberVolunteerCount += partymemberVolunteerUserIds.size(); + partymemberVolunteerCount = partymemberVolunteerUserIds.size(); resiVolunteerCount = volunteerTotalCount - partymemberVolunteerCount; //2. 查询志愿者服务次数 From b5d1790bff3f6a67d51fd264faff66755e879b72 Mon Sep 17 00:00:00 2001 From: wangxianzhang Date: Mon, 13 Dec 2021 15:57:28 +0800 Subject: [PATCH 43/71] =?UTF-8?q?=E4=BF=AE=E6=94=B9=EF=BC=9A=201.=E5=BF=97?= =?UTF-8?q?=E6=84=BF=E8=80=85=E5=88=86=E5=B8=83=E5=8F=82=E6=95=B0=E5=91=BD?= =?UTF-8?q?=E5=90=8D=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/dto/result/VolunteerDistributionResultDTO.java | 2 +- .../main/java/com/epmet/service/impl/VolunteerServiceImpl.java | 2 +- 2 files changed, 2 insertions(+), 2 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 c1bb3d866c..94a4d4ac88 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 @@ -27,7 +27,7 @@ public class VolunteerDistributionResultDTO { @Data public static class Distribution { - private Set volunteerTypes; + private Set volunteerCategories; private String epmetUserId; private String icResiUserId; private String longitude; 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 f0e2796a98..d259315211 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 @@ -162,7 +162,7 @@ public class VolunteerServiceImpl implements VolunteerService, ResultDataResolve ServiceConstant.GOV_ORG_SERVER, EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), msg, msg); - distribution.setVolunteerTypes(volunteerTypes); + distribution.setVolunteerCategories(volunteerTypes); distribution.setEpmetUserId(userBaseInfo.getUserId()); distribution.setIcResiUserId(icResiUserInfo.getId()); Optional.of(building).ifPresent(b -> { From 302c72d7bbc0f578478b5f22776eb790e44a79f8 Mon Sep 17 00:00:00 2001 From: wangxianzhang Date: Mon, 13 Dec 2021 15:58:59 +0800 Subject: [PATCH 44/71] =?UTF-8?q?=E4=BF=AE=E6=94=B9=EF=BC=9A=201.=E5=BF=97?= =?UTF-8?q?=E6=84=BF=E8=80=85=E5=88=86=E5=B8=83=E5=8F=82=E6=95=B0=E5=91=BD?= =?UTF-8?q?=E5=90=8D=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/service/heart/impl/HeartVolunteerServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/impl/HeartVolunteerServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/impl/HeartVolunteerServiceImpl.java index d9a931072b..902a6a8713 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/impl/HeartVolunteerServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/impl/HeartVolunteerServiceImpl.java @@ -33,6 +33,6 @@ public class HeartVolunteerServiceImpl implements HeartVolunteerService { LambdaQueryWrapper query = new LambdaQueryWrapper<>(); query.eq(VolunteerInfoEntity::getCustomerId, customerId); query.lt(VolunteerInfoEntity::getCreatedTime, endCreateTime); - volunteerInfoDao.selectList(query); + return volunteerInfoDao.selectList(query); } } From 5a420886a1fa7615e31e1e75c2795db1febbd098 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Mon, 13 Dec 2021 16:00:37 +0800 Subject: [PATCH 45/71] =?UTF-8?q?=E9=A2=9C=E8=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/IssueProjectCategoryDictDao.xml | 2 +- .../src/main/java/com/epmet/dto/result/CategoryListDTO.java | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueProjectCategoryDictDao.xml b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueProjectCategoryDictDao.xml index 2188bf2ea5..06c1fc0000 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueProjectCategoryDictDao.xml +++ b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueProjectCategoryDictDao.xml @@ -251,7 +251,7 @@ CATEGORY_CODE, CATEGORY_NAME, LENGTH(CATEGORY_CODE) AS codeLength, - IFNULL(color,'') AS colour + IFNULL(color,'') AS color FROM issue_project_category_dict WHERE DEL_FLAG = 0 AND CUSTOMER_ID = #{customerId} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/CategoryListDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/CategoryListDTO.java index a32b7125ea..8003cdfd0b 100644 --- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/CategoryListDTO.java +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/CategoryListDTO.java @@ -25,6 +25,8 @@ public class CategoryListDTO implements Serializable { */ private String categoryName; + private String color; + /** * 个数 */ From 7112bd44c6aa0fe7f0db8fe0fe288ab74a329b22 Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Mon, 13 Dec 2021 16:02:48 +0800 Subject: [PATCH 46/71] =?UTF-8?q?=E7=A4=BE=E5=8C=BA=E5=85=9A=E5=BB=BA?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=88=86=E6=9E=90-=E5=85=9A=E5=91=98?= =?UTF-8?q?=E7=9B=B8=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tools/dto/result/OptionDataResultDTO.java | 1 + .../service/impl/IcResiUserServiceImpl.java | 24 +++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/OptionDataResultDTO.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/OptionDataResultDTO.java index 78f77a850b..5f815c7f5c 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/OptionDataResultDTO.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/OptionDataResultDTO.java @@ -15,4 +15,5 @@ public class OptionDataResultDTO implements Serializable { private String label; private String value; private String code; + private String radio; } 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 cf10024449..2fad36a652 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 @@ -70,6 +70,8 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import java.math.BigDecimal; +import java.math.RoundingMode; import java.sql.Date; import java.sql.Timestamp; import java.util.*; @@ -972,17 +974,28 @@ public class IcResiUserServiceImpl extends BaseServiceImpl> dictResult = epmetAdminOpenFeignClient.dictList(dictFormDTO); Map map = new HashMap<>(); + int total = 0; //统计组织下各年龄范围人数 List list = baseDao.getPartyMemberAgeStatistics(formDTO.getOrgType(), formDTO.getOrgId()); if (CollectionUtils.isNotEmpty(list)) { map = list.stream().collect(Collectors.toMap(OptionDataResultDTO::getCode, OptionDataResultDTO::getValue)); + total = list.stream().mapToInt(item -> Integer.parseInt(item.getValue())).sum(); } Map finalMap = map; + int finalTotal = total; return dictResult.getData().stream().map(item -> { OptionDataResultDTO dto = new OptionDataResultDTO(); dto.setCode(item.getValue()); dto.setLabel(item.getLabel()); dto.setValue(null == finalMap.get(item.getValue())?NumConstant.ZERO_STR:finalMap.get(item.getValue())); + BigDecimal radio = new BigDecimal("0.00"); + if (NumConstant.ZERO != finalTotal) { + BigDecimal sum = new BigDecimal(finalTotal); + BigDecimal count = new BigDecimal(dto.getValue()); + BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED); + radio = count.multiply(hundred).divide(sum, NumConstant.TWO, RoundingMode.HALF_UP); + } + dto.setRadio(radio.stripTrailingZeros().toString().concat("%")); return dto; }).collect(Collectors.toList()); } @@ -1022,15 +1035,26 @@ public class IcResiUserServiceImpl extends BaseServiceImpl map = new HashMap<>(); //统计组织下文化程度党员人数 List list = baseDao.getPartyMemberEducationStatistics(formDTO.getOrgType(), formDTO.getOrgId()); + int total = 0; if (CollectionUtils.isNotEmpty(list)) { map = list.stream().collect(Collectors.toMap(OptionDataResultDTO::getCode, OptionDataResultDTO::getValue)); + total = list.stream().mapToInt(item -> Integer.parseInt(item.getValue())).sum(); } Map finalMap = map; + int finalTotal = total; return dictResult.getData().stream().map(item -> { OptionDataResultDTO dto = new OptionDataResultDTO(); dto.setCode(item.getValue()); dto.setLabel(item.getLabel()); dto.setValue(null == finalMap.get(item.getValue())?NumConstant.ZERO_STR:finalMap.get(item.getValue())); + BigDecimal radio = new BigDecimal("0.00"); + if (NumConstant.ZERO != finalTotal) { + BigDecimal sum = new BigDecimal(finalTotal); + BigDecimal count = new BigDecimal(dto.getValue()); + BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED); + radio = count.multiply(hundred).divide(sum, NumConstant.TWO, RoundingMode.HALF_UP); + } + dto.setRadio(radio.stripTrailingZeros().toString().concat("%")); return dto; }).collect(Collectors.toList()); } From 974da27bc08a93f56f9cb26e2e7d6fdeb8a92f3a Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Mon, 13 Dec 2021 16:12:01 +0800 Subject: [PATCH 47/71] =?UTF-8?q?=E5=88=86=E9=A1=B5=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/service/impl/IssueServiceImpl.java | 10 +++++----- .../src/main/resources/mapper/IssueDao.xml | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java index 6835ce4b4b..f433bd60ed 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java @@ -1588,11 +1588,12 @@ public class IssueServiceImpl extends BaseServiceImpl imp } // 分类编码长度 Integer length = baseDao.selectOneLevelCategoryLength(tokenDto.getCustomerId()); - PageInfo pageInfo = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.selectIssueLimit50(formDTO.getOrgId(), formDTO.getOrgType(), formDTO.getStatus(),length)); - List list = pageInfo.getList(); - if (CollectionUtils.isEmpty(list)){ + List allList = baseDao.selectIssueLimit50(formDTO.getOrgId(), formDTO.getOrgType(), formDTO.getStatus(), length); + if (CollectionUtils.isEmpty(allList)){ return new ResiBuzzResultDTO(); } + List list = allList.stream().skip(formDTO.getPageSize() * (formDTO.getPageNo() - NumConstant.ONE)) + .limit(formDTO.getPageSize()).collect(Collectors.toList()); AtomicReference no = new AtomicReference<>((formDTO.getPageNo() - NumConstant.ONE) * formDTO.getPageSize() + NumConstant.ONE); ResiBuzzResultDTO result = new ResiBuzzResultDTO(); UserResiInfoListFormDTO userResiInfoListFormDTO = new UserResiInfoListFormDTO(); @@ -1602,8 +1603,7 @@ public class IssueServiceImpl extends BaseServiceImpl imp throw new EpmetException("查询人员姓名失败..."); } // 默认最多50 产品要求 - Integer total = pageInfo.getSize(); - result.setTotal(total > NumConstant.FIFTY ? NumConstant.FIFTY : total); + result.setTotal(allList.size()); // 赋值展示名字 list.forEach(l -> { l.setSort(no.getAndSet(no.get() + NumConstant.ONE)); diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueDao.xml b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueDao.xml index d955db65ef..8bfe2b9bf9 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueDao.xml +++ b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueDao.xml @@ -622,7 +622,7 @@ AND i.ORG_ID_PATH LIKE CONCAT('%',#{orgId}) - ORDER BY (s.SUPPORT_COUNT + s.OPPOSITION_COUNT) DESC,i.created_time DESC + ORDER BY (s.SUPPORT_COUNT + s.OPPOSITION_COUNT) DESC,i.created_time DESC LIMIT 50 From e4af2c23d23a0c002ad972a8f4a0ec775d926675 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Mon, 13 Dec 2021 16:30:11 +0800 Subject: [PATCH 48/71] =?UTF-8?q?resi/group/topic/gettopicdetail=E8=BF=94?= =?UTF-8?q?=E5=9B=9EgridName?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../result/ResiTopicIncludeIssueDetailResultDTO.java | 3 +++ .../modules/topic/service/impl/ResiTopicServiceImpl.java | 9 +++++++++ 2 files changed, 12 insertions(+) diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/ResiTopicIncludeIssueDetailResultDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/ResiTopicIncludeIssueDetailResultDTO.java index 2bce88383f..9af69706cd 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/ResiTopicIncludeIssueDetailResultDTO.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/ResiTopicIncludeIssueDetailResultDTO.java @@ -1,5 +1,6 @@ package com.epmet.resi.group.dto.topic.result; +import com.fasterxml.jackson.annotation.JsonIgnore; import lombok.Data; import java.io.Serializable; @@ -90,4 +91,6 @@ public class ResiTopicIncludeIssueDetailResultDTO implements Serializable { * 话题被屏蔽详情 */ private TopicHiddenDetailDTO hiddenDetail; + + private String gridName; } diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java index 9e67dcd909..a41c97fc27 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java @@ -886,6 +886,15 @@ public class ResiTopicServiceImpl extends BaseServiceImpl gridInfoRes=govOrgOpenFeignClient.getGridBaseInfoByGridId(customerGridFormDTO); + if(gridInfoRes.success()&&null!=gridInfoRes.getData()){ + resultDTO.setGridName(gridInfoRes.getData().getGridNamePath()); + } + } //2.查询话题附件 QueryWrapper wrapper = new QueryWrapper<>(); wrapper.eq(FieldConstant.DEL_FLAG,NumConstant.ZERO_STR); From 950bb3fb142f35f78820bcc6f5cc7f54e0a079e7 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Mon, 13 Dec 2021 16:34:30 +0800 Subject: [PATCH 49/71] =?UTF-8?q?/resi/hall/issue/detail=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?shiftIssueTime?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/dto/result/IssueResultDTO.java | 4 ++++ .../gov-issue-server/src/main/resources/mapper/IssueDao.xml | 3 ++- .../main/java/com/epmet/dto/result/IssueDetailResultDTO.java | 5 +++++ .../src/main/java/com/epmet/dto/result/IssueResultDTO.java | 4 ++++ 4 files changed, 15 insertions(+), 1 deletion(-) diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/IssueResultDTO.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/IssueResultDTO.java index c2dbdb85eb..f63ea2d492 100644 --- a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/IssueResultDTO.java +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/IssueResultDTO.java @@ -1,8 +1,10 @@ package com.epmet.dto.result; +import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Data; import java.io.Serializable; +import java.util.Date; /** * @Author zxc @@ -49,4 +51,6 @@ public class IssueResultDTO implements Serializable { */ private String gridName; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date shiftIssueTime; } diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueDao.xml b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueDao.xml index 8bfe2b9bf9..3d1d2bde61 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueDao.xml +++ b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueDao.xml @@ -36,7 +36,8 @@ issue_status AS issueStatus, suggestion AS issueSuggestion, grid_id AS gridId, - created_by AS userId + created_by AS userId, + CREATED_TIME as shiftIssueTime FROM issue WHERE diff --git a/epmet-module/resi-hall/resi-hall-client/src/main/java/com/epmet/dto/result/IssueDetailResultDTO.java b/epmet-module/resi-hall/resi-hall-client/src/main/java/com/epmet/dto/result/IssueDetailResultDTO.java index 295522ae79..69ebc4476c 100644 --- a/epmet-module/resi-hall/resi-hall-client/src/main/java/com/epmet/dto/result/IssueDetailResultDTO.java +++ b/epmet-module/resi-hall/resi-hall-client/src/main/java/com/epmet/dto/result/IssueDetailResultDTO.java @@ -1,9 +1,11 @@ package com.epmet.dto.result; import com.epmet.dto.TopicInfoDTO; +import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Data; import java.io.Serializable; +import java.util.Date; /** * @Author zxc @@ -74,4 +76,7 @@ public class IssueDetailResultDTO implements Serializable { * 态度 - opposition(反对)support(赞成) */ private String attitude; + + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date shiftIssueTime; } diff --git a/epmet-module/resi-hall/resi-hall-client/src/main/java/com/epmet/dto/result/IssueResultDTO.java b/epmet-module/resi-hall/resi-hall-client/src/main/java/com/epmet/dto/result/IssueResultDTO.java index b278b9f585..e1360eb01b 100644 --- a/epmet-module/resi-hall/resi-hall-client/src/main/java/com/epmet/dto/result/IssueResultDTO.java +++ b/epmet-module/resi-hall/resi-hall-client/src/main/java/com/epmet/dto/result/IssueResultDTO.java @@ -1,8 +1,10 @@ package com.epmet.dto.result; +import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Data; import java.io.Serializable; +import java.util.Date; /** * @Author zxc @@ -44,5 +46,7 @@ public class IssueResultDTO implements Serializable { */ private String topicId; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date shiftIssueTime; } From ba13a313ad7cb6dc6ca6ed1e0f5119384afc34c1 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Mon, 13 Dec 2021 16:44:26 +0800 Subject: [PATCH 50/71] =?UTF-8?q?=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../migration/{V0.0.15__add_colour.sql => V0.0.15__add_color.sql} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename epmet-module/gov-issue/gov-issue-server/src/main/resources/db/migration/{V0.0.15__add_colour.sql => V0.0.15__add_color.sql} (100%) diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/resources/db/migration/V0.0.15__add_colour.sql b/epmet-module/gov-issue/gov-issue-server/src/main/resources/db/migration/V0.0.15__add_color.sql similarity index 100% rename from epmet-module/gov-issue/gov-issue-server/src/main/resources/db/migration/V0.0.15__add_colour.sql rename to epmet-module/gov-issue/gov-issue-server/src/main/resources/db/migration/V0.0.15__add_color.sql From 2d934e9892a0b939d943b9cddeee2ad221bf84b4 Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Mon, 13 Dec 2021 16:46:54 +0800 Subject: [PATCH 51/71] =?UTF-8?q?=E7=A4=BE=E5=8C=BA=E5=85=9A=E5=BB=BA?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=88=86=E6=9E=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/service/impl/IcPartyActivityServiceImpl.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyActivityServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyActivityServiceImpl.java index cd80f55b72..819f7bb94f 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyActivityServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyActivityServiceImpl.java @@ -339,7 +339,8 @@ public class IcPartyActivityServiceImpl extends BaseServiceImpl wrapper = new LambdaQueryWrapper<>(); - wrapper.eq(IcPartyActivityEntity::getAgencyId, formDTO.getAgencyId()); + wrapper.and(wp -> wp.eq(IcPartyActivityEntity::getAgencyId, formDTO.getAgencyId()).or(). + like(IcPartyActivityEntity::getPids, formDTO.getAgencyId())); wrapper.eq(StringUtils.isNotBlank(formDTO.getServiceMatter()), IcPartyActivityEntity::getServiceMatter, formDTO.getServiceMatter()); wrapper.ge(null != formDTO.getStartTime(),IcPartyActivityEntity::getActivityTime, formDTO.getStartTime()); wrapper.le(null != formDTO.getEndTime(), IcPartyActivityEntity::getActivityTime, formDTO.getEndTime()); From ef3eb202fabbaaee66e8e7d152d65d382ac890db Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Mon, 13 Dec 2021 16:50:59 +0800 Subject: [PATCH 52/71] =?UTF-8?q?=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../migration/{V0.0.15__add_color.sql => V0.0.16__add_color.sql} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename epmet-module/gov-issue/gov-issue-server/src/main/resources/db/migration/{V0.0.15__add_color.sql => V0.0.16__add_color.sql} (100%) diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/resources/db/migration/V0.0.15__add_color.sql b/epmet-module/gov-issue/gov-issue-server/src/main/resources/db/migration/V0.0.16__add_color.sql similarity index 100% rename from epmet-module/gov-issue/gov-issue-server/src/main/resources/db/migration/V0.0.15__add_color.sql rename to epmet-module/gov-issue/gov-issue-server/src/main/resources/db/migration/V0.0.16__add_color.sql From afff88835ae6d6aab2d0d8a43d409f9e827df4c3 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Mon, 13 Dec 2021 17:11:15 +0800 Subject: [PATCH 53/71] =?UTF-8?q?=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../migration/{V0.0.16__add_color.sql => V0.0.17__add_color.sql} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename epmet-module/gov-issue/gov-issue-server/src/main/resources/db/migration/{V0.0.16__add_color.sql => V0.0.17__add_color.sql} (100%) diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/resources/db/migration/V0.0.16__add_color.sql b/epmet-module/gov-issue/gov-issue-server/src/main/resources/db/migration/V0.0.17__add_color.sql similarity index 100% rename from epmet-module/gov-issue/gov-issue-server/src/main/resources/db/migration/V0.0.16__add_color.sql rename to epmet-module/gov-issue/gov-issue-server/src/main/resources/db/migration/V0.0.17__add_color.sql From 5b7ceebe5aec49d2abed54bbe8aaf747783abada Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Mon, 13 Dec 2021 17:45:58 +0800 Subject: [PATCH 54/71] =?UTF-8?q?=E7=A4=BE=E5=8C=BA=E5=85=9A=E5=BB=BA?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=88=86=E6=9E=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/IcPartyActivityServiceImpl.java | 23 +++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyActivityServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyActivityServiceImpl.java index 819f7bb94f..9258767df3 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyActivityServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyActivityServiceImpl.java @@ -72,6 +72,10 @@ public class IcPartyActivityServiceImpl extends BaseServiceImpl search(PartyActivityFormDTO formDTO) { @@ -152,7 +156,7 @@ public class IcPartyActivityServiceImpl extends BaseServiceImpl categoryMap = icResiDemandDictService.querySubCodeList(codeFormDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); IcPartyActivityDTO dto = ConvertUtils.sourceToTarget(entity, IcPartyActivityDTO.class); dto.setServiceMatterName(categoryMap.get(dto.getServiceMatter())); @@ -213,7 +217,7 @@ public class IcPartyActivityServiceImpl extends BaseServiceImpl categoryMap = icResiDemandDictService.querySubCodeList(codeFormDTO).stream().collect(Collectors.toMap(OptionDTO::getLabel, OptionDTO::getValue)); //获取联建单位 IcPartyUnitDTO unitDTO = new IcPartyUnitDTO(); @@ -338,6 +342,7 @@ public class IcPartyActivityServiceImpl extends BaseServiceImpl wrapper = new LambdaQueryWrapper<>(); wrapper.and(wp -> wp.eq(IcPartyActivityEntity::getAgencyId, formDTO.getAgencyId()).or(). like(IcPartyActivityEntity::getPids, formDTO.getAgencyId())); @@ -351,11 +356,14 @@ public class IcPartyActivityServiceImpl extends BaseServiceImpl option = icPartyUnitService.option(unitDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); + //获取服务事项字典 SubCodeFormDTO codeFormDTO = new SubCodeFormDTO(); codeFormDTO.setCustomerId(tokenDto.getCustomerId()); - codeFormDTO.setParentCategoryCode("1010"); + codeFormDTO.setParentCategoryCode(SERVICE_MATTER_CODE); Map categoryMap = icResiDemandDictService.querySubCodeList(codeFormDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); + //数据组装 dtoList.forEach(dto -> { dto.setServiceMatterName(categoryMap.get(dto.getServiceMatter())); dto.setUnitName(option.get(dto.getUnitId())); @@ -365,9 +373,16 @@ public class IcPartyActivityServiceImpl extends BaseServiceImpl(dtoList, pageInfo.getTotal()); } + /** + * 近30天开始时间和结束时间 (精确到秒) + * @Param formDTO + * @Return + * @Author zhaoqifeng + * @Date 2021/12/13 17:40 + */ private void setDate(PartyActivityFormDTO formDTO) { String start = DateUtils.getBeforeNDay(30); - formDTO.setEndTime(DateUtils.parse(start.concat("000000"), DateUtils.DATE_TIME_NO_SPLIT)); + formDTO.setStartTime(DateUtils.parse(start.concat("000000"), DateUtils.DATE_TIME_NO_SPLIT)); String end = DateUtils.format(new Date(), DateUtils.DATE_PATTERN); formDTO.setEndTime(DateUtils.parse(end.concat(" 23:59:59"), DateUtils.DATE_TIME_PATTERN)); } From 5d6474621178e70a7bd45ad21688012895fbcc68 Mon Sep 17 00:00:00 2001 From: wangxianzhang Date: Mon, 13 Dec 2021 22:35:47 +0800 Subject: [PATCH 55/71] =?UTF-8?q?=E4=BF=AE=E6=94=B9=EF=BC=9A=201.=E5=BF=97?= =?UTF-8?q?=E6=84=BF=E8=80=85=E5=88=86=E5=B8=83=E9=80=BB=E8=BE=91=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../result/DemandServiceCountResultDTO.java | 4 +++ .../dao/heart/IcUserDemandServiceDao.java | 2 +- .../service/heart/HeartDemandService.java | 2 +- .../heart/impl/HeartDemandServiceImpl.java | 4 +-- .../epmet/service/impl/DemandServiceImpl.java | 31 ++++++++++--------- .../mapper/heart/IcUserDemandServiceDao.xml | 7 +++-- .../epmet/controller/VolunteerController.java | 6 ---- .../service/impl/VolunteerServiceImpl.java | 13 ++++---- 8 files changed, 35 insertions(+), 34 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/heart/result/DemandServiceCountResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/heart/result/DemandServiceCountResultDTO.java index 57cc894ae4..16cbee4538 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/heart/result/DemandServiceCountResultDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/heart/result/DemandServiceCountResultDTO.java @@ -10,6 +10,10 @@ import lombok.Data; */ @Data public class DemandServiceCountResultDTO { + // 服务者ID private String serverId; + // 服务类型 private String serviceType; + // 服务次数 + private int serveTimes; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/heart/IcUserDemandServiceDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/heart/IcUserDemandServiceDao.java index 602c04da5e..165ae6b91c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/heart/IcUserDemandServiceDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/heart/IcUserDemandServiceDao.java @@ -40,5 +40,5 @@ public interface IcUserDemandServiceDao extends BaseDao listDemandServiceCountPage(@Param("customerId") String customerId, @Param("endTime") Date endTime, @Param("serviceType") String serviceType); + List listDemandServeTimes(@Param("customerId") String customerId, @Param("endTime") Date endTime, @Param("serviceType") String serviceType); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/HeartDemandService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/HeartDemandService.java index 1a106fa881..baaa29c97b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/HeartDemandService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/HeartDemandService.java @@ -11,5 +11,5 @@ import java.util.List; *@Date 2021/12/8 */ public interface HeartDemandService { - List listDemandServiceCountPage(String customerId, Date endTime, int serviceCountPageNo, int serviceCountPageSize); + List listDemandServeTimesPage(String customerId, Date endTime, int serviceCountPageNo, int serviceCountPageSize); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/impl/HeartDemandServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/impl/HeartDemandServiceImpl.java index a4192fcd30..c33f426ad5 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/impl/HeartDemandServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/impl/HeartDemandServiceImpl.java @@ -29,11 +29,11 @@ public class HeartDemandServiceImpl implements HeartDemandService { private IcUserDemandServiceDao demandServiceDao; @Override - public List listDemandServiceCountPage(String customerId, Date endTime, int serviceCountPageNo, int serviceCountPageSize) { + public List listDemandServeTimesPage(String customerId, Date endTime, int serviceCountPageNo, int serviceCountPageSize) { return PageHelper.startPage(serviceCountPageNo, serviceCountPageSize).doSelectPage(new ISelect() { @Override public void doSelect() { - demandServiceDao.listDemandServiceCountPage(customerId, endTime, "volunteer"); + demandServiceDao.listDemandServeTimes(customerId, endTime, "volunteer"); } }); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/DemandServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/DemandServiceImpl.java index e165e95a75..66cbf1058d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/DemandServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/DemandServiceImpl.java @@ -101,7 +101,7 @@ public class DemandServiceImpl implements DemandService { // 分片开始下标 int shardingStartIndex = 0; // 分片大小(条数) - int shardingSize = 2; + int shardingSize = 100; // 分片去确定党员身份,防止in条件过大 while (true) { @@ -130,43 +130,44 @@ public class DemandServiceImpl implements DemandService { //2. 查询志愿者服务次数 // 总服务次数 - int totalDemandServiceCount = 0; + int totalDemandServeTimes = 0; // 党员服务次数 - int partymemberDemandServiceCount = 0; + int partymemberDemandServeTimes = 0; // 居民服务次数 - int resiDemandServiceCount = 0; + int resiDemandServeTimes = 0; int serviceCountPageNo = 0; int serviceCountPageSize = 1000; while (true) { - List damendServiceCounts = heartDemandService.listDemandServiceCountPage(customerId, endTime, serviceCountPageNo, serviceCountPageSize); + // 取出每一个服务者的服务次数 + List damendServeTimes = heartDemandService.listDemandServeTimesPage(customerId, endTime, serviceCountPageNo, serviceCountPageSize); - for (DemandServiceCountResultDTO damendServiceCount : damendServiceCounts) { - String serverId = damendServiceCount.getServerId(); + for (DemandServiceCountResultDTO damendServiceTimes : damendServeTimes) { + String serverId = damendServiceTimes.getServerId(); if (partymemberVolunteerUserIds.contains(serverId)) { - partymemberDemandServiceCount++; + partymemberDemandServeTimes += damendServiceTimes.getServeTimes(); } else { - resiDemandServiceCount++; + resiDemandServeTimes += damendServiceTimes.getServeTimes(); } } - totalDemandServiceCount += damendServiceCounts.size(); - - if (damendServiceCounts.size() <= serviceCountPageSize) { + if (damendServeTimes.size() <= serviceCountPageSize) { break; } } + totalDemandServeTimes = partymemberDemandServeTimes + resiDemandServeTimes; + // 3.持久化 FactVolunteerServiceDailyEntity insert = new FactVolunteerServiceDailyEntity(); insert.setDateId(DimIdGenerator.getDateDimId(belongTime)); insert.setCustomerId(customerId); insert.setMonthId(DimIdGenerator.getMonthDimId(belongTime)); - insert.setPartyServiceTotal(partymemberDemandServiceCount); - insert.setServiceTotal(totalDemandServiceCount); + insert.setPartyServiceTotal(partymemberDemandServeTimes); + insert.setServiceTotal(totalDemandServeTimes); insert.setPartyTotal(partymemberVolunteerCount); - insert.setResiServiceTotal(resiDemandServiceCount); + insert.setResiServiceTotal(resiDemandServeTimes); insert.setResiTotal(resiVolunteerCount); insert.setVolunteerTotal(volunteerTotalCount); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/heart/IcUserDemandServiceDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/heart/IcUserDemandServiceDao.xml index 1c13f56e87..ddebabef66 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/heart/IcUserDemandServiceDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/heart/IcUserDemandServiceDao.xml @@ -20,14 +20,15 @@ - + select service.SERVER_ID, SERVICE_TYPE, count(1) as SERVE_TIMES from ic_user_demand_rec damend inner join ic_user_demand_service service on (damend.ID = service.DEMAND_REC_ID and service.DEL_FLAG = 0) where damend.DEL_FLAG = 0 and damend.STATUS = 'finished' - and damend.REPORT_TIME #{endTime} and damend.CUSTOMER_ID = #{customerId} + and service.SERVICE_END_TIME #{endTime} and service.SERVICE_TYPE = #{serviceType} + group by service.SERVER_ID, SERVICE_TYPE \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/VolunteerController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/VolunteerController.java index 40ea2d8807..aedfe54e49 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/VolunteerController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/VolunteerController.java @@ -29,11 +29,6 @@ public class VolunteerController { @Autowired private VolunteerService volunteerService; - //public VolunteerController(VolunteerService volunteerService, IcResiUserDao icResiUserDao, GovOrgOpenFeignClient govOrgOpenFeignClient) { - // this.volunteerService = volunteerService; - // System.out.println(this); - //} - /** * 志愿者分布查询 * @@ -42,7 +37,6 @@ public class VolunteerController { */ @PostMapping("distribution") public Result getVolunteerDistribution(@RequestBody VolunteerCommonFormDTO input) { - System.out.println(this); ValidatorUtils.validateEntity(input, VolunteerCommonFormDTO.GetVolunteerDistribution.class); String customerId = input.getCustomerId(); 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 d259315211..edc1149e6f 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 @@ -141,15 +141,16 @@ public class VolunteerServiceImpl implements VolunteerService, ResultDataResolve continue; } - List volunteer = icResiUserDao.selectVolunteerByUserId(icResiUserInfo.getId()); - if (CollectionUtils.isEmpty(volunteer)) { - // 此人没有志愿者信息 - continue; - } + // 查询志愿者类别 + List volunteerCategories = icResiUserDao.selectVolunteerByUserId(icResiUserInfo.getId()); + //if (CollectionUtils.isEmpty(volunteerCategories)) { + // // 此人没有志愿者信息 + // continue; + //} // 将志愿者类型列表字符串,切割放到set中 Set volunteerTypes = new HashSet(); - for (String vTypesString : volunteer) { + for (String vTypesString : volunteerCategories) { String[] vTypes = vTypesString.split(","); if (vTypes != null && vTypes.length > 0) { volunteerTypes.addAll(Arrays.asList(vTypes)); From 93f1ef9feff590b9927ac4d2bafce3f4377aea3e Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Tue, 14 Dec 2021 09:36:38 +0800 Subject: [PATCH 56/71] =?UTF-8?q?=E7=A4=BE=E5=8C=BA=E5=85=9A=E5=BB=BA?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=88=86=E6=9E=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/service/impl/IcPartyActivityServiceImpl.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyActivityServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyActivityServiceImpl.java index 9258767df3..57fda0e82e 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyActivityServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyActivityServiceImpl.java @@ -154,12 +154,18 @@ public class IcPartyActivityServiceImpl extends BaseServiceImpl categoryMap = icResiDemandDictService.querySubCodeList(codeFormDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); IcPartyActivityDTO dto = ConvertUtils.sourceToTarget(entity, IcPartyActivityDTO.class); dto.setServiceMatterName(categoryMap.get(dto.getServiceMatter())); + //获取单位名称 + IcPartyUnitDTO unitDTO = icPartyUnitService.get(dto.getUnitId()); + if (null != unitDTO) { + dto.setUnitName(unitDTO.getUnitName()); + } return dto; } From e8d5005f0dc4bc1ad5d9fc29ffa94053d5103840 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 14 Dec 2021 10:41:18 +0800 Subject: [PATCH 57/71] =?UTF-8?q?=E6=9C=8D=E5=8A=A1=E6=8E=AA=E6=96=BD?= =?UTF-8?q?=E5=88=86=E6=9E=90=E5=8E=BB=E6=8E=89=E5=85=A5=E5=8F=82=E7=9A=84?= =?UTF-8?q?pid?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../form/demand/CategoryAnalysisFormDTO.java | 3 +- .../form/demand/PageListAnalysisFormDTO.java | 6 ++-- .../impl/IcUserDemandRecServiceImpl.java | 29 ++++++++----------- 3 files changed, 16 insertions(+), 22 deletions(-) diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/CategoryAnalysisFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/CategoryAnalysisFormDTO.java index f4e792f75e..30605910cf 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/CategoryAnalysisFormDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/CategoryAnalysisFormDTO.java @@ -22,8 +22,7 @@ public class CategoryAnalysisFormDTO implements Serializable { @NotBlank(message = "先选择组织或网格", groups = AddUserShowGroup.class) private String orgId; - @NotBlank(message = "组织或网格的上级", groups = PageListAnalysisFormDTO.AddUserShowGroup.class) - private String pid; + @NotBlank(message = "组织:agency,网格:grid", groups = AddUserShowGroup.class) private String orgType; @NotBlank(message = "起止日期不能为空,格式yyyyMMdd", groups = AddUserShowGroup.class) diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/PageListAnalysisFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/PageListAnalysisFormDTO.java index 9add161aca..b48063a722 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/PageListAnalysisFormDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/PageListAnalysisFormDTO.java @@ -27,10 +27,9 @@ public class PageListAnalysisFormDTO implements Serializable { @NotNull(message = "每页数量不能为空", groups = AddUserInternalGroup.class) private Integer pageSize; - @NotBlank(message = "先选择组织或网格", groups = AddUserShowGroup.class) + @NotBlank(message = "先选择组织或网格不能为空", groups = AddUserShowGroup.class) private String orgId; - @NotBlank(message = "组织或网格的上级", groups = AddUserShowGroup.class) - private String pid; + @NotBlank(message = "orgType=grid或者agency,不能为空", groups = AddUserInternalGroup.class) private String orgType; @@ -49,4 +48,5 @@ public class PageListAnalysisFormDTO implements Serializable { private String gridPids; private Boolean pageFlag; + } 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 ae0ec89577..b968fe4017 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 @@ -47,11 +47,6 @@ import com.epmet.dto.result.AllGridsByUserIdResultDTO; import com.epmet.dto.result.IcResiUserBriefDTO; import com.epmet.dto.result.UserBaseInfoResultDTO; import com.epmet.dto.result.demand.*; -import com.epmet.dto.result.demand.DemandRecResultDTO; -import com.epmet.dto.result.demand.FinishResultDTO; -import com.epmet.dto.result.demand.IcResiUserReportDemandRes; -import com.epmet.dto.result.demand.ServiceStatDTO; -import com.epmet.dto.result.demand.*; import com.epmet.entity.*; import com.epmet.feign.EpmetAdminOpenFeignClient; import com.epmet.feign.EpmetUserOpenFeignClient; @@ -643,15 +638,15 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl pageListAnalysis(PageListAnalysisFormDTO formDTO) { if("agency".equals(formDTO.getOrgType())){ - if(NumConstant.ZERO_STR.equals(formDTO.getPid())){ + //找到当前组织的所有上级,再拼接上自己 + Result customerAgencyDTOResult=govOrgOpenFeignClient.getAgencyById(formDTO.getOrgId()); + if(!customerAgencyDTOResult.success()||null==customerAgencyDTOResult.getData()){ + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取组织信息异常govOrgOpenFeignClient.getAgencyById"); + } + if(NumConstant.ZERO_STR.equals(customerAgencyDTOResult.getData().getPid())){ //当前传入的组织id=客户的根组织 formDTO.setGridPids(formDTO.getOrgId()); }else{ - //找到当前组织的所有上级,再拼接上自己 - Result customerAgencyDTOResult=govOrgOpenFeignClient.getAgencyById(formDTO.getOrgId()); - if(!customerAgencyDTOResult.success()||null==customerAgencyDTOResult.getData()){ - throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取组织信息异常govOrgOpenFeignClient.getAgencyById"); - } formDTO.setGridPids(customerAgencyDTOResult.getData().getPids().concat(StrConstant.COLON).concat(formDTO.getOrgId())); } } @@ -754,15 +749,15 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl customerAgencyDTOResult=govOrgOpenFeignClient.getAgencyById(formDTO.getOrgId()); + if(!customerAgencyDTOResult.success()||null==customerAgencyDTOResult.getData()){ + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取组织信息异常govOrgOpenFeignClient.getAgencyById"); + } + if(NumConstant.ZERO_STR.equals(customerAgencyDTOResult.getData().getPid())){ //当前传入的组织id=客户的根组织 formDTO.setGridPids(formDTO.getOrgId()); }else{ - //找到当前组织的所有上级,再拼接上自己 - Result customerAgencyDTOResult=govOrgOpenFeignClient.getAgencyById(formDTO.getOrgId()); - if(!customerAgencyDTOResult.success()||null==customerAgencyDTOResult.getData()){ - throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取组织信息异常govOrgOpenFeignClient.getAgencyById"); - } formDTO.setGridPids(customerAgencyDTOResult.getData().getPids().concat(StrConstant.COLON).concat(formDTO.getOrgId())); } } From a0776cc4426f0152052124040c7472c104f18afe Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 14 Dec 2021 11:09:39 +0800 Subject: [PATCH 58/71] yyyy-MM-dd --- .../dto/form/demand/CategoryAnalysisFormDTO.java | 4 ++-- .../dto/form/demand/PageListAnalysisFormDTO.java | 4 ++-- .../main/resources/mapper/IcUserDemandRecDao.xml | 16 ++++++++-------- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/CategoryAnalysisFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/CategoryAnalysisFormDTO.java index 30605910cf..2e564db7cc 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/CategoryAnalysisFormDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/CategoryAnalysisFormDTO.java @@ -25,9 +25,9 @@ public class CategoryAnalysisFormDTO implements Serializable { @NotBlank(message = "组织:agency,网格:grid", groups = AddUserShowGroup.class) private String orgType; - @NotBlank(message = "起止日期不能为空,格式yyyyMMdd", groups = AddUserShowGroup.class) + @NotBlank(message = "起止日期不能为空,格式yyyy-MM-dd", groups = AddUserShowGroup.class) private String startDateId; - @NotBlank(message = "截止日期不能为空,格式yyyyMMdd", groups = AddUserShowGroup.class) + @NotBlank(message = "截止日期不能为空,格式yyyy-MM-dd", groups = AddUserShowGroup.class) private String endDateId; @NotBlank(message = "先选择组织或网格", groups = AddUserInternalGroup.class) diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/PageListAnalysisFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/PageListAnalysisFormDTO.java index b48063a722..464d1062a8 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/PageListAnalysisFormDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/PageListAnalysisFormDTO.java @@ -35,9 +35,9 @@ public class PageListAnalysisFormDTO implements Serializable { @NotBlank(message = "分类编码不能为空", groups = AddUserInternalGroup.class) private String categoryCode; - @NotBlank(message = "上报时间起始日期不能为空,格式yyyyMMdd", groups = AddUserInternalGroup.class) + @NotBlank(message = "上报时间起始日期不能为空,格式yyyy-MM-dd", groups = AddUserInternalGroup.class) private String startDateId; - @NotBlank(message = "上报时间截止日期不能为空,格式yyyyMMdd", groups = AddUserInternalGroup.class) + @NotBlank(message = "上报时间截止日期不能为空,格式yyyy-MM-dd", groups = AddUserInternalGroup.class) private String endDateId; @NotBlank(message = "tokenDto中的customerId不能为空",groups = AddUserInternalGroup.class) 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 ae5a8f6223..69dfd04d84 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 @@ -254,10 +254,10 @@ - AND DATE_FORMAT(r.REPORT_TIME,'%Y%m%d') = ]]> #{startDateId} + AND DATE_FORMAT(r.REPORT_TIME,'%Y-%m-%d') = ]]> #{startDateId} - AND DATE_FORMAT(r.REPORT_TIME,'%Y%m%d') #{endDateId} + AND DATE_FORMAT(r.REPORT_TIME,'%Y-%m-%d') #{endDateId} order by r.WANT_SERVICE_TIME desc,r.REPORT_TIME asc @@ -295,8 +295,8 @@ and m.GRID_PIDS like concat(#{gridPids},'%') - and DATE_FORMAT(m.REPORT_TIME,'%Y%m%d') >= #{startDateId} - and DATE_FORMAT(m.REPORT_TIME,'%Y%m%d') <= #{endDateId} + 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(#{category.value},'%') and m.status !='canceled' @@ -328,8 +328,8 @@ and m.GRID_PIDS like concat(#{gridPids},'%') - and DATE_FORMAT(m.REPORT_TIME,'%Y%m%d') >= #{startDateId} - and DATE_FORMAT(m.REPORT_TIME,'%Y%m%d') <= #{endDateId} + 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},'%') group by s.SERVICE_TYPE @@ -352,8 +352,8 @@ and m.GRID_PIDS like concat(#{gridPids},'%') - and DATE_FORMAT(m.REPORT_TIME,'%Y%m%d') >= #{startDateId} - and DATE_FORMAT(m.REPORT_TIME,'%Y%m%d') <= #{endDateId} + 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},'%') From 78a4b779d9c42fa98b9d69b5123527ed17c00bde Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 14 Dec 2021 11:49:45 +0800 Subject: [PATCH 59/71] =?UTF-8?q?=E5=88=97=E8=A1=A8=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/IcUserDemandRecDao.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 69dfd04d84..953db19cb8 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 @@ -90,7 +90,7 @@ AND r.GRID_PIDS LIKE concat('%',#{gridPids},'%') - and r.PARENT_CODE=#{categoryCode} + and (r.PARENT_CODE=#{categoryCode} or r.CATEGORY_CODE=#{categoryCode}) and r.CATEGORY_CODE=#{categoryCode} From 6404899d130d3e0f3f51941a1fe14555942dcae1 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Tue, 14 Dec 2021 13:53:13 +0800 Subject: [PATCH 60/71] emm --- .../gov-issue-server/src/main/resources/mapper/IssueDao.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueDao.xml b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueDao.xml index 3d1d2bde61..27d3b05535 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueDao.xml +++ b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueDao.xml @@ -656,7 +656,7 @@ AND i.ORG_ID_PATH LIKE CONCAT('%',#{orgId}) ORDER BY (s.SUPPORT_COUNT + s.OPPOSITION_COUNT) DESC,i.created_time DESC LIMIT 50)temp - GROUP BY categoryCode + GROUP BY categoryName From e087d1a1f413d68630f434db3d55ac9503c862d7 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 14 Dec 2021 14:26:26 +0800 Subject: [PATCH 61/71] =?UTF-8?q?=E6=9C=8D=E5=8A=A1=E6=8E=AA=E6=96=BD?= =?UTF-8?q?=E5=88=86=E6=9E=90=E8=BF=94=E5=9B=9EicResiUserId=E6=88=96?= =?UTF-8?q?=E8=80=85epmetUserId?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../demand/DemandResearchAnalysisFormDTO.java | 9 ++++- .../dto/result/demand/DemandRecResultDTO.java | 3 ++ .../epmet/constant/UserDemandConstant.java | 8 +++++ .../impl/IcUserDemandRecServiceImpl.java | 30 ++++++++++++++-- .../resources/mapper/IcUserDemandRecDao.xml | 36 +++++++++++++++++-- 5 files changed, 80 insertions(+), 6 deletions(-) diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/DemandResearchAnalysisFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/DemandResearchAnalysisFormDTO.java index d40ed7cb8a..ea3f8bcdcd 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/DemandResearchAnalysisFormDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/DemandResearchAnalysisFormDTO.java @@ -23,7 +23,7 @@ public class DemandResearchAnalysisFormDTO implements Serializable { @NotBlank(message = "firstCategoryCode不能为空",groups = AddUserInternalGroup.class) private String firstCategoryCode; - @NotBlank(message = "isResiUserId不能为空",groups = AddUserInternalGroup.class) + //@NotBlank(message = "isResiUserId不能为空",groups = AddUserInternalGroup.class) private String icResiUserId; private List epmetUserIdList; @@ -31,4 +31,11 @@ public class DemandResearchAnalysisFormDTO implements Serializable { @NotBlank(message = "tokenDto中的customerId不能为空",groups = AddUserInternalGroup.class) private String customerId; + + /** + * 个人档案:personal-data + * 服务措施分析:demand-analysis + */ + @NotBlank(message = "个人档案:personal-data;服务措施分析:demand-analysis",groups = AddUserInternalGroup.class) + private String queryOrigin; } diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandRecResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandRecResultDTO.java index feb5c70b84..06052f22cf 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandRecResultDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandRecResultDTO.java @@ -114,4 +114,7 @@ public class DemandRecResultDTO implements Serializable { * 完成情况 */ private String finishDesc; + + private String icResiUserId; + private String epmetUserId; } 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 c28768b30f..85168b8a32 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 @@ -50,4 +50,12 @@ public interface UserDemandConstant { String SOCIAL_ORG="social_org"; String COMMUNITY_ORG="community_org"; String PARTY_UNIT="party_unit"; + + + /** + * 个人档案:personal-data + * 服务措施分析:demand-analysis + */ + String PERSONAL_DATA="personal-data"; + String DEMAND_ANALYSIS="demand-analysis"; } 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 b968fe4017..1edd9d20d5 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 @@ -42,9 +42,11 @@ import com.epmet.dto.CustomerAgencyDTO; import com.epmet.dto.CustomerGridDTO; import com.epmet.dto.IcUserDemandRecDTO; import com.epmet.dto.form.CustomerGridFormDTO; +import com.epmet.dto.form.ResiUserFormDTO; import com.epmet.dto.form.demand.*; import com.epmet.dto.result.AllGridsByUserIdResultDTO; import com.epmet.dto.result.IcResiUserBriefDTO; +import com.epmet.dto.result.ResiUserResDTO; import com.epmet.dto.result.UserBaseInfoResultDTO; import com.epmet.dto.result.demand.*; import com.epmet.entity.*; @@ -583,7 +585,7 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl demandData=new ArrayList<>(); @@ -593,12 +595,34 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl()); demandData.add(demandDataDTO); + //如果是服务措施分析来的,并且是pc录入的需求,需要先去找epmetUserIdList + if(UserDemandConstant.DEMAND_ANALYSIS.equals(formDTO.getQueryOrigin()) + &&CollectionUtils.isEmpty(formDTO.getEpmetUserIdList())){ + ResiUserFormDTO resiUserFormDTO=new ResiUserFormDTO(); + resiUserFormDTO.setCustomerId(formDTO.getCustomerId()); + resiUserFormDTO.setIcResiUserId(formDTO.getIcResiUserId()); + Result resiRes=epmetUserOpenFeignClient.findEpmetUser(resiUserFormDTO); + if(!resiRes.success()){ + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "查询小程序用户异常"); + } + if (null != resiRes.getData() && CollectionUtils.isNotEmpty(resiRes.getData().getEpmetUserIdList())) { + formDTO.setEpmetUserIdList(resiRes.getData().getEpmetUserIdList()); + } + } //获取当前需求人,相同分类的需求列表。不分页,直接返回所有 List userIds=new ArrayList<>(); - userIds.add(formDTO.getIcResiUserId()); + if(StringUtils.isNotBlank(formDTO.getIcResiUserId())){ + userIds.add(formDTO.getIcResiUserId()); + } if(CollectionUtils.isNotEmpty(formDTO.getEpmetUserIdList())){ userIds.addAll(formDTO.getEpmetUserIdList()); } + if(StringUtils.isBlank(formDTO.getIcResiUserId())&&CollectionUtils.isEmpty(formDTO.getEpmetUserIdList())){ + //需求人不能为空 + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "需求人不能为空,icResiUserId与epmetUserIdList不能同时为空"); + } + + IcResiUserDemandFromDTO icResiUserDemandFromDTO=new IcResiUserDemandFromDTO(); icResiUserDemandFromDTO.setUserIds(userIds); icResiUserDemandFromDTO.setFirstCategoryCode(formDTO.getFirstCategoryCode()); @@ -625,6 +649,8 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl Date: Tue, 14 Dec 2021 14:36:08 +0800 Subject: [PATCH 62/71] =?UTF-8?q?heart=20=E6=97=A5=E5=BF=97=E9=85=8D?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet-heart-server/src/main/resources/logback-spring.xml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/logback-spring.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/logback-spring.xml index aacc15fdab..df57dd24a6 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/logback-spring.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/logback-spring.xml @@ -138,10 +138,9 @@ - + - From 40ab38f7bec4a6951919b1d3bd37b9a70bec3ecf Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Tue, 14 Dec 2021 14:37:20 +0800 Subject: [PATCH 63/71] =?UTF-8?q?=E7=A4=BE=E5=8C=BA=E5=85=9A=E5=BB=BA?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=88=86=E6=9E=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/service/impl/IcPartyActivityServiceImpl.java | 3 +++ .../epmet/service/impl/IcResiDemandDictServiceImpl.java | 8 +++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyActivityServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyActivityServiceImpl.java index 57fda0e82e..4057d1ba41 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyActivityServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyActivityServiceImpl.java @@ -154,6 +154,9 @@ public class IcPartyActivityServiceImpl extends BaseServiceImpl querySubCodeList(SubCodeFormDTO formDTO) { - return baseDao.selectByPCode(formDTO.getParentCategoryCode(),formDTO.getCustomerId(),formDTO.getCategoryName()); + List list = baseDao.selectByPCode(formDTO.getParentCategoryCode(),formDTO.getCustomerId(),formDTO.getCategoryName()); + if (CollectionUtils.isEmpty(list)) { + return Collections.emptyList(); + } + return list; } @Override From 20f1b885a0d58d538b5fca1dcdd9c2b091453251 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 14 Dec 2021 14:57:12 +0800 Subject: [PATCH 64/71] status --- .../com/epmet/dto/result/demand/IcResiUserReportDemandRes.java | 2 +- .../main/java/com/epmet/service/impl/ProjectServiceImpl.java | 1 + .../main/java/com/epmet/service/impl/ResiEventServiceImpl.java | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/IcResiUserReportDemandRes.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/IcResiUserReportDemandRes.java index 869f1b01e9..19757a671c 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/IcResiUserReportDemandRes.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/IcResiUserReportDemandRes.java @@ -26,7 +26,7 @@ public class IcResiUserReportDemandRes implements Serializable { @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") private Date wantServiceTime; - @JsonIgnore + //@JsonIgnore private String status; private String statusName; diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java index b14d2d6c02..2725a3f9f3 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java @@ -2958,6 +2958,7 @@ public class ProjectServiceImpl extends BaseServiceImpl userRes = epmetUserOpenFeignClient.findFamilyMem(formDTO.getIcResiUserId()); if (!userRes.success() || null == userRes.getData()) { throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取居民信息接口异常"); diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ResiEventServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ResiEventServiceImpl.java index ed2c5ee690..ab54bfd340 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ResiEventServiceImpl.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ResiEventServiceImpl.java @@ -688,6 +688,7 @@ public class ResiEventServiceImpl extends BaseServiceImpl userRes = epmetUserOpenFeignClient.findFamilyMem(formDTO.getIcResiUserId()); if (!userRes.success() || null == userRes.getData()) { throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取居民信息接口异常"); From eaed8608f49c4cc3c4986e686eb735996df8e340 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Tue, 14 Dec 2021 16:42:35 +0800 Subject: [PATCH 65/71] =?UTF-8?q?bug=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/dataaggre/controller/GovProjectController.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/GovProjectController.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/GovProjectController.java index 3d70bf2b96..422aa74f4c 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/GovProjectController.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/GovProjectController.java @@ -113,8 +113,9 @@ public class GovProjectController { * @author sun */ @PostMapping("projectanalysis") - public Result projectAnalysis(@RequestBody ProjectAnalysisFormDTO formDTO) { + public Result projectAnalysis(@LoginUser TokenDto tokenDto, @RequestBody ProjectAnalysisFormDTO formDTO) { ValidatorUtils.validateEntity(formDTO, ProjectAnalysisFormDTO.Analysis.class); + formDTO.setCustomerId(tokenDto.getCustomerId()); return new Result().ok(govProjectService.projectAnalysis(formDTO)); } From e84ea6189827bff9c9b589fe90c30971ffe93a27 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Tue, 14 Dec 2021 16:47:18 +0800 Subject: [PATCH 66/71] =?UTF-8?q?=E7=A8=8B=E5=BA=8F=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/dataaggre/dao/epmetuser/UserBaseInfoDao.java | 2 +- .../epmet/dataaggre/service/epmetuser/EpmetUserService.java | 2 +- .../service/epmetuser/impl/EpmetUserServiceImpl.java | 4 ++-- .../service/govproject/impl/GovProjectServiceImpl.java | 2 +- .../src/main/resources/mapper/epmetuser/UserBaseInfoDao.xml | 1 + 5 files changed, 6 insertions(+), 5 deletions(-) diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/UserBaseInfoDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/UserBaseInfoDao.java index 0ac5f211fc..e79c563c0a 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/UserBaseInfoDao.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/UserBaseInfoDao.java @@ -55,5 +55,5 @@ public interface UserBaseInfoDao extends BaseDao { * @Description 查询userId的身份证号在小程序用户中存在的多个userId值 * @author sun */ - List getUserBaseList(@Param("userId") String userId); + List getUserBaseList(@Param("userId") String userId, @Param("customerId") String customerId); } \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/EpmetUserService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/EpmetUserService.java index 8b898f8765..6979f5d8b4 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/EpmetUserService.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/EpmetUserService.java @@ -154,7 +154,7 @@ public interface EpmetUserService { * @Description 查询userId的身份证号在小程序用户中存在的多个userId值 * @author sun */ - List getUserBaseList(String userId); + List getUserBaseList(String userId, String customerId); /** * @Description 根据身份证号查询负能平台用户信息 diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java index ac6ee4a24e..181e037830 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java @@ -712,8 +712,8 @@ public class EpmetUserServiceImpl implements EpmetUserService { * @author sun */ @Override - public List getUserBaseList(String userId) { - return userBaseInfoDao.getUserBaseList(userId); + public List getUserBaseList(String userId, String customerId) { + return userBaseInfoDao.getUserBaseList(userId, customerId); } /** diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govproject/impl/GovProjectServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govproject/impl/GovProjectServiceImpl.java index 7c821cffaa..dc84f51bdc 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govproject/impl/GovProjectServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govproject/impl/GovProjectServiceImpl.java @@ -480,7 +480,7 @@ public class GovProjectServiceImpl implements GovProjectService { ProjectAnalysisResultDTO resultDTO = new ProjectAnalysisResultDTO(); resultDTO.setUserId(formDTO.getUserId()); //1.查询userId的身份证号在小程序用户中存在的多个userId值 - List userList = epmetUserService.getUserBaseList(formDTO.getUserId()); + List userList = epmetUserService.getUserBaseList(formDTO.getUserId(), formDTO.getCustomerId()); List userIds = userList.stream().map(UserBaseInfoDTO::getUserId).collect(Collectors.toList()); //2.查询对应负能平台用户家庭信息 diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/UserBaseInfoDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/UserBaseInfoDao.xml index 195e586292..6c118e2ce0 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/UserBaseInfoDao.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/UserBaseInfoDao.xml @@ -47,6 +47,7 @@ WHERE del_flag = '0' AND id_num = ( SELECT id_num FROM user_base_info WHERE user_id = #{userId}) + AND customer_id = #{customerId} \ No newline at end of file From f77aa6e8a26c5222605fef63616a08fc5c101cba Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 14 Dec 2021 16:58:15 +0800 Subject: [PATCH 67/71] =?UTF-8?q?=E7=82=B9=E5=87=BB=E5=B1=85=E6=B0=91?= =?UTF-8?q?=E7=AB=AF=E5=B0=8F=E7=A8=8B=E5=BA=8F=E7=94=A8=E6=88=B7=E4=B8=8A?= =?UTF-8?q?=E6=8A=A5=E7=9A=84=E9=9C=80=E6=B1=82=EF=BC=8C=E6=9F=A5=E7=9C=8B?= =?UTF-8?q?=E9=9C=80=E6=B1=82=E7=A0=94=E5=88=A4=E5=88=86=E6=9E=90=E9=80=BB?= =?UTF-8?q?=E8=BE=91=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../demand/DemandResearchAnalysisFormDTO.java | 2 +- .../DemandResearchAnalysisResultDTO.java | 10 +-- .../dto/result/demand/HouseMemResDTO.java | 22 +++++++ .../impl/IcUserDemandRecServiceImpl.java | 66 ++++++++++++++----- .../com/epmet/dto/form/FindIcUserFormDTO.java | 19 ++++++ .../epmet/dto/result/EpmetUserFamilyDTO.java | 35 ++++++++++ .../epmet/feign/EpmetUserOpenFeignClient.java | 9 +++ .../EpmetUserOpenFeignClientFallback.java | 11 ++++ .../com/epmet/controller/UserController.java | 12 ++++ .../src/main/java/com/epmet/dao/UserDao.java | 6 ++ .../java/com/epmet/service/UserService.java | 8 +++ .../epmet/service/impl/UserServiceImpl.java | 29 ++++++++ .../src/main/resources/mapper/UserDao.xml | 22 +++++++ 13 files changed, 225 insertions(+), 26 deletions(-) create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/HouseMemResDTO.java create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/FindIcUserFormDTO.java create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/EpmetUserFamilyDTO.java diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/DemandResearchAnalysisFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/DemandResearchAnalysisFormDTO.java index ea3f8bcdcd..a6adc0a695 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/DemandResearchAnalysisFormDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/DemandResearchAnalysisFormDTO.java @@ -36,6 +36,6 @@ public class DemandResearchAnalysisFormDTO implements Serializable { * 个人档案:personal-data * 服务措施分析:demand-analysis */ - @NotBlank(message = "个人档案:personal-data;服务措施分析:demand-analysis",groups = AddUserInternalGroup.class) + @NotBlank(message = "queryOrigin不能为空:个人档案:personal-data;服务措施分析:demand-analysis",groups = AddUserInternalGroup.class) private String queryOrigin; } diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandResearchAnalysisResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandResearchAnalysisResultDTO.java index 32f0737dc6..4828385812 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandResearchAnalysisResultDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandResearchAnalysisResultDTO.java @@ -1,6 +1,5 @@ package com.epmet.dto.result.demand; -import com.epmet.dto.result.HouseUserDTO; import lombok.Data; import java.io.Serializable; @@ -10,15 +9,8 @@ import java.util.List; * 数据分析-个人档案-需求详情,研判分析 */ @Data -public class DemandResearchAnalysisResultDTO implements Serializable { +public class DemandResearchAnalysisResultDTO extends HouseMemResDTO implements Serializable { private static final long serialVersionUID = -1024304149893118204L; - /** - * 居民信息及家属列表 - */ - private String icResiUserId; - private String icUserName; - private String houseId; - private List houseUserList; private List demandData; /** diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/HouseMemResDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/HouseMemResDTO.java new file mode 100644 index 0000000000..f8126473b5 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/HouseMemResDTO.java @@ -0,0 +1,22 @@ +package com.epmet.dto.result.demand; + +import com.epmet.dto.result.HouseUserDTO; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 数据分析-个人档案-需求详情,研判分析 + * 案件居民、家属 + */ +@Data +public class HouseMemResDTO implements Serializable { + /** + * 居民信息及家属列表 + */ + private String icResiUserId; + private String icUserName; + private String houseId; + private List houseUserList; +} 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 1edd9d20d5..e77ff237cd 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 @@ -42,12 +42,10 @@ import com.epmet.dto.CustomerAgencyDTO; import com.epmet.dto.CustomerGridDTO; import com.epmet.dto.IcUserDemandRecDTO; import com.epmet.dto.form.CustomerGridFormDTO; +import com.epmet.dto.form.FindIcUserFormDTO; import com.epmet.dto.form.ResiUserFormDTO; import com.epmet.dto.form.demand.*; -import com.epmet.dto.result.AllGridsByUserIdResultDTO; -import com.epmet.dto.result.IcResiUserBriefDTO; -import com.epmet.dto.result.ResiUserResDTO; -import com.epmet.dto.result.UserBaseInfoResultDTO; +import com.epmet.dto.result.*; import com.epmet.dto.result.demand.*; import com.epmet.entity.*; import com.epmet.feign.EpmetAdminOpenFeignClient; @@ -579,13 +577,9 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl userRes = epmetUserOpenFeignClient.findFamilyMem(formDTO.getIcResiUserId()); - if (!userRes.success() || null == userRes.getData()) { - throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取居民信息接口异常"); - } - IcResiUserBriefDTO icResiUserDTO = userRes.getData(); - DemandResearchAnalysisResultDTO resultDTO = ConvertUtils.sourceToTarget(icResiUserDTO, DemandResearchAnalysisResultDTO.class); - + HouseMemResDTO houseMemResDTO=queryDemandUserFamily(formDTO); + DemandResearchAnalysisResultDTO resultDTO = ConvertUtils.sourceToTarget(houseMemResDTO, DemandResearchAnalysisResultDTO.class); + //log.info(JSON.toJSONString(formDTO)); //返参格式套一层类别和类别名称 List demandData=new ArrayList<>(); @@ -596,13 +590,14 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl resiRes=epmetUserOpenFeignClient.findEpmetUser(resiUserFormDTO); - if(!resiRes.success()){ + Result resiRes = epmetUserOpenFeignClient.findEpmetUser(resiUserFormDTO); + if (!resiRes.success()) { throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "查询小程序用户异常"); } if (null != resiRes.getData() && CollectionUtils.isNotEmpty(resiRes.getData().getEpmetUserIdList())) { @@ -655,6 +650,45 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl userRes = epmetUserOpenFeignClient.findFamilyMem(formDTO.getIcResiUserId()); + if (!userRes.success() || null == userRes.getData()) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取居民信息接口异常"); + } + houseMemResDTO=ConvertUtils.sourceToTarget(userRes.getData(),HouseMemResDTO.class); + } + //服务措施点击了,小程序用户上报的需求 + if (StringUtils.isBlank(formDTO.getIcResiUserId())&&CollectionUtils.isNotEmpty(formDTO.getEpmetUserIdList())) { + //需要找到当前这个epmetUserIdList相同身份证号的人, + //以及这个身份证号所对应的居民的家属 + FindIcUserFormDTO findIcUserFormDTO=new FindIcUserFormDTO(); + findIcUserFormDTO.setCustomerId(formDTO.getCustomerId()); + findIcUserFormDTO.setEpmetUserId(formDTO.getEpmetUserIdList().get(NumConstant.ZERO)); + Result epmetUserFamilyDTOResult=epmetUserOpenFeignClient.findIcUser(findIcUserFormDTO); + if (!epmetUserFamilyDTOResult.success() || null == epmetUserFamilyDTOResult.getData()) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "根据小程序用户id,获取ic居民信息接口异常"); + } + houseMemResDTO=ConvertUtils.sourceToTarget(epmetUserFamilyDTOResult.getData(),HouseMemResDTO.class); + formDTO.setEpmetUserIdList(epmetUserFamilyDTOResult.getData().getEpmetUserIdList()); + } + return houseMemResDTO; + } + /** * 数分析-服务措施分析-分页查询 * diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/FindIcUserFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/FindIcUserFormDTO.java new file mode 100644 index 0000000000..c42fdeac01 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/FindIcUserFormDTO.java @@ -0,0 +1,19 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + + +@Data +public class FindIcUserFormDTO implements Serializable { + public interface AddUserInternalGroup { + } + + @NotBlank(message = "epmetUserId不能为空", groups = AddUserInternalGroup.class) + private String epmetUserId; + + @NotBlank(message = "客户id不能为空", groups = AddUserInternalGroup.class) + private String customerId; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/EpmetUserFamilyDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/EpmetUserFamilyDTO.java new file mode 100644 index 0000000000..9b80c69701 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/EpmetUserFamilyDTO.java @@ -0,0 +1,35 @@ +package com.epmet.dto.result; + +import lombok.AllArgsConstructor; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + + +@Data +public class EpmetUserFamilyDTO implements Serializable { + /** + * 当前客户下,与自己相同身份证号的所有账号 + */ + private List epmetUserIdList; + + /** + * 同身份证号对应的ic里的居民 + */ + private String icResiUserId; + /** + * ic里的姓名 + */ + private String icUserName; + + /** + * ic里的房子id + */ + private String houseId; + + /** + * 同屋的其他人 + */ + private List houseUserList; +} 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 2fe940ead3..bff8b92a50 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 @@ -672,4 +672,13 @@ public interface EpmetUserOpenFeignClient { @GetMapping("/epmetuser/icresiuser/findfamilymem/{icResiUserId}") Result findFamilyMem(@PathVariable("icResiUserId") String icResiUserId); + + /** + * 查找居民端小程序里的用户对应ic里的人。以及家属们 + * + * @param formDTO + * @return + */ + @PostMapping(value = "/epmetuser/user/findicuser") + Result findIcUser(@RequestBody FindIcUserFormDTO formDTO); } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java index fc6766d255..109c54c0ed 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 @@ -495,4 +495,15 @@ public class EpmetUserOpenFeignClientFallback implements EpmetUserOpenFeignClien public Result findFamilyMem(String icResiUserId) { return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "findFamilyMem", icResiUserId); } + + /** + * 查找居民端小程序里的用户对应ic里的人。以及家属们 + * + * @param epmetUserIdList + * @return + */ + @Override + public Result findIcUser(FindIcUserFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "findIcUser", formDTO); + } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserController.java index 66d5d15d7a..5d5870439e 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserController.java @@ -198,4 +198,16 @@ public class UserController { ValidatorUtils.validateEntity(formDTO,ResiUserFormDTO.AddUserInternalGroup.class); return new Result().ok(userService.findEpmetUser(formDTO)); } + + /** + * 查找居民端小程序里的用户对应ic里的人。以及家属们 + * + * @param findIcUserFormDTO + * @return + */ + @PostMapping(value = "findicuser") + public Result findIcUser(@RequestBody FindIcUserFormDTO findIcUserFormDTO){ + ValidatorUtils.validateEntity(findIcUserFormDTO,FindIcUserFormDTO.AddUserInternalGroup.class); + return new Result().ok(userService.findIcUser(findIcUserFormDTO)); + } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserDao.java index e4c7a2cec5..0d77ea3ae3 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserDao.java @@ -12,6 +12,8 @@ import com.epmet.entity.UserEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; +import java.util.List; + /** * @Description 用户DAO * @IntefaceName UserDao @@ -63,4 +65,8 @@ public interface UserDao extends BaseDao { * @date 2021/9/10 8:51 上午 */ UserDTO selectByUserId(String userId); + + String selectIdNum(@Param("customerId") String customerId,@Param("epmetUserId") String epmetUserId); + + List selectCommonEpmetUser(@Param("idNum") String idNum, @Param("customerId") String customerId); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserService.java index 0790655742..132ef019a7 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserService.java @@ -113,4 +113,12 @@ public interface UserService extends BaseService { * @return */ ResiUserResDTO findEpmetUser(ResiUserFormDTO formDTO); + + /** + * 查找居民端小程序里的用户对应ic里的人。以及家属们 + * + * @param findIcUserFormDTO + * @return + */ + EpmetUserFamilyDTO findIcUser(FindIcUserFormDTO findIcUserFormDTO); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserServiceImpl.java index 697fda9582..1d987951bd 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserServiceImpl.java @@ -33,6 +33,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.ArrayList; +import java.util.Arrays; import java.util.Date; import java.util.List; import java.util.stream.Collectors; @@ -385,4 +386,32 @@ public class UserServiceImpl extends BaseServiceImpl implem return resiUserResDTO; } + /** + * 查找居民端小程序里的用户对应ic里的人。以及家属们 + * + * @param findIcUserFormDTO + * @return + */ + @Override + public EpmetUserFamilyDTO findIcUser(FindIcUserFormDTO findIcUserFormDTO) { + EpmetUserFamilyDTO result=new EpmetUserFamilyDTO(); + String idNum=baseDao.selectIdNum(findIcUserFormDTO.getCustomerId(),findIcUserFormDTO.getEpmetUserId()); + if(StringUtils.isNotBlank(idNum)){ + //同客户下,相同身份证号的,epmetuser + List epmetUserIdList=baseDao.selectCommonEpmetUser(idNum,findIcUserFormDTO.getCustomerId()); + result.setEpmetUserIdList(epmetUserIdList); + //找到该身份证号的居民 + IcResiUserDTO icResiUserDTO=icResiUserService.getByIdCard(findIcUserFormDTO.getCustomerId(),idNum,null); + if(null!=icResiUserDTO){ + result.setIcResiUserId(icResiUserDTO.getId()); + result.setIcUserName(icResiUserDTO.getName()); + result.setHouseId(icResiUserDTO.getHomeId()); + IcResiUserBriefDTO icResiUserBriefDTO=icResiUserService.findFamilyMem(icResiUserDTO.getId()); + result.setHouseUserList(null!=icResiUserBriefDTO&&CollectionUtils.isNotEmpty(icResiUserBriefDTO.getHouseUserList())?icResiUserBriefDTO.getHouseUserList():new ArrayList<>()); + } + } + result.setEpmetUserIdList(Arrays.asList(findIcUserFormDTO.getEpmetUserId())); + return result; + } + } diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/UserDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/UserDao.xml index 6d82e4c200..605350bde2 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/UserDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/UserDao.xml @@ -82,4 +82,26 @@ u.DEL_FLAG = '0' AND u.id = #{userId} + + + + From 369915a942c5e08b00387ca1bbb4b6ec41680580 Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 15 Dec 2021 09:09:57 +0800 Subject: [PATCH 68/71] =?UTF-8?q?org=20=E4=BB=A3=E7=A0=81=E6=B8=85?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/service/impl/BuildingServiceImpl.java | 8 ++++---- .../service/impl/IcPlacePatrolRecordServiceImpl.java | 6 +++--- .../impl/IcPlacePatrolReviewRecordServiceImpl.java | 6 +++--- .../service/impl/IcPlacePatrolTeamServiceImpl.java | 10 +++++----- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/BuildingServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/BuildingServiceImpl.java index f1c5d28379..24fe5e520a 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/BuildingServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/BuildingServiceImpl.java @@ -88,7 +88,7 @@ public class BuildingServiceImpl implements BuildingService { IcBuildingUnitEntity icBuildingUnit= new IcBuildingUnitEntity(); icBuildingUnit.setCustomerId(customerId); icBuildingUnit.setBuildingId(entity.getId()); - icBuildingUnit.setUnitName(String.valueOf(i+1)+"单元"); + icBuildingUnit.setUnitName((i + 1) +"单元"); icBuildingUnit.setUnitNum(String.valueOf(i+1)); unitList.add(icBuildingUnit); } @@ -103,7 +103,7 @@ public class BuildingServiceImpl implements BuildingService { log.error("com.epmet.service.impl.BuildingServiceImpl.treeList,没有找到工作人员所属的机关信息,用户Id:{}",staffId); return new ArrayList<>(); } - + // agency = new CustomerStaffAgencyDTO(); // agency.setAgencyId("77f6bc7f07064bf4c09ef848139a344c"); //1.获取所在组织及下级组织 @@ -275,7 +275,7 @@ public class BuildingServiceImpl implements BuildingService { IcBuildingUnitEntity icBuildingUnit= new IcBuildingUnitEntity(); icBuildingUnit.setBuildingId(uuid); icBuildingUnit.setCustomerId(customerId); - icBuildingUnit.setUnitName(String.valueOf(i+1)+"单元"); + icBuildingUnit.setUnitName((i + 1) +"单元"); icBuildingUnit.setUnitNum(String.valueOf(i+1)); unitList.add(icBuildingUnit); } @@ -464,7 +464,7 @@ public class BuildingServiceImpl implements BuildingService { IcBuildingUnitEntity icBuildingUnit= new IcBuildingUnitEntity(); icBuildingUnit.setBuildingId(icBuilding.getId()); icBuildingUnit.setCustomerId(customerId); - icBuildingUnit.setUnitName(String.valueOf(i+1)+"单元"); + icBuildingUnit.setUnitName((i + 1) +"单元"); icBuildingUnit.setUnitNum(String.valueOf(i+1)); unitList.add(icBuildingUnit); } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPlacePatrolRecordServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPlacePatrolRecordServiceImpl.java index 2b205e9ae6..5535988941 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPlacePatrolRecordServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPlacePatrolRecordServiceImpl.java @@ -139,7 +139,7 @@ public class IcPlacePatrolRecordServiceImpl extends BaseServiceImpl { if (str.equals(r.getId())) { @@ -188,7 +188,7 @@ public class IcPlacePatrolRecordServiceImpl extends BaseServiceImpl { if (str.equals(r.getId())) { @@ -202,4 +202,4 @@ public class IcPlacePatrolRecordServiceImpl extends BaseServiceImpl teamDTOList = icPlacePatrolTeamStaffDao.getByTeamId(resultDTO.getPlacePatrolTeamId()); //3.封装九小场所数据 - StringBuffer inspectorsNames = new StringBuffer(""); + StringBuffer inspectorsNames = new StringBuffer(); for (String str : resultDTO.getInspectors().split(",")) { teamDTOList.forEach(r -> { if (str.equals(r.getId())) { @@ -195,7 +195,7 @@ public class IcPlacePatrolReviewRecordServiceImpl extends BaseServiceImpl { if (str.equals(r.getId())) { @@ -218,4 +218,4 @@ public class IcPlacePatrolReviewRecordServiceImpl extends BaseServiceImpl { if (str.equals(r.getId())) { @@ -200,7 +200,7 @@ public class IcPlacePatrolTeamServiceImpl extends BaseServiceImpl { if (str.equals(r.getValue())) { @@ -248,7 +248,7 @@ public class IcPlacePatrolTeamServiceImpl extends BaseServiceImpl { if (str.equals(r.getId())) { @@ -257,7 +257,7 @@ public class IcPlacePatrolTeamServiceImpl extends BaseServiceImpl { if (str.equals(r.getValue())) { @@ -272,4 +272,4 @@ public class IcPlacePatrolTeamServiceImpl extends BaseServiceImpl Date: Wed, 15 Dec 2021 10:20:59 +0800 Subject: [PATCH 69/71] serviceShowFlag --- .../java/com/epmet/dto/result/demand/DemandRecResultDTO.java | 4 ++++ .../com/epmet/service/impl/IcUserDemandRecServiceImpl.java | 3 +++ .../src/main/java/com/epmet/controller/ProjectController.java | 1 + .../main/java/com/epmet/controller/ResiEventController.java | 1 + 4 files changed, 9 insertions(+) diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandRecResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandRecResultDTO.java index 06052f22cf..e7b673d22f 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandRecResultDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandRecResultDTO.java @@ -88,6 +88,10 @@ public class DemandRecResultDTO implements Serializable { * XXX(区域化党建单位) */ private String serviceShowName; + /** + * 只要有服务方就显示 + */ + private Boolean serviceShowFlag; /** * 服务方类型:志愿者:volunteer;社会组织:social_org;社区自组织:community_org;区域党建单位:party_unit; */ 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 e77ff237cd..7fecdb9e18 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 @@ -323,6 +323,7 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl(list, pageInfo.getTotal()); @@ -563,6 +564,7 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl(list, total); diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectController.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectController.java index db1af3d7a9..070fc8bba0 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectController.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectController.java @@ -301,6 +301,7 @@ public class ProjectController { /** * 个人档案-话题详情-研判分析 + * 只看来源于议题的项目 * @param tokenDto * @param formDTO * @return diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ResiEventController.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ResiEventController.java index 5ebcafac13..ca48b13304 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ResiEventController.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ResiEventController.java @@ -243,6 +243,7 @@ public class ResiEventController { /** * 数据分析-个人档案-上报事件列表-事件详情研判分析 + * 只看来源于需求上报的项目 * * @param formDTO * @return From 04f9bb0933b527b7fd6c6f1c82f821e0973ea3a6 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 15 Dec 2021 11:10:16 +0800 Subject: [PATCH 70/71] =?UTF-8?q?=E9=9C=80=E6=B1=82=E7=9A=84=E7=A0=94?= =?UTF-8?q?=E5=88=A4=E5=88=86=E6=9E=90=EF=BC=8C=E6=8E=92=E9=99=A4=E5=BD=93?= =?UTF-8?q?=E5=89=8D=E7=9A=84=E9=9C=80=E6=B1=82=E8=AF=A6=E6=83=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/form/demand/DemandResearchAnalysisFormDTO.java | 5 +++++ .../com/epmet/dto/form/demand/IcResiUserDemandFromDTO.java | 6 ++++++ .../com/epmet/service/impl/IcUserDemandRecServiceImpl.java | 1 + .../src/main/resources/mapper/IcUserDemandRecDao.xml | 3 +++ 4 files changed, 15 insertions(+) diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/DemandResearchAnalysisFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/DemandResearchAnalysisFormDTO.java index a6adc0a695..893a383708 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/DemandResearchAnalysisFormDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/DemandResearchAnalysisFormDTO.java @@ -38,4 +38,9 @@ public class DemandResearchAnalysisFormDTO implements Serializable { */ @NotBlank(message = "queryOrigin不能为空:个人档案:personal-data;服务措施分析:demand-analysis",groups = AddUserInternalGroup.class) private String queryOrigin; + + /** + * 当前查看的需求详情的需求id + */ + private String demandRecId; } diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/IcResiUserDemandFromDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/IcResiUserDemandFromDTO.java index 4589bbd9ed..ea0f862854 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/IcResiUserDemandFromDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/IcResiUserDemandFromDTO.java @@ -41,4 +41,10 @@ public class IcResiUserDemandFromDTO implements Serializable { * epmetUserIdList+userId */ private List userIds; + + + /** + * 当前查看的需求详情的需求id 可空 + */ + private String demandRecId; } 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 7fecdb9e18..e66cb7cdc9 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 @@ -623,6 +623,7 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl demandList = baseDao.selectUserDemand(icResiUserDemandFromDTO); if(CollectionUtils.isNotEmpty(demandList)){ 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 9e66aa8abc..11d3190a6c 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 @@ -152,6 +152,9 @@ and r.CATEGORY_CODE like concat(#{firstCategoryCode},'%') + + and r.id !=#{demandRecId} + ORDER BY r.WANT_SERVICE_TIME DESC From cbd0e286b6c02dc2b01566aa60cb23b299fd0551 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Wed, 15 Dec 2021 13:30:36 +0800 Subject: [PATCH 71/71] =?UTF-8?q?=E7=A0=94=E5=88=A4=E5=88=86=E6=9E=90?= =?UTF-8?q?=E4=B8=AD=E9=A1=B9=E7=9B=AE=E5=88=97=E8=A1=A8=E6=8E=92=E9=99=A4?= =?UTF-8?q?=E5=BD=93=E5=89=8D=E6=AD=A3=E5=9C=A8=E6=9F=A5=E7=9C=8B=E7=9A=84?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dataaggre/dto/govproject/form/ProjectAnalysisFormDTO.java | 3 +++ .../service/govproject/impl/GovProjectServiceImpl.java | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/form/ProjectAnalysisFormDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/form/ProjectAnalysisFormDTO.java index d3d1a0e9a8..a620667571 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/form/ProjectAnalysisFormDTO.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/form/ProjectAnalysisFormDTO.java @@ -24,6 +24,9 @@ public class ProjectAnalysisFormDTO implements Serializable { //一级分类Id集合 @NotNull(message = "分类Code集合不能为空", groups = {Analysis.class}) private List categoryCodeList; + //当前查看的项目Id + @NotBlank(message = "当前查看项目Id不能为空", groups = {Analysis.class}) + private String projectId; private String customerId; diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govproject/impl/GovProjectServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govproject/impl/GovProjectServiceImpl.java index dc84f51bdc..200054ae6d 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govproject/impl/GovProjectServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govproject/impl/GovProjectServiceImpl.java @@ -539,7 +539,7 @@ public class GovProjectServiceImpl implements GovProjectService { }); //当前分类下来源楼院小组的项目 groupList.forEach(gr -> { - if (secondCodeMap.containsKey(gr.getCategoryCode())) { + if (secondCodeMap.containsKey(gr.getCategoryCode()) && !formDTO.getProjectId().equals(gr.getProjectId())) { ProjectAnalysisResultDTO.Project project = ConvertUtils.sourceToTarget(gr, ProjectAnalysisResultDTO.Project.class); groupPrList.add(project); } @@ -548,7 +548,7 @@ public class GovProjectServiceImpl implements GovProjectService { groupProjectList.add(groupCa); //当前分类下来源事件上报的项目 eventList.forEach(gr -> { - if (secondCodeMap.containsKey(gr.getCategoryCode())) { + if (secondCodeMap.containsKey(gr.getCategoryCode()) && !formDTO.getProjectId().equals(gr.getProjectId())) { ProjectAnalysisResultDTO.Project project = ConvertUtils.sourceToTarget(gr, ProjectAnalysisResultDTO.Project.class); eventPrList.add(project); }