diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/AblityListResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/AblityListResultDTO.java index 97c32e1994..d6cc4cd785 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/AblityListResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/AblityListResultDTO.java @@ -3,6 +3,7 @@ package com.epmet.evaluationindex.screen.dto.result; import lombok.Data; import java.io.Serializable; +import java.math.BigDecimal; /** * 按月查询各项指标数据--接口返参 @@ -30,4 +31,9 @@ public class AblityListResultDTO implements Serializable { */ private String showType; + /** + * 指标对应的权重 + */ + private BigDecimal weight; + } diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/DepartmentNameListResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/DepartmentNameListResultDTO.java new file mode 100644 index 0000000000..94cfb8fc51 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/DepartmentNameListResultDTO.java @@ -0,0 +1,28 @@ +package com.epmet.evaluationindex.screen.dto.result; + +import lombok.AllArgsConstructor; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2020/10/26 3:36 下午 + */ +@Data +@AllArgsConstructor +public class DepartmentNameListResultDTO implements Serializable { + + private static final long serialVersionUID = -801407836277197080L; + + /** + * 部门名 + */ + private String departmentName; + /** + * 工作人员 + */ + private List staffList; + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectDetailResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectDetailResultDTO.java index 3e7f064407..df2f60b2f2 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectDetailResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectDetailResultDTO.java @@ -1,6 +1,8 @@ package com.epmet.project.dto.result; +import com.epmet.evaluationindex.screen.dto.result.DepartmentNameListResultDTO; import lombok.Data; +import lombok.NoArgsConstructor; import java.io.Serializable; import java.util.ArrayList; @@ -40,6 +42,15 @@ public class ProjectDetailResultDTO implements Serializable { */ private List processList; + /** + * 当前跟进部门 + */ + private List departmentNameList; + /** + * 当前跟进部门 + */ + private List departmentList; + public ProjectDetailResultDTO() { this.eventTitle = ""; this.eventContent = ""; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/fact/FactIndexController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/fact/FactIndexController.java index 5780a6e4c3..2fe90dbce7 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/fact/FactIndexController.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/fact/FactIndexController.java @@ -1,7 +1,5 @@ package com.epmet.datareport.controller.fact; -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.commons.tools.validator.ValidatorUtils; import com.epmet.datareport.service.fact.FactIndexService; @@ -40,7 +38,7 @@ public class FactIndexController { /** * @param formDTO - * @Description 按月份查询各项能力分数 + * @Description 按月份查询本级及下级分数 * @author sun */ @PostMapping("index/scorelist") diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/DistributionController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/DistributionController.java index 8c17f03238..25bf9e5434 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/DistributionController.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/DistributionController.java @@ -27,8 +27,8 @@ public class DistributionController { private DistributionService distributionService; /** - * @Description 1、党支部 * @param formDTO + * @Description 1、党支部分布 【只显示 screen_customer_biz_org 表中存在的orgId的数据】 * @author zxc * @date 2020/8/18 10:59 上午 */ @@ -39,7 +39,7 @@ public class DistributionController { } /** - * @Description 2、用户分布 + * @Description 2、用户分布 【只显示 screen_customer_biz_org 表中存在的orgId的数据】 * @param userFormDTO * @author zxc * @date 2020/8/18 11:10 上午 @@ -51,7 +51,7 @@ public class DistributionController { } /** - * @Description 3、党员分布 + * @Description 3、党员分布 【只显示 screen_customer_biz_org 表中存在的orgId的数据】 * @param parymemberFormDTO * @author zxc * @date 2020/8/18 11:20 上午 diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexAgencyScoreDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexAgencyScoreDao.java index 66cbc46d42..57a9829f1d 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexAgencyScoreDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexAgencyScoreDao.java @@ -39,22 +39,22 @@ public interface FactIndexAgencyScoreDao { /** * @param formDTO - * @Description 分别查询区县、乡镇街道过去12个月党建能力、治理能力、服务能力每月总分、本级得分、下级得分数据 + * @Description 分别查询区县、乡镇街道过去12个月党建能力、治理能力、服务能力每月各项乘以权重后的得分数据 * @author sun */ - LinkedList selectAblityIndex(AblityIndexFormDTO formDTO); + LinkedList selectAgencyAblityWeightScoreIndex(AblityIndexFormDTO formDTO); /** * @param formDTO * @Description 查询当前组织某一月份党建能力、治理能力、服务能力对应的总分、本级分、下级分 * @author sun */ - List selectScoreList(ScoreListFormDTO formDTO); + List selectAgencyWeightScoreList(ScoreListFormDTO formDTO); /** * @param formDTO * @Description 分别查询区县、乡镇街道过去12个月党建能力、治理能力、服务能力每月总分、本级得分、下级得分数据 * @author sun */ - LinkedList selectMonthScoreList(MonthScoreListFormDTO formDTO); + LinkedList selectAgencyMonthWeightScoreList(MonthScoreListFormDTO formDTO); } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexCommunityScoreDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexCommunityScoreDao.java index 0c7a7a7f65..d0bfc62ac5 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexCommunityScoreDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexCommunityScoreDao.java @@ -42,19 +42,19 @@ public interface FactIndexCommunityScoreDao { * @Description 分别查询社区过去12个月党建能力、治理能力、服务能力每月总分、本级得分、下级得分数据 * @author sun */ - LinkedList selectCommunityAblityIndex(AblityIndexFormDTO formDTO); + LinkedList selectCommunityAblityWeightScore(AblityIndexFormDTO formDTO); /** * @param formDTO * @Description 查询社区级组织某一月份党建能力、治理能力、服务能力对应的总分、本级分、下级分 * @author sun */ - List selectCommunityScoreList(ScoreListFormDTO formDTO); + List selectCommunityWeightScoreList(ScoreListFormDTO formDTO); /** * @param formDTO * @Description 分别查询社区过去12个月党建能力、治理能力、服务能力每月总分、本级得分、下级得分数据 * @author sun */ - LinkedList selectCommunityMonthScoreList(MonthScoreListFormDTO formDTO); + LinkedList selectCommunityMonthWeightScoreList(MonthScoreListFormDTO formDTO); } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexGridScoreDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexGridScoreDao.java index c5153b0933..c94fdb23a3 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexGridScoreDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexGridScoreDao.java @@ -42,19 +42,19 @@ public interface FactIndexGridScoreDao { * @Description 分别查网格过去12个月党建能力、治理能力、服务能力每月总分、本级得分、下级得分数据 * @author sun */ - LinkedList selectGridAblityIndex(AblityIndexFormDTO formDTO); + LinkedList selectGridAblityWeightScore(AblityIndexFormDTO formDTO); /** * @param formDTO * @Description 分别查网格某一月份党建能力、治理能力、服务能力对应的总分、本级分、下级分 * @author sun */ - List selectGridScoreList(ScoreListFormDTO formDTO); + List selectGridWeightScoreList(ScoreListFormDTO formDTO); /** * @param formDTO * @Description 分别查网格过去12个月党建能力、治理能力、服务能力每月总分、本级得分、下级得分数据 * @author sun */ - LinkedList selectGridMonthScoreList(MonthScoreListFormDTO formDTO); + LinkedList selectGridMonthWeightScoreList(MonthScoreListFormDTO formDTO); } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/fact/impl/FactIndexServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/fact/impl/FactIndexServiceImpl.java index a73529b0dc..01e0a69ac6 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/fact/impl/FactIndexServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/fact/impl/FactIndexServiceImpl.java @@ -79,12 +79,12 @@ public class FactIndexServiceImpl implements FactIndexService { //区县级、乡镇街道级 if ("district".equals(agency.getLevel()) || "street".equals(agency.getLevel())) { //4-1.查询过去12个月党建能力、治理能力、服务能力每月总分数据 - list = factIndexAgencyScoreDao.selectAblityIndex(formDTO); + list = factIndexAgencyScoreDao.selectAgencyAblityWeightScoreIndex(formDTO); //社区级 } else if ("community".equals(agency.getLevel())) { //4-1.查询过去12个月党建能力、治理能力、服务能力每月总分、本级得分、下级得分数据 - list = factIndexCommunityScoreDao.selectCommunityAblityIndex(formDTO); + list = factIndexCommunityScoreDao.selectCommunityAblityWeightScore(formDTO); } else { //throw new RenException(String.format("根据组织Id查询到的组织级别信息错误,组织Id:%s", formDTO.getOrgId())); return resultList; @@ -92,7 +92,7 @@ public class FactIndexServiceImpl implements FactIndexService { //网格层级数据 } else if (FactConstant.GRID.equals(formDTO.getOrgType())) { //5.查询网格过去12个月党建能力、治理能力、服务能力每月总分数据 - list = factIndexGridScoreDao.selectGridAblityIndex(formDTO); + list = factIndexGridScoreDao.selectGridAblityWeightScore(formDTO); } else { throw new RenException(String.format("能力指数查询,orgType类型错误,组织Id:%s,类型Type:%s", formDTO.getOrgId(), formDTO.getOrgType())); } @@ -181,11 +181,11 @@ public class FactIndexServiceImpl implements FactIndexService { //区县级、乡镇街道级 if ("district".equals(agency.getLevel()) || "street".equals(agency.getLevel())) { //3-1.查询当前组织某一月份党建能力、治理能力、服务能力对应的总分、本级分、下级分 - resultList = factIndexAgencyScoreDao.selectScoreList(formDTO); + resultList = factIndexAgencyScoreDao.selectAgencyWeightScoreList(formDTO); //社区级 } else if ("community".equals(agency.getLevel())) { //3-1.查询当前组织某一月份党建能力、治理能力、服务能力对应的总分、本级分、下级分 - resultList = factIndexCommunityScoreDao.selectCommunityScoreList(formDTO); + resultList = factIndexCommunityScoreDao.selectCommunityWeightScoreList(formDTO); } else { //throw new RenException(String.format("根据组织Id查询到的组织级别信息错误,组织Id:%s", formDTO.getOrgId())); return resultList; @@ -194,7 +194,7 @@ public class FactIndexServiceImpl implements FactIndexService { //4.网格层级数据 } else if (FactConstant.GRID.equals(formDTO.getOrgType())) { //4-1.查询当前组织某一月份党建能力、治理能力、服务能力对应的总分、本级分、下级分 - resultList = factIndexGridScoreDao.selectGridScoreList(formDTO); + resultList = factIndexGridScoreDao.selectGridWeightScoreList(formDTO); } else { throw new RenException(String.format("按月份查询各项能力分数,orgType类型错误,组织Id:%s,类型Type:%s", formDTO.getOrgId(), formDTO.getOrgType())); } @@ -229,12 +229,12 @@ public class FactIndexServiceImpl implements FactIndexService { //区县级、乡镇街道级 if ("district".equals(agency.getLevel()) || "street".equals(agency.getLevel())) { //4-1.查询过去12个月党建能力、治理能力、服务能力每月总分、本级得分、下级得分数据 - list = factIndexAgencyScoreDao.selectMonthScoreList(formDTO); + list = factIndexAgencyScoreDao.selectAgencyMonthWeightScoreList(formDTO); //社区级 } else if ("community".equals(agency.getLevel())) { //4-1.查询过去12个月党建能力、治理能力、服务能力每月总分、本级得分、下级得分数据 - list = factIndexCommunityScoreDao.selectCommunityMonthScoreList(formDTO); + list = factIndexCommunityScoreDao.selectCommunityMonthWeightScoreList(formDTO); } else { //throw new RenException(String.format("根据组织Id查询到的组织级别信息错误,组织Id:%s", formDTO.getOrgId())); return resultList; @@ -242,7 +242,7 @@ public class FactIndexServiceImpl implements FactIndexService { //网格层级数据 } else if (FactConstant.GRID.equals(formDTO.getOrgType())) { //5.查询网格过去12个月党建能力、治理能力、服务能力每月总分、本级得分、下级得分数据 - list = factIndexGridScoreDao.selectGridMonthScoreList(formDTO); + list = factIndexGridScoreDao.selectGridMonthWeightScoreList(formDTO); } else { throw new RenException(String.format("能力指数查询,orgType类型错误,组织Id:%s,类型Type:%s", formDTO.getOrgId(), formDTO.getOrgType())); } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/project/impl/ProjectServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/project/impl/ProjectServiceImpl.java index 8b642366cd..45f1f87a0b 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/project/impl/ProjectServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/project/impl/ProjectServiceImpl.java @@ -11,7 +11,8 @@ import com.epmet.datareport.service.evaluationindex.screen.ScreenDifficultyDataS import com.epmet.dto.form.LoginUserDetailsFormDTO; import com.epmet.dto.form.ProcessListFormDTO; import com.epmet.dto.result.LoginUserDetailsResultDTO; -import com.epmet.dto.result.ProcesslistResultDTO; +import com.epmet.dto.result.ProcessAndCurrentDeptResultDTO; +import com.epmet.evaluationindex.screen.dto.result.DepartmentNameListResultDTO; import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.feign.GovProjectOpenFeignClient; import com.epmet.module.project.service.ProjectService; @@ -190,13 +191,16 @@ public class ProjectServiceImpl implements ProjectService { if (null == projectDetailResultDTO) { return new ProjectDetailResultDTO(); } - Result> processList = govProjectOpenFeignClient.getProcessList(processListFormDTO); + Result processList = govProjectOpenFeignClient.getProcessList(processListFormDTO); if (!processList.success()) { throw new RenException(ProjectConstant.PROCESS_FAILURE); } - - List processResultDTOS = ConvertUtils.sourceToTarget(processList.getData(), ProjectProcessResultDTO.class); + ProcessAndCurrentDeptResultDTO data = processList.getData(); + List processResultDTOS = ConvertUtils.sourceToTarget(data.getProcessList(), ProjectProcessResultDTO.class); projectDetailResultDTO.setProcessList(processResultDTOS); + List departmentNameListResultDTOS = ConvertUtils.sourceToTarget(data.getDepartmentList(), DepartmentNameListResultDTO.class); + projectDetailResultDTO.setDepartmentList(departmentNameListResultDTOS); + projectDetailResultDTO.setDepartmentNameList(data.getDepartmentNameList()); return projectDetailResultDTO; } diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexAgencyScoreDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexAgencyScoreDao.xml index 484abef720..85ae080a02 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexAgencyScoreDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexAgencyScoreDao.xml @@ -3,10 +3,10 @@ - SELECT fact.month_id AS "monthId", - ROUND(fact.score, 1) AS "indexTotal", + ROUND(fact.score*fact.WEIGHT, 1) AS "indexTotal", fact.index_code AS "indexCode" FROM fact_index_agency_score fact @@ -21,12 +21,12 @@ fact.month_id ASC - SELECT fact.index_code AS "indexCode", - ROUND(fact.score, 1) AS "indexTotal", - ROUND(self.self_score, 1) AS "agencyScore", - ROUND(self.sub_score, 1) AS "subAgencyScore" + ROUND(fact.score*fact.WEIGHT, 1) AS "indexTotal", + ROUND(self.self_score*fact.WEIGHT, 1) AS "agencyScore", + ROUND(self.sub_score*fact.WEIGHT, 1) AS "subAgencyScore" FROM fact_index_agency_score fact INNER JOIN fact_index_agency_self_sub_score self ON fact.agency_id = self.agency_id @@ -41,12 +41,12 @@ AND fact.month_id = #{monthId} - SELECT fact.month_id AS "monthId", - ROUND(fact.score, 1) AS "indexTotal", - ROUND(self.self_score, 1) AS "agencyScore", - ROUND(self.sub_score, 1) AS "subAgencyScore", + ROUND(fact.score*fact.WEIGHT, 1) AS "indexTotal", + ROUND(self.self_score*fact.WEIGHT, 1) AS "agencyScore", + ROUND(self.sub_score*fact.WEIGHT, 1) AS "subAgencyScore", fact.index_code AS "indexCode" FROM fact_index_agency_score fact diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexAgencySubScoreDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexAgencySubScoreDao.xml index 9744157016..691f149e1c 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexAgencySubScoreDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexAgencySubScoreDao.xml @@ -7,7 +7,8 @@ SELECT fact.index_code AS "key", IF(fact.origin_value='',0,IFNULL(fact.origin_value,0)) AS "value", - dict.index_name AS "name" + dict.index_name AS "name", + round(fact.WEIGHT,2) AS weight FROM fact_index_agency_sub_score fact LEFT JOIN index_dict dict ON fact.index_code = dict.index_code diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCommunityScoreDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCommunityScoreDao.xml index a2a4e89303..29e6d24277 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCommunityScoreDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCommunityScoreDao.xml @@ -3,10 +3,10 @@ - SELECT fact.month_id AS "monthId", - ROUND(fact.score, 1) AS "indexTotal", + ROUND(fact.score*fact.WEIGHT, 1) AS "indexTotal", fact.index_code AS "indexCode" FROM fact_index_community_score fact @@ -21,12 +21,12 @@ fact.month_id ASC - SELECT fact.index_code AS "indexCode", - ROUND(fact.score, 1) AS "indexTotal", - ROUND(self.self_score, 1) AS "agencyScore", - ROUND(self.sub_score, 1) AS "subAgencyScore" + ROUND(fact.score*fact.WEIGHT, 1) AS "indexTotal", + ROUND(self.self_score*fact.WEIGHT, 1) AS "agencyScore", + ROUND(self.sub_score*fact.WEIGHT, 1) AS "subAgencyScore" FROM fact_index_community_score fact INNER JOIN fact_index_community_self_sub_score self ON fact.agency_id = self.agency_id @@ -41,12 +41,12 @@ AND fact.month_id = #{monthId} - SELECT fact.month_id AS "monthId", - ROUND(fact.score, 1) AS "indexTotal", - ROUND(self.self_score, 1) AS "agencyScore", - ROUND(self.sub_score, 1) AS "subAgencyScore", + ROUND(fact.score*fact.WEIGHT, 1) AS "indexTotal", + ROUND(self.self_score*fact.WEIGHT, 1) AS "agencyScore", + ROUND(self.sub_score*fact.WEIGHT, 1) AS "subAgencyScore", fact.index_code AS "indexCode" FROM fact_index_community_score fact diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCommunitySubScoreDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCommunitySubScoreDao.xml index 197b6f9bf9..db57d11ee3 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCommunitySubScoreDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCommunitySubScoreDao.xml @@ -7,7 +7,8 @@ SELECT fact.index_code AS "key", IF(fact.origin_value='',0,IFNULL(fact.origin_value,0)) AS "value", - dict.index_name AS "name" + dict.index_name AS "name", + round(fact.WEIGHT,2) AS weight FROM fact_index_community_sub_score fact LEFT JOIN index_dict dict ON fact.index_code = dict.index_code diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexGridScoreDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexGridScoreDao.xml index 65e511d43e..249f24d125 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexGridScoreDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexGridScoreDao.xml @@ -3,10 +3,10 @@ - SELECT fact.month_id AS "monthId", - ROUND(fact.score, 1) AS "indexTotal", + ROUND(fact.score*fact.WEIGHT, 1) AS "indexTotal", fact.index_code AS "indexCode" FROM fact_index_grid_score fact @@ -21,12 +21,12 @@ fact.month_id ASC - SELECT fact.index_code AS "indexCode", - ROUND(fact.score, 1) AS "indexTotal", - ROUND(self.self_score, 1) AS "agencyScore", - ROUND(self.sub_score, 1) AS "subAgencyScore" + ROUND(fact.score*fact.WEIGHT, 1) AS "indexTotal", + ROUND(self.self_score*fact.WEIGHT, 1) AS "agencyScore", + ROUND(self.sub_score*fact.WEIGHT, 1) AS "subAgencyScore" FROM fact_index_grid_score fact INNER JOIN fact_index_grid_self_sub_score self ON fact.grid_id = self.grid_id @@ -42,12 +42,12 @@ AND fact.month_id = #{monthId} - SELECT fact.month_id AS "monthId", - ROUND(fact.score, 1) AS "indexTotal", - ROUND(self.self_score, 1) AS "agencyScore", - ROUND(self.sub_score, 1) AS "subAgencyScore", + ROUND(fact.score*fact.WEIGHT, 1) AS "indexTotal", + ROUND(self.self_score*fact.WEIGHT, 1) AS "agencyScore", + ROUND(self.sub_score*fact.WEIGHT, 1) AS "subAgencyScore", fact.index_code AS "indexCode" FROM fact_index_grid_score fact diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexGridSubScoreDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexGridSubScoreDao.xml index 1b317e2791..0cf826892b 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexGridSubScoreDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexGridSubScoreDao.xml @@ -7,7 +7,8 @@ SELECT fact.index_code AS "key", IF(fact.origin_value='',0,IFNULL(fact.origin_value,0)) AS "value", - dict.index_name AS "name" + dict.index_name AS "name", + round(fact.WEIGHT,2) AS weight FROM fact_index_grid_sub_score fact LEFT JOIN index_dict dict ON fact.index_code = dict.index_code diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml index 9007350e5c..f16395c129 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml @@ -80,7 +80,7 @@ sutd.org_type AS type FROM screen_user_total_data sutd - LEFT JOIN screen_customer_agency sca ON sca.agency_id = sutd.org_id + LEFT JOIN screen_customer_agency sca ON sca.agency_id = sutd.org_id AND sca.is_display = 1 WHERE sutd.del_flag = '0' AND sca.del_flag = 0 @@ -98,7 +98,7 @@ sutd.org_type AS type FROM screen_user_total_data sutd - LEFT JOIN screen_customer_agency sca ON sca.agency_id = sutd.org_id + LEFT JOIN screen_customer_agency sca ON sca.agency_id = sutd.org_id AND sca.is_display = 1 WHERE sutd.del_flag = '0' AND sca.del_flag = 0 diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerGridDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerGridDao.xml index b17fe0f6a8..c072214600 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerGridDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerGridDao.xml @@ -21,14 +21,16 @@ diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProcessAndCurrentDeptResultDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProcessAndCurrentDeptResultDTO.java new file mode 100644 index 0000000000..fde671e08c --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProcessAndCurrentDeptResultDTO.java @@ -0,0 +1,48 @@ +package com.epmet.dto.result; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2020/10/26 9:36 上午 + */ +@Data +public class ProcessAndCurrentDeptResultDTO implements Serializable { + + private static final long serialVersionUID = 2977695657920536933L; + + private List processList; + + /** + * 当前跟进部门 + */ + private List departmentNameList; + /** + * 当前跟进部门 + */ + private List departmentList; + + @NoArgsConstructor + @Data + public static class DepartmentNameListBean { + /** + * 部门名 + */ + private String departmentName; + /** + * 工作人员 + */ + private List staffList; + } + + public ProcessAndCurrentDeptResultDTO() { + this.processList = new ArrayList<>(); + this.departmentNameList = new ArrayList<>(); + this.departmentList = new ArrayList<>(); + } +} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/GovProjectOpenFeignClient.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/GovProjectOpenFeignClient.java index ea9d169a57..0f89d630d4 100644 --- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/GovProjectOpenFeignClient.java +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/GovProjectOpenFeignClient.java @@ -4,6 +4,7 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.dto.form.ProcessListFormDTO; import com.epmet.dto.form.ProjectListFromDTO; import com.epmet.dto.result.PendProjectListResultDTO; +import com.epmet.dto.result.ProcessAndCurrentDeptResultDTO; import com.epmet.dto.result.ProcesslistResultDTO; import org.springframework.cloud.openfeign.FeignClient; @@ -33,5 +34,5 @@ public interface GovProjectOpenFeignClient { Result> getPendProjectList(@RequestBody ProjectListFromDTO fromDTO); @PostMapping("gov/project/trace/processlistnotrule") - Result> getProcessList(@RequestBody ProcessListFormDTO fromDTO); + Result getProcessList(@RequestBody ProcessListFormDTO fromDTO); } diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/fallback/GovProjectOpenFeignClientFallback.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/fallback/GovProjectOpenFeignClientFallback.java index 5ae4f94533..a3eb7d7e01 100644 --- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/fallback/GovProjectOpenFeignClientFallback.java +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/fallback/GovProjectOpenFeignClientFallback.java @@ -6,6 +6,7 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.dto.form.ProcessListFormDTO; import com.epmet.dto.form.ProjectListFromDTO; import com.epmet.dto.result.PendProjectListResultDTO; +import com.epmet.dto.result.ProcessAndCurrentDeptResultDTO; import com.epmet.dto.result.ProcesslistResultDTO; import com.epmet.feign.GovProjectOpenFeignClient; import org.springframework.stereotype.Component; @@ -26,7 +27,7 @@ public class GovProjectOpenFeignClientFallback implements GovProjectOpenFeignCli } @Override - public Result> getProcessList(ProcessListFormDTO fromDTO) { + public Result getProcessList(ProcessListFormDTO fromDTO) { return ModuleUtils.feignConError(ServiceConstant.GOV_PROJECT_SERVER, "getProcessList", fromDTO); } } diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectTraceController.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectTraceController.java index bbdfa5378b..582d4e6413 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectTraceController.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectTraceController.java @@ -186,9 +186,9 @@ public class ProjectTraceController { * @Description 项目跟踪-项目处理进展列表 **/ @PostMapping("processlistnotrule") - public Result> processListNotRule(@RequestBody ProcessListFormDTO formDTO) { + public Result processListNotRule(@RequestBody ProcessListFormDTO formDTO) { ValidatorUtils.validateEntity(formDTO); - return new Result>().ok(projectProcessService.progressList(formDTO)); + return new Result().ok(projectProcessService.progressAndCurrentDept(formDTO)); } /** diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectProcessService.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectProcessService.java index 98bb36ec5d..c8b4dfdcc7 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectProcessService.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectProcessService.java @@ -24,7 +24,6 @@ import com.epmet.dto.ProjectProcessDTO; import com.epmet.dto.form.*; import com.epmet.dto.result.*; import com.epmet.entity.ProjectProcessEntity; -import org.springframework.web.bind.annotation.RequestBody; import java.util.List; import java.util.Map; @@ -136,4 +135,12 @@ public interface ProjectProcessService extends BaseService */ ProjectDetailCheckResultDTO checkProjectClose(ProjectIdFormDTO projectIdFormDTO); + /** + * @Description 查询项目进展和当前处理部门 + * @Param formDTO + * @author zxc + * @date 2020/10/26 9:41 上午 + */ + ProcessAndCurrentDeptResultDTO progressAndCurrentDept(ProcessListFormDTO formDTO); + } \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectProcessServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectProcessServiceImpl.java index 8c8a2dc776..6af8b68c00 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectProcessServiceImpl.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectProcessServiceImpl.java @@ -35,15 +35,19 @@ import com.epmet.commons.tools.utils.ScanContentUtils; import com.epmet.constant.ProjectConstant; import com.epmet.constant.ReadFlagConstant; import com.epmet.constant.UserMessageConstant; +import com.epmet.dao.ProjectDao; import com.epmet.dao.ProjectProcessDao; import com.epmet.dao.ProjectStaffDao; +import com.epmet.dto.ProjectDTO; import com.epmet.dto.ProjectProcessDTO; +import com.epmet.dto.ProjectStaffDTO; import com.epmet.dto.form.*; import com.epmet.dto.result.*; import com.epmet.entity.ProjectEntity; import com.epmet.entity.ProjectProcessEntity; import com.epmet.entity.ProjectStaffEntity; import com.epmet.feign.EpmetUserFeignClient; +import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.feign.GovOrgFeignClient; import com.epmet.redis.ProjectProcessRedis; import com.epmet.service.ProjectProcessService; @@ -87,6 +91,10 @@ public class ProjectProcessServiceImpl extends BaseServiceImpl page(Map params) { @@ -340,4 +348,63 @@ public class ProjectProcessServiceImpl extends BaseServiceImpl departments = new ArrayList<>(); + List departmentNameList = new ArrayList<>(); + List departmentList = new ArrayList<>(); + ProjectDetailResultDTO projectDetailResultDTO = projectDao.selectProjectDetail(formDTO.getProjectId()); + if (null == projectDetailResultDTO){ + result.setDepartmentList(departmentList); + result.setDepartmentNameList(departments); + return result; + } + if (ProjectConstant.CLOSED.equals(projectDetailResultDTO.getProjectStatus())) { + //项目已结案,跟进部门为空 + result.setDepartmentList(departmentList); + result.setDepartmentNameList(departments); + } else { + //项目未结案,找出所有跟进部门 + ProjectDTO projectDTO = new ProjectDTO(); + projectDTO.setId(formDTO.getProjectId()); + departmentNameList = projectDao.selectCurrentDepartmentList(projectDTO); + //提取工作人员ID + List staffIdList = departmentNameList.stream().map(ProjectStaffDTO::getStaffId).collect(Collectors.toList()); + staffIdList = staffIdList.stream().distinct().collect(Collectors.toList()); + //根据部门分组 + Map> departmentMap = + departmentNameList.stream().collect(Collectors.groupingBy(ProjectStaffDTO::getDepartmentName)); + //获取工作人员信息(姓名) + UserIdsFormDTO userIdsFormDTO = new UserIdsFormDTO(); + userIdsFormDTO.setUserIds(staffIdList); + Result> staffListResult = epmetUserOpenFeignClient.getStaffInfoList(userIdsFormDTO); + if (!staffListResult.success()) { + throw new RenException(staffListResult.getCode(), staffListResult.getMsg()); + } + List staffList = staffListResult.getData(); + for (String departmentName : departmentMap.keySet()) { + ProjectDetailResultDTO.DepartmentNameListBean bean = new ProjectDetailResultDTO.DepartmentNameListBean(); + bean.setDepartmentName(departmentName); + List staffDTOList = departmentMap.get(departmentName); + List staffNameList = + staffDTOList.stream().flatMap(staffDto -> staffList.stream().filter(staffInfo -> + staffDto.getStaffId().equals(staffInfo.getStaffId())).map((StaffSinGridResultDTO::getStaffName))).collect(Collectors.toList()); + bean.setStaffList(staffNameList); + departmentList.add(bean); + departments.add(departmentName); + } + result.setDepartmentList(departmentList); + result.setDepartmentNameList(departments); + } + return result; + } } \ No newline at end of file