diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/CommonOperateTypeEnum.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/CommonOperateTypeEnum.java index 1dc0b571c5..e38a14a21f 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/CommonOperateTypeEnum.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/CommonOperateTypeEnum.java @@ -11,6 +11,8 @@ public enum CommonOperateTypeEnum { ADD("add", "添加"), EDIT("edit", "编辑"), DEL("del", "删除"), + DESC("DESC", "降序"), + ASC("ASC", "升序"), ; private String code; diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/EnvEnum.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/EnvEnum.java index ed782790e8..d0df724665 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/EnvEnum.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/EnvEnum.java @@ -11,21 +11,23 @@ import org.springframework.core.env.Environment; * @date 2020-07-03 11:14 **/ public enum EnvEnum { - LOCAL("local", "本地环境"), - DEV("dev", "开发环境"), - TEST("test", "体验环境"), - PROD("prod", "生产环境"), - UN_KNOWN("un_known", "未知"), + LOCAL("local", "本地环境","http://localhost:8080/api/"), + DEV("dev", "开发环境","http://192.168.1.130:8080/api/"), + TEST("test", "体验环境","https://epmet-dev.elinkservice.cn/api/"), + PROD("prod", "生产环境","https://epmet-cloud.elinkservice.cn/api/"), + UN_KNOWN("un_known", "未知","https://epmet-dev.elinkservice.cn/api/"), ; private String code; private String name; + private String url; - EnvEnum(String code, String name) { + EnvEnum(String code, String name, String url) { this.code = code; this.name = name; + this.url = url; } public static EnvEnum getEnum(String code) { @@ -59,4 +61,8 @@ public enum EnvEnum { public String getName() { return name; } + + public String getUrl(){ + return url; + } } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/HttpClientManager.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/HttpClientManager.java index 0c6c4cb9ae..d69f319d7b 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/HttpClientManager.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/HttpClientManager.java @@ -159,6 +159,29 @@ public class HttpClientManager { } + public Result sendPostByJSONAndHeader(String url, String jsonStrParam,Map headerMap) { + + try { + HttpPost httppost = new HttpPost(url); + httppost.setConfig(requestConfig); + httppost.addHeader("Content-Type", "application/json; charset=utf-8"); + if (null != headerMap){ + headerMap.forEach((k,v) -> { + httppost.addHeader(k,v); + }); + } + if (StringUtils.isNotEmpty(jsonStrParam)) { + StringEntity se = new StringEntity(jsonStrParam, "utf-8"); + httppost.setEntity(se); + } + return execute(httppost, false); + } catch (Exception e) { + log.error("send exception", e); + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode(), EpmetErrorCode.SERVER_ERROR.getMsg()); + } + + } + /** * 上传临时素材 * @author zhaoqifeng diff --git a/epmet-module/data-report/data-report-client/pom.xml b/epmet-module/data-report/data-report-client/pom.xml index 5bba5f2cb4..8700a85f3b 100644 --- a/epmet-module/data-report/data-report-client/pom.xml +++ b/epmet-module/data-report/data-report-client/pom.xml @@ -17,6 +17,11 @@ epmet-commons-tools 2.0.0 + + com.epmet + gov-project-client + 2.0.0 + diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/CompartmentByBizTypeFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/CompartmentByBizTypeFormDTO.java new file mode 100644 index 0000000000..695255bccc --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/CompartmentByBizTypeFormDTO.java @@ -0,0 +1,31 @@ +package com.epmet.evaluationindex.screen.dto.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/10/22 + */ +@Data +public class CompartmentByBizTypeFormDTO implements Serializable { + + private static final long serialVersionUID = -3354778434424878413L; + + public interface CompartmentByBizType extends CustomerClientShowGroup {} + + /** + * 机关ID + */ + @NotBlank(message = "机关ID不能为空",groups = {CompartmentByBizType.class}) + private String agencyId; + + /** + * 业务类型 + */ + @NotBlank(message = "bizType不能为空", groups = {CompartmentByBizType.class}) + private String bizType; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/SubSingleIndexRankFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/SubSingleIndexRankFormDTO.java new file mode 100644 index 0000000000..268a66ac55 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/SubSingleIndexRankFormDTO.java @@ -0,0 +1,37 @@ +package com.epmet.evaluationindex.screen.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * desc:下级组织单项排行分数 form + * + * @DateTime 2020/8/20 9:54 上午 + */ +@Data +public class SubSingleIndexRankFormDTO implements Serializable { + + private static final long serialVersionUID = -2920561669035794486L; + @NotBlank(message = "客户ID不能为空") + private String customerId; + /** + * 机关ID + */ + @NotBlank(message = "机关ID不能为空") + private String agencyId; + @NotBlank(message = "指标code不能为空") + private String indexCode; + + /** + * 默认查询前几名 + */ + private Integer topNum; + + private String monthId; + private String orgType; + private String sort; + + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/TreeByTypeFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/TreeByTypeFormDTO.java new file mode 100644 index 0000000000..aa0636363b --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/TreeByTypeFormDTO.java @@ -0,0 +1,22 @@ +package com.epmet.evaluationindex.screen.dto.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/10/22 10:52 上午 + */ +@Data +public class TreeByTypeFormDTO implements Serializable { + + private static final long serialVersionUID = -1438758394814978472L; + + public interface TreeByType extends CustomerClientShowGroup{} + + @NotBlank(message = "bizType不能为空",groups = TreeByType.class) + private String bizType; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/AgencyDistributionResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/AgencyDistributionResultDTO.java index 753cf368dd..3a91fdfbf7 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/AgencyDistributionResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/AgencyDistributionResultDTO.java @@ -37,4 +37,9 @@ public class AgencyDistributionResultDTO implements Serializable { * 组织:agency; 网格:grid ; 部门:dept */ private String type; + + public AgencyDistributionResultDTO() { + this.subAreaMarks = ""; + this.subCenterMark = ""; + } } diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PeerComparisonResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PeerComparisonResultDTO.java index 9a89c5daa8..825571dbd6 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PeerComparisonResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PeerComparisonResultDTO.java @@ -5,7 +5,8 @@ import lombok.Data; import java.io.Serializable; /** - * 同级对比各项数据查询--接口返参 + * 同级对比(下级单项指数排行)各项数据查询--接口返参 + * * @Author sun */ @Data diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/constant/ProjectConstant.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/constant/ProjectConstant.java index 27d195e832..7b07db5c72 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/constant/ProjectConstant.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/constant/ProjectConstant.java @@ -20,4 +20,6 @@ public interface ProjectConstant { */ String TYPE_EXCEPTION = "必要参数为空或参数格式错误"; + String PROCESS_FAILURE = "查询项目进展失败......"; + } 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 new file mode 100644 index 0000000000..88355feec4 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectDetailResultDTO.java @@ -0,0 +1,73 @@ +package com.epmet.project.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/23 10:13 上午 + */ +@Data +public class ProjectDetailResultDTO implements Serializable { + + private static final long serialVersionUID = 2450826789942547426L; + + /** 【事件 = 项目】 + * 事件标题 + */ + private String eventTitle; + + /** + * 事件内容 + */ + private String eventContent; + + /** + * 事件来源 + */ + private String eventSource; + + /** + * 事件图片集合 + */ + private List imgUrlList; + + /** + * 项目进展 + */ + private List processList; + + /** + * 当前跟进部门 + */ + private List departmentNameList; + /** + * 当前跟进部门 + */ + private List departmentList; + + @NoArgsConstructor + @Data + public static class DepartmentNameListBean { + /** + * 部门名 + */ + private String departmentName; + /** + * 工作人员 + */ + private List staffList; + } + + public ProjectDetailResultDTO() { + this.eventTitle = ""; + this.eventContent = ""; + this.eventSource = ""; + this.imgUrlList = new ArrayList<>(); + this.processList = new ArrayList<>(); + } +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectProcessResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectProcessResultDTO.java new file mode 100644 index 0000000000..8a0d6e82ac --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectProcessResultDTO.java @@ -0,0 +1,77 @@ +/** + * 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.project.dto.result; + +import lombok.Data; + +import java.io.Serializable; + + +/** + * 项目跟踪-项目处理进展列表-接口返参 + * + * @author sun + */ +@Data +public class ProjectProcessResultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 项目Id + */ + private String projectId = ""; + + /** + * 项目处理进展Id + */ + private String processId = ""; + + /** + * 处理进展名称 + */ + private String processName = ""; + + /** + * 处理进展时间 + */ + private Long processTime; + + /** + * 处理进展时间 字符串 + */ + //@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + //private String processTimeStr; + + /** + * 处理部门 + */ + private String departmentName = ""; + + /** + * 公开答复 + */ + private String publicReply = ""; + + /** + * 内部备注 + */ + private String internalRemark = ""; + + +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/pom.xml b/epmet-module/data-report/data-report-server/pom.xml index 1af9355f8e..0d964e6099 100644 --- a/epmet-module/data-report/data-report-server/pom.xml +++ b/epmet-module/data-report/data-report-server/pom.xml @@ -34,6 +34,11 @@ epmet-user-client 2.0.0 + + com.epmet + common-service-client + 2.0.0 + org.springframework.boot spring-boot-starter-web diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/constant/FactConstant.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/constant/FactConstant.java index 4e2449c81c..d400f023bb 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/constant/FactConstant.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/constant/FactConstant.java @@ -61,4 +61,6 @@ public interface FactConstant { * 评价指标类型-百分比 */ String PERCENT = "percent"; + + String URL = "https://epmet-dev.elinkservice.cn/api/"; } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/backdoor/BackDoorController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/backdoor/BackDoorController.java new file mode 100644 index 0000000000..e8b373f1b1 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/backdoor/BackDoorController.java @@ -0,0 +1,37 @@ +package com.epmet.datareport.controller.backdoor; + +import com.epmet.datareport.service.backdoor.BackDoorService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +/** + * @Author zxc + * @DateTime 2020/10/21 5:17 下午 + */ +@RestController +@RequestMapping("backdoor") +public class BackDoorController { + + @Autowired + private BackDoorService backDoorService; + + /** + * desc: 重定向到target 方法,适用于外部鉴权接口的查询 比如大屏的查询接口 + * + * @param dataType + * @param appId + * @param target + * @param targetParam + * @return java.lang.String + * @author LiuJanJun + * @date 2020/10/23 1:44 下午 + */ + @PostMapping("redirect/external") + public Object backDoor(@RequestHeader(value = "Data-Type", defaultValue = "real", required = false) String dataType, + @RequestHeader(value = "env", defaultValue = "test", required = false) String env, + @RequestHeader("AppId") String appId, @RequestHeader("target") String target, + @RequestBody(required = false) Object targetParam) { + return backDoorService.redirect(dataType, appId, target, targetParam,env); + } + +} 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/project/ProjectController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/project/ProjectController.java index cd6648151c..1fb8ccab27 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/project/ProjectController.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/project/ProjectController.java @@ -6,6 +6,7 @@ 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.project.ProjectService; +import com.epmet.dto.form.ProcessListFormDTO; import com.epmet.project.constant.ProjectConstant; import com.epmet.project.dto.form.DifficultyRankFormDTO; import com.epmet.project.dto.form.ProjectIncrTrendFormDTO; @@ -41,7 +42,7 @@ public class ProjectController { /** * @Author sun - * @Description t + * @Description 数据-项目-获取组织下饼图数据 **/ @PostMapping("summaryinfo") public Result> summaryInfo(@LoginUser TokenDto tokenDto) { @@ -79,6 +80,18 @@ public class ProjectController { return new Result>().ok(projectService.getProjectIncrTrend(tokenDto, formDTO)); } + /** + * @Description 项目详情 + * @Param processListFormDTO + * @author zxc + * @date 2020/10/23 10:31 上午 + */ + @PostMapping("projectdetail") + public Result projectDetail(@RequestBody ProcessListFormDTO processListFormDTO){ + ValidatorUtils.validateEntity(processListFormDTO); + return new Result().ok(projectService.projectDetail(processListFormDTO)); + } + /** * @Description 难点赌点-耗时最长|涉及部门最多|处理次数 * @NEI https://nei.netease.com/interface/detail/res/?pid=57068&id=321614 diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/AgencyController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/AgencyController.java index 0b978ce9b0..86a6f3213e 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/AgencyController.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/AgencyController.java @@ -3,7 +3,9 @@ package com.epmet.datareport.controller.screen; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.datareport.service.evaluationindex.screen.AgencyService; +import com.epmet.evaluationindex.screen.dto.form.CompartmentByBizTypeFormDTO; import com.epmet.evaluationindex.screen.dto.form.CompartmentFormDTO; +import com.epmet.evaluationindex.screen.dto.form.TreeByTypeFormDTO; import com.epmet.evaluationindex.screen.dto.result.CompartmentResultDTO; import com.epmet.evaluationindex.screen.dto.result.TreeResultDTO; import org.springframework.beans.factory.annotation.Autowired; @@ -41,7 +43,8 @@ public class AgencyController { * @date 2020/10/21 2:49 下午 */ @PostMapping("treebytype") - public Result treeByType(@RequestHeader("CustomerId") String customerId,@RequestParam("bizType")String bizType){ + public Result treeByType(@RequestHeader("CustomerId") String customerId,@RequestBody TreeByTypeFormDTO bizType){ + ValidatorUtils.validateEntity(bizType, TreeByTypeFormDTO.TreeByType.class); return new Result().ok(agencyService.treeByType(customerId,bizType)); } @@ -57,4 +60,10 @@ public class AgencyController { return new Result().ok(agencyService.compartment(compartmentFormDTO)); } + @PostMapping("compartmentbybiztype") + public Result compartmentByBizType(@RequestBody CompartmentByBizTypeFormDTO compartmentFormDTO){ + ValidatorUtils.validateEntity(compartmentFormDTO, CompartmentByBizTypeFormDTO.CompartmentByBizType.class); + return new Result().ok(agencyService.compartmentByBizType(compartmentFormDTO)); + } + } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/IndexController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/IndexController.java index 100c35b293..00fc8046a5 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/IndexController.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/IndexController.java @@ -1,7 +1,5 @@ package com.epmet.datareport.controller.screen; -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.eum.OrgTypeEnum; @@ -88,6 +86,22 @@ public class IndexController { return new Result>().ok(indexService.getSubAgencyIndexRank(formDTO)); } + /** + * desc: 下级组织单项指数得分排行 + * + * @param customerId + * @param formDTO + * @return com.epmet.commons.tools.utils.Result> + * @author LiuJanJun + * @date 2020/10/22 1:49 下午 + */ + @PostMapping("subsingleindexrank") + public Result> getSubSingleIndexRank(@RequestHeader("CustomerId") String customerId, @RequestBody SubSingleIndexRankFormDTO formDTO) { + formDTO.setCustomerId(customerId); + ValidatorUtils.validateEntity(formDTO); + return new Result>().ok(indexService.getSubSingleIndexRank(formDTO)); + } + /** * @param formDTO * @Description 4、获取该客户下所有网格指标排行 diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java index c49b83e304..7efd4d1853 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java @@ -33,18 +33,18 @@ import java.util.List; public interface ScreenCustomerAgencyDao { /** - * @Description 查询客户根组织ID * @param customerId + * @Description 查询客户根组织ID * @author zxc * @date 2020/8/18 2:44 下午 */ - TreeResultDTO selectRootAgencyId(@Param("customerId")String customerId); + TreeResultDTO selectRootAgencyId(@Param("customerId") String customerId); - TreeResultDTO selectRootAgencyIdByBizType(@Param("customerId")String customerId,@Param("bizType")String bizType); + TreeResultDTO selectRootAgencyIdByBizType(@Param("customerId") String customerId, @Param("bizType") String bizType); /** - * @Description 查询下级机关的 名称和id * @param subAgencyPids + * @Description 查询下级机关的 名称和id * @author zxc * @date 2020/8/18 4:48 下午 */ @@ -53,36 +53,40 @@ public interface ScreenCustomerAgencyDao { List selectSubAgencyListByBizType(@Param("subAgencyPids") String subAgencyPids); /** - * @Description 查询当前机关的区域信息 * @param agencyId + * @Description 查询当前机关的区域信息 * @author zxc * @date 2020/8/18 4:51 下午 */ - CompartmentResultDTO getAgencyAreaInfo(@Param("agencyId")String agencyId); + CompartmentResultDTO getAgencyAreaInfo(@Param("agencyId") String agencyId); + + CompartmentResultDTO getAgencyAreaInfoByBizType(@Param("agencyId") String agencyId, @Param("bizType") String bizType); /** - * @Description 查询子级区域分布信息【机关级别】 * @param agencyId + * @Description 查询子级区域分布信息【机关级别】 * @author zxc * @date 2020/8/18 5:12 下午 */ - List selectSubDistribution(@Param("agencyId")String agencyId); + List selectSubDistribution(@Param("agencyId") String agencyId); + + List selectSubDistributionByType(@Param("agencyId") String agencyId, @Param("bizType") String bizType); /** - * @Description 查询子级用户分布【机关级别】 * @param parentId + * @Description 查询子级用户分布【机关级别】 * @author zxc * @date 2020/8/19 9:33 上午 */ - List selectUserDistributionAgency(@Param("parentId")String parentId); + List selectUserDistributionAgency(@Param("parentId") String parentId); /** - * @Description 查询子级党员分布【机关级别】 * @param parentId + * @Description 查询子级党员分布【机关级别】 * @author zxc * @date 2020/8/19 10:30 上午 */ - List selectParymemberDistribution(@Param("parentId")String parentId); + List selectParymemberDistribution(@Param("parentId") String parentId); /** * @param agencyId @@ -90,4 +94,14 @@ public interface ScreenCustomerAgencyDao { * @author sun */ int selectRootAgency(@Param("agencyId") String agencyId); + + /** + * desc: 根据orgId获取组织信息 + * + * @param agencyId + * @return com.epmet.evaluationindex.screen.dto.result.CompartmentResultDTO + * @author LiuJanJun + * @date 2020/10/23 3:54 下午 + */ + CompartmentResultDTO getAgencyInfoByAegncyId(@Param("agencyId") String agencyId); } \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenDifficultyDataDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenDifficultyDataDao.java index 8697ba9adf..5a0a566342 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenDifficultyDataDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenDifficultyDataDao.java @@ -18,6 +18,7 @@ package com.epmet.datareport.dao.evaluationindex.screen; import com.epmet.evaluationindex.screen.dto.result.DifficultProjectResultDTO; +import com.epmet.project.dto.result.ProjectDetailResultDTO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -41,4 +42,6 @@ public interface ScreenDifficultyDataDao { **/ List selectDifficulty(@Param("agencyId")String agencyId,@Param("type")String type); + ProjectDetailResultDTO projectDetail(@Param("eventId")String projectId); + } \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenIndexDataMonthlyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenIndexDataMonthlyDao.java index 2c030eac41..93221bd6f0 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenIndexDataMonthlyDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenIndexDataMonthlyDao.java @@ -91,8 +91,15 @@ public interface ScreenIndexDataMonthlyDao{ /** * @param formDTO - * @Description 先进排行-先进支部排行 + * @Description 先进排行-先进支部排行 * @author sun */ List selectRankList(AdvancedBranchRankFormDTO formDTO); + + /** + * @param formDTO + * @Description 下级单项指标得分排行 + * @author sun + */ + List getSingleIndexRank(SubSingleIndexRankFormDTO formDTO); } 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/backdoor/BackDoorService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/backdoor/BackDoorService.java new file mode 100644 index 0000000000..381d3874a1 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/backdoor/BackDoorService.java @@ -0,0 +1,11 @@ +package com.epmet.datareport.service.backdoor; + +/** + * @Author zxc + * @DateTime 2020/10/21 5:17 下午 + */ +public interface BackDoorService { + + Object redirect(String dataType, String appId, String target, Object o,String env); + +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/backdoor/impl/BackDoorServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/backdoor/impl/BackDoorServiceImpl.java new file mode 100644 index 0000000000..639d39526f --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/backdoor/impl/BackDoorServiceImpl.java @@ -0,0 +1,50 @@ +package com.epmet.datareport.service.backdoor.impl; + +import com.alibaba.fastjson.JSON; +import com.epmet.commons.tools.enums.EnvEnum; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.utils.HttpClientManager; +import com.epmet.commons.tools.utils.Result; +import com.epmet.datareport.constant.FactConstant; +import com.epmet.datareport.service.backdoor.BackDoorService; +import com.epmet.dto.result.AppIdInfoResultDTO; +import com.epmet.feign.EpmetCommonServiceOpenFeignClient; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.HashMap; +import java.util.Map; + +/** + * @Author zxc + * @DateTime 2020/10/21 5:17 下午 + */ +@Service +@Slf4j +public class BackDoorServiceImpl implements BackDoorService { + + @Autowired + private EpmetCommonServiceOpenFeignClient commonServiceOpenFeignClient; + + @Override + public Object redirect(String dataType, String appId, String target, Object targetParam, String env) { + Result appIdInfoResultDTOResult = commonServiceOpenFeignClient.appIdInfo(appId); + if (!appIdInfoResultDTOResult.success()) { + throw new RenException("获取accessToken失败......"); + } + AppIdInfoResultDTO data = appIdInfoResultDTOResult.getData(); + String url = EnvEnum.getEnum(env).getUrl().concat(target); + Map headerMap = new HashMap<>(16); + headerMap.put("AccessToken", data.getAccessToken()); + headerMap.put("AppId", data.getAppId()); + headerMap.put("AuthType", "jwt"); + headerMap.put("Data-Type",dataType); + Result stringResult = HttpClientManager.getInstance().sendPostByJSONAndHeader(url, JSON.toJSONString(targetParam), headerMap); + log.info(JSON.toJSONString(stringResult)); + if (!stringResult.success()){ + throw new RenException("请求【"+url+"】失败......"+stringResult.error()); + } + return JSON.parseObject(stringResult.getData()); + } +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/AgencyService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/AgencyService.java index 7e07abbcf2..046eaccbef 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/AgencyService.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/AgencyService.java @@ -1,6 +1,8 @@ package com.epmet.datareport.service.evaluationindex.screen; +import com.epmet.evaluationindex.screen.dto.form.CompartmentByBizTypeFormDTO; import com.epmet.evaluationindex.screen.dto.form.CompartmentFormDTO; +import com.epmet.evaluationindex.screen.dto.form.TreeByTypeFormDTO; import com.epmet.evaluationindex.screen.dto.result.CompartmentResultDTO; import com.epmet.evaluationindex.screen.dto.result.TreeResultDTO; @@ -20,14 +22,8 @@ public interface AgencyService { */ TreeResultDTO tree(String customerId); - /** - * @Description 智慧社区的tree - * @Param customerId - * @Param bizType - * @author zxc - * @date 2020/10/21 2:49 下午 - */ - TreeResultDTO treeByType(String customerId,String bizType); + + TreeResultDTO treeByType(String customerId, TreeByTypeFormDTO bizType); /** * @Description 2、组织区域查询 @@ -37,4 +33,6 @@ public interface AgencyService { */ CompartmentResultDTO compartment(CompartmentFormDTO compartmentFormDTO); + CompartmentResultDTO compartmentByBizType(CompartmentByBizTypeFormDTO compartmentFormDTO); + } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/IndexService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/IndexService.java index 3485770cc2..0dc99d37bc 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/IndexService.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/IndexService.java @@ -72,8 +72,18 @@ public interface IndexService { /** * @param formDTO - * @Description 先进排行-先进支部排行 + * @Description 先进排行-先进支部排行 * @author sun */ List advancedBranchRank(AdvancedBranchRankFormDTO formDTO); + + /** + * desc:下级单项指数排行 + * + * @param formDTO + * @return java.util.List + * @author LiuJanJun + * @date 2020/10/22 10:58 上午 + */ + List getSubSingleIndexRank(SubSingleIndexRankFormDTO formDTO); } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/ScreenDifficultyDataService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/ScreenDifficultyDataService.java new file mode 100644 index 0000000000..d40e84cb11 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/ScreenDifficultyDataService.java @@ -0,0 +1,14 @@ +package com.epmet.datareport.service.evaluationindex.screen; + +import com.epmet.dto.form.ProcessListFormDTO; +import com.epmet.project.dto.result.ProjectDetailResultDTO; + +/** + * @Author zxc + * @DateTime 2020/10/23 1:26 下午 + */ +public interface ScreenDifficultyDataService { + + ProjectDetailResultDTO projectDetail(ProcessListFormDTO processListFormDTO); + +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java index df622e9924..24a5367d87 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java @@ -8,7 +8,9 @@ import com.epmet.datareport.dao.evaluationindex.screen.ScreenCustomerAgencyDao; import com.epmet.datareport.dao.evaluationindex.screen.ScreenCustomerGridDao; import com.epmet.datareport.service.evaluationindex.screen.AgencyService; import com.epmet.evaluationindex.screen.constant.ScreenConstant; +import com.epmet.evaluationindex.screen.dto.form.CompartmentByBizTypeFormDTO; import com.epmet.evaluationindex.screen.dto.form.CompartmentFormDTO; +import com.epmet.evaluationindex.screen.dto.form.TreeByTypeFormDTO; import com.epmet.evaluationindex.screen.dto.result.AgencyDistributionResultDTO; import com.epmet.evaluationindex.screen.dto.result.CompartmentResultDTO; import com.epmet.evaluationindex.screen.dto.result.TreeResultDTO; @@ -75,10 +77,10 @@ public class AgencyServiceImpl implements AgencyService { */ @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override - public TreeResultDTO treeByType(String customerId, String bizType) { + public TreeResultDTO treeByType(String customerId, TreeByTypeFormDTO bizType) { TreeResultDTO rootAgency = null; try { - rootAgency = screenCustomerAgencyDao.selectRootAgencyIdByBizType(customerId,bizType); + rootAgency = screenCustomerAgencyDao.selectRootAgencyIdByBizType(customerId,bizType.getBizType()); if (null == rootAgency) { return new TreeResultDTO(); } @@ -205,4 +207,22 @@ public class AgencyServiceImpl implements AgencyService { } return agencyAreaInfo; } + + @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) + @Override + public CompartmentResultDTO compartmentByBizType(CompartmentByBizTypeFormDTO compartmentFormDTO) { + CompartmentResultDTO agencyAreaInfo = screenCustomerAgencyDao.getAgencyAreaInfoByBizType(compartmentFormDTO.getAgencyId(),compartmentFormDTO.getBizType()); + if (null == agencyAreaInfo){ + return new CompartmentResultDTO(); + } + if (agencyAreaInfo.getLevel().equals(ScreenConstant.COMMUNITY)){ + // 当level为"community"时,查询screen_customer_grid表 + List agencyDistributionResultDTOS = screenCustomerGridDao.selectSubDistribution(compartmentFormDTO.getAgencyId()); + agencyAreaInfo.setAgencyDistribution(agencyDistributionResultDTOS); + }else { + List agencyDistributionResultDTOS = screenCustomerAgencyDao.selectSubDistributionByType(compartmentFormDTO.getAgencyId(),compartmentFormDTO.getBizType()); + agencyAreaInfo.setAgencyDistribution(agencyDistributionResultDTOS); + } + return agencyAreaInfo; + } } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/IndexServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/IndexServiceImpl.java index a133a5dab4..4ff84d3ab6 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/IndexServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/IndexServiceImpl.java @@ -2,6 +2,7 @@ package com.epmet.datareport.service.evaluationindex.screen.impl; import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.enums.CommonOperateTypeEnum; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.constant.DataSourceConstant; import com.epmet.datareport.dao.evaluationindex.screen.ScreenIndexDataMonthlyDao; @@ -11,18 +12,15 @@ import com.epmet.evaluationindex.screen.constant.ScreenConstant; import com.epmet.evaluationindex.screen.dto.form.*; import com.epmet.evaluationindex.screen.dto.result.*; import org.apache.commons.lang3.StringUtils; -import org.jsoup.helper.DataUtil; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; -import org.springframework.util.unit.DataUnit; import java.math.BigDecimal; import java.text.NumberFormat; import java.time.LocalDate; import java.util.ArrayList; import java.util.Comparator; -import java.util.Date; import java.util.List; import java.util.stream.Collectors; @@ -328,4 +326,20 @@ public class IndexServiceImpl implements IndexService { return list; } + @Override + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) + public List getSubSingleIndexRank(SubSingleIndexRankFormDTO formDTO) { + if (StringUtils.isBlank(formDTO.getMonthId())) { + formDTO.setMonthId(DateUtils.getBeforeNMonth(1)); + } + if (StringUtils.isBlank(formDTO.getSort())) { + formDTO.setSort(CommonOperateTypeEnum.DESC.getCode()); + } + if (formDTO.getTopNum() == null) { + formDTO.setTopNum(NumConstant.FIVE); + } + List list = screenIndexDataMonthlyDao.getSingleIndexRank(formDTO); + return list; + } + } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenDifficultyDataServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenDifficultyDataServiceImpl.java new file mode 100644 index 0000000000..e044c24aab --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenDifficultyDataServiceImpl.java @@ -0,0 +1,31 @@ +package com.epmet.datareport.service.evaluationindex.screen.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.constant.DataSourceConstant; +import com.epmet.datareport.dao.evaluationindex.screen.ScreenDifficultyDataDao; +import com.epmet.datareport.service.evaluationindex.screen.ScreenDifficultyDataService; +import com.epmet.dto.form.ProcessListFormDTO; +import com.epmet.project.dto.result.ProjectDetailResultDTO; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +/** + * @Author zxc + * @DateTime 2020/10/23 1:26 下午 + */ +@Service +@Slf4j +@DataSource(DataSourceConstant.EVALUATION_INDEX) +public class ScreenDifficultyDataServiceImpl implements ScreenDifficultyDataService { + + @Autowired + private ScreenDifficultyDataDao screenDifficultyDataDao; + + @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) + @Override + public ProjectDetailResultDTO projectDetail(ProcessListFormDTO processListFormDTO) { + ProjectDetailResultDTO projectDetailResultDTO = screenDifficultyDataDao.projectDetail(processListFormDTO.getProjectId()); + return projectDetailResultDTO; + } +} 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 e796935094..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 @@ -70,7 +70,7 @@ public class FactIndexServiceImpl implements FactIndexService { //组织层级数据 if (FactConstant.AGENCY.equals(formDTO.getOrgType())) { //3.根据组织Id查询组织信息 - CompartmentResultDTO agency = screenCustomerAgencyDao.getAgencyAreaInfo(formDTO.getOrgId()); + CompartmentResultDTO agency = screenCustomerAgencyDao.getAgencyInfoByAegncyId(formDTO.getOrgId()); if (null == agency) { //throw new RenException(String.format("根据组织Id未查询到组织信息,组织Id:%s", formDTO.getOrgId())); return resultList; @@ -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())); } @@ -172,7 +172,7 @@ public class FactIndexServiceImpl implements FactIndexService { //组织层级数据 if (FactConstant.AGENCY.equals(formDTO.getOrgType())) { //2.根据组织Id查询组织信息 - CompartmentResultDTO agency = screenCustomerAgencyDao.getAgencyAreaInfo(formDTO.getOrgId()); + CompartmentResultDTO agency = screenCustomerAgencyDao.getAgencyInfoByAegncyId(formDTO.getOrgId()); if (null == agency) { //throw new RenException(String.format("根据组织Id未查询到组织信息,组织Id:%s", formDTO.getOrgId())); return resultList; @@ -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())); } @@ -220,7 +220,7 @@ public class FactIndexServiceImpl implements FactIndexService { //组织层级数据 if (FactConstant.AGENCY.equals(formDTO.getOrgType())) { //3.根据组织Id查询组织信息 - CompartmentResultDTO agency = screenCustomerAgencyDao.getAgencyAreaInfo(formDTO.getOrgId()); + CompartmentResultDTO agency = screenCustomerAgencyDao.getAgencyInfoByAegncyId(formDTO.getOrgId()); if (null == agency) { //throw new RenException(String.format("根据组织Id未查询到组织信息,组织Id:%s", formDTO.getOrgId())); return resultList; @@ -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())); } @@ -291,7 +291,7 @@ public class FactIndexServiceImpl implements FactIndexService { //组织层级数据 if (FactConstant.AGENCY.equals(formDTO.getOrgType())) { //2.根据组织Id查询组织信息 - CompartmentResultDTO agency = screenCustomerAgencyDao.getAgencyAreaInfo(formDTO.getOrgId()); + CompartmentResultDTO agency = screenCustomerAgencyDao.getAgencyInfoByAegncyId(formDTO.getOrgId()); if (null == agency) { //throw new RenException(String.format("根据组织Id未查询到组织信息,组织Id:%s", formDTO.getOrgId())); return resultList; @@ -359,7 +359,7 @@ public class FactIndexServiceImpl implements FactIndexService { //组织层级数据 if (FactConstant.AGENCY.equals(formDTO.getOrgType())) { //3.根据组织Id查询组织信息 - CompartmentResultDTO agency = screenCustomerAgencyDao.getAgencyAreaInfo(formDTO.getOrgId()); + CompartmentResultDTO agency = screenCustomerAgencyDao.getAgencyInfoByAegncyId(formDTO.getOrgId()); if (null == agency) { //throw new RenException(String.format("查询组织信息失败,组织Id:%s", formDTO.getOrgId())); return resultList; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/project/ProjectService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/project/ProjectService.java index a51d157689..18246addc6 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/project/ProjectService.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/project/ProjectService.java @@ -2,6 +2,7 @@ package com.epmet.datareport.service.project; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.project.dto.form.DifficultyRankFormDTO; +import com.epmet.dto.form.ProcessListFormDTO; import com.epmet.project.dto.form.ProjectIncrTrendFormDTO; import com.epmet.project.dto.result.*; @@ -43,6 +44,14 @@ public interface ProjectService { **/ List getProjectIncrTrend(TokenDto tokenDto, ProjectIncrTrendFormDTO formDTO); + /** + * @Description 项目详情 + * @Param processListFormDTO + * @author zxc + * @date 2020/10/23 10:33 上午 + */ + ProjectDetailResultDTO projectDetail( ProcessListFormDTO processListFormDTO); + /** * @Description 难点赌点-耗时最长|涉及部门最多|处理次数 * @NEI https://nei.netease.com/interface/detail/res/?pid=57068&id=321614 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 376ac9ffad..3610436962 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 @@ -4,20 +4,28 @@ import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.constant.DataSourceConstant; +import com.epmet.commons.tools.utils.Result; import com.epmet.datareport.dao.project.ProjectDao; import com.epmet.dto.CustomerAgencyDTO; +import com.epmet.datareport.service.evaluationindex.screen.ScreenDifficultyDataService; import com.epmet.dto.form.LoginUserDetailsFormDTO; import com.epmet.dto.form.SubAgencyFormDTO; import com.epmet.dto.result.GridByStaffResultDTO; +import com.epmet.dto.form.ProcessListFormDTO; import com.epmet.dto.result.LoginUserDetailsResultDTO; import com.epmet.dto.result.SubAgencyResultDTO; import com.epmet.dto.result.SubListResultDTO; +import com.epmet.dto.result.ProcessAndCurrentDeptResultDTO; +import com.epmet.dto.result.ProcesslistResultDTO; import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.feign.GovOrgOpenFeignClient; import com.epmet.datareport.service.project.ProjectService; +import com.epmet.feign.GovProjectOpenFeignClient; +import com.epmet.module.project.service.ProjectService; import com.epmet.project.constant.ProjectConstant; import com.epmet.project.dto.FactAgencyProjectDailyDTO; import com.epmet.project.dto.form.DifficultyRankFormDTO; @@ -45,6 +53,10 @@ public class ProjectServiceImpl implements ProjectService { private ProjectDao projectDao; @Autowired private EpmetUserOpenFeignClient epmetUserOpenFeignClient; + @Autowired + private GovProjectOpenFeignClient govProjectOpenFeignClient; + @Autowired + private ScreenDifficultyDataService screenDifficultyDataService; @Autowired private GovOrgOpenFeignClient govOrgOpenFeignClient; @@ -181,6 +193,30 @@ public class ProjectServiceImpl implements ProjectService { return resultList; } + /** + * @Description 项目详情 + * @Param processListFormDTO + * @author zxc + * @date 2020/10/23 10:33 上午 + */ + @Override + public ProjectDetailResultDTO projectDetail(ProcessListFormDTO processListFormDTO) { + ProjectDetailResultDTO projectDetailResultDTO = screenDifficultyDataService.projectDetail(processListFormDTO); + if (null == projectDetailResultDTO) { + return new ProjectDetailResultDTO(); + } + Result processList = govProjectOpenFeignClient.getProcessList(processListFormDTO); + if (!processList.success()) { + throw new RenException(ProjectConstant.PROCESS_FAILURE); + } + ProcessAndCurrentDeptResultDTO data = processList.getData(); + List processResultDTOS = ConvertUtils.sourceToTarget(data.getProcessList(), ProjectProcessResultDTO.class); + projectDetailResultDTO.setProcessList(processResultDTOS); + projectDetailResultDTO.setDepartmentList(data.getDepartmentList()); + projectDetailResultDTO.setDepartmentNameList(data.getDepartmentNameList()); + return projectDetailResultDTO; + } + /** * @author sun * @Description 获取机关ID 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/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/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/screen/ScreenCustomerAgencyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml index ca4cb2c6a8..9007350e5c 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 @@ -49,6 +49,7 @@ screen_customer_agency WHERE del_flag = 0 + and is_display = 1 AND agency_id = #{agencyId} @@ -64,6 +65,7 @@ screen_customer_agency WHERE del_flag = 0 + AND is_display = 1 AND pid = #{agencyId} @@ -151,4 +153,48 @@ ca.created_time DESC + + + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenDifficultyDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenDifficultyDataDao.xml index 0bb479ed65..9c1325f591 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenDifficultyDataDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenDifficultyDataDao.xml @@ -30,4 +30,29 @@ DESC + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml index 401d3d1a68..c5a9a6305d 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml @@ -205,4 +205,51 @@ LIMIT #{topNum} + diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CustomerAgencyFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CustomerAgencyFormDTO.java index cebf258d31..a9f9d34697 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CustomerAgencyFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CustomerAgencyFormDTO.java @@ -68,4 +68,9 @@ public class CustomerAgencyFormDTO implements Serializable { * 数据更新至: yyyy|yyyyMM|yyyyMMdd(08-21新增) */ private String dataEndTime; + + /** + * 是否显示 + */ + private String isDisplay; } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/DifficultyDataDetailFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/DifficultyDataDetailFormDTO.java index ab77a2363c..209cc61392 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/DifficultyDataDetailFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/DifficultyDataDetailFormDTO.java @@ -48,6 +48,11 @@ public class DifficultyDataDetailFormDTO implements Serializable { */ private String eventSource; + /** + * 事件标题 + */ + private String eventTitle; + /** * 事件内容 */ diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/ProjectExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/ProjectExtractServiceImpl.java index 5f4220162b..5077794d49 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/ProjectExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/ProjectExtractServiceImpl.java @@ -5,6 +5,8 @@ import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.commons.tools.utils.Result; +import com.epmet.constant.OrgTypeConstant; +import com.epmet.constant.ProjectConstant; import com.epmet.dao.evaluationindex.extract.FactOriginProjectOrgPeriodDailyDao; import com.epmet.dto.ProjectDTO; import com.epmet.dto.extract.FactOriginProjectMainDailyDTO; @@ -34,10 +36,10 @@ import com.epmet.service.stats.DimCustomerService; import com.epmet.service.topic.TopicService; import com.epmet.util.DimIdGenerator; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; -import org.apache.commons.collections4.CollectionUtils; import java.text.SimpleDateFormat; import java.util.*; @@ -88,9 +90,9 @@ public class ProjectExtractServiceImpl implements ProjectExtractService { if (!CollectionUtils.isEmpty(closedList)) { List closeProjects = pendingList.stream().flatMap(pending -> closedList.stream().filter(closed -> pending.getId().equals(closed.getProjectId())).map(process -> { - FactOriginProjectMainDailyEntity entity = new FactOriginProjectMainDailyEntity(); - entity.setId(process.getProjectId()); - entity.setProjectStatus("closed"); + FactOriginProjectMainDailyEntity entity = new FactOriginProjectMainDailyEntity(); + entity.setId(process.getProjectId()); + entity.setProjectStatus(ProjectConstant.CLOSED); entity.setCreatedTime(DateUtils.stringToDate(pending.getDateId(), DateUtils.DATE_PATTERN_YYYYMMDD)); entity.setUpdatedTime(process.getUpdatedTime()); entity.setIsResolved(process.getIsResolved()); @@ -196,10 +198,11 @@ public class ProjectExtractServiceImpl implements ProjectExtractService { } } final List mainList = list; + List logList = new ArrayList<>(); //节点发起人 部门流转退回结案 List processList = projectProcessService.getProcessListByCustomer(customerId, dateString); if (!CollectionUtils.isEmpty(processList)) { - List logList = processList.stream().map(process -> { + logList = processList.stream().map(process -> { //获取日期相关维度 DimIdGenerator.DimIdBean dimId = DimIdGenerator.getDimIdBean(process.getCreatedTime()); FactOriginProjectLogDailyEntity entity = new FactOriginProjectLogDailyEntity(); @@ -215,11 +218,11 @@ public class ProjectExtractServiceImpl implements ProjectExtractService { entity.setIsActive(NumConstant.ONE); entity.setPids(process.getPids()); if (StringUtils.isNotBlank(process.getDepartmentId())) { - entity.setOrgType("department"); + entity.setOrgType(OrgTypeConstant.DEPARTMENT); entity.setOrgId(process.getDepartmentId()); entity.setPid(process.getAgencyId()); }else if (StringUtils.isNotBlank(process.getGridId())) { - entity.setOrgType("grid"); + entity.setOrgType(OrgTypeConstant.GRID); entity.setOrgId(process.getGridId()); entity.setPid(process.getAgencyId()); }else{ @@ -245,67 +248,11 @@ public class ProjectExtractServiceImpl implements ProjectExtractService { return entity; }).collect(Collectors.toList()); - - //节点发起人 响应 - List responseList = projectProcessService.getResponseProcessList(customerId, dateString); - if (!CollectionUtils.isEmpty(responseList)) { - logList.addAll(responseList.stream().map(process -> { - //获取日期相关维度 - DimIdGenerator.DimIdBean dimId = DimIdGenerator.getDimIdBean(process.getCreatedTime()); - FactOriginProjectLogDailyEntity entity = new FactOriginProjectLogDailyEntity(); - entity.setCustomerId(customerId); - entity.setAgencyId(process.getAgencyId()); - entity.setYearId(dimId.getYearId()); - entity.setQuarterId(dimId.getQuarterId()); - entity.setMonthId(dimId.getMonthId()); - entity.setDateId(dimId.getDateId()); - entity.setProjectId(process.getProjectId()); - entity.setOperationUserId(process.getStaffId()); - entity.setActionCode(process.getOperation()); - entity.setIsActive(NumConstant.ONE); - entity.setPids(process.getPids()); - if (StringUtils.isNotBlank(process.getDepartmentId())) { - entity.setOrgType("department"); - entity.setOrgId(process.getDepartmentId()); - entity.setPid(process.getAgencyId()); - } else if (StringUtils.isNotBlank(process.getGridId())) { - entity.setOrgType("grid"); - entity.setOrgId(process.getGridId()); - entity.setPid(process.getAgencyId()); - } else { - if (!process.getPids().contains(StrConstant.COLON)) { - entity.setPids(""); - entity.setPid(NumConstant.ZERO_STR); - } else { - String[] orgArray = process.getPids().split(StrConstant.COLON); - if (orgArray.length > NumConstant.ONE) { - entity.setPid(orgArray[orgArray.length - NumConstant.TWO]); - String path = process.getPids().replaceAll(process.getAgencyId(), ""); - if (path.endsWith(StrConstant.COLON)) { - path = path.substring(NumConstant.ZERO, path.length() - NumConstant.ONE); - } - entity.setPids(path); - } else { - log.warn("【data-statistical】业务数据抽取模块,ProjectExtractServiceImpl.saveOriginProjectDaily:查询出的项目节点发起人所属的orgIdPath不正确,agencyId->{},orgIdPath->{}", process.getAgencyId(), process.getPids()); - entity.setPid(NumConstant.ZERO_STR); - entity.setPids(""); - } - } - } - - return entity; - }).collect(Collectors.toList())); - } - - //项目评论人 - List satisfactionRecordList = projectProcessService.getSatisfactionRecord(customerId, dateString); - - satisfactionRecordList.forEach(log -> mainList.stream().filter(project -> log.getProjectId().equals(project.getId())).forEach(main -> { - //进行满意度评价的居民的所属机关的父机机关信息 - log.setPid(main.getPid()); - log.setPids(main.getPids()); - })); - logList.addAll(satisfactionRecordList.stream().map(process -> { + } + //节点发起人 响应 + List responseList = projectProcessService.getResponseProcessList(customerId, dateString); + if (!CollectionUtils.isEmpty(responseList)) { + logList.addAll(responseList.stream().map(process -> { //获取日期相关维度 DimIdGenerator.DimIdBean dimId = DimIdGenerator.getDimIdBean(process.getCreatedTime()); FactOriginProjectLogDailyEntity entity = new FactOriginProjectLogDailyEntity(); @@ -319,67 +266,123 @@ public class ProjectExtractServiceImpl implements ProjectExtractService { entity.setOperationUserId(process.getStaffId()); entity.setActionCode(process.getOperation()); entity.setIsActive(NumConstant.ONE); - entity.setOrgId(process.getGridId()); - entity.setOrgType("grid"); - entity.setPids(process.getPids()); - entity.setPid(process.getPid()); - return entity; - }).collect(Collectors.toList())); - - - //节点接收人 - List processStaffList = projectProcessService.getProcessStaffByCustomer(customerId, dateString); - logList.addAll(processStaffList.stream().map(process -> { - //获取日期相关维度 - DimIdGenerator.DimIdBean dimId = DimIdGenerator.getDimIdBean(process.getCreatedTime()); - FactOriginProjectLogDailyEntity entity = new FactOriginProjectLogDailyEntity(); - entity.setCustomerId(customerId); - entity.setAgencyId(process.getAgencyId()); - entity.setYearId(dimId.getYearId()); - entity.setQuarterId(dimId.getQuarterId()); - entity.setMonthId(dimId.getMonthId()); - entity.setDateId(dimId.getDateId()); - entity.setProjectId(process.getProjectId()); - entity.setOperationUserId(process.getStaffId()); - entity.setActionCode(process.getOperation()); - entity.setIsActive(NumConstant.ZERO); entity.setPids(process.getPids()); if (StringUtils.isNotBlank(process.getDepartmentId())) { - entity.setOrgType("department"); + entity.setOrgType(OrgTypeConstant.DEPARTMENT); entity.setOrgId(process.getDepartmentId()); entity.setPid(process.getAgencyId()); - }else if (StringUtils.isNotBlank(process.getGridId())) { - entity.setOrgType("grid"); + } else if (StringUtils.isNotBlank(process.getGridId())) { + entity.setOrgType(OrgTypeConstant.GRID); entity.setOrgId(process.getGridId()); entity.setPid(process.getAgencyId()); - }else{ - if(!process.getPids().contains(StrConstant.COLON)){ + } else { + if (!process.getPids().contains(StrConstant.COLON)) { entity.setPids(""); entity.setPid(NumConstant.ZERO_STR); - }else{ + } else { String[] orgArray = process.getPids().split(StrConstant.COLON); - if(orgArray.length > NumConstant.ONE){ + if (orgArray.length > NumConstant.ONE) { entity.setPid(orgArray[orgArray.length - NumConstant.TWO]); - String path = process.getPids().replaceAll(process.getAgencyId(),""); - if(path.endsWith(StrConstant.COLON)){ - path =path.substring(NumConstant.ZERO,path.length() - NumConstant.ONE); + String path = process.getPids().replaceAll(process.getAgencyId(), ""); + if (path.endsWith(StrConstant.COLON)) { + path = path.substring(NumConstant.ZERO, path.length() - NumConstant.ONE); } entity.setPids(path); - }else{ - log.warn("【data-statistical】业务数据抽取模块,ProjectExtractServiceImpl.saveOriginProjectDaily:查询出的项目节点发起人所属的orgIdPath不正确,agencyId->{},orgIdPath->{}",process.getAgencyId(),process.getPids()); + } else { + log.warn("【data-statistical】业务数据抽取模块,ProjectExtractServiceImpl.saveOriginProjectDaily:查询出的项目节点发起人所属的orgIdPath不正确,agencyId->{},orgIdPath->{}", process.getAgencyId(), process.getPids()); entity.setPid(NumConstant.ZERO_STR); entity.setPids(""); } } } + return entity; }).collect(Collectors.toList())); + } - if (!logList.isEmpty()) { - factOriginProjectLogDailyService.deleteByDate(customerId, dateString); - factOriginProjectLogDailyService.insertBatch(logList); + //项目评论人 + List satisfactionRecordList = projectProcessService.getSatisfactionRecord(customerId, dateString); + + satisfactionRecordList.forEach(log -> mainList.stream().filter(project -> log.getProjectId().equals(project.getId())).forEach(main -> { + //进行满意度评价的居民的所属机关的父机机关信息 + log.setPid(main.getPid()); + log.setPids(main.getPids()); + })); + logList.addAll(satisfactionRecordList.stream().map(process -> { + //获取日期相关维度 + DimIdGenerator.DimIdBean dimId = DimIdGenerator.getDimIdBean(process.getCreatedTime()); + FactOriginProjectLogDailyEntity entity = new FactOriginProjectLogDailyEntity(); + entity.setCustomerId(customerId); + entity.setAgencyId(process.getAgencyId()); + entity.setYearId(dimId.getYearId()); + entity.setQuarterId(dimId.getQuarterId()); + entity.setMonthId(dimId.getMonthId()); + entity.setDateId(dimId.getDateId()); + entity.setProjectId(process.getProjectId()); + entity.setOperationUserId(process.getStaffId()); + entity.setActionCode(process.getOperation()); + entity.setIsActive(NumConstant.ONE); + entity.setOrgId(process.getGridId()); + entity.setOrgType(OrgTypeConstant.GRID); + entity.setPids(process.getPids()); + entity.setPid(process.getPid()); + return entity; + }).collect(Collectors.toList())); + + + //节点接收人 + List processStaffList = projectProcessService.getProcessStaffByCustomer(customerId, dateString); + logList.addAll(processStaffList.stream().map(process -> { + //获取日期相关维度 + DimIdGenerator.DimIdBean dimId = DimIdGenerator.getDimIdBean(process.getCreatedTime()); + FactOriginProjectLogDailyEntity entity = new FactOriginProjectLogDailyEntity(); + entity.setCustomerId(customerId); + entity.setAgencyId(process.getAgencyId()); + entity.setYearId(dimId.getYearId()); + entity.setQuarterId(dimId.getQuarterId()); + entity.setMonthId(dimId.getMonthId()); + entity.setDateId(dimId.getDateId()); + entity.setProjectId(process.getProjectId()); + entity.setOperationUserId(process.getStaffId()); + entity.setActionCode(process.getOperation()); + entity.setIsActive(NumConstant.ZERO); + entity.setPids(process.getPids()); + if (StringUtils.isNotBlank(process.getDepartmentId())) { + entity.setOrgType(OrgTypeConstant.DEPARTMENT); + entity.setOrgId(process.getDepartmentId()); + entity.setPid(process.getAgencyId()); + }else if (StringUtils.isNotBlank(process.getGridId())) { + entity.setOrgType(OrgTypeConstant.GRID); + entity.setOrgId(process.getGridId()); + entity.setPid(process.getAgencyId()); + }else{ + if(!process.getPids().contains(StrConstant.COLON)){ + entity.setPids(""); + entity.setPid(NumConstant.ZERO_STR); + }else{ + String[] orgArray = process.getPids().split(StrConstant.COLON); + if(orgArray.length > NumConstant.ONE){ + entity.setPid(orgArray[orgArray.length - NumConstant.TWO]); + String path = process.getPids().replaceAll(process.getAgencyId(),""); + if(path.endsWith(StrConstant.COLON)){ + path =path.substring(NumConstant.ZERO,path.length() - NumConstant.ONE); + } + entity.setPids(path); + }else{ + log.warn("【data-statistical】业务数据抽取模块,ProjectExtractServiceImpl.saveOriginProjectDaily:查询出的项目节点发起人所属的orgIdPath不正确,agencyId->{},orgIdPath->{}",process.getAgencyId(),process.getPids()); + entity.setPid(NumConstant.ZERO_STR); + entity.setPids(""); + } + } } + return entity; + }).collect(Collectors.toList())); + + if (!logList.isEmpty()) { + factOriginProjectLogDailyService.deleteByDate(customerId, dateString); + factOriginProjectLogDailyService.insertBatch(logList); } + } /** @@ -406,21 +409,21 @@ public class ProjectExtractServiceImpl implements ProjectExtractService { dest.setOrgType("dept"); dest.setPid(original.getOrgId()); dest.setPids(original.getOrgIdPath()); - }else if(StringUtils.isNotBlank(original.getGridId())){ - dest.setOrgType("grid"); + }else if(StringUtils.isNotBlank(original.getGridId())) { + dest.setOrgType(OrgTypeConstant.GRID); dest.setPid(original.getOrgId()); dest.setPids(original.getOrgIdPath()); - }else{ - dest.setOrgType("agency"); + }else { + dest.setOrgType(OrgTypeConstant.AGENCY); dest.setPids(""); String[] array = original.getOrgIdPath().split(StrConstant.COLON); - if(array.length <= NumConstant.ZERO){ + if (array.length <= NumConstant.ZERO) { dest.setPid(NumConstant.ZERO_STR); } - if(array[NumConstant.ZERO].equals(original.getOrgId()) && array.length == NumConstant.ONE){ + if (array[NumConstant.ZERO].equals(original.getOrgId()) && array.length == NumConstant.ONE) { dest.setPid(NumConstant.ZERO_STR); } - if(array.length > NumConstant.ONE && original.getOrgId().equals(array[array.length - NumConstant.ONE])){ + if (array.length > NumConstant.ONE && original.getOrgId().equals(array[array.length - NumConstant.ONE])) { dest.setPid(array[array.length - NumConstant.TWO]); dest.setPids(original.getOrgIdPath().replace(original.getOrgId(),"")); } @@ -479,7 +482,7 @@ public class ProjectExtractServiceImpl implements ProjectExtractService { */ private Integer getDetentionDays(String id, Date startDate, Date endDate) { int result; - SimpleDateFormat format = new SimpleDateFormat("yyyyMMdd"); + SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); List list = new ArrayList<>(); WorkDayFormDTO workDayFormDTO = new WorkDayFormDTO(); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateCommunityServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateCommunityServiceImpl.java index bd290fd73d..fa0fc396b3 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateCommunityServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateCommunityServiceImpl.java @@ -197,7 +197,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni List detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode(), IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); if (CollectionUtils.isEmpty(detailListByParentCode)) { log.error(IndexCalConstant.INDEX_DETAIL_LIST_NULL); - return false; + return true; } List indexInputVOS = new ArrayList<>(); Map pid = new HashMap<>(); @@ -272,7 +272,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni List detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode(), IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); if (CollectionUtils.isEmpty(detailListByParentCode)) { log.error(IndexCalConstant.INDEX_DETAIL_LIST_NULL); - return false; + return true; } List indexInputVOS = new ArrayList<>(); Map pid = new HashMap<>(); @@ -344,7 +344,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni List detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode(), IndexCodeEnum.FU_WU_NENG_LI.getCode()); if (CollectionUtils.isEmpty(detailListByParentCode)) { log.error(IndexCalConstant.INDEX_DETAIL_LIST_NULL); - return false; + return true; } List indexInputVOS = new ArrayList<>(); Map pid = new HashMap<>(); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java index 35d59bf71b..5b18396a66 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java @@ -194,7 +194,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict List indexDetailList = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.QUAN_QU_XIANG_GUAN.getCode(), IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); if (CollectionUtils.isEmpty(indexDetailList)) { log.error(IndexCalConstant.INDEX_DETAIL_LIST_NULL); - return false; + return true; } List indexInputVOS = new ArrayList<>(); Map pid = new HashMap<>(); @@ -271,7 +271,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict List detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.QUAN_QU_XIANG_GUAN.getCode(), IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); if (CollectionUtils.isEmpty(detailListByParentCode)) { log.error(IndexCalConstant.INDEX_DETAIL_LIST_NULL); - return false; + return true; } List indexInputVOS = new ArrayList<>(); Map pid = new HashMap<>(); @@ -350,7 +350,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict List detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.QUAN_QU_XIANG_GUAN.getCode(), IndexCodeEnum.FU_WU_NENG_LI.getCode()); if (CollectionUtils.isEmpty(detailListByParentCode)) { log.error(IndexCalConstant.INDEX_DETAIL_LIST_NULL); - return false; + return true; } List indexInputVOS = new ArrayList<>(); Map pid = new HashMap<>(); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateStreetServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateStreetServiceImpl.java index 468aa668a7..4669ae0cda 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateStreetServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateStreetServiceImpl.java @@ -198,7 +198,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ List detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.JIE_DAO_XIANG_GUAN.getCode(), IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); if (CollectionUtils.isEmpty(detailListByParentCode)) { log.error(IndexCalConstant.INDEX_DETAIL_LIST_NULL); - return false; + return true; } List indexInputVOS = new ArrayList<>(); Map pid = new HashMap<>(); @@ -273,7 +273,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ List detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.JIE_DAO_XIANG_GUAN.getCode(), IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); if (CollectionUtils.isEmpty(detailListByParentCode)) { log.error(IndexCalConstant.INDEX_DETAIL_LIST_NULL); - return false; + return true; } List indexInputVOS = new ArrayList<>(); Map pid = new HashMap<>(); @@ -345,7 +345,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ List detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.JIE_DAO_XIANG_GUAN.getCode(), IndexCodeEnum.FU_WU_NENG_LI.getCode()); if (CollectionUtils.isEmpty(detailListByParentCode)) { log.error(IndexCalConstant.INDEX_DETAIL_LIST_NULL); - return false; + return true; } List indexInputVOS = new ArrayList<>(); Map pid = new HashMap<>(); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/BatchScoreCalculator.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/BatchScoreCalculator.java index 900b15aaf5..47be178b7a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/BatchScoreCalculator.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/BatchScoreCalculator.java @@ -66,22 +66,24 @@ public class BatchScoreCalculator { BigDecimal minScoreValue = idx.getScoreCalculator().getMinScore(); BigDecimal maxScoreValue = idx.getScoreCalculator().getMaxScore(); - if (idx.getScoreCalculator().getMaxValue().compareTo(idx.getScoreCalculator().getMinValue()) == 0) { - //*((max-min)/ (Math.PI/2))+min - //Math.atan(new Double(vo.getSampleValue().toString()))* - normalizeValue = new BigDecimal(Math.atan(new Double(getFinalSampleValue(vo.getSampleValue(), threshold).toString()))) - .multiply( - (maxScoreValue.subtract(minScoreValue).divide(new BigDecimal(Math.PI / 2), 10, RoundingMode.HALF_UP))) - .add(minScoreValue).setScale(6, RoundingMode.HALF_UP); - // - if (scoreCalculator.getCorrelation().getCode().equals(Correlation.NEGATIVE)) { - normalizeValue = maxScoreValue.subtract(normalizeValue); - } - }else { - //如果不需要归一 则 直接value*权重 - if (idx.isScore()) { - vo.setSampleValue(new BigDecimal(vo.getSampleValue().toString()).compareTo(NumConstant.ZERO_DECIMAL) == NumConstant.ZERO ? ScoreConstants.MIN_SCORE : new BigDecimal(vo.getSampleValue().toString())); - normalizeValue = getFinalSampleValue(vo.getSampleValue(), threshold); + + //1.如果是分数值(平均值)不需要归一 则 直接value*权重 + //2.否则 先判断 样本值是否相等 是:反正切函数 否:归一算法 + if (idx.isScore()) { + vo.setSampleValue(new BigDecimal(vo.getSampleValue().toString()).compareTo(NumConstant.ZERO_DECIMAL) == NumConstant.ZERO ? ScoreConstants.MIN_SCORE : new BigDecimal(vo.getSampleValue().toString())); + normalizeValue = getFinalSampleValue(vo.getSampleValue(), threshold); + } else { + if (idx.getScoreCalculator().getMaxValue().compareTo(idx.getScoreCalculator().getMinValue()) == 0) { + //*((max-min)/ (Math.PI/2))+min + //Math.atan(new Double(vo.getSampleValue().toString()))* + normalizeValue = new BigDecimal(Math.atan(new Double(getFinalSampleValue(vo.getSampleValue(), threshold).toString()))) + .multiply( + (maxScoreValue.subtract(minScoreValue).divide(new BigDecimal(Math.PI / 2), 10, RoundingMode.HALF_UP))) + .add(minScoreValue).setScale(6, RoundingMode.HALF_UP); + // + if (scoreCalculator.getCorrelation().getCode().equals(Correlation.NEGATIVE)) { + normalizeValue = maxScoreValue.subtract(normalizeValue); + } } else { normalizeValue = scoreCalculator.normalize(getFinalSampleValue(vo.getSampleValue(), threshold)); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerAgencyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerAgencyDao.xml index 4e91fadb91..97eea5c398 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerAgencyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerAgencyDao.xml @@ -24,6 +24,7 @@ PARTY_MARK, `LEVEL`, AREA_CODE, + IS_DISPLAY, DEL_FLAG, REVISION, CREATED_BY, @@ -46,6 +47,7 @@ #{item.partyMark}, #{item.level}, #{item.areaCode}, + ifnull(#{item.isDisplay},'1'), 0, 0, 'APP_USER', diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenDifficultyDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenDifficultyDataDao.xml index ed0681e753..c56a4e85ab 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenDifficultyDataDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenDifficultyDataDao.xml @@ -18,6 +18,7 @@ PARENT_ID, ORG_NAME, EVENT_ID, + EVENT_TITLE, EVENT_IMG_URL, EVENT_SOURCE, EVENT_CONTENT, @@ -47,6 +48,7 @@ #{item.parentId}, #{item.orgName}, #{item.eventId}, + #{item.eventTitle}, #{item.eventImgUrl}, #{item.eventSource}, #{item.eventContent}, diff --git a/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/form/GetJwtAccessTokenFormDTO.java b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/form/GetJwtAccessTokenFormDTO.java new file mode 100644 index 0000000000..47577b2787 --- /dev/null +++ b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/form/GetJwtAccessTokenFormDTO.java @@ -0,0 +1,13 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; + +@Data +public class GetJwtAccessTokenFormDTO { + + @NotBlank(message = "AppId不能为空") + private String appId; + +} diff --git a/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/result/AppIdInfoResultDTO.java b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/result/AppIdInfoResultDTO.java new file mode 100644 index 0000000000..b4dc217e2d --- /dev/null +++ b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/result/AppIdInfoResultDTO.java @@ -0,0 +1,32 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/10/21 5:30 下午 + */ +@Data +public class AppIdInfoResultDTO implements Serializable { + + private static final long serialVersionUID = 4556971930323763712L; + + /** + * 应用ID + */ + private String appId; + + /** + * 客户ID + */ + private String customerId; + + /** + * 密钥 + */ + private String secret; + + private String accessToken; +} diff --git a/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/result/GetJwtAccessTokenResultDTO.java b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/result/GetJwtAccessTokenResultDTO.java new file mode 100644 index 0000000000..58cf9ecc6f --- /dev/null +++ b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/result/GetJwtAccessTokenResultDTO.java @@ -0,0 +1,16 @@ +package com.epmet.dto.result; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@AllArgsConstructor +@NoArgsConstructor +public class GetJwtAccessTokenResultDTO { + + private String customerId; + private String token; + private Long ts; + +} diff --git a/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/feign/EpmetCommonServiceOpenFeignClient.java b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/feign/EpmetCommonServiceOpenFeignClient.java index 23a5e04e56..0e2a656e62 100644 --- a/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/feign/EpmetCommonServiceOpenFeignClient.java +++ b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/feign/EpmetCommonServiceOpenFeignClient.java @@ -4,9 +4,11 @@ import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.form.CostDayFormDTO; import com.epmet.dto.form.ExternalAppAuthFormDTO; +import com.epmet.dto.form.GetJwtAccessTokenFormDTO; import com.epmet.dto.form.WorkDayFormDTO; import com.epmet.dto.result.CostDayResultDTO; import com.epmet.dto.form.WorkMinuteFormDTO; +import com.epmet.dto.result.AppIdInfoResultDTO; import com.epmet.dto.result.ExternalAppAuthResultDTO; import com.epmet.dto.result.WorkDayResultDTO; import com.epmet.feign.fallback.EpmetCommonServiceOpenFeignClientFallback; @@ -58,6 +60,18 @@ public interface EpmetCommonServiceOpenFeignClient { @PostMapping("/commonservice/externalapp/get-secret") Result getSecret(@RequestBody String appId); + /** + * @Description 获取AccessToken + * @return Result + * @author wxz + * @date 2020.10.22 10:19 + */ + @PostMapping("/commonservice/externalapp/get-jwt-accesstoken") + Result getAccessToken(@RequestBody GetJwtAccessTokenFormDTO form); + + @PostMapping("/commonservice/externalapp/appidinfo") + Result appIdInfo(@RequestBody String appId); + /** * 工作日计算 * @author zhaoqifeng diff --git a/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/feign/fallback/EpmetCommonServiceOpenFeignClientFallback.java b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/feign/fallback/EpmetCommonServiceOpenFeignClientFallback.java index 1da180368d..bd397df1d0 100644 --- a/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/feign/fallback/EpmetCommonServiceOpenFeignClientFallback.java +++ b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/feign/fallback/EpmetCommonServiceOpenFeignClientFallback.java @@ -5,9 +5,11 @@ import com.epmet.commons.tools.utils.ModuleUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.form.CostDayFormDTO; import com.epmet.dto.form.ExternalAppAuthFormDTO; +import com.epmet.dto.form.GetJwtAccessTokenFormDTO; import com.epmet.dto.form.WorkDayFormDTO; import com.epmet.dto.form.WorkMinuteFormDTO; import com.epmet.dto.result.CostDayResultDTO; +import com.epmet.dto.result.AppIdInfoResultDTO; import com.epmet.dto.result.ExternalAppAuthResultDTO; import com.epmet.dto.result.WorkDayResultDTO; import com.epmet.feign.EpmetCommonServiceOpenFeignClient; @@ -44,6 +46,16 @@ public class EpmetCommonServiceOpenFeignClientFallback implements EpmetCommonSer return ModuleUtils.feignConError(ServiceConstant.EPMET_COMMON_SERVICE, "getSecret", appId); } + @Override + public Result appIdInfo(String appId) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_COMMON_SERVICE, "appIdInfo", appId); + } + + @Override + public Result getAccessToken(GetJwtAccessTokenFormDTO form) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_COMMON_SERVICE, "getAccessToken", form); + } + /** * 工作日计算 * diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/controller/ExternalAppController.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/controller/ExternalAppController.java index f1229c7902..baee81af67 100644 --- a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/controller/ExternalAppController.java +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/controller/ExternalAppController.java @@ -8,8 +8,11 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.form.ExternalAppAuthFormDTO; import com.epmet.dto.form.ExternalAppFormDTO; +import com.epmet.dto.form.GetJwtAccessTokenFormDTO; +import com.epmet.dto.result.AppIdInfoResultDTO; import com.epmet.dto.result.ExternalAppAuthResultDTO; import com.epmet.dto.result.ExternalAppResultDTO; +import com.epmet.dto.result.GetJwtAccessTokenResultDTO; import com.epmet.service.ExternalAppAuthService; import com.epmet.service.ExternalAppSecretService; import com.epmet.service.ExternalAppService; @@ -17,10 +20,7 @@ import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; import java.util.List; @@ -146,4 +146,23 @@ public class ExternalAppController { return new Result().ok(secret); } + /** + * @Description 获取AccessToken + * @return Result + * @author wxz + * @date 2020.10.22 10:19 + */ + @PostMapping("get-jwt-accesstoken") + public Result getAccessToken(@RequestBody GetJwtAccessTokenFormDTO form) { + ValidatorUtils.validateEntity(form); + String appId = form.getAppId(); + GetJwtAccessTokenResultDTO jwtAccessToken = externalAppService.getJwtAccessToken(appId); + return new Result().ok(jwtAccessToken); + } + + @PostMapping("appidinfo") + public Result appIdInfo(@RequestBody String appId){ + return new Result().ok(externalAppService.appIdInfo(appId)); + } + } diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/dao/ExternalAppDao.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/dao/ExternalAppDao.java index 45dda5390a..b2f89b9b90 100644 --- a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/dao/ExternalAppDao.java +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/dao/ExternalAppDao.java @@ -18,6 +18,7 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.result.AppIdInfoResultDTO; import com.epmet.dto.result.ExternalAppResultDTO; import com.epmet.entity.ExternalAppEntity; import org.apache.ibatis.annotations.Mapper; @@ -41,4 +42,12 @@ public interface ExternalAppDao extends BaseDao { List list(@Param("customerId") String customerId); List getCustomerIds(); + + /** + * @Description 根据appId查询客户ID和密钥 + * @Param appId + * @author zxc + * @date 2020/10/21 5:50 下午 + */ + AppIdInfoResultDTO appIdInfo(@Param("appId")String appId); } \ No newline at end of file diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/ExternalAppService.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/ExternalAppService.java index 4d5d847e68..77e4c32f48 100644 --- a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/ExternalAppService.java +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/ExternalAppService.java @@ -18,7 +18,9 @@ package com.epmet.service; import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.result.AppIdInfoResultDTO; import com.epmet.dto.result.ExternalAppResultDTO; +import com.epmet.dto.result.GetJwtAccessTokenResultDTO; import java.util.List; @@ -38,4 +40,8 @@ public interface ExternalAppService { List getCustomerIds(); String resetSecret(String appId); + + GetJwtAccessTokenResultDTO getJwtAccessToken(String appId); + + AppIdInfoResultDTO appIdInfo(String appId); } \ No newline at end of file diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/ExternalAppServiceImpl.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/ExternalAppServiceImpl.java index db3267c600..7b4229b3a1 100644 --- a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/ExternalAppServiceImpl.java +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/ExternalAppServiceImpl.java @@ -27,12 +27,15 @@ import com.epmet.dao.ExternalAppDao; import com.epmet.dao.ExternalAppSecretDao; import com.epmet.dao.ExternalCustomerDao; import com.epmet.dto.CustomerDTO; +import com.epmet.dto.result.AppIdInfoResultDTO; import com.epmet.dto.result.ExternalAppResultDTO; +import com.epmet.dto.result.GetJwtAccessTokenResultDTO; import com.epmet.entity.ExternalAppEntity; import com.epmet.entity.ExternalAppSecretEntity; import com.epmet.enu.CustomerTypeEnum; import com.epmet.feign.OperCrmOpenFeignClient; import com.epmet.service.ExternalAppService; +import com.epmet.utils.externalapp.ExtAppJwtTokenUtils; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import org.slf4j.Logger; @@ -41,6 +44,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import java.util.HashMap; import java.util.List; import java.util.UUID; @@ -70,6 +74,9 @@ public class ExternalAppServiceImpl implements ExternalAppService { @Autowired private RedisUtils redisUtils; + @Autowired + private ExtAppJwtTokenUtils tokenUtils; + @Transactional @Override public ExternalAppResultDTO add(String appName, String customerId, String customerType) { @@ -197,4 +204,25 @@ public class ExternalAppServiceImpl implements ExternalAppService { return null; } + @Override + public GetJwtAccessTokenResultDTO getJwtAccessToken(String appId) { + ExternalAppEntity externalAppEntity = externalAppDao.selectById(appId); + String customerId = externalAppEntity.getCustomerId(); + String secret = externalAppSecretDao.getSecretByAppId(appId); + long ts = System.currentTimeMillis(); + + String token = tokenUtils.genToken(secret, appId, customerId, ts); + return new GetJwtAccessTokenResultDTO(customerId, token, ts); + } + @Override + public AppIdInfoResultDTO appIdInfo(String appId) { + AppIdInfoResultDTO appIdInfoResultDTO = externalAppDao.appIdInfo(appId); + if (null == appIdInfoResultDTO){ + throw new RenException("没查到对应appId【"+appId+"】的信息"); + } + String accessToken = tokenUtils.genToken(appIdInfoResultDTO.getSecret(), appId, appIdInfoResultDTO.getCustomerId(), System.currentTimeMillis()); + appIdInfoResultDTO.setAccessToken(accessToken); + return appIdInfoResultDTO; + } + } \ No newline at end of file diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/utils/externalapp/ExtAppJwtTokenUtils.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/utils/externalapp/ExtAppJwtTokenUtils.java index b945889b7c..1714ed728a 100644 --- a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/utils/externalapp/ExtAppJwtTokenUtils.java +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/utils/externalapp/ExtAppJwtTokenUtils.java @@ -49,7 +49,7 @@ public class ExtAppJwtTokenUtils { } } - public String createToken(Map map, String secret) { + private String createToken(Map map, String secret) { return Jwts.builder() .setHeaderParam("typ", "JWT") .setClaims(map) @@ -59,21 +59,7 @@ public class ExtAppJwtTokenUtils { .compact(); } -// /** -// * token是否过期 -// * -// * @return true:过期 -// */ -// public boolean isTokenExpired(Date expiration) { -// return expiration.before(new Date()); -// } - - public static void main(String[] args) { - genToken(); -// getClaim(); - } - - public static void genToken() { + public static void genTestToken() { HashMap claim = new HashMap<>(); //市北 //String secret = "612d304095c50369c3ef06e490f05779eeb8f19ff16566c73aeafafc5fa01970"; @@ -89,21 +75,23 @@ public class ExtAppJwtTokenUtils { String appId = "f358d63a89f3670c197c62ca4c3a0366"; String customrId = "45687aa479955f9d06204d415238f7cc"; - claim.put("customerId", customrId); - claim.put("appId", appId); long ts = System.currentTimeMillis() + 1000 * 60 * 1; System.out.println("时间戳:" + ts); + String token = new ExtAppJwtTokenUtils().genToken(secret, appId, customrId, ts); + System.out.println(token); + } + + public String genToken(String secret, String appId, String customrId, Long ts) { + HashMap claim = new HashMap<>(); + claim.put("customerId", customrId); + claim.put("appId", appId); claim.put("ts", ts); - String abc = new ExtAppJwtTokenUtils().createToken(claim, secret); - System.out.println(abc); + return createToken(claim, secret); } - public static void getClaim() { - String token = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJhcHBJZCI6IjEiLCJjdXN0b21lcklkIjoiYzEiLCJpYXQiOjE1OTc3NDI2NTB9.09Vop0Nobg3LENAJoAZaCUKtgAjADAK48BS11ky3YdAp6h-cXYtGeqUxbgvE_4F6239rc7UE2fjxtEvMuWEJuA"; - - Claims claimByToken = new ExtAppJwtTokenUtils().getClaimByToken(token, "4a762660254c57996343f8ee42fbc0a6"); - System.out.println(claimByToken); + public static void main(String[] args) { + genTestToken(); } } diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/resources/mapper/ExternalAppDao.xml b/epmet-module/epmet-common-service/common-service-server/src/main/resources/mapper/ExternalAppDao.xml index 8ce99b1a67..55889d71b1 100644 --- a/epmet-module/epmet-common-service/common-service-server/src/main/resources/mapper/ExternalAppDao.xml +++ b/epmet-module/epmet-common-service/common-service-server/src/main/resources/mapper/ExternalAppDao.xml @@ -66,5 +66,19 @@ SELECT CUSTOMER_ID FROM external_app WHERE DEL_FLAG = 0 + + + \ No newline at end of file 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..d55b9c8373 --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProcessAndCurrentDeptResultDTO.java @@ -0,0 +1,41 @@ +package com.epmet.dto.result; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; +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; + } +} 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 c16b8da399..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 @@ -1,8 +1,11 @@ package com.epmet.feign; 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; import com.epmet.commons.tools.constant.ServiceConstant; @@ -29,4 +32,7 @@ public interface GovProjectOpenFeignClient { */ @PostMapping("gov/project/project/pendprojectlist") Result> getPendProjectList(@RequestBody ProjectListFromDTO fromDTO); + + @PostMapping("gov/project/trace/processlistnotrule") + 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 aa84f509c5..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 @@ -3,8 +3,11 @@ package com.epmet.feign.fallback; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.ModuleUtils; import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.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; @@ -22,4 +25,9 @@ public class GovProjectOpenFeignClientFallback implements GovProjectOpenFeignCli public Result> getPendProjectList(ProjectListFromDTO fromDTO) { return ModuleUtils.feignConError(ServiceConstant.GOV_PROJECT_SERVER, "getPendProjectList", fromDTO); } + + @Override + 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 d32f28f8de..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 @@ -179,6 +179,18 @@ public class ProjectTraceController { return new Result>().ok(projectProcessService.progressList(formDTO)); } + /** + * @param formDTO + * @return + * @Author zxc + * @Description 项目跟踪-项目处理进展列表 + **/ + @PostMapping("processlistnotrule") + public Result processListNotRule(@RequestBody ProcessListFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO); + return new Result().ok(projectProcessService.progressAndCurrentDept(formDTO)); + } + /** * @param formDTO * @return 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 794960ea13..59f41ab307 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 @@ -134,6 +134,14 @@ public interface ProjectProcessService extends BaseService */ ProjectDetailCheckResultDTO checkProjectClose(ProjectIdFormDTO projectIdFormDTO); + /** + * @Description 查询项目进展和当前处理部门 + * @Param formDTO + * @author zxc + * @date 2020/10/26 9:41 上午 + */ + ProcessAndCurrentDeptResultDTO progressAndCurrentDept(ProcessListFormDTO formDTO); + /** * @Description 查询项目-机关各个节点的响应列表 * @param projects 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 92f5992a48..5aff33c19a 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 @@ -37,9 +37,12 @@ import com.epmet.constant.ProjectConstant; import com.epmet.constant.ReadFlagConstant; import com.epmet.constant.UserMessageConstant; import com.epmet.dao.ProjectOrgRelationDao; +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; @@ -48,6 +51,7 @@ import com.epmet.entity.ProjectProcessEntity; import com.epmet.entity.ProjectStaffEntity; import com.epmet.feign.EpmetCommonServiceOpenFeignClient; 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; @@ -98,6 +102,10 @@ public class ProjectProcessServiceImpl extends BaseServiceImpl page(Map params) { @@ -399,6 +407,65 @@ 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; + } /** * @Description 查询项目-机关各个节点的响应列表 * @param projects