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"; } 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..bfaf63703a --- /dev/null +++ b/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/CalPartyUnitSatisfactionFormDTO.java @@ -0,0 +1,19 @@ +package com.epmet.commons.rocketmq.messages; + + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +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-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-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/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govissue/IssueProjectCategoryDictDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govissue/IssueProjectCategoryDictDTO.java index 4555a86cd2..fc11fafe4f 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govissue/IssueProjectCategoryDictDTO.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govissue/IssueProjectCategoryDictDTO.java @@ -87,7 +87,7 @@ public class IssueProjectCategoryDictDTO implements Serializable { /** * 颜色 */ - private String colour; + private String color; } \ No newline at end of file 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-client/src/main/java/com/epmet/dataaggre/dto/govproject/result/ProjectCategoryTotalResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/result/ProjectCategoryTotalResultDTO.java index 69e247e5d8..5ae7d12cda 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/result/ProjectCategoryTotalResultDTO.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/result/ProjectCategoryTotalResultDTO.java @@ -19,7 +19,7 @@ public class ProjectCategoryTotalResultDTO implements Serializable { //一级分类名称 private String categoryName; //一级分类颜色 - private String colour = ""; + private String color = ""; //分类下项目总数 private Integer total = 0; 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/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)); } 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 0bb46ba328..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 @@ -373,7 +373,7 @@ public class GovProjectServiceImpl implements GovProjectService { if (ca.getCategoryCode().equals(l.getCategoryCode())) { dto.setCategoryCode(ca.getCategoryCode()); dto.setCategoryName(ca.getCategoryName()); - dto.setColour(ca.getColour()); + dto.setColor(ca.getColor()); } }); map.put(l.getCategoryCode(), l.getCategoryCode()); @@ -385,7 +385,7 @@ public class GovProjectServiceImpl implements GovProjectService { dto.setAgencyId(formDTO.getAgencyId()); dto.setCategoryCode(ca.getCategoryCode()); dto.setCategoryName(ca.getCategoryName()); - dto.setColour(ca.getColour()); + dto.setColor(ca.getColor()); resultList.add(dto); map.put(ca.getCategoryCode(), ca.getCategoryCode()); } @@ -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.查询对应负能平台用户家庭信息 @@ -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); } 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 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 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/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..16cbee4538 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/heart/result/DemandServiceCountResultDTO.java @@ -0,0 +1,19 @@ +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 { + // 服务者ID + private String serverId; + // 服务类型 + private String serviceType; + // 服务次数 + private int serveTimes; +} 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..872dbc96a2 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 color; + } \ No newline at end of file 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/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..165ae6b91c --- /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 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/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/issue/IssueProjectCategoryDictEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/issue/IssueProjectCategoryDictEntity.java index 67c82fee00..1c1afbcc08 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 color; + } 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..baaa29c97b --- /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 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/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..b8e4414f60 --- /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 listVolunteers(String customerId, Date endCreateTime); +} 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..c33f426ad5 --- /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 listDemandServeTimesPage(String customerId, Date endTime, int serviceCountPageNo, int serviceCountPageSize) { + return PageHelper.startPage(serviceCountPageNo, serviceCountPageSize).doSelectPage(new ISelect() { + @Override + public void doSelect() { + demandServiceDao.listDemandServeTimes(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..902a6a8713 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/impl/HeartVolunteerServiceImpl.java @@ -0,0 +1,38 @@ +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 listVolunteers(String customerId, Date endCreateTime) { + LambdaQueryWrapper query = new LambdaQueryWrapper<>(); + query.eq(VolunteerInfoEntity::getCustomerId, customerId); + query.lt(VolunteerInfoEntity::getCreatedTime, endCreateTime); + return 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..66cbf1058d --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/DemandServiceImpl.java @@ -0,0 +1,176 @@ +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 targetDate 要清理哪天的数据 + * @param customerIds 要清理哪些客户的 + */ + private void clearOldDatas(List customerIds, Date targetDate) { + + String dateDimId = DimIdGenerator.getDateDimId(targetDate); + + demandStatsService.clearVolunteerDemandServiceDailyStats(customerIds, dateDimId); + + } + + /** + * 统计单个客户的志愿者服务情况 + * @param customerId 客户ID + * @param endTime 统计截止时间( partymemberVolunteerUserIds = new ArrayList<>(16); + + List volunteers = heartVolunteerService.listVolunteers(customerId, endTime); + + volunteerTotalCount = volunteers.size(); + + // 分片开始下标 + int shardingStartIndex = 0; + // 分片大小(条数) + int shardingSize = 100; + + // 分片去确定党员身份,防止in条件过大 + while (true) { + int realShardingSize = Math.min(shardingSize, volunteerTotalCount - shardingStartIndex); + + if (realShardingSize <= 0) { + break; + } + + int shardingEndIndex = shardingStartIndex + realShardingSize; + List volunteerUserIds = volunteers.subList(shardingStartIndex, shardingEndIndex) + .stream() + .map((volunteerInfoEntity) -> volunteerInfoEntity.getUserId()) + .collect(Collectors.toList()); + + List tempPartymemberUserIds = userService.filterUserIds(volunteerUserIds, EpmetRoleKeyConstant.PARTYMEMBER); + + partymemberVolunteerUserIds.addAll(tempPartymemberUserIds); + + shardingStartIndex = shardingEndIndex; + } + + partymemberVolunteerCount = partymemberVolunteerUserIds.size(); + resiVolunteerCount = volunteerTotalCount - partymemberVolunteerCount; + + //2. 查询志愿者服务次数 + + // 总服务次数 + int totalDemandServeTimes = 0; + // 党员服务次数 + int partymemberDemandServeTimes = 0; + // 居民服务次数 + int resiDemandServeTimes = 0; + + int serviceCountPageNo = 0; + int serviceCountPageSize = 1000; + while (true) { + + // 取出每一个服务者的服务次数 + List damendServeTimes = heartDemandService.listDemandServeTimesPage(customerId, endTime, serviceCountPageNo, serviceCountPageSize); + + for (DemandServiceCountResultDTO damendServiceTimes : damendServeTimes) { + String serverId = damendServiceTimes.getServerId(); + if (partymemberVolunteerUserIds.contains(serverId)) { + partymemberDemandServeTimes += damendServiceTimes.getServeTimes(); + } else { + resiDemandServeTimes += damendServiceTimes.getServeTimes(); + } + } + + 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(partymemberDemandServeTimes); + insert.setServiceTotal(totalDemandServeTimes); + insert.setPartyTotal(partymemberVolunteerCount); + insert.setResiServiceTotal(resiDemandServeTimes); + 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..ddebabef66 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/heart/IcUserDemandServiceDao.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ 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} + + + 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..2e564db7cc --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/CategoryAnalysisFormDTO.java @@ -0,0 +1,41 @@ +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 = "组织:agency,网格:grid", groups = AddUserShowGroup.class) + private String orgType; + @NotBlank(message = "起止日期不能为空,格式yyyy-MM-dd", groups = AddUserShowGroup.class) + private String startDateId; + @NotBlank(message = "截止日期不能为空,格式yyyy-MM-dd", 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/form/demand/DemandResearchAnalysisFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/DemandResearchAnalysisFormDTO.java index d40ed7cb8a..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 @@ -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,16 @@ public class DemandResearchAnalysisFormDTO implements Serializable { @NotBlank(message = "tokenDto中的customerId不能为空",groups = AddUserInternalGroup.class) private String customerId; + + /** + * 个人档案:personal-data + * 服务措施分析:demand-analysis + */ + @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-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..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 @@ -27,18 +27,17 @@ 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; @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) @@ -49,4 +48,5 @@ public class PageListAnalysisFormDTO implements Serializable { private String gridPids; private Boolean pageFlag; + } 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/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/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-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/DemandRecResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandRecResultDTO.java index feb5c70b84..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; */ @@ -114,4 +118,7 @@ public class DemandRecResultDTO implements Serializable { * 完成情况 */ private String finishDesc; + + private String icResiUserId; + private String epmetUserId; } 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..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,18 +9,10 @@ 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 demandList; + private List demandData; /** * 入参中给的,再返回去 */ diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/FinishResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/FinishResultDTO.java new file mode 100644 index 0000000000..96d03b9c2d --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/FinishResultDTO.java @@ -0,0 +1,15 @@ +package com.epmet.dto.result.demand; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 完成需求时,是否需要计算 区域化党建单位的满意度 + * + */ +@Data +public class FinishResultDTO implements Serializable { + private Boolean sendCalStatisfaction; + private String partyUnitId; +} 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-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/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-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-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/pom.xml b/epmet-module/epmet-heart/epmet-heart-server/pom.xml index 3aeab54847..034780d7d5 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/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/controller/IcPartyUnitController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyUnitController.java index 359e6b3657..27f193b978 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.dto.result.OptionDataResultDTO; @@ -179,4 +180,18 @@ public class IcPartyUnitController { ValidatorUtils.validateEntity(formDTO); return new Result>().ok(icPartyUnitService.distribution(formDTO)); } + + + /** + * 计算区域化党建单位的群众满意度 + * + * @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/controller/IcUserDemandRecController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcUserDemandRecController.java index 666243eee0..06c991b31c 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 @@ -17,15 +17,23 @@ package com.epmet.controller; +import com.epmet.commons.rocketmq.messages.CalPartyUnitSatisfactionFormDTO; import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ExcelUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.constant.SystemMessageType; import com.epmet.constant.UserDemandConstant; +import com.epmet.dto.form.SystemMsgFormDTO; import com.epmet.dto.form.demand.*; 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.OptionDTO; +import com.epmet.feign.EpmetMessageOpenFeignClient; import com.epmet.service.*; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; @@ -60,7 +68,8 @@ public class IcUserDemandRecController { private IcCommunitySelfOrganizationService icCommunitySelfOrganizationService; @Autowired private IcPartyUnitService icPartyUnitService; - + @Autowired + private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient; /** * 根据服务方类型查询 下拉框 @@ -179,7 +188,16 @@ public class IcUserDemandRecController { formDTO.setCustomerId(tokenDto.getCustomerId()); formDTO.setUserId(tokenDto.getUserId()); ValidatorUtils.validateEntity(formDTO,FinishStaffFromDTO.AddUserShowGroup.class,FinishStaffFromDTO.AddUserInternalGroup.class); - icUserDemandRecService.finish(formDTO); + FinishResultDTO finishResultDTO=icUserDemandRecService.finish(formDTO); + if(finishResultDTO.getSendCalStatisfaction()){ + CalPartyUnitSatisfactionFormDTO mqMsg = new CalPartyUnitSatisfactionFormDTO(); + mqMsg.setCustomerId(formDTO.getCustomerId()); + mqMsg.setPartyUnitId(finishResultDTO.getPartyUnitId()); + SystemMsgFormDTO form = new SystemMsgFormDTO(); + form.setMessageType(SystemMessageType.CAL_PARTY_UNIT_SATISFACTION); + form.setContent(mqMsg); + epmetMessageOpenFeignClient.sendSystemMsgByMQ(form); + } return new Result(); } @@ -257,4 +275,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/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/dao/IcPartyUnitDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPartyUnitDao.java index e287499c48..faddda7644 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 @@ -25,6 +25,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; /** @@ -63,4 +64,6 @@ public interface IcPartyUnitDao extends BaseDao { * @Date 2021/12/9 14:24 */ List getDistribution(@Param("agencyId")String agencyId); + + 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 aa7c3c68c1..6c36e11618 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.*; 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; @@ -65,4 +67,23 @@ public interface IcUserDemandRecDao extends BaseDao { * @return */ 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, + @Param("orgType") String orgType, + @Param("gridPids") String gridPids, + @Param("startDateId") String startDateId, + @Param("endDateId") String endDateId); + + 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/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 ebb876072a..490e19bee6 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 @@ -19,6 +19,7 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.dto.result.OptionDataResultDTO; +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; @@ -141,4 +142,10 @@ public interface IcPartyUnitService extends BaseService { * @Date 2021/12/9 10:10 */ List distribution(PartyActivityFormDTO formDTO); + + /** + * 计算区域化党建单位的群众满意度 + * @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/IcUserDemandRecService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcUserDemandRecService.java index 685261ec33..d17b6b3bfc 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,9 +21,12 @@ 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.FinishResultDTO; import com.epmet.dto.result.demand.IcResiUserReportDemandRes; +import com.epmet.dto.result.demand.ServiceStatDTO; import com.epmet.entity.IcUserDemandRecEntity; import java.util.List; @@ -128,7 +131,7 @@ public interface IcUserDemandRecService extends BaseService pageListAnalysis(PageListAnalysisFormDTO formDTO); + + /** + * 数据分析-服务措施分析-柱状图 + * + * @return + */ + CategoryAnalysisResDTO categoryAnalysis(CategoryAnalysisFormDTO formDTO); + + /** + * 计算出服务方,评价总分,服务的需求个数 + * + * @param customerId + * @param partyUnitId + * @return + */ + List 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/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/IcPartyActivityServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyActivityServiceImpl.java index cd80f55b72..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 @@ -72,6 +72,10 @@ public class IcPartyActivityServiceImpl extends BaseServiceImpl search(PartyActivityFormDTO formDTO) { @@ -150,12 +154,21 @@ 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; } @@ -213,7 +226,7 @@ public class IcPartyActivityServiceImpl extends BaseServiceImpl categoryMap = icResiDemandDictService.querySubCodeList(codeFormDTO).stream().collect(Collectors.toMap(OptionDTO::getLabel, OptionDTO::getValue)); //获取联建单位 IcPartyUnitDTO unitDTO = new IcPartyUnitDTO(); @@ -338,8 +351,10 @@ 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()); @@ -350,11 +365,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())); @@ -364,9 +382,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)); } 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..ab96c7c68b 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; @@ -46,6 +48,7 @@ import com.epmet.dto.form.demand.ServiceQueryFormDTO; import com.epmet.dto.form.demand.SubCodeFormDTO; import com.epmet.dto.result.PartyUnitDistributionResultDTO; import com.epmet.dto.result.demand.OptionDTO; +import com.epmet.dto.result.demand.ServiceStatDTO; import com.epmet.entity.IcPartyUnitEntity; import com.epmet.excel.IcPartyUnitImportExcel; import com.epmet.feign.EpmetAdminOpenFeignClient; @@ -64,6 +67,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; @@ -111,6 +115,11 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl()); } + if(StringUtils.isBlank(item.getSatisfaction())){ + item.setSatisfaction(StrConstant.HYPHEN); + }else{ + item.setSatisfaction(new BigDecimal(item.getSatisfaction()).setScale(2,BigDecimal.ROUND_HALF_UP).toString()); + } }); PageInfo pageInfo = new PageInfo<>(dtoList); return new PageData<>(dtoList, pageInfo.getTotal()); @@ -415,7 +424,32 @@ 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; + } + + /** + * 计算区域化党建单位的群众满意度 + * 总分➗需求个数 + * @param formDTO + */ + @Override + public void calPartyUnitSatisfation(CalPartyUnitSatisfactionFormDTO formDTO) { + log.info("收到消息内容啦...." + JSON.toJSONString(formDTO)); + List 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/IcResiDemandDictServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcResiDemandDictServiceImpl.java index 5fe0df4eff..8dfd1599cf 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcResiDemandDictServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcResiDemandDictServiceImpl.java @@ -36,11 +36,13 @@ import com.epmet.service.IcResiDemandDictService; 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.lang3.StringUtils; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.util.Arrays; +import java.util.Collections; import java.util.List; import java.util.Map; @@ -203,7 +205,11 @@ public class IcResiDemandDictServiceImpl 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 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..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 @@ -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; @@ -41,13 +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.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.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.*; +import com.epmet.dto.result.demand.*; import com.epmet.entity.*; import com.epmet.feign.EpmetAdminOpenFeignClient; import com.epmet.feign.EpmetUserOpenFeignClient; @@ -56,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; @@ -73,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 @@ -90,6 +91,7 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl page(Map params) { IPage page = baseDao.selectPage( @@ -239,9 +241,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("查询志愿者信息异常"); } @@ -321,6 +323,7 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl(list, pageInfo.getTotal()); @@ -410,7 +413,7 @@ 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 houseMemResDTO=queryDemandUserFamily(formDTO); + DemandResearchAnalysisResultDTO resultDTO = ConvertUtils.sourceToTarget(houseMemResDTO, DemandResearchAnalysisResultDTO.class); + //log.info(JSON.toJSONString(formDTO)); + + //返参格式套一层类别和类别名称 + List 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); + + //如果是服务措施分析来的,并且是pc录入的需求,需要先去找epmetUserIdList + if (UserDemandConstant.DEMAND_ANALYSIS.equals(formDTO.getQueryOrigin()) + && StringUtils.isNotBlank(formDTO.getIcResiUserId()) + && 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()); + } } - IcResiUserBriefDTO icResiUserDTO = userRes.getData(); - DemandResearchAnalysisResultDTO resultDTO = ConvertUtils.sourceToTarget(icResiUserDTO, DemandResearchAnalysisResultDTO.class); - resultDTO.setEpmetUserIdList(CollectionUtils.isNotEmpty(formDTO.getEpmetUserIdList()) ? formDTO.getEpmetUserIdList() : Collections.emptyList()); //获取当前需求人,相同分类的需求列表。不分页,直接返回所有 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()); + icResiUserDemandFromDTO.setDemandRecId(formDTO.getDemandRecId()); List demandList = baseDao.selectUserDemand(icResiUserDemandFromDTO); if(CollectionUtils.isNotEmpty(demandList)){ @@ -603,11 +645,53 @@ 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; + } + /** * 数分析-服务措施分析-分页查询 * @@ -617,15 +701,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())); } } @@ -654,9 +738,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("查询志愿者信息异常"); } @@ -691,11 +775,141 @@ 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); + + log.info("阶段性胜利1:"+ JSON.toJSONString(legend)); + // 3、传进来的是组织id的话,查询出全路径 + if("agency".equals(formDTO.getOrgType())){ + //找到当前组织的所有上级,再拼接上自己 + 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{ + formDTO.setGridPids(customerAgencyDTOResult.getData().getPids().concat(StrConstant.COLON).concat(formDTO.getOrgId())); + } + } + + //4、构造最后的反参 + List 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(), + formDTO.getOrgType(), + formDTO.getGridPids(), + formDTO.getStartDateId(), + formDTO.getEndDateId()); + if(!CollectionUtils.isEmpty(haveDemandList)){ + 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)){ + log.info("阶段性胜利4:"+ JSON.toJSONString(map)); + for(CategoryAnalysisDTO result:list){ + if (map.containsKey(result.getCategoryCode()) && null != map.get(result.getCategoryCode())) { + //如果当前分类下有上报的需求,将原来的0改为实际的需求数量 + CategoryAnalysisDTO tempDto=map.get(result.getCategoryCode()); + result.setTotal(tempDto.getTotal()); + + //当前分类有居民的明细:未完成多少个,xxx个志愿者完成xxx个需求 + if(CollectionUtils.isNotEmpty(tempDto.getDetail())){ + List 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()); + } + } + + } + + } + + } + + } + + } + + //返回结果,也不知道对不对 + CategoryAnalysisResDTO result=new CategoryAnalysisResDTO(); + result.setLegend(legend); + result.setCategoryList(list); + 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); + l.add(d); + }); + return l; + } + /** + * 计算出服务方,评价总分,服务的需求个数 + * + * @param customerId + * @param partyUnitId + * @return + */ + @Override + public List 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/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/epmet-heart/epmet-heart-server/src/main/resources/bootstrap.yml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/bootstrap.yml index fe4ff2e5fa..11e6aea570 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/bootstrap.yml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/bootstrap.yml @@ -141,7 +141,10 @@ dingTalk: robot: webHook: @dingTalk.robot.webHook@ secret: @dingTalk.robot.secret@ - +rocketmq: + # 是否开启mq + enable: @rocketmq.enable@ + name-server: @rocketmq.nameserver@ # 停机选项 shutdown: graceful: 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 @@ - + - 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 aa0785186d..d7f02b7109 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 @@ -74,4 +74,10 @@ ID + + 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/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 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..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 @@ -75,7 +75,17 @@ case when r.PARENT_CODE !='0' then r.PARENT_CODE ELSE R.CATEGORY_CODE END - ) as firstCategoryCode + ) as firstCategoryCode, + ( + CASE WHEN R.DEMAND_USER_TYPE='ic_resi_user' THEN R.DEMAND_USER_ID + ELSE '' + END + ) as icResiUserId, + ( + CASE WHEN R.DEMAND_USER_TYPE='mini_resi' THEN R.DEMAND_USER_ID + ELSE '' + END + ) as epmetUserId FROM ic_user_demand_rec r left JOIN ic_user_demand_service s ON ( r.id = s.DEMAND_REC_ID AND s.DEL_FLAG = '0' ) @@ -90,7 +100,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} @@ -142,6 +152,9 @@ and r.CATEGORY_CODE like concat(#{firstCategoryCode},'%') + + and r.id !=#{demandRecId} + ORDER BY r.WANT_SERVICE_TIME DESC @@ -182,7 +195,17 @@ IFNULL(s.FINISH_DESC,'') as finishDesc, '' AS serviceShowName, s.id as serviceId, - left(r.CATEGORY_CODE,4) as firstCategoryCode + left(r.CATEGORY_CODE,4) as firstCategoryCode, + ( + CASE WHEN R.DEMAND_USER_TYPE='ic_resi_user' THEN R.DEMAND_USER_ID + ELSE '' + END + ) as icResiUserId, + ( + CASE WHEN R.DEMAND_USER_TYPE='mini_resi' THEN R.DEMAND_USER_ID + ELSE '' + END + ) as epmetUserId FROM ic_user_demand_rec r left JOIN ic_user_demand_service s ON ( r.id = s.DEMAND_REC_ID AND s.DEL_FLAG = '0' ) @@ -235,7 +258,17 @@ case when r.PARENT_CODE !='0' then r.PARENT_CODE ELSE R.CATEGORY_CODE END - ) as firstCategoryCode + ) as firstCategoryCode, + ( + CASE WHEN R.DEMAND_USER_TYPE='ic_resi_user' THEN R.DEMAND_USER_ID + ELSE '' + END + ) as icResiUserId, + ( + CASE WHEN R.DEMAND_USER_TYPE='mini_resi' THEN R.DEMAND_USER_ID + ELSE '' + END + ) as epmetUserId FROM ic_user_demand_rec r left JOIN ic_user_demand_service s ON ( r.id = s.DEMAND_REC_ID AND s.DEL_FLAG = '0' ) @@ -254,11 +287,128 @@ - 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 + + + + + + + + + + + + + + + + + \ No newline at end of file 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); + } +} 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"; } 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 430d1acbdb..92703db76e 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; } 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-client/src/main/java/com/epmet/dto/result/CategoryListResultDTO.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/CategoryListResultDTO.java index 8f719ff94c..dea3653428 100644 --- a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/CategoryListResultDTO.java +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/CategoryListResultDTO.java @@ -30,7 +30,7 @@ public class CategoryListResultDTO implements Serializable { /** * 颜色 */ - private String colour; + private String color; /** * 1级分类长度 @@ -42,6 +42,6 @@ public class CategoryListResultDTO implements Serializable { this.categoryName = ""; this.count = NumConstant.ZERO; this.codeLength = NumConstant.ZERO; - this.colour = ""; + this.color = ""; } } 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-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..22ae365945 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; /** @@ -33,12 +35,12 @@ public class ResiBuzzLeftPieChartResultDTO implements Serializable { /** * 颜色 */ - private String colour; + private String color; public ResiBuzzLeftPieChartResultDTO() { this.count = NumConstant.ZERO; this.categoryCode = ""; this.categoryName = ""; - this.colour = ""; + this.color = ""; } } 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/entity/IssueProjectCategoryDictEntity.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/entity/IssueProjectCategoryDictEntity.java index b99f37a2bf..0a05d29091 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 color; + } 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..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 @@ -1586,11 +1586,14 @@ 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())); - List list = pageInfo.getList(); - if (CollectionUtils.isEmpty(list)){ + // 分类编码长度 + Integer length = baseDao.selectOneLevelCategoryLength(tokenDto.getCustomerId()); + 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(); @@ -1599,8 +1602,9 @@ public class IssueServiceImpl extends BaseServiceImpl imp if (!usersResult.success()){ throw new EpmetException("查询人员姓名失败..."); } - Integer total = Integer.valueOf(String.valueOf(pageInfo.getTotal())); - result.setTotal(total > NumConstant.FIFTY ? NumConstant.FIFTY : total); + // 默认最多50 产品要求 + result.setTotal(allList.size()); + // 赋值展示名字 list.forEach(l -> { l.setSort(no.getAndSet(no.get() + NumConstant.ONE)); usersResult.getData().forEach(u -> { @@ -1630,6 +1634,7 @@ public class IssueServiceImpl extends BaseServiceImpl imp formDTO.setOrgId(staffInfo.getAgencyId()); formDTO.setOrgType(IssueConstant.ISSUE_AGENCY); } + // 分类编码长度 Integer length = baseDao.selectOneLevelCategoryLength(tokenDto.getCustomerId()); List result = baseDao.resiBuzzLeftPieChart(formDTO.getOrgId(), formDTO.getOrgType(), length, tokenDto.getCustomerId()); if(CollectionUtils.isEmpty(result)){ @@ -1646,7 +1651,7 @@ public class IssueServiceImpl extends BaseServiceImpl imp */ @Override public List getProjectCountByGrid(ProjectDistributionAnalysisFormDTO formDTO) { - List result = baseDao.getProjectCountByGrid(formDTO.getOrgId(), formDTO.getStartDate(), formDTO.getEndDate()); + List result = baseDao.getProjectCountByGrid(formDTO.getOrgId(), formDTO.getStartDate(), formDTO.getEndDate()); if (CollectionUtils.isEmpty(result)){ return new ArrayList<>(); } 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.17__add_color.sql similarity index 80% 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.17__add_color.sql index 81473802f7..0ed1ab2b24 100644 --- 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.17__add_color.sql @@ -1,87 +1,87 @@ -alter table issue_project_category_dict add column `COLOUR` VARCHAR(20) COMMENT '颜色' AFTER `SORT`; +alter table issue_project_category_dict add column `COLOR` VARCHAR(20) COMMENT '颜色' AFTER `SORT`; UPDATE issue_project_category_dict -SET colour = '#ffba00' +SET color = '#ffba00' WHERE DEL_FLAG = '0' AND CATEGORY_TYPE = '1' AND CATEGORY_NAME = '市场监管'; UPDATE issue_project_category_dict -SET colour = '#ffd074' +SET color = '#ffd074' WHERE DEL_FLAG = '0' AND CATEGORY_TYPE = '1' AND CATEGORY_NAME = '卫生计生监督执法'; UPDATE issue_project_category_dict -SET colour = '#42cd05' +SET color = '#42cd05' WHERE DEL_FLAG = '0' AND CATEGORY_TYPE = '1' AND CATEGORY_NAME = '建设管理'; UPDATE issue_project_category_dict -SET colour = '#16d783' +SET color = '#16d783' WHERE DEL_FLAG = '0' AND CATEGORY_TYPE = '1' AND CATEGORY_NAME = '文化执法'; UPDATE issue_project_category_dict -SET colour = '#00e5ed' +SET color = '#00e5ed' WHERE DEL_FLAG = '0' AND CATEGORY_TYPE = '1' AND CATEGORY_NAME = '民政'; UPDATE issue_project_category_dict -SET colour = '#0091ed' +SET color = '#0091ed' WHERE DEL_FLAG = '0' AND CATEGORY_TYPE = '1' AND CATEGORY_NAME = '其他'; UPDATE issue_project_category_dict -SET colour = '#1b51ff' +SET color = '#1b51ff' WHERE DEL_FLAG = '0' AND CATEGORY_TYPE = '1' AND CATEGORY_NAME = '城市管理'; UPDATE issue_project_category_dict -SET colour = '#1641cc' +SET color = '#1641cc' WHERE DEL_FLAG = '0' AND CATEGORY_TYPE = '1' AND CATEGORY_NAME = '公安交通管理'; UPDATE issue_project_category_dict -SET colour = '#2a00ff' +SET color = '#2a00ff' WHERE DEL_FLAG = '0' AND CATEGORY_TYPE = '1' AND CATEGORY_NAME = '消防安全'; UPDATE issue_project_category_dict -SET colour = '#7800ff' +SET color = '#7800ff' WHERE DEL_FLAG = '0' AND CATEGORY_TYPE = '1' AND CATEGORY_NAME = '创卫复审类'; UPDATE issue_project_category_dict -SET colour = '#c600ff' +SET color = '#c600ff' WHERE DEL_FLAG = '0' AND CATEGORY_TYPE = '1' AND CATEGORY_NAME = '环境保护'; UPDATE issue_project_category_dict -SET colour = '#ff00d2' +SET color = '#ff00d2' WHERE DEL_FLAG = '0' AND CATEGORY_TYPE = '1' AND CATEGORY_NAME = '安全监管'; UPDATE issue_project_category_dict -SET colour = '#ff2a00' +SET color = '#ff2a00' WHERE DEL_FLAG = '0' AND CATEGORY_TYPE = '1' AND CATEGORY_NAME = '社会治安综治'; UPDATE issue_project_category_dict -SET colour = '#ff7800' +SET color = '#ff7800' WHERE DEL_FLAG = '0' AND CATEGORY_TYPE = '1' AND CATEGORY_NAME = '食品药品监管'; 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..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 @@ -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 @@ -579,22 +580,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} @@ -605,7 +623,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 @@ -620,12 +638,12 @@ 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..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(colour,'') 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-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-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-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..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 @@ -26,6 +26,15 @@ public class AgencyTreeResultDTO implements Serializable { private String pid; private String level; + //经度【没值则取跟客户的值】 + private String longitude; + //维度【没值则取跟客户的值】 + private String latitude; + + /** + * orgId-orgLevel + */ + private String orgLevel; /** * 下级机关组织 */ 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-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/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..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 @@ -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/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/CustomerAgencyServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java index de90539444..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,6 +1119,9 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl()); @@ -1152,7 +1158,10 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl()); } 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/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<>(); 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 SELECT - id AS "agencyId", - organization_name AS "agencyName", - pids AS "pids" - FROM customer_agency - WHERE del_flag = '0' - AND pids = #{subAgencyPids} - ORDER BY created_time DESC + ca.id AS "agencyId", + ca.organization_name AS "agencyName", + ca.pids AS "pids", + ca.level level, + ( 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_agency ca + WHERE ca.del_flag = '0' + AND ca.pids = #{subAgencyPids} + ORDER BY ca.created_time DESC SELECT - ca.id AS "agencyId", - ca.organization_name AS "agencyName", - ca.pids AS "pids", - ca.PID AS pid, - ca.LEVEL + ca.id agencyId, + ca.organization_name agencyName, + ca.pids pids, + ca.pid pid, + ca.level level, + ( 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_agency ca INNER JOIN customer_staff_agency csa ON ca.id = csa.agency_id diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml index 94ca7a4587..0ddf90f008 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml @@ -389,12 +389,30 @@ + + + + + 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} + + + +