diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/ServiceConstant.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/ServiceConstant.java index b66c3c33d2..e104c83e54 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/ServiceConstant.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/ServiceConstant.java @@ -119,6 +119,11 @@ public interface ServiceConstant { */ String DATA_STATISTICAL_SERVER = "data-statistical-server"; + /** + * 数据统计结果查询 + */ + String DATA_REPORT_SERVER="data-report-server"; + /** * 微信第三方平台 */ diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/AgencyNode.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/AgencyNode.java new file mode 100644 index 0000000000..e6346d7e50 --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/AgencyNode.java @@ -0,0 +1,26 @@ +package com.epmet.commons.tools.utils; + +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +/** + * 描述一下 + * + * @author yinzuomei@elink-cn.com + * @date 2021/2/4 20:49 + */ +@Data +public class AgencyNode implements Serializable { + + private String areaCode; + + private String parentAreaCode; + + /** + * 子节点列表 + */ + private List subAgencyList = new ArrayList<>(); +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/AgencyTreeUtils.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/AgencyTreeUtils.java new file mode 100644 index 0000000000..80ad231f47 --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/AgencyTreeUtils.java @@ -0,0 +1,73 @@ +package com.epmet.commons.tools.utils; + + +import com.epmet.commons.tools.validator.AssertUtils; + +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +/** + * 描述一下 + * + * @author yinzuomei@elink-cn.com + * @date 2021/2/4 20:49 + */ +public class AgencyTreeUtils { + + /** + * 根据pid,构建树节点 + */ + public static List build(List agencyNodes, String parentAreaCode) { + //pid不能为空 + AssertUtils.isNull(parentAreaCode, "parentAreaCode"); + + List treeList = new ArrayList<>(); + for (T agencyNode : agencyNodes) { + if (parentAreaCode.equals(agencyNode.getParentAreaCode())) { + treeList.add(findChildren(agencyNodes, agencyNode)); + } + } + + return treeList; + } + + /** + * 查找子节点 + */ + private static T findChildren(List agencyNodes, T rootNode) { + for (T agencyNode : agencyNodes) { + if (rootNode.getAreaCode().equals(agencyNode.getParentAreaCode())) { + rootNode.getSubAgencyList().add(findChildren(agencyNodes, agencyNode)); + } + } + return rootNode; + } + + /** + * 构建树节点 + */ + public static List build(List agencyNodes) { + List result = new ArrayList<>(); + + //list转map + Map nodeMap = new LinkedHashMap<>(agencyNodes.size()); + for (T agencyNode : agencyNodes) { + nodeMap.put(agencyNode.getAreaCode(), agencyNode); + } + + for (T node : nodeMap.values()) { + T parent = nodeMap.get(node.getParentAreaCode()); + if (parent != null && !(node.getAreaCode().equals(parent.getAreaCode()))) { + parent.getSubAgencyList().add(node); + continue; + } + + result.add(node); + } + + return result; + } + +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java index e4a6cf94cb..8c6432aadd 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java @@ -729,4 +729,38 @@ public class DateUtils { LocalDate ldn = new LocalDate(date); return ldn.dayOfMonth().withMaximumValue().toDate(); } + + /** + * @return ["202002","202003","202004","202005","202006","202007","202008","202009","202010","202011","202012","202101"] + * @param monthId 202101 + * @param num 11 + * @description 截止到当前monthId,近12个月的坐标 + * @Date 2021/2/1 17:20 + **/ + public static List getMonthIdList(String monthId,int num) { + List monthIdList = new ArrayList<>(); + for (int i = num; i >= NumConstant.ZERO; i--) { + Calendar c = Calendar.getInstance(); + c.setTime(com.epmet.commons.tools.utils.DateUtils.stringToDate(monthId.concat("01"), com.epmet.commons.tools.utils.DateUtils.DATE_PATTERN_YYYYMMDD)); + c.add(Calendar.MONTH, -i); + Date date = c.getTime(); + String month = com.epmet.commons.tools.utils.DateUtils.format(date, com.epmet.commons.tools.utils.DateUtils.DATE_PATTERN_YYYYMM); + // monthIdList.add(month.substring(4, 6).concat("月")); + monthIdList.add(month); + } + return monthIdList; + } + + /** + * @author yinzuomei + * @description 获取当前时间的山个月monthId + * @Date 2021/2/1 17:41 + **/ + public static String getCurrentTimeBeforeMonthId(){ + Calendar c = Calendar.getInstance(); + c.setTime(new Date()); + c.add(Calendar.MONTH, -1); + Date nowDate = c.getTime(); + return com.epmet.commons.tools.utils.DateUtils.format(nowDate, com.epmet.commons.tools.utils.DateUtils.DATE_PATTERN_YYYYMM); + } } diff --git a/epmet-gateway/src/main/java/com/epmet/auth/InternalAuthProcessor.java b/epmet-gateway/src/main/java/com/epmet/auth/InternalAuthProcessor.java index 30e8d2b457..bd7d740297 100644 --- a/epmet-gateway/src/main/java/com/epmet/auth/InternalAuthProcessor.java +++ b/epmet-gateway/src/main/java/com/epmet/auth/InternalAuthProcessor.java @@ -115,7 +115,7 @@ public class InternalAuthProcessor extends AuthProcessor { builder.header(AppClientConstant.CUSTOMER_ID,baseTokenDto.getCustomerId()); } - if (StringUtils.equals(baseTokenDto.getApp(), "gov")) {//工作端 + if (StringUtils.equalsAny(baseTokenDto.getApp(), AppClientConstant.APP_GOV, AppClientConstant.APP_RESI)) {//工作端/居民端 if(StringUtils.isNotBlank(customerId)){ exchange.getRequest().mutate().header(AppClientConstant.CUSTOMER_ID, customerId); } diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/CustomerAgencyDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/CustomerAgencyDTO.java index c3a6f3d697..4b98fb899f 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/CustomerAgencyDTO.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/CustomerAgencyDTO.java @@ -128,4 +128,8 @@ public class CustomerAgencyDTO implements Serializable { */ private String district; + /** + * 当前组织的上级行政地区编码add0204;举例平阴县对应的是济南市3701 + */ + private String parentAreaCode; } \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govorg/CustomerAgencyEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govorg/CustomerAgencyEntity.java index 1f7dc21bea..79f226ca2f 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govorg/CustomerAgencyEntity.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govorg/CustomerAgencyEntity.java @@ -94,4 +94,8 @@ public class CustomerAgencyEntity extends BaseEpmetEntity { */ private String district; + /** + * 当前组织的上级行政地区编码add0204;举例平阴县对应的是济南市3701 + */ + private String parentAreaCode; } diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/ScreenProjectQuantityOrgMonthlyDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/ScreenProjectQuantityOrgMonthlyDTO.java new file mode 100644 index 0000000000..0019aed057 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/ScreenProjectQuantityOrgMonthlyDTO.java @@ -0,0 +1,59 @@ +/** + * 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.dto; + +import lombok.Data; + +import java.io.Serializable; + + +/** + * 项目(事件)数量分析按组织_按月统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-01-27 + */ +@Data +public class ScreenProjectQuantityOrgMonthlyDTO implements Serializable { + private static final long serialVersionUID = 6821188282305837207L; + /** + * 客户ID + */ + private String customerId; + + /** + * 日期yyyyMMdd + */ + private String monthId; + + /** + * 组织id + */ + private String orgId; + + /** + * 当前组织内,本月新增的项目数量:转项目日期在当前月份内 + */ + private Integer projectIncr; + + /** + * 截止到当前月份:累计项目总数 + */ + private Integer projectTotal; + +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/form/screen/EfficiencyAnalysisFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/form/screen/EfficiencyAnalysisFormDTO.java new file mode 100644 index 0000000000..0bf1c1556f --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/form/screen/EfficiencyAnalysisFormDTO.java @@ -0,0 +1,20 @@ +package com.epmet.dto.form.screen; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; + +/** + * 【事件分析】效率分析 入参DTO + * + * @author yinzuomei@elink-cn.com + * @date 2021/2/1 18:27 + */ +@Data +public class EfficiencyAnalysisFormDTO extends ScreenCommonFormDTO{ + /** + * 网格:grid; 街道:street + */ + @NotBlank(message = "type不能为空:网格:grid; 街道:street") + private String type; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/form/screen/QueryQuantityMonthlyFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/form/screen/QueryQuantityMonthlyFormDTO.java new file mode 100644 index 0000000000..7ee3cade33 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/form/screen/QueryQuantityMonthlyFormDTO.java @@ -0,0 +1,28 @@ +package com.epmet.dto.form.screen; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; + +/** + * 近12个月【事件分析】月度数量分析 入参DTO + * + * @author yinzuomei@elink-cn.com + * @date 2021/2/1 16:34 + */ +@Data +public class QueryQuantityMonthlyFormDTO extends ScreenCommonFormDTO{ + private static final long serialVersionUID = 8848067533647648347L; + + /** + * 每月项目增量:incr;累计项目数量:sum + */ + @NotBlank(message = "type不能为空:每月项目增量:incr;累计项目数量:sum") + private String type ; + + /** + * 截止到某月格式:yyyyMM;可为空 + */ + private String endMonthId; + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/form/screen/ScreenCommonFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/form/screen/ScreenCommonFormDTO.java new file mode 100644 index 0000000000..f2e4e45533 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/form/screen/ScreenCommonFormDTO.java @@ -0,0 +1,24 @@ +package com.epmet.dto.form.screen; + +import lombok.Data; + +import java.io.Serializable; + + +/** + * 大屏通用入参 + * + * @author yinzuomei@elink-cn.com + */ +@Data +public class ScreenCommonFormDTO implements Serializable { + private static final long serialVersionUID = -5959152175751211940L; + /** + * 来源于请求头中的customerId + */ + private String customerId; + /** + * 当前要查询的组织id + */ + private String agencyId; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/ScreenCustomerAgencyDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/ScreenCustomerAgencyDTO.java new file mode 100644 index 0000000000..c78858001d --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/ScreenCustomerAgencyDTO.java @@ -0,0 +1,45 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 组织机构信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-21 + */ +@Data +public class ScreenCustomerAgencyDTO implements Serializable { + private static final long serialVersionUID = 6328123559936824470L; + /** + * 客户id + */ + private String customerId; + + /** + * 组织id + */ + private String agencyId; + + /** + * 组织名称 + */ + private String agencyName; + + /** + * 机关级别(社区级:community, + 乡(镇、街道)级:street, + 区县级: district, + 市级: city + 省级:province) + */ + private String level; + + /** + * 行政地区编码 + */ + private String areaCode; + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/plugins/AgencyNodeDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/plugins/AgencyNodeDTO.java new file mode 100644 index 0000000000..2890092b80 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/plugins/AgencyNodeDTO.java @@ -0,0 +1,50 @@ +package com.epmet.dto.result.plugins; + +import com.epmet.commons.tools.utils.AgencyNode; +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +/** + * 008、当前用户的数据权限(多客户版本) 返参DTO + * + * @author yinzuomei@elink-cn.com + * @date 2021/2/3 20:33 + */ +@Data +public class AgencyNodeDTO extends AgencyNode implements Serializable { + + private static final long serialVersionUID = -3745920378557792529L; + /** + * 直属机关Id + * */ + private String agencyId; + + /** + * 直属机关名称 + * */ + private String agencyName; + + /** + * 机关级别(社区级:community, 乡(镇、街道)级:street, 区县级: district, 市级: city 省级:province) + * */ + private String level; + + /** + * 当前agencyId所属的客户id add02.03 + * */ + private String customerId; + + /** + * 直属机关直属网格列表 + * */ + private List gridList = new ArrayList<>(); + + /** + * 直属机关直属部门列表 + * */ + private List departmentList = new ArrayList<>(); + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/plugins/BidInfoResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/plugins/BidInfoResultDTO.java new file mode 100644 index 0000000000..5dc420ecde --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/plugins/BidInfoResultDTO.java @@ -0,0 +1,15 @@ +package com.epmet.dto.result.plugins; + +import lombok.Data; + +/** + * 【146体系】竞标管理-列表 + * + * @author yinzuomei@elink-cn.com + * @date 2021/1/22 13:37 + */ +@Data +public class BidInfoResultDTO { + private String bidName; + private String statusDesc; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/plugins/ContractResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/plugins/ContractResultDTO.java new file mode 100644 index 0000000000..e8a655284f --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/plugins/ContractResultDTO.java @@ -0,0 +1,19 @@ +package com.epmet.dto.result.plugins; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.util.Date; + +/** + * 【146体系】合同监督-列表 + * + * @author yinzuomei@elink-cn.com + * @date 2021/1/22 13:30 + */ +@Data +public class ContractResultDTO { + private String contractListName; + @JsonFormat(pattern = "yyyy.MM.dd", timezone = "GMT+8") + private Date dueDate; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/plugins/DeptNodeDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/plugins/DeptNodeDTO.java new file mode 100644 index 0000000000..ed105f71c9 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/plugins/DeptNodeDTO.java @@ -0,0 +1,36 @@ +package com.epmet.dto.result.plugins; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 部门信息 + * @ClassName ExtDeptResultDTO + * @Auth wangc + * @Date 2020-08-17 17:16 + */ +@Data +public class DeptNodeDTO implements Serializable { + private static final long serialVersionUID = 1792371558965832432L; + + /** + * 部门Id + * */ + private String deptId; + + /** + * 部门名称 + * */ + private String deptName; + + /** + * 当前deptId所属的customerId add02.03 + * */ + private String customerId; + + /** + * 当前deptId对应的地区编码 add02.03 + * */ + private String areaCode; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/plugins/GridNodeDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/plugins/GridNodeDTO.java new file mode 100644 index 0000000000..9199f6fb91 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/plugins/GridNodeDTO.java @@ -0,0 +1,36 @@ +package com.epmet.dto.result.plugins; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 008、当前用户的数据权限(多客户版本) 返参DTO + * + * @author yinzuomei@elink-cn.com + * @date 2021/2/3 20:33 + */ +@Data +public class GridNodeDTO implements Serializable { + private static final long serialVersionUID = -4531574240525562587L; + + /** + * 网格Id + * */ + private String gridId; + + /** + * 网格名称 + * */ + private String gridName; + + /** + * 当前gridId所属的客户id add02.03 + * */ + private String customerId; + + /** + * 当前gridId对应的地区编码 add02.03 + * */ + private String areaCode; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/plugins/OneListResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/plugins/OneListResultDTO.java new file mode 100644 index 0000000000..f59006896a --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/plugins/OneListResultDTO.java @@ -0,0 +1,18 @@ +package com.epmet.dto.result.plugins; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 【146体系】清单列表 + * + * @author yinzuomei@elink-cn.com + * @date 2021/1/22 13:23 + */ +@Data +public class OneListResultDTO implements Serializable { + private static final long serialVersionUID = -1578923862757670664L; + private String listName; + private String listId; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/screen/EfficiencyAnalysisResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/screen/EfficiencyAnalysisResultDTO.java new file mode 100644 index 0000000000..9924e7f041 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/screen/EfficiencyAnalysisResultDTO.java @@ -0,0 +1,40 @@ +package com.epmet.dto.result.screen; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * 【事件分析】效率分析 返参DTO + * + * @author yinzuomei@elink-cn.com + * @date 2021/2/1 18:23 + */ +@Data +public class EfficiencyAnalysisResultDTO implements Serializable { + private static final long serialVersionUID = 7291513498972998552L; + + /** + * 可能是网格名,也可能是组织名 + */ + private String name; + + /** + * 解决率: 带%:90.74% + */ + private String resolvedRatioStr; + + /** + * 解决率数值 90.74 + */ + private BigDecimal resolvedRatio; + + /** + * 方便查找日志 + */ + private String customerId; + private String agencyId; + private String gridId; + private String dateId; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/screen/ProjectQuantityResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/screen/ProjectQuantityResultDTO.java new file mode 100644 index 0000000000..89f55620cc --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/screen/ProjectQuantityResultDTO.java @@ -0,0 +1,40 @@ +package com.epmet.dto.result.screen; + +import lombok.Data; + +/** + * 【事件分析】数量统计查询 + * + * @author yinzuomei@elink-cn.com + * @date 2021/1/29 16:39 + */ +@Data +public class ProjectQuantityResultDTO { + /** + * 事件总数 + */ + private Integer projectTotal; + + /** + * 已解决数 + */ + private Integer resolvedNum; + + /** + * 解决率,带%号的字符串 + */ + private String resolvedRatio; + + /** + * 事件总数,带%号的字符串 + */ + private String satisfactionRatio; + + /** + * 方便查找日志 + */ + private String customerId; + private String agencyId; + private String dateId; + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/screen/QueryQuantityMonthlyResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/screen/QueryQuantityMonthlyResultDTO.java new file mode 100644 index 0000000000..283c24a977 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/screen/QueryQuantityMonthlyResultDTO.java @@ -0,0 +1,27 @@ +package com.epmet.dto.result.screen; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 近12个月【事件分析】月度数量分析 返参DTO + * + * @author yinzuomei@elink-cn.com + * @date 2021/2/1 16:57 + */ +@Data +public class QueryQuantityMonthlyResultDTO implements Serializable { + private static final long serialVersionUID = -9214182002720799008L; + + /** + * 横坐标集合 + */ + private List xAxis; + + /** + * 每个月的项目增量或者累计数量,根据入参type决定 + */ + private List yAxis; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/constant/ScreenConstant.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/constant/ScreenConstant.java index e9729e7a23..2da4370f64 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/constant/ScreenConstant.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/constant/ScreenConstant.java @@ -24,4 +24,21 @@ public interface ScreenConstant { String GET_AREA_TREE_FAILURE = "查询行政地区编码树失败......"; + String STREET = "street"; + + String DISTRICT = "district"; + + String CITY = "city"; + + String PROVINCE = "province"; + + String LEVEL = "level"; + + String STR_NULL = ""; + + String ENGLISH_COMMA = ","; + + String GRID = "grid"; + + String AGENCY = "agency"; } diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/MonthBarchartFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/MonthBarchartFormDTO.java index 224ab623db..f028fffeff 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/MonthBarchartFormDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/MonthBarchartFormDTO.java @@ -26,4 +26,9 @@ public class MonthBarchartFormDTO implements Serializable { * 月份ID,如果此列有值,查询截止到当前monthId的近12个月数据 */ private String monthId; + + /** + * area_code升级,新增此参数,来源于当前token + */ + private String customerId; } diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/MonthPieChartFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/MonthPieChartFormDTO.java index a5e9c53f26..8b3a973153 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/MonthPieChartFormDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/MonthPieChartFormDTO.java @@ -21,4 +21,9 @@ public class MonthPieChartFormDTO implements Serializable { */ @NotBlank(message = "机关ID不能为空",groups = {MonthPieChart.class}) private String agencyId; + + /** + * area_code升级,新增此参数,来源于当前token + */ + private String customerId; } diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/SubAgencyIndexRankFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/SubAgencyIndexRankFormDTO.java index 608c6b0492..b1ffd9243d 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/SubAgencyIndexRankFormDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/SubAgencyIndexRankFormDTO.java @@ -30,4 +30,9 @@ public class SubAgencyIndexRankFormDTO implements Serializable { private Integer topNum; private String yearId; + + /** + * area_code升级,新增此参数,来源于当前token + */ + private String customerId; } diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/SubAgencyIndexRankYMFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/SubAgencyIndexRankYMFormDTO.java index e973fefa50..ebfea119a4 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/SubAgencyIndexRankYMFormDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/SubAgencyIndexRankYMFormDTO.java @@ -53,4 +53,9 @@ public class SubAgencyIndexRankYMFormDTO implements Serializable { * 组织类型 组织:agency 网格:grid */ private String orgType; + + /** + * area_code升级,新增此参数,来源于当前token + */ + private String customerId; } diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/YearAverageIndexFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/YearAverageIndexFormDTO.java index e53a94cfa9..a9da3253cf 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/YearAverageIndexFormDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/YearAverageIndexFormDTO.java @@ -21,4 +21,9 @@ public class YearAverageIndexFormDTO implements Serializable { */ @NotBlank(message = "机关ID不能为空",groups = {YearAverageIndex.class}) private String agencyId; + + /** + * area_code升级,新增此参数,来源于当前token + */ + private String customerId; } diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/feign/DataReportOpenFeignClient.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/feign/DataReportOpenFeignClient.java new file mode 100644 index 0000000000..d3466126a4 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/feign/DataReportOpenFeignClient.java @@ -0,0 +1,27 @@ +package com.epmet.feign; + +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.result.plugins.AgencyNodeDTO; +import com.epmet.feign.impl.DataReportOpenFeignClientFallBack; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; + +/** + * 本服务对外开放的API,其他服务通过引用此client调用该服务 + * + * @author yinzuomei@elink-cn.com + * @date 2021/2/3 22:05 + */ +// @FeignClient(name = ServiceConstant.DATA_REPORT_SERVER, fallback = DataReportOpenFeignClientFallBack.class,url = "localhost:8109") +@FeignClient(name = ServiceConstant.DATA_REPORT_SERVER, fallback = DataReportOpenFeignClientFallBack.class) +public interface DataReportOpenFeignClient { + /** + * @param agencyId + * @description 查询当前组织及下级组织树 + * @Date 2021/2/3 22:05 + **/ + @GetMapping("/data/report/screen/agency/querystaffagencytree/{agencyId}") + Result queryStaffAgencyTree(@PathVariable("agencyId") String agencyId); +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/feign/impl/DataReportOpenFeignClientFallBack.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/feign/impl/DataReportOpenFeignClientFallBack.java new file mode 100644 index 0000000000..64a9f66d0f --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/feign/impl/DataReportOpenFeignClientFallBack.java @@ -0,0 +1,21 @@ +package com.epmet.feign.impl; + +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.result.plugins.AgencyNodeDTO; +import com.epmet.feign.DataReportOpenFeignClient; +import org.springframework.stereotype.Component; + +@Component +public class DataReportOpenFeignClientFallBack implements DataReportOpenFeignClient { + /** + * @param agencyId + * @description 查询当前组织及下级组织树 + * @Date 2021/2/3 22:05 + **/ + @Override + public Result queryStaffAgencyTree(String agencyId) { + return ModuleUtils.feignConError(ServiceConstant.DATA_REPORT_SERVER, "queryStaffAgencyTree",agencyId); + } +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/plugins/OfsController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/plugins/OfsController.java new file mode 100644 index 0000000000..9a2cbb121b --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/plugins/OfsController.java @@ -0,0 +1,65 @@ +package com.epmet.datareport.controller.plugins; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.datareport.service.plugins.OfsService; +import com.epmet.dto.result.plugins.BidInfoResultDTO; +import com.epmet.dto.result.plugins.ContractResultDTO; +import com.epmet.dto.result.plugins.OneListResultDTO; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestHeader; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + +/** + * 146体系数据查询 + * + * @author yinzuomei@elink-cn.com + * @date 2021/1/22 12:58 + */ +@RestController +@RequestMapping("plugins/ofs") +public class OfsController { + @Autowired + private OfsService ofsService; + + /** + * @param customerId + * @author yinzuomei + * @description 【146体系】清单列表 + * @Date 2021/1/22 13:36 + **/ + @PostMapping("list") + public Result> oneList(@RequestHeader("CustomerId") String customerId){ + if(StringUtils.isNotBlank(customerId)){ + return new Result().ok(ofsService.queryOneList(customerId)); + } + return new Result(); + } + + /** + * @param customerId + * @author yinzuomei + * @description 【146体系】合同监督-列表 + * @Date 2021/1/22 13:36 + **/ + @PostMapping("contractlist") + public Result> queryContractList(@RequestHeader("CustomerId") String customerId){ + if(StringUtils.isNotBlank(customerId)){ + return new Result().ok(ofsService.queryContractList(customerId)); + } + return new Result(); + } + + @PostMapping("bidlist") + public Result> bidList(@RequestHeader("CustomerId") String customerId){ + if(StringUtils.isNotBlank(customerId)){ + return new Result().ok(ofsService.queryBidList(customerId)); + } + return new Result(); + } + +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/plugins/WorkRecordController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/plugins/WorkRecordController.java new file mode 100644 index 0000000000..f606c32458 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/plugins/WorkRecordController.java @@ -0,0 +1,28 @@ +package com.epmet.datareport.controller.plugins; + +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * 大屏工作日志相关输出接口 + * + * @author yinzuomei@elink-cn.com + * @date 2021/2/21 19:51 + */ +@RestController +@RequestMapping("plugins/workrecord") +public class WorkRecordController { + //todo + //5、【工作日志】本机及下级排名 + //NEI接口地址:https://nei.netease.com/interface/detail/?pid=57068&id=348966 + //返参中的当前组织的参与人数、组织次数 直接sum所有下级的值; + //下级根据当前组织的areaCode查询下级列表,再去查询screen_work_record_org_daily + //legend来源于screen_customer_work_record_dict表 level=2,dataType=party + + + + + + //6、【工作日志】近12月趋势图 + //NEI接口地址:https://nei.netease.com/interface/detail/?pid=57068&id=348967 +} 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 94186e7336..88fa5c31b8 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 @@ -5,17 +5,21 @@ import com.epmet.commons.tools.exception.RenException; 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.evaluationindex.screen.*; import com.epmet.datareport.service.project.ProjectService; import com.epmet.dto.form.ProcessListFormDTO; +import com.epmet.dto.form.screen.EfficiencyAnalysisFormDTO; +import com.epmet.dto.form.screen.QueryQuantityMonthlyFormDTO; +import com.epmet.dto.form.screen.ScreenCommonFormDTO; +import com.epmet.dto.result.screen.EfficiencyAnalysisResultDTO; +import com.epmet.dto.result.screen.ProjectQuantityResultDTO; +import com.epmet.dto.result.screen.QueryQuantityMonthlyResultDTO; import com.epmet.project.constant.ProjectConstant; import com.epmet.project.dto.form.DifficultyRankFormDTO; import com.epmet.project.dto.form.ProjectIncrTrendFormDTO; import com.epmet.project.dto.result.*; 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; @@ -29,7 +33,14 @@ public class ProjectController { @Autowired private ProjectService projectService; - + @Autowired + private ScreenProjectGridDailyService projectGridDailyService; + @Autowired + private ScreenProjectOrgDailyService projectOrgDailyService; + @Autowired + private ScreenProjectQuantityGridMonthlyService projectQuantityGridMonthlyService; + @Autowired + private ScreenProjectQuantityOrgMonthlyService projectQuantityOrgMonthlyService; /** * @Author sun @@ -119,6 +130,42 @@ public class ProjectController { return new Result>().ok(projectService.getMyNextAgency(tokenDto)); } + /** + * @param customerId + * @param formDTO + * @description 【事件分析】数量统计查询 平阴大屏 + **/ + @PostMapping("queryquantity") + public Result queryQuantity(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCommonFormDTO formDTO){ + formDTO.setCustomerId(customerId); + return new Result().ok(projectOrgDailyService.queryQuantity(formDTO)); + } + /** + * @param customerId + * @param formDTO + * @author yinzuomei + * @description 近12个月【事件分析】月度数量分析 平阴大屏 + **/ + @PostMapping("queryquantity-monthly") + public Result queryQuantityMonthly(@RequestHeader("CustomerId") String customerId, @RequestBody QueryQuantityMonthlyFormDTO formDTO) { + formDTO.setCustomerId(customerId); + ValidatorUtils.validateEntity(formDTO); + return new Result().ok(projectQuantityOrgMonthlyService.queryQuantityMonthly(formDTO)); + } + + /** + * @param customerId + * @param formDTO + * @author yinzuomei + * @description 【事件分析】效率分析 平阴大屏 + **/ + @PostMapping("efficiency-analysis") + public Result> efficiencyAnalysis(@RequestHeader("CustomerId") String customerId, @RequestBody EfficiencyAnalysisFormDTO formDTO){ + formDTO.setCustomerId(customerId); + ValidatorUtils.validateEntity(formDTO); + return new Result>().ok(projectOrgDailyService.efficiencyAnalysis(formDTO)); + } + //todo 【事件类型分析】NEI接口地址: https://nei.netease.com/interface/detail/?pid=57068&id=346721 } 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 91672af42b..1eba0b727c 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 @@ -7,11 +7,13 @@ import com.epmet.dto.form.AddAreaCodeDictFormDTO; import com.epmet.dto.form.AreaCodeDictFormDTO; import com.epmet.dto.result.AreaCodeDictResultDTO; import com.epmet.dto.result.commonservice.AddAreaCodeDictResultDTO; +import com.epmet.dto.result.plugins.AgencyNodeDTO; 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.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -94,4 +96,18 @@ public class AgencyController { ValidatorUtils.validateEntity(formDTO); return new Result().ok(agencyService.addStreetCommAreaCode(formDTO)); } + /** + * @param agencyId + * @author yinzuomei + * @description 查询当前组织及下级组织树 + * @Date 2021/2/3 22:19 + **/ + @GetMapping("querystaffagencytree/{agencyId}") + public Result queryStaffAgencyTree(@PathVariable("agencyId") String agencyId) { + //todo 单独校验下此方法 + if (StringUtils.isNotBlank(agencyId)) { + return new Result().ok(agencyService.queryStaffAgencyTree(agencyId)); + } + return new Result<>(); + } } 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 00fc8046a5..5ebeef980d 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 @@ -6,6 +6,7 @@ import com.epmet.datareport.eum.OrgTypeEnum; import com.epmet.datareport.service.evaluationindex.screen.IndexService; import com.epmet.evaluationindex.screen.dto.form.*; import com.epmet.evaluationindex.screen.dto.result.*; +import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -17,6 +18,7 @@ import java.util.List; * @author yinzuomei@elink-cn.com * @date 2020/8/18 10:13 */ +@Slf4j @RestController @RequestMapping("/screen/index") public class IndexController { @@ -31,7 +33,9 @@ public class IndexController { * @date 2020/8/19 2:53 下午 */ @PostMapping("yearaverageindex") - public Result yearAverageIndex(@RequestBody YearAverageIndexFormDTO yearAverageIndexFormDTO){ + public Result yearAverageIndex(@RequestHeader("CustomerId") String customerId,@RequestBody YearAverageIndexFormDTO yearAverageIndexFormDTO){ + //area_code升级,新增此参数 + yearAverageIndexFormDTO.setCustomerId(customerId); ValidatorUtils.validateEntity(yearAverageIndexFormDTO, YearAverageIndexFormDTO.YearAverageIndex.class); return new Result().ok(indexService.yearAverageIndex(yearAverageIndexFormDTO)); } @@ -43,7 +47,9 @@ public class IndexController { * @date 2020/8/19 3:17 下午 */ @PostMapping("monthindexanalysis/piechart") - public Result monthPieChart(@RequestBody MonthPieChartFormDTO monthPieChartFormDTO){ + public Result monthPieChart(@RequestHeader("CustomerId") String customerId,@RequestBody MonthPieChartFormDTO monthPieChartFormDTO){ + //area_code升级,新增此参数 + monthPieChartFormDTO.setCustomerId(customerId); ValidatorUtils.validateEntity(monthPieChartFormDTO, MonthPieChartFormDTO.MonthPieChart.class); return new Result().ok(indexService.monthPieChart(monthPieChartFormDTO)); } @@ -55,7 +61,9 @@ public class IndexController { * @date 2020/8/19 5:27 下午 */ @PostMapping("monthindexanalysis/barchart") - public Result monthBarchart(@RequestBody MonthBarchartFormDTO monthBarchartFormDTO){ + public Result monthBarchart(@RequestHeader("CustomerId") String customerId,@RequestBody MonthBarchartFormDTO monthBarchartFormDTO){ + //area_code升级,新增此参数 + monthBarchartFormDTO.setCustomerId(customerId); ValidatorUtils.validateEntity(monthBarchartFormDTO, MonthBarchartFormDTO.MonthBarchart.class); return new Result().ok(indexService.monthBarchart(monthBarchartFormDTO)); } @@ -67,7 +75,9 @@ public class IndexController { * @date 2020/8/20 10:02 上午 */ @PostMapping("subagencyindexrank") - public Result> subAgencyIndexRank(@RequestBody SubAgencyIndexRankFormDTO subAgencyIndexRankFormDTO){ + public Result> subAgencyIndexRank(@RequestHeader("CustomerId") String customerId,@RequestBody SubAgencyIndexRankFormDTO subAgencyIndexRankFormDTO){ + //area_code升级,新增此参数 + subAgencyIndexRankFormDTO.setCustomerId(customerId); ValidatorUtils.validateEntity(subAgencyIndexRankFormDTO, SubAgencyIndexRankFormDTO.SubAgencyIndexRank.class); return new Result>().ok(indexService.subAgencyIndexRank(subAgencyIndexRankFormDTO)); } @@ -81,7 +91,9 @@ public class IndexController { * @Date 13:39 2020-09-11 **/ @PostMapping("dataclient/subagencyindexrank") - public Result> getSubAgencyIndexRank(@RequestBody SubAgencyIndexRankYMFormDTO formDTO) { + public Result> getSubAgencyIndexRank(@RequestHeader("CustomerId") String customerId,@RequestBody SubAgencyIndexRankYMFormDTO formDTO) { + //area_code升级,新增此参数 + formDTO.setCustomerId(customerId); ValidatorUtils.validateEntity(formDTO, SubAgencyIndexRankYMFormDTO.SubAgencyIndexRank.class); return new Result>().ok(indexService.getSubAgencyIndexRank(formDTO)); } @@ -118,7 +130,7 @@ public class IndexController { /** * @param formDTO - * @Description 组织月度指数得分 + * @Description 数据改版:组织月度指数得分 * @author sun */ @PostMapping("month/indexscore") @@ -129,7 +141,7 @@ public class IndexController { /** * @param formDTO - * @Description 先进排行-先进支部排行 + * @Description 数据改版:先进排行-先进支部排行 * @author sun */ @PostMapping("advancedbranchrank") 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 52ddea4bd0..af4b0b7af2 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 @@ -17,6 +17,10 @@ package com.epmet.datareport.dao.evaluationindex.screen; +import com.epmet.dto.result.ScreenCustomerAgencyDTO; +import com.epmet.dto.result.plugins.AgencyNodeDTO; +import com.epmet.dto.result.plugins.DeptNodeDTO; +import com.epmet.dto.result.plugins.GridNodeDTO; import com.epmet.evaluationindex.screen.dto.result.*; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -112,4 +116,38 @@ public interface ScreenCustomerAgencyDao { * @date 2020/10/28 10:33 上午 */ List selectSubAgencyId(@Param("agencyId") String agencyId); + + /** + * @param agencyId + * @author yinzuomei + * @description 查询组织基本信息 + **/ + ScreenCustomerAgencyDTO selectByAgencyId(@Param("agencyId") String agencyId); + + /** + * @param areaCode + * @author yinzuomei + * @description 根据areaCode查询组织机构 + * @Date 2021/2/4 21:51 + **/ + List queryStaffAgencyTree(@Param("areaCode")String areaCode); + + /** + * @param areaCode + * @param agencyId + * @author yinzuomei + * @description 查找组织下的部门 + * @Date 2021/2/4 21:51 + **/ + List selectDeptList(@Param("areaCode") String areaCode,@Param("agencyId") String agencyId); + + /** + * @param areaCode + * @param agencyId + * @author yinzuomei + * @description 查找组织下的网格 + * @Date 2021/2/4 21:52 + **/ + List selectGridList(@Param("areaCode") String areaCode,@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/ScreenProjectGridDailyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenProjectGridDailyDao.java new file mode 100644 index 0000000000..1eada75ab4 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenProjectGridDailyDao.java @@ -0,0 +1,43 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.datareport.dao.evaluationindex.screen; + +import com.epmet.dto.result.screen.EfficiencyAnalysisResultDTO; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + + +/** + * 项目(事件)分析按网格_按天统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-01-27 + */ +@Mapper +public interface ScreenProjectGridDailyDao{ + + /** + * @param customerId + * @param areaCode + * @author yinzuomei + * @description 下级网格的效率(解决率)列表 + **/ + List queryGridEfficiencyAnalysis(@Param("customerId") String customerId, @Param("areaCode") String areaCode); +} \ 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/ScreenProjectOrgDailyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenProjectOrgDailyDao.java new file mode 100644 index 0000000000..2a26119d9c --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenProjectOrgDailyDao.java @@ -0,0 +1,48 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.datareport.dao.evaluationindex.screen; + +import com.epmet.dto.result.screen.EfficiencyAnalysisResultDTO; +import com.epmet.dto.result.screen.ProjectQuantityResultDTO; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 项目(事件)分析按组织_按天统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-01-27 + */ +@Mapper +public interface ScreenProjectOrgDailyDao { + + /** + * @author yinzuomei + * @description 【事件分析】数量统计查询 + **/ + ProjectQuantityResultDTO queryQuantity(@Param("customerId") String customerId, @Param("agencyId")String agencyId); + + /** + * @param areaCode + * @author yinzuomei + * @description 下级组织的效率(解决率)列表 + **/ + List queryEfficiencyAnalysis(@Param("customerId")String customerId,@Param("areaCode") String areaCode); +} \ 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/ScreenProjectQuantityGridMonthlyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenProjectQuantityGridMonthlyDao.java new file mode 100644 index 0000000000..02c9545001 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenProjectQuantityGridMonthlyDao.java @@ -0,0 +1,32 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.datareport.dao.evaluationindex.screen; + +import org.apache.ibatis.annotations.Mapper; + +/** + * 项目(事件)数量分析按网格_按月统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-01-27 + */ +@Mapper +public interface ScreenProjectQuantityGridMonthlyDao { + + +} \ 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/ScreenProjectQuantityOrgMonthlyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenProjectQuantityOrgMonthlyDao.java new file mode 100644 index 0000000000..205c648f36 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenProjectQuantityOrgMonthlyDao.java @@ -0,0 +1,44 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.datareport.dao.evaluationindex.screen; + +import com.epmet.dto.ScreenProjectQuantityOrgMonthlyDTO; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 项目(事件)数量分析按组织_按月统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-01-27 + */ +@Mapper +public interface ScreenProjectQuantityOrgMonthlyDao { + + /** + * @return java.util.List + * @param customerId 当前客户id + * @param agencyId 当前要查询的组织 + * @param endMonthId 截止月份yyyyMM + * @author yinzuomei + * @description 近12个月【事件分析】月度数量分析 + **/ + List selectList(@Param("customerId") String customerId, @Param("agencyId")String agencyId, @Param("endMonthId")String endMonthId); +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/plugins/ScreenBidInfoDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/plugins/ScreenBidInfoDao.java new file mode 100644 index 0000000000..b379de0b24 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/plugins/ScreenBidInfoDao.java @@ -0,0 +1,36 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.datareport.dao.plugins; + +import com.epmet.dto.result.plugins.BidInfoResultDTO; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * 146:竞标管理 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-01-22 + */ +@Mapper +public interface ScreenBidInfoDao{ + + + List selectList(String customerId); +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/plugins/ScreenContractInfoDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/plugins/ScreenContractInfoDao.java new file mode 100644 index 0000000000..2c597dff06 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/plugins/ScreenContractInfoDao.java @@ -0,0 +1,35 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.datareport.dao.plugins; + +import com.epmet.dto.result.plugins.ContractResultDTO; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * 146:合同基本信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-01-22 + */ +@Mapper +public interface ScreenContractInfoDao { + + List selectList(String customerId); +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/plugins/ScreenListInfoDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/plugins/ScreenListInfoDao.java new file mode 100644 index 0000000000..2b368a041f --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/plugins/ScreenListInfoDao.java @@ -0,0 +1,35 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.datareport.dao.plugins; + +import com.epmet.dto.result.plugins.OneListResultDTO; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * 146:一张清单列表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-01-22 + */ +@Mapper +public interface ScreenListInfoDao { + + List selectList(String customerId); +} \ No newline at end of file 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 3812695176..69d55a72d8 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 @@ -4,6 +4,7 @@ import com.epmet.dto.form.AddAreaCodeDictFormDTO; import com.epmet.dto.form.AreaCodeDictFormDTO; import com.epmet.dto.result.AreaCodeDictResultDTO; import com.epmet.dto.result.commonservice.AddAreaCodeDictResultDTO; +import com.epmet.dto.result.plugins.AgencyNodeDTO; import com.epmet.evaluationindex.screen.dto.form.CompartmentByBizTypeFormDTO; import com.epmet.evaluationindex.screen.dto.form.CompartmentFormDTO; import com.epmet.evaluationindex.screen.dto.form.TreeByTypeFormDTO; @@ -50,4 +51,11 @@ public interface AgencyService { List areaCodeDictTree(AreaCodeDictFormDTO formDTO); AddAreaCodeDictResultDTO addStreetCommAreaCode(AddAreaCodeDictFormDTO formDTO); + /** + * @param agencyId + * @author yinzuomei + * @description 查询当前组织及下级组织树 + * @Date 2021/2/3 22:19 + **/ + AgencyNodeDTO queryStaffAgencyTree(String agencyId); } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/ScreenProjectGridDailyService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/ScreenProjectGridDailyService.java new file mode 100644 index 0000000000..d9eb13c55f --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/ScreenProjectGridDailyService.java @@ -0,0 +1,38 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.datareport.service.evaluationindex.screen; + +import com.epmet.dto.result.screen.EfficiencyAnalysisResultDTO; + +import java.util.List; + +/** + * 项目(事件)分析按网格_按天统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-01-27 + */ +public interface ScreenProjectGridDailyService { + /** + * @param customerId + * @param areaCode + * @author yinzuomei + * @description 【事件分析】效率分析 网格的解决率 + **/ + List efficiencyAnalysis(String customerId, String areaCode); +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/ScreenProjectOrgDailyService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/ScreenProjectOrgDailyService.java new file mode 100644 index 0000000000..ee1c9e85fb --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/ScreenProjectOrgDailyService.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.datareport.service.evaluationindex.screen; + +import com.epmet.dto.form.screen.EfficiencyAnalysisFormDTO; +import com.epmet.dto.form.screen.ScreenCommonFormDTO; +import com.epmet.dto.result.screen.EfficiencyAnalysisResultDTO; +import com.epmet.dto.result.screen.ProjectQuantityResultDTO; + +import java.util.List; + +/** + * 项目(事件)分析按组织_按天统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-01-27 + */ +public interface ScreenProjectOrgDailyService { + /** + * @param formDTO + * @author yinzuomei + * @description 【事件分析】数量统计查询 + **/ + ProjectQuantityResultDTO queryQuantity(ScreenCommonFormDTO formDTO); + + /** + * @param formDTO + * @author yinzuomei + * @description 【事件分析】效率分析 + **/ + List efficiencyAnalysis(EfficiencyAnalysisFormDTO formDTO); +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/ScreenProjectQuantityGridMonthlyService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/ScreenProjectQuantityGridMonthlyService.java new file mode 100644 index 0000000000..2e965971f5 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/ScreenProjectQuantityGridMonthlyService.java @@ -0,0 +1,28 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.datareport.service.evaluationindex.screen; + +/** + * 项目(事件)数量分析按网格_按月统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-01-27 + */ +public interface ScreenProjectQuantityGridMonthlyService { + +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/ScreenProjectQuantityOrgMonthlyService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/ScreenProjectQuantityOrgMonthlyService.java new file mode 100644 index 0000000000..182feb83bd --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/ScreenProjectQuantityOrgMonthlyService.java @@ -0,0 +1,37 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.datareport.service.evaluationindex.screen; + +import com.epmet.dto.form.screen.QueryQuantityMonthlyFormDTO; +import com.epmet.dto.result.screen.QueryQuantityMonthlyResultDTO; + +/** + * 项目(事件)数量分析按组织_按月统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-01-27 + */ +public interface ScreenProjectQuantityOrgMonthlyService { + + /** + * @param formDTO + * @author yinzuomei + * @description 近12个月【事件分析】月度数量分析 + **/ + QueryQuantityMonthlyResultDTO queryQuantityMonthly(QueryQuantityMonthlyFormDTO formDTO); +} \ No newline at end of file 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 8252b44077..5a9be23e4a 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 @@ -1,8 +1,10 @@ package com.epmet.datareport.service.evaluationindex.screen.impl; +import com.alibaba.fastjson.JSON; 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.utils.AgencyTreeUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.constant.DataSourceConstant; import com.epmet.datareport.dao.evaluationindex.screen.ScreenCustomerAgencyDao; @@ -12,6 +14,8 @@ import com.epmet.dto.form.AddAreaCodeDictFormDTO; import com.epmet.dto.form.AreaCodeDictFormDTO; import com.epmet.dto.result.AreaCodeDictResultDTO; import com.epmet.dto.result.commonservice.AddAreaCodeDictResultDTO; +import com.epmet.dto.result.ScreenCustomerAgencyDTO; +import com.epmet.dto.result.plugins.AgencyNodeDTO; import com.epmet.evaluationindex.screen.constant.ScreenConstant; import com.epmet.evaluationindex.screen.dto.form.CompartmentByBizTypeFormDTO; import com.epmet.evaluationindex.screen.dto.form.CompartmentFormDTO; @@ -20,6 +24,8 @@ import com.epmet.evaluationindex.screen.dto.result.AgencyDistributionResultDTO; import com.epmet.evaluationindex.screen.dto.result.CompartmentResultDTO; import com.epmet.evaluationindex.screen.dto.result.TreeResultDTO; import com.epmet.feign.EpmetCommonServiceOpenFeignClient; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; import org.apache.ibatis.exceptions.TooManyResultsException; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -34,6 +40,7 @@ import java.util.List; * @author yinzuomei@elink-cn.com * @date 2020/8/18 10:18 */ +@Slf4j @Service @DataSource(DataSourceConstant.EVALUATION_INDEX) public class AgencyServiceImpl implements AgencyService { @@ -261,4 +268,26 @@ public class AgencyServiceImpl implements AgencyService { } throw new RenException(res.getMsg() + res.getInternalMsg()); } + + /** + * @param agencyId + * @author yinzuomei + * @description 查询当前组织及下级组织树 + * @Date 2021/2/3 22:19 + **/ + @Override + public AgencyNodeDTO queryStaffAgencyTree(String agencyId) { + ScreenCustomerAgencyDTO agencyDTO = screenCustomerAgencyDao.selectByAgencyId(agencyId); + if (null == agencyDTO || StringUtils.isBlank(agencyDTO.getAreaCode())) { + throw new RenException(String.format("当前agencyId%s所属的area_code为空", agencyId)); + } + List list = screenCustomerAgencyDao.queryStaffAgencyTree(agencyDTO.getAreaCode()); + for (AgencyNodeDTO agencyNodeDTO : list) { + agencyNodeDTO.setGridList(screenCustomerAgencyDao.selectGridList(agencyNodeDTO.getAreaCode(), agencyNodeDTO.getAgencyId())); + agencyNodeDTO.setDepartmentList(screenCustomerAgencyDao.selectDeptList(agencyNodeDTO.getAreaCode(), agencyNodeDTO.getAgencyId())); + } + List treeList = AgencyTreeUtils.build(list); + log.info(JSON.toJSONString(treeList)); + return treeList.get(NumConstant.ZERO); + } } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenProjectGridDailyServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenProjectGridDailyServiceImpl.java new file mode 100644 index 0000000000..a1f8a0c9fd --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenProjectGridDailyServiceImpl.java @@ -0,0 +1,53 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.datareport.service.evaluationindex.screen.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.constant.DataSourceConstant; +import com.epmet.datareport.dao.evaluationindex.screen.ScreenProjectGridDailyDao; +import com.epmet.datareport.service.evaluationindex.screen.ScreenProjectGridDailyService; +import com.epmet.dto.result.screen.EfficiencyAnalysisResultDTO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 项目(事件)分析按网格_按天统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-01-27 + */ +@DataSource(DataSourceConstant.EVALUATION_INDEX) +@Service +public class ScreenProjectGridDailyServiceImpl implements ScreenProjectGridDailyService { + @Autowired + private ScreenProjectGridDailyDao screenProjectGridDailyDao; + + /** + * @param customerId + * @param areaCode + * @author yinzuomei + * @description 【事件分析】效率分析 网格的解决率 + **/ + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) + @Override + public List efficiencyAnalysis(String customerId, String areaCode) { + return screenProjectGridDailyDao.queryGridEfficiencyAnalysis(customerId,areaCode); + } +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenProjectOrgDailyServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenProjectOrgDailyServiceImpl.java new file mode 100644 index 0000000000..b4518096dc --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenProjectOrgDailyServiceImpl.java @@ -0,0 +1,101 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.datareport.service.evaluationindex.screen.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.constant.DataSourceConstant; +import com.epmet.datareport.dao.evaluationindex.screen.ScreenCustomerAgencyDao; +import com.epmet.datareport.dao.evaluationindex.screen.ScreenProjectOrgDailyDao; +import com.epmet.datareport.service.evaluationindex.screen.ScreenProjectGridDailyService; +import com.epmet.datareport.service.evaluationindex.screen.ScreenProjectOrgDailyService; +import com.epmet.dto.form.screen.EfficiencyAnalysisFormDTO; +import com.epmet.dto.form.screen.ScreenCommonFormDTO; +import com.epmet.dto.result.ScreenCustomerAgencyDTO; +import com.epmet.dto.result.screen.EfficiencyAnalysisResultDTO; +import com.epmet.dto.result.screen.ProjectQuantityResultDTO; +import com.epmet.evaluationindex.screen.constant.ScreenConstant; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +/** + * 项目(事件)分析按组织_按天统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-01-27 + */ +@Slf4j +@Service +@DataSource(DataSourceConstant.EVALUATION_INDEX) +public class ScreenProjectOrgDailyServiceImpl implements ScreenProjectOrgDailyService { + @Autowired + private ScreenProjectOrgDailyDao baseDao; + @Autowired + private ScreenCustomerAgencyDao screenCustomerAgencyDao; + @Autowired + private ScreenProjectGridDailyService screenProjectGridDailyService; + /** + * @param formDTO + * @author yinzuomei + * @description 【事件分析】数量统计查询 + **/ + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) + @Override + public ProjectQuantityResultDTO queryQuantity(ScreenCommonFormDTO formDTO) { + //客户id、agencyId都不能为空 + ProjectQuantityResultDTO resultDTO = baseDao.queryQuantity(formDTO.getCustomerId(), formDTO.getAgencyId()); + if (null != resultDTO) { + return resultDTO; + } + log.warn("【事件分析】数量统计查询 结果为空"); + ProjectQuantityResultDTO defaultDto = new ProjectQuantityResultDTO(); + defaultDto.setCustomerId(formDTO.getCustomerId()); + defaultDto.setAgencyId(formDTO.getAgencyId()); + defaultDto.setProjectTotal(NumConstant.ZERO); + defaultDto.setResolvedNum(NumConstant.ZERO); + defaultDto.setResolvedRatio("0%"); + defaultDto.setSatisfactionRatio("0%"); + return defaultDto; + } + + /** + * @param formDTO + * @author yinzuomei + * @description 【事件分析】效率分析 + **/ + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) + @Override + public List efficiencyAnalysis(EfficiencyAnalysisFormDTO formDTO) { + ScreenCustomerAgencyDTO agencyDTO = screenCustomerAgencyDao.selectByAgencyId(formDTO.getAgencyId()); + if (null != agencyDTO) { + if (ScreenConstant.STREET.equals(formDTO.getType())) { + // 查询当前入参的下一级 + // type=street查询screen_project_org_daily + return baseDao.queryEfficiencyAnalysis(formDTO.getCustomerId(), agencyDTO.getAreaCode()); + } else if (ScreenConstant.GRID.equals(formDTO.getType())) { + // type=grid查询组织下的网格 + return screenProjectGridDailyService.efficiencyAnalysis(formDTO.getCustomerId(), agencyDTO.getAreaCode()); + } + } + return new ArrayList<>(); + } +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenProjectQuantityGridMonthlyServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenProjectQuantityGridMonthlyServiceImpl.java new file mode 100644 index 0000000000..49f991a29a --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenProjectQuantityGridMonthlyServiceImpl.java @@ -0,0 +1,36 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.datareport.service.evaluationindex.screen.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.constant.DataSourceConstant; +import com.epmet.datareport.service.evaluationindex.screen.ScreenProjectQuantityGridMonthlyService; +import org.springframework.stereotype.Service; + +/** + * 项目(事件)数量分析按网格_按月统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-01-27 + */ +@DataSource(DataSourceConstant.EVALUATION_INDEX) +@Service +public class ScreenProjectQuantityGridMonthlyServiceImpl implements ScreenProjectQuantityGridMonthlyService { + + +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenProjectQuantityOrgMonthlyServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenProjectQuantityOrgMonthlyServiceImpl.java new file mode 100644 index 0000000000..1e4855604d --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenProjectQuantityOrgMonthlyServiceImpl.java @@ -0,0 +1,97 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.datareport.service.evaluationindex.screen.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.constant.DataSourceConstant; +import com.epmet.datareport.dao.evaluationindex.screen.ScreenProjectQuantityOrgMonthlyDao; +import com.epmet.datareport.service.evaluationindex.screen.ScreenProjectQuantityOrgMonthlyService; +import com.epmet.dto.ScreenProjectQuantityOrgMonthlyDTO; +import com.epmet.dto.form.screen.QueryQuantityMonthlyFormDTO; +import com.epmet.dto.result.screen.QueryQuantityMonthlyResultDTO; +import com.epmet.evaluationindex.screen.constant.ScreenConstant; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.function.Function; +import java.util.stream.Collectors; + +/** + * 项目(事件)数量分析按组织_按月统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-01-27 + */ +@DataSource(DataSourceConstant.EVALUATION_INDEX) +@Service +public class ScreenProjectQuantityOrgMonthlyServiceImpl implements ScreenProjectQuantityOrgMonthlyService { + @Autowired + private ScreenProjectQuantityOrgMonthlyDao baseDao; + + /** + * @param formDTO + * @author yinzuomei + * @description 近12个月【事件分析】月度数量分析 + **/ + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) + @Override + public QueryQuantityMonthlyResultDTO queryQuantityMonthly(QueryQuantityMonthlyFormDTO formDTO) { + if (StringUtils.isBlank(formDTO.getEndMonthId())) { + formDTO.setEndMonthId(DateUtils.getCurrentTimeBeforeMonthId()); + } + QueryQuantityMonthlyResultDTO resultDTO = new QueryQuantityMonthlyResultDTO(); + //近12个月的monthId集合,["202002","202003","202004","202005","202006","202007","202008","202009","202010","202011","202012","202101"] + List monthIdList = DateUtils.getMonthIdList(formDTO.getEndMonthId(), NumConstant.ELEVEN); + //要返回的横坐标:["02月","03月","04月","05月","06月","07月","08月","09月","10月","11月","12月","01月"] + List xAxis = new ArrayList<>(); + List yAxis = new ArrayList<>(); + //查询近12个月的数据 + List dtoList = baseDao.selectList(formDTO.getCustomerId(), formDTO.getAgencyId(), formDTO.getEndMonthId()); + + Map dtoMap = new HashMap<>(); + if (!CollectionUtils.isEmpty(dtoList)) { + dtoMap = dtoList.stream().collect(Collectors.toMap(ScreenProjectQuantityOrgMonthlyDTO::getMonthId, Function.identity(), (key1, key2) -> key2)); + } + for (String monthId : monthIdList) { + //202101=>01月 + xAxis.add(monthId.substring(NumConstant.FOUR, NumConstant.SIX).concat(ScreenConstant.MONTH)); + if (!CollectionUtils.isEmpty(dtoList)) { + if ("incr".equals(formDTO.getType())) { + yAxis.add(dtoMap.get(monthId).getProjectIncr()); + } else if ("sum".equals(formDTO.getType())) { + yAxis.add(dtoMap.get(monthId).getProjectTotal()); + } + continue; + } + //没有数据默认赋值0 + yAxis.add(0); + } + resultDTO.setXAxis(xAxis); + resultDTO.setYAxis(yAxis); + return resultDTO; + } + +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/plugins/OfsService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/plugins/OfsService.java new file mode 100644 index 0000000000..71185ba723 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/plugins/OfsService.java @@ -0,0 +1,34 @@ +package com.epmet.datareport.service.plugins; + +import com.epmet.dto.result.plugins.BidInfoResultDTO; +import com.epmet.dto.result.plugins.ContractResultDTO; +import com.epmet.dto.result.plugins.OneListResultDTO; + +import java.util.List; + +/** + * 146体系数据查询 + * + * @author yinzuomei@elink-cn.com + * @date 2021/1/22 10:18 + */ +public interface OfsService { + + List queryOneList(String customerId); + + /** + * @param customerId + * @author yinzuomei + * @description 【146体系】合同监督-列表 + * @Date 2021/1/22 13:36 + **/ + List queryContractList(String customerId); + + /** + * @param customerId + * @author yinzuomei + * @description 【146体系】竞标管理-列表 + * @Date 2021/1/22 13:38 + **/ + List queryBidList(String customerId); +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/plugins/impl/OfsServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/plugins/impl/OfsServiceImpl.java new file mode 100644 index 0000000000..7ae8b62e43 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/plugins/impl/OfsServiceImpl.java @@ -0,0 +1,59 @@ +package com.epmet.datareport.service.plugins.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.constant.DataSourceConstant; +import com.epmet.datareport.dao.plugins.ScreenBidInfoDao; +import com.epmet.datareport.dao.plugins.ScreenContractInfoDao; +import com.epmet.datareport.dao.plugins.ScreenListInfoDao; +import com.epmet.datareport.service.plugins.OfsService; +import com.epmet.dto.result.plugins.BidInfoResultDTO; +import com.epmet.dto.result.plugins.ContractResultDTO; +import com.epmet.dto.result.plugins.OneListResultDTO; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 146体系数据查询 + * + * @author yinzuomei@elink-cn.com + * @date 2021/1/22 10:20 + */ +@Service +@Slf4j +@DataSource(DataSourceConstant.EVALUATION_INDEX) +public class OfsServiceImpl implements OfsService { + @Autowired + private ScreenBidInfoDao screenBidInfoDao; + @Autowired + private ScreenContractInfoDao screenContractInfoDao; + @Autowired + private ScreenListInfoDao screenListInfoDao; + + + @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) + @Override + public List queryOneList(String customerId) { + return screenListInfoDao.selectList(customerId); + } + + + @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) + @Override + public List queryContractList(String customerId) { + return screenContractInfoDao.selectList(customerId); + } + + /** + * @param customerId + * @author yinzuomei + * @description 【146体系】竞标管理-列表 + * @Date 2021/1/22 13:38 + **/ + @Override + public List queryBidList(String customerId) { + return screenBidInfoDao.selectList(customerId); + } +} diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/plugins/ScreenBidInfoDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/plugins/ScreenBidInfoDao.xml new file mode 100644 index 0000000000..ea22e57743 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/plugins/ScreenBidInfoDao.xml @@ -0,0 +1,18 @@ + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/plugins/ScreenContractInfoDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/plugins/ScreenContractInfoDao.xml new file mode 100644 index 0000000000..9c66e72c65 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/plugins/ScreenContractInfoDao.xml @@ -0,0 +1,18 @@ + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/plugins/ScreenListInfoDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/plugins/ScreenListInfoDao.xml new file mode 100644 index 0000000000..647ff94bd4 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/plugins/ScreenListInfoDao.xml @@ -0,0 +1,17 @@ + + + + + + \ No newline at end of file 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 c63fc774a1..cf3b1a7631 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 @@ -216,4 +216,60 @@ AND IS_DISPLAY = 1 AND pid = #{agencyId} + + + + + + + + + + + + diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectGridDailyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectGridDailyDao.xml new file mode 100644 index 0000000000..2011413015 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectGridDailyDao.xml @@ -0,0 +1,32 @@ + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectOrgDailyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectOrgDailyDao.xml new file mode 100644 index 0000000000..f050e5dd1b --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectOrgDailyDao.xml @@ -0,0 +1,55 @@ + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectQuantityGridMonthlyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectQuantityGridMonthlyDao.xml new file mode 100644 index 0000000000..98b140e175 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectQuantityGridMonthlyDao.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectQuantityOrgMonthlyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectQuantityOrgMonthlyDao.xml new file mode 100644 index 0000000000..6e836f4df4 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectQuantityOrgMonthlyDao.xml @@ -0,0 +1,25 @@ + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/PingYinConstants.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/PingYinConstants.java new file mode 100644 index 0000000000..836e68c786 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/PingYinConstants.java @@ -0,0 +1,22 @@ +package com.epmet.constant; + +/** + * @Author zxc + * @DateTime 2021/1/28 下午3:20 + */ +public interface PingYinConstants { + + String GRID_INFO_IS_ZERO = "客户【%s】下的网格信息为空......"; + String AGENCY_INFO_IS_ZERO = "客户【%s】下的组织信息为空......"; + String SELECT_GRID_INFO_BY_ORG_IS_NULL = "客户【%s】根据orgId查询网格项目信息为空......"; + + String EVALUATE_BAD = "bad"; + String EVALUATE_GOOD = "good"; + String EVALUATE_PERFECT = "perfect"; + + String UN_CLOSED = "unClosed"; + String CLOSED = "closed"; + + String CREATED_BY = "APP_USER"; + +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/CalculateCommonFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/CalculateCommonFormDTO.java index cfdc9f2ec9..03c5ae0ddb 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/CalculateCommonFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/CalculateCommonFormDTO.java @@ -5,6 +5,8 @@ import lombok.Data; import javax.validation.constraints.NotBlank; import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; /** * 指标计算通用入参DTO @@ -29,6 +31,17 @@ public class CalculateCommonFormDTO implements Serializable { @NotBlank(message = "客户id不能为空", groups = { CancelCalculateGroup.class }) private String customerId; + /** + * 当前客户所属的地区编码 add 01.14 + */ + private String customerAreaCode = ""; + + /** + * 当前客户下的需要汇聚的子客户列表 add 01.14 + * 暂不使用 + */ + private List subCustomerIds = new ArrayList<>(); + public CalculateCommonFormDTO() { super(); } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/CustomerSubInfoDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/CustomerSubInfoDTO.java new file mode 100644 index 0000000000..0e9f0c961e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/CustomerSubInfoDTO.java @@ -0,0 +1,29 @@ +package com.epmet.dto.indexcal; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 查询当前客户的area_code信息、以及下一级客户列表 + * + * @author yinzuomei@elink-cn.com + * @date 2021/1/14 16:17 + */ +@Data +public class CustomerSubInfoDTO implements Serializable { + private String customerId; + + private String customerName; + /** + * 当前客户所属的地区编码 add 01.14 + */ + private String customerAreaCode; + + /** + * 当前客户下的需要汇聚的子客户列表 add 01.14 + * 暂不使用 + */ + private List subCustomerIds; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/PageQueryGridFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/PageQueryGridFormDTO.java index 3db0986065..bd156d2aaf 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/PageQueryGridFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/PageQueryGridFormDTO.java @@ -4,6 +4,8 @@ import lombok.Data; import javax.validation.constraints.Min; import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; /** * 分页查询网格列表 @@ -36,13 +38,25 @@ public class PageQueryGridFormDTO implements Serializable { private Integer pageIndex; + /** + * 当前客户所属的地区编码 add 01.14 + */ + private String customerAreaCode = ""; + + /** + * 当前客户下的需要汇聚的子客户列表 add 01.14 + * 暂不使用 + */ + private List subCustomerIds = new ArrayList<>(); - public PageQueryGridFormDTO(String customerId,String monthId,int pageIndex,int pageNo,int pageSize){ + public PageQueryGridFormDTO(String customerId,String monthId,int pageIndex,int pageNo,int pageSize,String customerAreaCode,List subCustomerIds){ this.customerId=customerId; this.monthId=monthId; this.pageIndex=pageIndex; this.pageNo=pageNo; this.pageSize=pageSize; + this.customerAreaCode=customerAreaCode; + this.subCustomerIds=subCustomerIds; } } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/DeptGovrnAbilityFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/DeptGovrnAbilityFormDTO.java index b35ca1537a..fac962754f 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/DeptGovrnAbilityFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/DeptGovrnAbilityFormDTO.java @@ -69,4 +69,52 @@ public class DeptGovrnAbilityFormDTO implements Serializable { * 办结项目满意度 */ private BigDecimal satisfactionRatio; + + /** + * V2升级新增字段, 详见说明文档 + * 2020-01-07 + */ + private BigDecimal respProjectRatioFz; + + /** + * V2升级新增字段, 详见说明文档 + * 2020-01-07 + */ + private BigDecimal respProjectRatioFm; + + /** + * V2升级新增字段, 详见说明文档 + * 2020-01-07 + */ + private BigDecimal handleProjectRatioFz; + + /** + * V2升级新增字段, 详见说明文档 + * 2020-01-07 + */ + private BigDecimal handleProjectRatioFm; + + /** + * V2升级新增字段, 详见说明文档 + * 2020-01-07 + */ + private BigDecimal closedProjectRatioFz; + + /** + * V2升级新增字段, 详见说明文档 + * 2020-01-07 + */ + private BigDecimal closedProjectRatioFm; + + /** + * V2升级新增字段, 详见说明文档 + * 2020-01-07 + */ + private BigDecimal satisfactionRatioFz; + + /** + * V2升级新增字段, 详见说明文档 + * 2020-01-07 + */ + private BigDecimal satisfactionRatioFm; } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridGovrnAbilityFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridGovrnAbilityFormDTO.java index 021533fe59..1d2f1e7202 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridGovrnAbilityFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridGovrnAbilityFormDTO.java @@ -79,4 +79,40 @@ public class GridGovrnAbilityFormDTO implements Serializable { * 网格自治项目数 统计期网格自身内办结的项目数目 */ private Integer selfSolveProjectCount; + + /** + * V2升级新增字段, 详见说明文档 + * 2020-01-07 + */ + private BigDecimal transferRightRatioFz; + + /** + * V2升级新增字段, 详见说明文档 + * 2020-01-07 + */ + private BigDecimal transferRightRatioFm; + + /** + * V2升级新增字段, 详见说明文档 + * 2020-01-07 + */ + private BigDecimal satisfactionRatioFz; + + /** + * V2升级新增字段, 详见说明文档 + * 2020-01-07 + */ + private BigDecimal satisfactionRatioFm; + + /** + * V2升级新增字段, 详见说明文档 + * 2020-01-07 + */ + private BigDecimal issueToProjectRatioFz; + + /** + * V2升级新增字段, 详见说明文档 + * 2020-01-07 + */ + private BigDecimal issueToProjectRatioFm; } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridPartyAbilityFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridPartyAbilityFormDTO.java index 3aa816cafd..c7acdf1827 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridPartyAbilityFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridPartyAbilityFormDTO.java @@ -104,4 +104,16 @@ public class GridPartyAbilityFormDTO implements Serializable { * 党员参加三会一课人次 */ private Integer joinThreeMeetsCount; + + /** + * V2升级字段:issueToProjectRatio的分子:评价周期内转为项目的数量 + * 2020-01-07 新增 + */ + private Integer shiftedProjectTotal; + + /** + * V2升级字段:issueToProjectRatio的分母:评价周期内网格内居民提出的议题数目 + * 2020-01-07 新增 + */ + private Integer issueTotal; } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridServiceAbilityFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridServiceAbilityFormDTO.java index 02b7906a36..fe34aaa150 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridServiceAbilityFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridServiceAbilityFormDTO.java @@ -55,4 +55,27 @@ public class GridServiceAbilityFormDTO implements Serializable { */ private BigDecimal partyVolunteerRatio; + /** + * V2升级字段:partyVolunteerRatio的分子:网格党员志愿者数 + * 2020-01-07 + */ + private Integer partyVolunteerTotal; + + /** + * V2升级字段:partyVolunteerRatio的分母:志愿者总数 + * 2020-01-07 + */ + private Integer volunteerTotal; + + /** + * V2升级字段:volunteerRatio的分子:居民且注册志愿者的总人数 + * 2020-01-07 + */ + private Integer volunteerUserTotal; + + /** + * V2升级字段:volunteerRatio的分母:网格内注册居民数 + * 2020-01-07 + */ + private Integer regUserTotal; } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/OrgGovrnAbilityFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/OrgGovrnAbilityFormDTO.java index dc91df6e08..afcb201303 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/OrgGovrnAbilityFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/OrgGovrnAbilityFormDTO.java @@ -80,4 +80,64 @@ public class OrgGovrnAbilityFormDTO implements Serializable { * 街道办结项目的处理效率, data_type=street时有值 */ private BigDecimal handleProjectRatio; + + /** + * V2升级新增字段, 详见说明文档 + * 2020-01-07 + */ + private BigDecimal respProjectRatioFz; + + /** + * V2升级新增字段, 详见说明文档 + * 2020-01-07 + */ + private BigDecimal respProjectRatioFm; + + /** + * V2升级新增字段, 详见说明文档 + * 2020-01-07 + */ + private BigDecimal closedProjectRatioFz; + + /** + * V2升级新增字段, 详见说明文档 + * 2020-01-07 + */ + private BigDecimal closedProjectRatioFm; + + /** + * V2升级新增字段, 详见说明文档 + * 2020-01-07 + */ + private BigDecimal satisfactionRatioFz; + + /** + * V2升级新增字段, 详见说明文档 + * 2020-01-07 + */ + private BigDecimal satisfactionRatioFm; + + /** + * V2升级新增字段, 详见说明文档 + * 2020-01-07 + */ + private BigDecimal overdueProjectRatioFz; + + /** + * V2升级新增字段, 详见说明文档 + * 2020-01-07 + */ + private BigDecimal overdueProjectRatioFm; + + /** + * V2升级新增字段, 详见说明文档 + * 2020-01-07 + */ + private BigDecimal handleProjectRatioFz; + + /** + * V2升级新增字段, 详见说明文档 + * 2020-01-07 + */ + private BigDecimal handleProjectRatioFm; } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/org/result/CustomerAreaCodeResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/org/result/CustomerAreaCodeResultDTO.java new file mode 100644 index 0000000000..f3b4a73048 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/org/result/CustomerAreaCodeResultDTO.java @@ -0,0 +1,25 @@ +package com.epmet.dto.org.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/1/14 上午11:05 + */ +@Data +public class CustomerAreaCodeResultDTO implements Serializable { + + private static final long serialVersionUID = -4722604654441455214L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 行政区域编码 + */ + private String areaCode; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/pingyin/result/ClosedIncrResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/pingyin/result/ClosedIncrResultDTO.java new file mode 100644 index 0000000000..d1f9083b30 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/pingyin/result/ClosedIncrResultDTO.java @@ -0,0 +1,19 @@ +package com.epmet.dto.pingyin.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/2/1 上午9:22 + */ +@Data +public class ClosedIncrResultDTO implements Serializable { + + private static final long serialVersionUID = 4907953818631953766L; + + private String gridId; + + private Integer closedIncr; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/pingyin/result/EvaluateTotalResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/pingyin/result/EvaluateTotalResultDTO.java new file mode 100644 index 0000000000..3eb30a3887 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/pingyin/result/EvaluateTotalResultDTO.java @@ -0,0 +1,20 @@ +package com.epmet.dto.pingyin.result; + +import com.epmet.commons.tools.constant.NumConstant; +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/1/29 上午9:08 + */ +@Data +public class EvaluateTotalResultDTO implements Serializable { + + private static final long serialVersionUID = -4734985200452228738L; + + private String orgId; + + private Integer evaluateCount = NumConstant.ZERO; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/pingyin/result/ProjectIncrResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/pingyin/result/ProjectIncrResultDTO.java new file mode 100644 index 0000000000..6200eb8add --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/pingyin/result/ProjectIncrResultDTO.java @@ -0,0 +1,19 @@ +package com.epmet.dto.pingyin.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/1/29 下午2:28 + */ +@Data +public class ProjectIncrResultDTO implements Serializable { + + private static final long serialVersionUID = -1452144390062903633L; + + private String gridId; + + private Integer projectIncr; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/pingyin/result/ProjectOrgDailyResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/pingyin/result/ProjectOrgDailyResultDTO.java new file mode 100644 index 0000000000..a19749c5e0 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/pingyin/result/ProjectOrgDailyResultDTO.java @@ -0,0 +1,54 @@ +package com.epmet.dto.pingyin.result; + +import com.epmet.commons.tools.constant.NumConstant; +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/2/1 下午3:34 + */ +@Data +public class ProjectOrgDailyResultDTO implements Serializable { + + private static final long serialVersionUID = -6838351691873050562L; + + /** + * 行政区域编码 + */ + private String areaCode; + + /** + * 项目总数 + */ + private Integer projectTotal; + + /** + * 已解决的项目总数 + */ + private Integer resolvedNum; + + /** + * 参与满意度评价的总次数 + */ + private Integer evaluateTotal; + + /** + * 满意+非常满意的总次数 + */ + private Integer goodTotal; + + /** + * 不满意总次数 + */ + private Integer badTotal; + + public ProjectOrgDailyResultDTO() { + this.projectTotal = NumConstant.ZERO; + this.resolvedNum = NumConstant.ZERO; + this.evaluateTotal = NumConstant.ZERO; + this.goodTotal = NumConstant.ZERO; + this.badTotal = NumConstant.ZERO; + } +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/pingyin/result/ProjectOrgMonthlyResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/pingyin/result/ProjectOrgMonthlyResultDTO.java new file mode 100644 index 0000000000..8829d379c4 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/pingyin/result/ProjectOrgMonthlyResultDTO.java @@ -0,0 +1,46 @@ +package com.epmet.dto.pingyin.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/2/2 上午11:01 + */ +@Data +public class ProjectOrgMonthlyResultDTO implements Serializable { + + private static final long serialVersionUID = 4917301916897636586L; + + /** + * 行政区域编码 + */ + private String areaCode; + + /** + * 本月新增的项目数量:转项目日期在当前月份内 + */ + private Integer projectIncr; + + /** + * 累计项目总数 + */ + private Integer projectTotal; + + /** + * 累计未结项目总数 + */ + private Integer unClosedTotal; + + /** + * 累计已结项目 + */ + private Integer closedTotal; + + /** + * 本月新增结案项目数 + */ + private Integer closedIncr; + +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/pingyin/result/ProjectTotalResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/pingyin/result/ProjectTotalResultDTO.java new file mode 100644 index 0000000000..a356c0ccdb --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/pingyin/result/ProjectTotalResultDTO.java @@ -0,0 +1,18 @@ +package com.epmet.dto.pingyin.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/1/28 下午3:15 + */ +@Data +public class ProjectTotalResultDTO implements Serializable { + + private static final long serialVersionUID = 6071988402600005617L; + + private String gridId; + private Integer projectTotal; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/pingyin/result/ResolvedNumResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/pingyin/result/ResolvedNumResultDTO.java new file mode 100644 index 0000000000..6710de4469 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/pingyin/result/ResolvedNumResultDTO.java @@ -0,0 +1,18 @@ +package com.epmet.dto.pingyin.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/1/28 下午3:15 + */ +@Data +public class ResolvedNumResultDTO implements Serializable { + + private static final long serialVersionUID = 607198840261205617L; + + private String gridId; + private Integer resolvedNum; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/pingyin/result/UnClosedTotalResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/pingyin/result/UnClosedTotalResultDTO.java new file mode 100644 index 0000000000..d31e85ec28 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/pingyin/result/UnClosedTotalResultDTO.java @@ -0,0 +1,19 @@ +package com.epmet.dto.pingyin.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/1/29 下午2:59 + */ +@Data +public class UnClosedTotalResultDTO implements Serializable { + + private static final long serialVersionUID = -722723608888414454L; + + private String gridId; + + private Integer projectCount; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/plugins/BidFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/plugins/BidFormDTO.java new file mode 100644 index 0000000000..154d6c87a0 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/plugins/BidFormDTO.java @@ -0,0 +1,60 @@ +package com.epmet.dto.plugins; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import java.io.Serializable; +import java.util.Date; + +/** + * 【146】竞标管理 + * + * @author yinzuomei@elink-cn.com + * @date 2021/1/22 10:54 + */ +@Data +public class BidFormDTO implements Serializable { + private static final long serialVersionUID = -9132608534627587213L; + /** + * 竞标项目id + */ + private String bidId; + + /** + * 竞标项目名称 + */ + private String bidName; + + /** + * 状态编码 + */ + private String statusCode; + + /** + * 状态描述eg:已中标、未中标、投标中、 + */ + private String statusDesc; + + /** + * 金额单位万元 + */ + private Double amount; + + /** + * 发布时间 + */ + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date releaseTime; + + /** + * 发布村镇,以英文逗号隔开 + */ + private String townIds; + + /** + * 发布村镇名称,以英文逗号隔开 + */ + private String townNames; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/plugins/ContractFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/plugins/ContractFormDTO.java new file mode 100644 index 0000000000..445885e04c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/plugins/ContractFormDTO.java @@ -0,0 +1,56 @@ +package com.epmet.dto.plugins; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import java.io.Serializable; +import java.util.Date; + +/** + * 【146】合同监管入参 + * + * @author yinzuomei@elink-cn.com + * @date 2021/1/22 10:43 + */ +@Data +public class ContractFormDTO implements Serializable { + private static final long serialVersionUID = 971064596156093552L; + /** + * 合同id + */ + private String contractId; + + /** + * 合同名称 + */ + private String contractName; + + /** + * 合同所属类别编码 + */ + private String categoryCode; + + /** + * 合同所属类别名称 + */ + private String categoryName; + + /** + * 合同到期日期:2020-12-31 + */ + @DateTimeFormat(pattern = "yyyy-MM-dd") + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + private Date dueDate; + + /** + * 发布村镇,以英文逗号隔开 + */ + private String townIds; + + /** + * 发布村镇名称,以英文逗号隔开 + */ + private String townNames; + +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/plugins/OneListFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/plugins/OneListFormDTO.java new file mode 100644 index 0000000000..992e62d2d3 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/plugins/OneListFormDTO.java @@ -0,0 +1,35 @@ +package com.epmet.dto.plugins; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 【146】一张清单 入参 + * + * @author yinzuomei@elink-cn.com + * @date 2021/1/22 10:12 + */ +@Data +public class OneListFormDTO implements Serializable { + private static final long serialVersionUID = 8350552654881582654L; + /** + * 清单id + */ + private String listId; + + /** + * 清单编码 + */ + private String listCode; + + /** + * 名称 + */ + private String listName; + + /** + * 排序 + */ + private Integer sort; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/plugins/ScreenCustomerWorkRecordDictDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/plugins/ScreenCustomerWorkRecordDictDTO.java new file mode 100644 index 0000000000..9718304450 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/plugins/ScreenCustomerWorkRecordDictDTO.java @@ -0,0 +1,126 @@ +/** + * 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.dto.plugins; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 工作日志资源字典表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-02-04 + */ +@Data +public class ScreenCustomerWorkRecordDictDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键(客户每次上传,直接根据customerId全删全增) + */ + private String id; + + /** + * 客户Id + */ + private String customerId; + + /** + * 数据更新至日期eg:20200101 + */ + private String dateId; + + /** + * 资源id + */ + private String dictId; + + /** + * 父资源ID;如果是一级分类pid=0 + */ + private String pid; + + /** + * 资源类型 + */ + private String resourceType; + + /** + * 资源编码 + */ + private String resourceCode; + + /** + * 资源标签名 + */ + private String resourceLabel; + + /** + * 显示标识:0否,1是 + */ + private String showFlag; + + /** + * 排序 + */ + private Integer sort; + + /** + * 数据类别 :party:支部建设; union:联合建设;党员志愿服务:voluntaryservice;所有的一级分类需要对应到这三个key中 + */ + private String dataType; + + /** + * 当前资源属于几级,例如:1、2、3、4.... + */ + private Integer level; + + /** + * 逻辑删除标识 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/plugins/ScreenWorkRecordGridDailyFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/plugins/ScreenWorkRecordGridDailyFormDTO.java new file mode 100644 index 0000000000..5d75e69216 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/plugins/ScreenWorkRecordGridDailyFormDTO.java @@ -0,0 +1,57 @@ +package com.epmet.dto.plugins; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 工作日志-网格按日统计(累计值) + * + * @author yinzuomei@elink-cn.com + * @date 2021/2/21 18:48 + */ +@Data +public class ScreenWorkRecordGridDailyFormDTO implements Serializable { + private static final long serialVersionUID = 5993623581944585517L; + + /** + * 网格id + */ + private String gridId; + + /** + * 网格所属的组织id + */ + private String agencyId; + + /** + * 会议类型编码;对应screen_customer_work_record_dict的资源编码 + */ + private String meetingCode; + + /** + * 随手记类型编码;对应screen_customer_work_record_dict的资源编码 + */ + private String typeCode; + + /** + * 组织次数 + */ + private Integer organizeTotal; + + /** + * 当前组织参与的总次数 + */ + private Integer participateTotal; + + /** + * 参与人数 + */ + private Integer participateUserTotal; + + /** + * 平均参与人数 + */ + private Integer avgParticipateUserTotal; + +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/plugins/ScreenWorkRecordGridMonthlyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/plugins/ScreenWorkRecordGridMonthlyDTO.java new file mode 100644 index 0000000000..9fb30a14d7 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/plugins/ScreenWorkRecordGridMonthlyDTO.java @@ -0,0 +1,122 @@ +/** + * 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.dto.plugins; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 工作日志-网格按月统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-02-04 + */ +@Data +public class ScreenWorkRecordGridMonthlyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID 主键 + */ + private String id; + + /** + * 客户Id + */ + private String customerId; + + /** + * 月份Id:yyyyMM + */ + private String monthId; + + /** + * 网格id + */ + private String gridId; + + /** + * 网格所属的组织id + */ + private String agencyId; + + /** + * 会议类型编码;对应screen_customer_work_record_dict的资源编码 + */ + private String meetingCode; + + /** + * 随手记类型编码;对应screen_customer_work_record_dict的资源编码 + */ + private String typeCode; + + /** + * 组织次数 + */ + private Integer organizeTotal; + + /** + * 当前组织参与的总次数 + */ + private Integer participateTotal; + + /** + * 参与人数 + */ + private Integer participateUserTotal; + + /** + * 平均参与人数 + */ + private Integer avgParticipateUserTotal; + + /** + * 删除标识 0未删除;1已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/plugins/ScreenWorkRecordOrgDailyFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/plugins/ScreenWorkRecordOrgDailyFormDTO.java new file mode 100644 index 0000000000..92a13b72ed --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/plugins/ScreenWorkRecordOrgDailyFormDTO.java @@ -0,0 +1,47 @@ +package com.epmet.dto.plugins; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 工作日志-组织按日统计(累计值) + * + * @author yinzuomei@elink-cn.com + * @date 2021/2/21 18:49 + */ +@Data +public class ScreenWorkRecordOrgDailyFormDTO implements Serializable { + private static final long serialVersionUID = 819322082786098071L; + + /** + * 组织Id + */ + private String orgId; + + /** + * 会议类型编码;对应screen_customer_work_record_dict的资源编码 + */ + private String meetingCode; + + /** + * 随手记类型编码;对应screen_customer_work_record_dict的资源编码 + */ + private String typeCode; + + /** + * 组织次数 + */ + private Integer organizeTotal; + + /** + * 参与人数 + */ + private Integer participateUserTotal; + + /** + * 平均参与人数 + */ + private Integer avgParticipateUserTotal; + +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/plugins/ScreenWorkRecordOrgMonthlyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/plugins/ScreenWorkRecordOrgMonthlyDTO.java new file mode 100644 index 0000000000..4848454792 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/plugins/ScreenWorkRecordOrgMonthlyDTO.java @@ -0,0 +1,112 @@ +/** + * 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.dto.plugins; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 工作日志-组织按月统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-02-04 + */ +@Data +public class ScreenWorkRecordOrgMonthlyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID 主键 + */ + private String id; + + /** + * 客户Id + */ + private String customerId; + + /** + * 月份Id:yyyyMM + */ + private String monthId; + + /** + * 组织Id + */ + private String orgId; + + /** + * 会议类型编码;对应screen_customer_work_record_dict的资源编码 + */ + private String meetingCode; + + /** + * 随手记类型编码;对应screen_customer_work_record_dict的资源编码 + */ + private String typeCode; + + /** + * 组织次数 + */ + private Integer organizeTotal; + + /** + * 参与人数 + */ + private Integer participateUserTotal; + + /** + * 平均参与人数 + */ + private Integer avgParticipateUserTotal; + + /** + * 删除标识 0未删除;1已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectGridDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectGridDailyDTO.java new file mode 100644 index 0000000000..c1f5f2ed12 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectGridDailyDTO.java @@ -0,0 +1,152 @@ +/** + * 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.dto.screen; + +import com.epmet.commons.tools.constant.NumConstant; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +/** + * 项目(事件)分析按网格_按天统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-01-27 + */ +@Data +public class ScreenProjectGridDailyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 日期yyyyMMdd + */ + private String dateId; + + /** + * 网格id + */ + private String gridId; + + /** + * 网格所属的组织id + */ + private String pid; + + /** + * 网格所有的父级id,以英文:或者英文,隔开 + */ + private String pids; + + /** + * 截止到当前日期,网格内项目总数 + */ + private Integer projectTotal; + + /** + * 截止到当前日期,网格内已解决的项目总数 + */ + private Integer resolvedNum; + + /** + * 解决率=RESOLVED_NUM/PROJECT_TOTAL,存储小数即可,保留小数点后4位 + */ + private BigDecimal resolvedRatio; + + /** + * 对当前网格内项目,参与满意度评价的总次数 + */ + private Integer evaluateTotal; + + /** + * 对当前网格内项目,满意+非常满意的总次数 + */ + private Integer goodTotal; + + /** + * 对当前网格内项目,不满意总次数 + */ + private Integer badTotal; + + /** + * 满意率=good_total/evaluate_total + */ + private BigDecimal goodRatio; + + /** + * 不满意率=bad_total/evaluate_total + */ + private BigDecimal badRatio; + + /** + * 删除标识 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + public ScreenProjectGridDailyDTO() { + this.projectTotal = NumConstant.ZERO; + this.resolvedNum = NumConstant.ZERO; + this.resolvedRatio = NumConstant.ZERO_DECIMAL; + this.evaluateTotal = NumConstant.ZERO; + this.goodTotal = NumConstant.ZERO; + this.badTotal = NumConstant.ZERO; + this.goodRatio = NumConstant.ZERO_DECIMAL; + this.badRatio = NumConstant.ZERO_DECIMAL; + this.createdBy = "APP_USER"; + this.updatedBy = "APP_USER"; + this.delFlag = NumConstant.ZERO_STR; + this.revision = NumConstant.ZERO; + } +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectOrgDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectOrgDailyDTO.java new file mode 100644 index 0000000000..7b449b50fe --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectOrgDailyDTO.java @@ -0,0 +1,147 @@ +/** + * 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.dto.screen; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +/** + * 项目(事件)分析按组织_按天统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-01-27 + */ +@Data +public class ScreenProjectOrgDailyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 日期yyyyMMdd + */ + private String dateId; + + /** + * 组织id + */ + private String orgId; + + /** + * 社区级:community,乡(镇、街道)级:street,区县级: district,市级: city省级:province + */ + private String orgType; + + /** + * 当前orgId所属的上级id + */ + private String pid; + + /** + * orgId所有的父级id,以英文:或者英文,隔开 + */ + private String pids; + + /** + * 截止到当前日期,网格内项目总数 + */ + private Integer projectTotal; + + /** + * 截止到当前日期,网格内已解决的项目总数 + */ + private Integer resolvedNum; + + /** + * 解决率=RESOLVED_NUM/PROJECT_TOTAL,存储小数即可,保留小数点后4位 + */ + private BigDecimal resolvedRatio; + + /** + * 对当前组织内项目,参与满意度评价的总次数 + */ + private Integer evaluateTotal; + + /** + * 对当前组织内项目,满意+非常满意的总次数 + */ + private Integer goodTotal; + + /** + * 对当前组织内项目,不满意总次数 + */ + private Integer badTotal; + + /** + * 满意率=good_total/evaluate_total + */ + private BigDecimal goodRatio; + + /** + * 不满意率=bad_total/evaluate_total + */ + private BigDecimal badRatio; + + /** + * 删除标识 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * 行政区域编码 + */ + private String areaCode; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectQuantityGridMonthlyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectQuantityGridMonthlyDTO.java new file mode 100644 index 0000000000..b735ed6e27 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectQuantityGridMonthlyDTO.java @@ -0,0 +1,134 @@ +/** + * 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.dto.screen; + +import com.epmet.commons.tools.constant.NumConstant; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 项目(事件)数量分析按网格_按月统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-01-27 + */ +@Data +public class ScreenProjectQuantityGridMonthlyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 日期yyyyMMdd + */ + private String monthId; + + /** + * 网格id + */ + private String gridId; + + /** + * 网格所属的组织id + */ + private String pid; + + /** + * 网格所有的父级id,以英文:或者英文,隔开 + */ + private String pids; + + /** + * 当前网格,本月新增的项目数量:转项目日期在当前月份内 + */ + private Integer projectIncr; + + /** + * 截止到当前月份:累计项目总数 + */ + private Integer projectTotal; + + /** + * 截止到当前月份:累计未结项目总数 + */ + private Integer unClosedTotal; + + /** + * 截止到当前月份:累计已结项目 + */ + private Integer closedTotal; + + /** + * 本月新增结案项目数 + */ + private Integer closedIncr; + + /** + * 删除标识 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + public ScreenProjectQuantityGridMonthlyDTO() { + this.projectIncr = NumConstant.ZERO; + this.projectTotal = NumConstant.ZERO; + this.unClosedTotal = NumConstant.ZERO; + this.closedTotal = NumConstant.ZERO; + this.closedIncr = NumConstant.ZERO; + this.delFlag = NumConstant.ZERO_STR; + this.revision = NumConstant.ZERO; + this.createdBy = "APP_USER"; + this.updatedBy = "APP_USER"; + } +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectQuantityOrgMonthlyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectQuantityOrgMonthlyDTO.java new file mode 100644 index 0000000000..0355ec4a8a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectQuantityOrgMonthlyDTO.java @@ -0,0 +1,141 @@ +/** + * 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.dto.screen; + +import com.epmet.commons.tools.constant.NumConstant; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 项目(事件)数量分析按组织_按月统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-01-27 + */ +@Data +public class ScreenProjectQuantityOrgMonthlyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 日期yyyyMMdd + */ + private String monthId; + + /** + * 组织id + */ + private String orgId; + + /** + * 社区级:community,乡(镇、街道)级:street,区县级: district,市级: city省级:province + */ + private String orgType; + + /** + * 当前orgId所属的上级id + */ + private String pid; + + /** + * orgId所有的父级id,以英文:或者英文,隔开 + */ + private String pids; + + /** + * 当前组织内,本月新增的项目数量:转项目日期在当前月份内 + */ + private Integer projectIncr; + + /** + * 截止到当前月份:累计项目总数 + */ + private Integer projectTotal; + + /** + * 截止到当前月份:累计未结项目总数 + */ + private Integer unClosedTotal; + + /** + * 截止到当前月份:累计已结项目 + */ + private Integer closedTotal; + + /** + * 本月新增结案项目数 + */ + private Integer closedIncr; + + /** + * 删除标识 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + private String areaCode; + + public ScreenProjectQuantityOrgMonthlyDTO() { + this.projectIncr = NumConstant.ZERO; + this.projectTotal = NumConstant.ZERO; + this.unClosedTotal = NumConstant.ZERO; + this.closedTotal = NumConstant.ZERO; + this.closedIncr = NumConstant.ZERO; + this.delFlag = NumConstant.ZERO_STR; + this.revision = NumConstant.ZERO; + this.createdBy = "APP_USER"; + this.updatedBy = "APP_USER"; + } +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/ScreenCollFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/ScreenCollFormDTO.java index 760e48b3da..fa3e97d11d 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/ScreenCollFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/ScreenCollFormDTO.java @@ -45,4 +45,9 @@ public class ScreenCollFormDTO implements Serializable { public String toString() { return JSON.toJSONString(this); } + + /** + * 当前客户id + */ + private String customerId; } 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 a9f9d34697..0ef8749799 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 @@ -73,4 +73,9 @@ public class CustomerAgencyFormDTO implements Serializable { * 是否显示 */ private String isDisplay; + + /** + * 当前组织的上级行政地区编码add0204;举例平阴县对应的是济南市3701 + */ + private String parentAreaCode; } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CustomerDeptFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CustomerDeptFormDTO.java index a99713701a..e39b6e1644 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CustomerDeptFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CustomerDeptFormDTO.java @@ -48,4 +48,10 @@ public class CustomerDeptFormDTO implements Serializable { * 数据更新至: yyyy|yyyyMM|yyyyMMdd(08-21新增) */ private String dataEndTime; + + /** + * V2升级必传参数:当前网格所属行政地区编码,去除末尾0 + * 2020-01-07 + */ + private String areaCode; } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CustomerGridFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CustomerGridFormDTO.java index 75eb13a0fa..ad9277c0d8 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CustomerGridFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CustomerGridFormDTO.java @@ -53,4 +53,10 @@ public class CustomerGridFormDTO implements Serializable { * 所有上级ID,用英文逗号分开(8.26新增) */ private String allParentIds; + + /** + * V2升级必传参数:当前网格所属行政地区编码,去除末尾0 + * 2020-01-07 + */ + private String areaCode; } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/DimCustomerDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/DimCustomerDTO.java index 86aff5d046..d9de52d3e7 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/DimCustomerDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/DimCustomerDTO.java @@ -17,9 +17,10 @@ package com.epmet.dto.stats; +import lombok.Data; + import java.io.Serializable; import java.util.Date; -import lombok.Data; /** @@ -73,4 +74,8 @@ public class DimCustomerDTO implements Serializable { */ private Date updatedTime; + /** + * 客户所属行政地区编码,取值来自客户根组织的area_code(01.14 add) + */ + private String areaCode; } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java index 755705a6ce..5d340fa7f3 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java @@ -36,6 +36,10 @@ import com.epmet.service.evaluationindex.extract.dataToIndex.*; import com.epmet.service.evaluationindex.extract.todata.FactOriginTopicMainDailyService; import com.epmet.service.evaluationindex.extract.toscreen.*; import com.epmet.service.evaluationindex.indexcal.*; +import com.epmet.service.evaluationindex.screen.ScreenProjectGridDailyService; +import com.epmet.service.evaluationindex.screen.ScreenProjectOrgDailyService; +import com.epmet.service.evaluationindex.screen.ScreenProjectQuantityGridMonthlyService; +import com.epmet.service.evaluationindex.screen.ScreenProjectQuantityOrgMonthlyService; import com.epmet.service.stats.DimAgencyService; import com.epmet.service.stats.DimCustomerPartymemberService; import lombok.extern.slf4j.Slf4j; @@ -175,8 +179,8 @@ public class DemoController { } @PostMapping("zxc2") - public Result getZxc2(){ - indexCalculateCommunityService.calCommunityAll("45687aa479955f9d06204d415238f7cc", "202008"); + public Result getZxc2(@RequestBody CalculateCommonFormDTO formDTO){ + indexCalculateCommunityService.calCommunityAll(formDTO); return new Result(); } @@ -484,17 +488,13 @@ public class DemoController { } @PostMapping("streetZxc") - public void getStreet(){ - String customerId = "b09527201c4409e19d1dbc5e3c3429a1"; - String monthId = "202009"; - indexCalculateStreetService.calStreetAll(customerId,monthId); + public void getStreet(@RequestBody CalculateCommonFormDTO form){ + indexCalculateStreetService.calStreetAll(form); } @PostMapping("districtZxc") - public void getDistrict(){ - String customerId = "45687aa479955f9d06204d415238f7cc"; - String monthId = "202009"; - indexCalculateDistrictService.calDistrictAll(customerId,monthId); + public void getDistrict(@RequestBody CalculateCommonFormDTO form){ + indexCalculateDistrictService.calDistrictAll(form); } @PostMapping("gridZxc") public void getGrid(){ @@ -747,4 +747,40 @@ public class DemoController { log.info("影响行数="+updateNum); return new Result(); } + + @Autowired + private ScreenProjectGridDailyService screenProjectGridDailyService; + + @Autowired + private ScreenProjectQuantityGridMonthlyService screenProjectQuantityGridMonthlyService; + + @Autowired + private ScreenProjectOrgDailyService screenProjectOrgDailyService; + + @Autowired + private ScreenProjectQuantityOrgMonthlyService screenProjectQuantityOrgMonthlyService; + + @PostMapping("screenProjectGridDaily") + public Result screenProjectGridDaily(@RequestParam("customerId")String customerId,@RequestParam("dateId")String dateId){ + screenProjectGridDailyService.extractionProjectGridDaily(customerId,dateId); + return new Result(); + } + + @PostMapping("screenProjectQuantityGrid") + public Result screenProjectQuantityGrid(@RequestParam("customerId")String customerId,@RequestParam("monthId")String monthId){ + screenProjectQuantityGridMonthlyService.extractionProjectGridMonthly(customerId,monthId); + return new Result(); + } + + @PostMapping("screenProjectOrgDaily") + public Result screenProjectOrgDaily(@RequestParam("customerId")String customerId,@RequestParam("dateId")String dateId){ + screenProjectOrgDailyService.extractionProjectOrgDaily(customerId, dateId); + return new Result(); + } + + @PostMapping("screenProjectQuantityOrgMonthly") + public Result screenProjectQuantityOrgMonthly(@RequestParam("customerId")String customerId,@RequestParam("monthId")String monthId){ + screenProjectQuantityOrgMonthlyService.extractionProjectOrgMonthly(customerId,monthId); + return new Result(); + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexCalculateController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexCalculateController.java index 11e082057a..1bf83298cc 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexCalculateController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexCalculateController.java @@ -84,6 +84,9 @@ public class IndexCalculateController { CalculateCommonFormDTO form = new CalculateCommonFormDTO(); form.setCustomerId(flag.getForm().getCustomerId()); form.setMonthId(flag.getForm().getMonthId()); + //01.14 add + form.setCustomerAreaCode(flag.getForm().getCustomerAreaCode()); + form.setSubCustomerIds(flag.getForm().getSubCustomerIds()); indexCalculate(form); } }); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ScreenProjectDataCollController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ScreenProjectDataCollController.java new file mode 100644 index 0000000000..2efc866c87 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ScreenProjectDataCollController.java @@ -0,0 +1,92 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.exception.ValidateException; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.screen.*; +import com.epmet.dto.screencoll.ScreenCollFormDTO; +import com.epmet.service.evaluationindex.screen.*; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.util.CollectionUtils; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * @Description 事件/项目采集接口入口 + * @ClassName ScreenProjectDataCollController + * @Auth wangc + * @Date 2021-01-27 17:10 + */ +@Slf4j +@RestController +@RequestMapping("project") +public class ScreenProjectDataCollController { + + @Autowired + private ScreenProjectGridDailyService projectGridDailyService; + @Autowired + private ScreenProjectOrgDailyService projectOrgDailyService; + @Autowired + private ScreenProjectQuantityGridMonthlyService projectQuantityGridMonthlyService; + @Autowired + private ScreenProjectQuantityOrgMonthlyService projectQuantityOrgMonthlyService; + + /** + * @author wangc + * @description 【事件/项目分析】网格内月度数量统计 + **/ + @RequestMapping("quantity-grid-monthly") + public Result quantityGridMonthly(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO param) { + if (null == param || CollectionUtils.isEmpty(param.getDataList()) || StringUtils.isBlank(param.getMonthId())) { + throw new ValidateException("参数错误:dataList不能为空且monthId不能为空"); + } + projectQuantityGridMonthlyService.collect(customerId, param); + return new Result(); + } + + /** + * @author wangc + * @description 【事件/项目分析】组织内月度数量统计 + **/ + @RequestMapping("quantity-org-monthly") + public Result quantityOrgMonthly(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO param) { + if (null == param || CollectionUtils.isEmpty(param.getDataList()) || StringUtils.isBlank(param.getMonthId())) { + throw new ValidateException("参数错误:dataList不能为空且monthId不能为空"); + } + projectQuantityOrgMonthlyService.collect(customerId, param); + return new Result(); + } + + /** + * @author wangc + * @description 【事件/项目分析】网格内事件 + **/ + @RequestMapping("project-grid-daily") + public Result projectGridDaily(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO param) { + if (null == param || CollectionUtils.isEmpty(param.getDataList()) || StringUtils.isBlank(param.getDateId())) { + throw new ValidateException("参数错误:dataList不能为空且dataId不能为空"); + } + projectGridDailyService.collect(customerId, param); + return new Result(); + } + + /** + * @author wangc + * @description 【事件/项目分析】组织内事件 + **/ + @RequestMapping("project-org-daily") + public Result projectOrgDaily(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO param) { + if (null == param || CollectionUtils.isEmpty(param.getDataList()) || StringUtils.isBlank(param.getDateId())) { + throw new ValidateException("参数错误:dataList不能为空且dataId不能为空"); + } + projectOrgDailyService.collect(customerId, param); + return new Result(); + } + + //todo 【事件/项目分析】按类别统计-网格 + //todo 【事件/项目分析】按类别统计-组织 + //上述两个接口可以有采集接口方便灌假数。后面项目分类统计两个方案A:从项目信息中分析计算到大屏表; B:下面三个子客户(榆山街道、孔村街道、锦水街道)单独上报;子客户根据area_code计算 +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/plugins/OfsController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/plugins/OfsController.java new file mode 100644 index 0000000000..09f5942c5c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/plugins/OfsController.java @@ -0,0 +1,66 @@ +package com.epmet.controller.plugins; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.plugins.BidFormDTO; +import com.epmet.dto.plugins.ContractFormDTO; +import com.epmet.dto.plugins.OneListFormDTO; +import com.epmet.dto.screencoll.ScreenCollFormDTO; +import com.epmet.service.plugins.OfsService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +/** + * 146体系数据采集 + * + * @author yinzuomei@elink-cn.com + * @date 2021/1/22 10:10 + */ +@RestController +@RequestMapping("plugins/ofs") +public class OfsController { + + @Autowired + private OfsService ofsService; + + /** + * @param customerId + * @param formDTO + * @author yinzuomei + * @description 【146】一张清单 + * @Date 2021/1/22 10:19 + **/ + @PostMapping("onelist-daily") + public Result collOneList(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO){ + formDTO.setCustomerId(customerId); + ofsService.collOneList(formDTO); + return new Result(); + } + + /** + * @param customerId + * @param formDTO + * @author yinzuomei + * @description 【146】合同监管 + * @Date 2021/1/22 10:42 + **/ + @PostMapping("contract-daily") + public Result collContract(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO){ + formDTO.setCustomerId(customerId); + ofsService.collContract(formDTO); + return new Result(); + } + + /** + * @param customerId + * @param formDTO + * @author yinzuomei + * @description 【146】竞标管理 + * @Date 2021/1/22 10:53 + **/ + @PostMapping("bid-daily") + public Result collBid(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO){ + formDTO.setCustomerId(customerId); + ofsService.collBid(formDTO); + return new Result(); + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/plugins/WorkRecordColController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/plugins/WorkRecordColController.java new file mode 100644 index 0000000000..d6631f2b51 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/plugins/WorkRecordColController.java @@ -0,0 +1,91 @@ +package com.epmet.controller.plugins; + +import com.alibaba.fastjson.JSON; +import com.epmet.commons.tools.exception.ValidateException; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.plugins.*; +import com.epmet.dto.screencoll.ScreenCollFormDTO; +import com.epmet.service.plugins.ScreenCustomerWorkRecordDictService; +import com.epmet.service.plugins.impl.ScreenWorkRecordOrgMonthlyServiceImpl; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.util.CollectionUtils; +import org.springframework.web.bind.annotation.*; + +/** + * 工作日志数据采集 + * + * @author yinzuomei@elink-cn.com + * @date 2021/1/22 10:10 + */ +@RestController +@RequestMapping("plugins/workrecord") +@Slf4j +public class WorkRecordColController { + + @Autowired + ScreenCustomerWorkRecordDictService dictService; + @Autowired + ScreenWorkRecordOrgMonthlyServiceImpl orgMonthlyService; + + /** + * @Description 【工作日志】客户资源字典信息上传 + * + * 按月上传工作日志统计数据时,同步调用此接口上传字典信息 + * @param customerId + * @param data + * @return com.epmet.commons.tools.utils.Result + * @author wangc + * @date 2021.02.04 16:16 + */ + @PostMapping("resource-dict") + public Result resourceDict(@RequestHeader("CustomerId")String customerId, @RequestBody ScreenCollFormDTO data){ + if(StringUtils.isBlank(customerId) || CollectionUtils.isEmpty(data.getDataList()) || + StringUtils.isBlank(data.getDateId())) { + log.error("com.epmet.controller.plugins.WorkRecordColController.resourceDict,param:{}", JSON.toJSONString(data)); + throw new ValidateException("客户Id、上传数据列表、日期Id不可为空"); + } + dictService.collect(customerId,data); + return new Result(); + } + + /** + * @Description 【工作日志】组织按月统计 + * @param customerId + * @param data + * @return com.epmet.commons.tools.utils.Result + * @author wangc + * @date 2021.02.04 16:16 + */ + @PostMapping("org-monthly") + public Result collectOrg(@RequestHeader("CustomerId")String customerId, @RequestBody ScreenCollFormDTO data){ + if(StringUtils.isBlank(customerId) || CollectionUtils.isEmpty(data.getDataList()) || + StringUtils.isBlank(data.getMonthId())) { + log.error("com.epmet.controller.plugins.WorkRecordColController.collectOrg,param:{}", JSON.toJSONString(data)); + throw new ValidateException("客户Id、上传数据列表、月份Id不可为空"); + } + orgMonthlyService.collect(customerId,data); + return new Result(); + } + + /** + * @Description 【工作日志】组织按日统计 累计值 + * @param customerId + * @param data + * @return com.epmet.commons.tools.utils.Result + * @author wangc + * @date 2021.02.04 16:16 + */ + @PostMapping("org-daily") + public Result collectOrgDaily(@RequestHeader("CustomerId")String customerId, @RequestBody ScreenCollFormDTO data){ + if(StringUtils.isBlank(customerId) || CollectionUtils.isEmpty(data.getDataList()) || + StringUtils.isBlank(data.getDateId())) { + log.error("com.epmet.controller.plugins.WorkRecordColController.collectOrgDaily,param:{}", JSON.toJSONString(data)); + throw new ValidateException("客户Id、上传数据列表、日期Id不可为空"); + } + //todo + // orgMonthlyService.collectOrgDaily(customerId,data); + return new Result(); + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/crm/CustomerRelationDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/crm/CustomerRelationDao.java new file mode 100644 index 0000000000..d79e843076 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/crm/CustomerRelationDao.java @@ -0,0 +1,44 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.crm; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.indexcal.CustomerSubInfoDTO; +import com.epmet.entity.crm.CustomerRelationEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 客户关系表(01.14 add) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-01-14 + */ +@Mapper +public interface CustomerRelationDao extends BaseDao { + + /** + * @param customerIds + * @author yinzuomei + * @description 查询当前客户的area_code信息、以及下一级客户列表 + * @Date 2021/1/21 11:27 + **/ + List selectCustomerSubInfo(@Param("list") List customerIds); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectMainDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectMainDailyDao.java index ebbbe5e84b..12b747d206 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectMainDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectMainDailyDao.java @@ -23,6 +23,7 @@ import com.epmet.dto.extract.result.GridProjectClosedTotalResultDTO; import com.epmet.dto.extract.result.OrgStatisticsResultDTO; import com.epmet.dto.extract.result.TransferRightRatioResultDTO; import com.epmet.dto.indexcollect.result.CpcIndexCommonDTO; +import com.epmet.dto.pingyin.result.*; import com.epmet.dto.screen.form.ProjectSourceMapFormDTO; import com.epmet.entity.evaluationindex.extract.FactOriginProjectMainDailyEntity; import com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity; @@ -217,4 +218,59 @@ public interface FactOriginProjectMainDailyDao extends BaseDao getOrgProjectCount(@Param("customerId") String customerId, @Param("monthId")String monthId, @Param("level") String level); + + /** + * @Description 查询项目总数 + * @Param customerId + * @Param dateId + * @author zxc + * @date 2021/1/28 下午4:01 + */ + List selectProjectTotal(@Param("customerId")String customerId, @Param("dateId")String dateId, @Param("monthId")String monthId); + + /** + * @Description 查询已解决项目数 + * @Param customerId + * @Param dateId + * @author zxc + * @date 2021/1/28 下午4:15 + */ + List selectResolvedNum(@Param("customerId")String customerId, @Param("dateId")String dateId); + + /** + * @Description 查询 满意度评价次数 + * @Param customerId + * @Param dateId + * @author zxc + * @date 2021/1/29 上午9:10 + */ + List selectEvaluateCount(@Param("customerId")String customerId, @Param("dateId")String dateId, @Param("activeCodes") List activeCodes); + + /** + * @Description 查询本月新增项目数 + * @Param customerId + * @Param monthId + * @author zxc + * @date 2021/1/29 下午2:31 + */ + List selectProjectIncr(@Param("customerId")String customerId, @Param("monthId")String monthId); + + /** + * @Description 根据状态查询项目数 + * @Param customerId + * @Param monthId + * @Param status + * @author zxc + * @date 2021/1/29 下午3:25 + */ + List selectProjectCount(@Param("customerId")String customerId, @Param("monthId")String monthId, @Param("status") String status); + + /** + * @Description 本月新增结案项目数 + * @Param customerId + * @Param monthId + * @author zxc + * @date 2021/2/1 上午9:25 + */ + List selectClosedIncr(@Param("customerId")String customerId, @Param("monthId")String monthId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/AgencyScoreDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/AgencyScoreDao.java index 3046923a98..5e0d0585be 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/AgencyScoreDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/AgencyScoreDao.java @@ -62,6 +62,16 @@ public interface AgencyScoreDao extends BaseDao { */ List selectAgencyScoreInfo(@Param("customerId") String customerId, @Param("monthId")String monthId, @Param("dataType")String dataType); + /** + * @Description 查询【fact_index_agency_score】相关信息 存在下级客户 + * @Param areaCode + * @Param monthId + * @Param dataType + * @author zxc + * @date 2021/1/15 下午4:23 + */ + List selectAgencyScoreInfoExistsSub(@Param("areaCode") String areaCode,@Param("areaCodeLength") Integer areaCodeLength, @Param("monthId")String monthId, @Param("dataType")String dataType); + /** * @Description 区下级街道得分平均值 * @param customerId @@ -71,6 +81,17 @@ public interface AgencyScoreDao extends BaseDao { */ List selectAgencyScoreAvg(@Param("customerId")String customerId, @Param("monthId")String monthId, @Param("indexCode")String indexCode,@Param("dataType")String dataType); + /** + * @Description 区下级街道得分平均值 存在下级客户 + * @Param monthId + * @Param indexCode + * @Param dataType + * @Param areaCode + * @author zxc + * @date 2021/1/18 上午9:09 + */ + List selectAgencyScoreAvgExistsSub(@Param("monthId")String monthId, @Param("indexCode")String indexCode,@Param("dataType")String dataType,@Param("areaCode")String areaCode,@Param("areaCodeLength")Integer areaCodeLength); + /** * 根据入参查询 区/街道相关分数表 记录 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CommunityScoreDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CommunityScoreDao.java index 95d0f60e84..1e653e61a7 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CommunityScoreDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CommunityScoreDao.java @@ -61,6 +61,15 @@ public interface CommunityScoreDao extends BaseDao selectCommunityInfo(@Param("customerId") String customerId,@Param("monthId")String monthId); + /** + * @Description 查询社区相关信息 存在下级客户 + * @Param areaCode + * @Param monthId + * @author zxc + * @date 2021/1/15 下午2:18 + */ + List selectCommunityInfoExistsSub(@Param("areaCode") String areaCode,@Param("monthId")String monthId); + /** * 根据入参查询 查询社区相关信息 * @param customerId @@ -79,6 +88,16 @@ public interface CommunityScoreDao extends BaseDao selectSubCommAvgScore(@Param("customerId")String customerId, @Param("monthId")String monthId, @Param("indexCode")String indexCode); + /** + * @Description 街道下级所有社区得分平均值 存在下级客户 + * @Param monthId + * @Param indexCode + * @Param areaCode + * @author zxc + * @date 2021/1/15 下午3:19 + */ + List selectSubCommAvgScoreExistSub(@Param("monthId")String monthId, @Param("indexCode")String indexCode,@Param("areaCode")String areaCode); + /** * 根据入参查询 查询社区id * @param customerId diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/DeptScoreDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/DeptScoreDao.java index c236c31e6c..a22317c371 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/DeptScoreDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/DeptScoreDao.java @@ -68,6 +68,16 @@ public interface DeptScoreDao extends BaseDao { */ List selectGovernDeptScoreAvg(@Param("customerId")String customerId, @Param("monthId")String monthId, @Param("indexCode")String indexCode); + /** + * @Description 所有直属部门治理能力平均值 存在下级客户 + * @Param areaCode + * @Param monthId + * @Param indexCode + * @author zxc + * @date 2021/1/18 上午9:31 + */ + List selectGovernDeptScoreAvgExistsSub(@Param("areaCode")String areaCode, @Param("monthId")String monthId, @Param("indexCode")String indexCode); + /** * @return int * @param customerId 客户id diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/GridScoreDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/GridScoreDao.java index e4eef189fd..0435005a88 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/GridScoreDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/GridScoreDao.java @@ -78,6 +78,16 @@ public interface GridScoreDao extends BaseDao { */ List selectSubGridAvgScore(@Param("customerId")String customerId, @Param("monthId")String monthId, @Param("indexCode")String indexCode); + /** + * @Description 所有网格的平均值 + * @Param monthId + * @Param indexCode + * @Param areaCode + * @author zxc + * @date 2021/1/15 上午9:24 + */ + List selectSubGridAvgScoreByAreaCode(@Param("monthId")String monthId, @Param("indexCode")String indexCode, @Param("areaCode")String areaCode); + /** * 根据入参查询 网格相关分值记录 * @param customerId diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityDeptMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityDeptMonthlyDao.java index b4f79644d0..b53a2d7a83 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityDeptMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityDeptMonthlyDao.java @@ -18,7 +18,6 @@ package com.epmet.dao.evaluationindex.indexcoll; /** import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.indexcal.CalculateCommonFormDTO; -import com.epmet.dto.indexcal.SubAgencyScoreAvgResultDTO; import com.epmet.dto.indexcollect.form.DeptGovrnAbilityFormDTO; import com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityDeptMonthlyEntity; import org.apache.ibatis.annotations.Mapper; @@ -90,7 +89,9 @@ public interface FactIndexGovrnAblityDeptMonthlyDao extends BaseDao> selectListByMonthId(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("offset") Integer offset, - @Param("pageSize") Integer pageSize); + @Param("pageSize") Integer pageSize, + @Param("customerAreaCode") String customerAreaCode, + @Param("subCustomerIds") List subCustomerIds); /** * @return com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityDeptMonthlyEntity diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.java index 2e047268de..a47ebdc88d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.java @@ -19,7 +19,6 @@ package com.epmet.dao.evaluationindex.indexcoll; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.extract.form.GovernAbilityGridMonthlyFormDTO; -import com.epmet.dto.extract.form.PartyAbilityGridMonthlyFormDTO; import com.epmet.dto.indexcal.CalculateCommonFormDTO; import com.epmet.dto.indexcal.PageQueryGridFormDTO; import com.epmet.dto.indexcollect.form.GridGovrnAbilityFormDTO; @@ -44,11 +43,7 @@ public interface FactIndexGovrnAblityGridMonthlyDao extends BaseDao - * @param customerId - * @param monthId * @author yinzuomei * @description 查询治理能力,网格相关,各五级指标最大值,最小值 * @Date 2020/8/27 13:10 **/ - Map selectGovrnAblityGridMinAndMax(@Param("customerId") String customerId, @Param("monthId") String monthId); + Map selectGovrnAblityGridMinAndMax(CalculateCommonFormDTO formDTO); /** * @return int diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.java index 5d172d1e06..48d156cc81 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.java @@ -67,6 +67,15 @@ public interface FactIndexGovrnAblityOrgMonthlyDao extends BaseDao> selectCommunityGovernAbility(@Param("customerId")String customerId, @Param("monthId")String monthId,@Param("level")String level); + /** + * @Description 社区治理能力各个参数查询【被吹哨次数、办结项目数、项目响应度、超期项目率、【街道办结项目的处理效率,level为street时存在】、办结项目率、办结项目满意度】存在下级客户时 + * @Param areaCode + * @Param monthId + * @author zxc + * @date 2021/1/15 下午1:27 + */ + List> selectCommunityGovernAbilityExistsSub(@Param("monthId")String monthId,@Param("areaCode")String areaCode); + /** * 根据组织类型删除数据 * @author zhaoqifeng diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexPartyAblityCpcMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexPartyAblityCpcMonthlyDao.java index 619b621d7a..1102a159b9 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexPartyAblityCpcMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexPartyAblityCpcMonthlyDao.java @@ -18,6 +18,7 @@ package com.epmet.dao.evaluationindex.indexcoll; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.indexcal.CalculateCommonFormDTO; import com.epmet.dto.indexcollect.form.GridPartyMemberDataDetailFormDTO; import com.epmet.entity.evaluationindex.indexcoll.FactIndexPartyAblityCpcMonthlyEntity; import org.apache.ibatis.annotations.Mapper; @@ -59,9 +60,29 @@ public interface FactIndexPartyAblityCpcMonthlyDao extends BaseDao list, @Param("customerId") String customerId); - List> getCountByMonthId(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("offset") Integer offset, @Param("pageSize") Integer pageSize); + /** + * @return java.util.List> + * @param customerId 当前计算的客户id + * @param monthId yyyyMM + * @param offset + * @param pageSize + * @param customerAreaCode 当前计算的客户所属的area_code + * @param subCustomerIds 当前计算的客户下的子客户id + * @description 分页查询党建能力-党员相关 指标原始数据 + * @Date 2021/1/15 10:04 + **/ + List> getCountByMonthId(@Param("customerId") String customerId, @Param("monthId") String monthId, + @Param("offset") Integer offset, @Param("pageSize") Integer pageSize, + @Param("customerAreaCode") String customerAreaCode, + @Param("subCustomerIds") List subCustomerIds); - Map getExtremeValue(@Param("customerId") String customerId, @Param("monthId") String monthId); + /** + * @return java.util.Map + * @param formDTO: customerId 当前计算的客户id;monthId yyyyMM;customerAreaCode 当前计算的客户所属的area_code;subCustomerIds 当前计算的客户下的子客户id + * @description 党员相关-党建能力各个指标值的最大值、最小值(1)有子客户时按照area_code查询(2)没有子客户按照customerId查询 + * @Date 2021/1/15 9:44 + **/ + Map getExtremeValue(CalculateCommonFormDTO formDTO); /** * @return int diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexPartyAblityGridMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexPartyAblityGridMonthlyDao.java index e15e5cc90b..ec9404e36b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexPartyAblityGridMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexPartyAblityGridMonthlyDao.java @@ -73,13 +73,12 @@ public interface FactIndexPartyAblityGridMonthlyDao extends BaseDao - * @param customerId - * @param monthId + * @param formDTO * @author yinzuomei * @description 查询党建能力,网格相关,各五级指标最大值,最小值 * @Date 2020/8/27 12:51 **/ - Map selectPartyAblityGridMinAndMax(@Param("customerId") String customerId, @Param("monthId") String monthId); + Map selectPartyAblityGridMinAndMax(CalculateCommonFormDTO formDTO); /** * @return java.lang.Integer diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexPartyAblityOrgMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexPartyAblityOrgMonthlyDao.java index f9ab1ba754..ebbdc9424f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexPartyAblityOrgMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexPartyAblityOrgMonthlyDao.java @@ -78,6 +78,25 @@ public interface FactIndexPartyAblityOrgMonthlyDao extends BaseDao> selectPublishArticleCountMap(@Param("customerId")String customerId, @Param("monthId")String monthId,@Param("level")String level); + /** + * @Description 查询社区下的发文数 Map 存在下级客户 + * @Param monthId + * @Param areaCode + * @author zxc + * @date 2021/1/15 下午3:31 + */ + List> selectPublishArticleCountMapExistSub(@Param("monthId")String monthId,@Param("areaCode")String areaCode,@Param("areaCodeLength")Integer areaCodeLength); + + /** + * @Description 查询社区下的发文数 Map【根据areaCode】 + * @Param customerId + * @Param monthId + * @Param level + * @author zxc + * @date 2021/1/15 上午9:48 + */ + List> selectPublishArticleCountMapbyAreaCode(@Param("monthId")String monthId,@Param("areaCode")String areaCode); + /** * 根据组织类型删除数据 * @author zhaoqifeng diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexServiceAblityGridMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexServiceAblityGridMonthlyDao.java index 10cabe11f1..ebb543d4b9 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexServiceAblityGridMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexServiceAblityGridMonthlyDao.java @@ -71,13 +71,11 @@ public interface FactIndexServiceAblityGridMonthlyDao extends BaseDao - * @param customerId - * @param monthId * @author yinzuomei * @description 查询 服务能力,网格相关,各五级指标最大值,最小值 * @Date 2020/8/27 13:15 **/ - Map selectServiceAblityGridMinAndMax(@Param("customerId") String customerId, @Param("monthId") String monthId); + Map selectServiceAblityGridMinAndMax(CalculateCommonFormDTO formDTO); /** * @return int diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexServiceAblityOrgMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexServiceAblityOrgMonthlyDao.java index c7ea1d7795..bacc7b77ed 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexServiceAblityOrgMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexServiceAblityOrgMonthlyDao.java @@ -79,6 +79,15 @@ public interface FactIndexServiceAblityOrgMonthlyDao extends BaseDao> selectActivityCountMap(@Param("customerId")String customerId, @Param("monthId")String monthId,@Param("level")String level); + /** + * @Description 社区活动组织次数 存在下级客户 + * @Param monthId + * @Param areaCode + * @author zxc + * @date 2021/1/15 下午1:53 + */ + List> selectActivityCountMapExistsSub(@Param("monthId")String monthId,@Param("areaCode")String areaCode); + /** * 根据组织类型删除数据 * @author zhaoqifeng diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java index 3b43d23c4d..de96e0abd3 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java @@ -24,6 +24,7 @@ import com.epmet.dto.extract.form.ScreenPartyLinkMassesDataFormDTO; import com.epmet.dto.extract.result.CustomerAgencyInfoResultDTO; import com.epmet.dto.extract.result.OrgNameResultDTO; import com.epmet.dto.indexcollect.form.CustomerBizOrgFormDTO; +import com.epmet.dto.screen.ScreenProjectOrgDailyDTO; import com.epmet.dto.screen.result.TreeResultDTO; import com.epmet.dto.screencoll.form.CustomerAgencyFormDTO; import com.epmet.entity.evaluationindex.screen.ScreenCustomerAgencyEntity; @@ -71,7 +72,9 @@ public interface ScreenCustomerAgencyDao extends BaseDao selectListMismatcCommunityAgencyInfo(@Param("customerId") String customerId, @Param("agencyIds") String[] agencyIds); + List selectListMismatcCommunityAgencyInfo(@Param("customerId") String customerId, @Param("agencyIds") String[] agencyIds, + @Param("customerAreaCode") String customerAreaCode, + @Param("subCustomerIds")List subCustomerIds); /** * 根据客户id,查询区/街道 组织名称、id @@ -81,7 +84,9 @@ public interface ScreenCustomerAgencyDao extends BaseDao selectListAgencyInfo(@Param("customerId") String customerId); + List selectListAgencyInfo(@Param("customerId") String customerId, + @Param("customerAreaCode") String customerAreaCode, + @Param("subCustomerIds")List subCustomerIds); /** * @param agencyId @@ -100,7 +105,9 @@ public interface ScreenCustomerAgencyDao extends BaseDao selectListMismatcStreetAndDistrictAgencyInfo(@Param("customerId") String customerId, @Param("agencyIds") String[] agencyIds); + List selectListMismatcStreetAndDistrictAgencyInfo(@Param("customerId") String customerId, @Param("agencyIds") String[] agencyIds, + @Param("customerAreaCode") String customerAreaCode, + @Param("subCustomerIds")List subCustomerIds); /** * desc:获取客户的组织条数 @@ -177,4 +184,12 @@ public interface ScreenCustomerAgencyDao extends BaseDao selectOrgNameAgency(@Param("agencyIds") List agencyIds); Boolean initBizOrg(CustomerBizOrgFormDTO formDTO); + + /** + * @Description 根据客户ID查询组织信息 + * @Param customerId + * @author zxc + * @date 2021/2/1 下午2:03 + */ + List selectAgencyByCustomer(@Param("customerId")String customerId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerDeptDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerDeptDao.java index 3a992c7ca6..5f8e0555c1 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerDeptDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerDeptDao.java @@ -57,14 +57,13 @@ public interface ScreenCustomerDeptDao extends BaseDao void batchInsertCustomerDept(@Param("list") List list, @Param("customerId")String customerId); /** - * @param customerId * @param deptId * @return com.epmet.entity.evaluationindex.screen.ScreenCustomerDeptEntity * @author yinzuomei * @description 查询部门所属组织id * @Date 2020/9/3 16:32 **/ - ScreenCustomerDeptEntity selectParentAgencyId(@Param("customerId") String customerId, @Param("deptId") String deptId); + ScreenCustomerDeptEntity selectParentAgencyId(@Param("deptId") String deptId); /** * 返回当前客户下,未匹配到的区直部门信息 @@ -76,7 +75,9 @@ public interface ScreenCustomerDeptDao extends BaseDao * @Date 10:45 2020-09-04 **/ List selectListMismatchDeptInfo(@Param("customerId") String customerId, - @Param("deptIds") String[] deptIds); + @Param("deptIds") String[] deptIds, + @Param("customerAreaCode") String customerAreaCode, + @Param("subCustomerIds")List subCustomerIds); /** * 根据客户id 查询部门 信息 @@ -85,7 +86,9 @@ public interface ScreenCustomerDeptDao extends BaseDao * @Author zhangyong * @Date 16:57 2020-09-03 **/ - List selectListDeptInfo(@Param("customerId")String customerId); + List selectListDeptInfo(@Param("customerId")String customerId, + @Param("customerAreaCode") String customerAreaCode, + @Param("subCustomerIds")List subCustomerIds); /** * 查询最后一次添加的部门 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerGridDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerGridDao.java index b0e405eace..c06e189d7c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerGridDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerGridDao.java @@ -23,6 +23,7 @@ import com.epmet.dto.extract.form.*; import com.epmet.dto.extract.result.GridInfoResultDTO; import com.epmet.dto.extract.result.OrgNameResultDTO; import com.epmet.dto.indexcal.PageQueryGridFormDTO; +import com.epmet.dto.screen.ScreenProjectGridDailyDTO; import com.epmet.dto.screencoll.form.CustomerGridFormDTO; import com.epmet.entity.evaluationindex.screen.ScreenCustomerGridEntity; import org.apache.ibatis.annotations.Mapper; @@ -88,14 +89,13 @@ public interface ScreenCustomerGridDao extends BaseDao List pageListByCustomerId(PageQueryGridFormDTO formDTO); /** - * @param customerId 客户id * @param gridId 网格id * @return java.lang.String * @author yinzuomei * @description 查询网格所属的组织id * @Date 2020/8/31 12:35 **/ - ScreenCustomerGridDTO selectParentAgencyId(@Param("customerId") String customerId, @Param("gridId") String gridId); + ScreenCustomerGridDTO selectParentAgencyId(@Param("gridId") String gridId); /** * 返回当前客户下,未匹配到的网格信息 @@ -107,7 +107,9 @@ public interface ScreenCustomerGridDao extends BaseDao * @Date 10:45 2020-09-04 **/ List selectListMismatchGridInfo(@Param("customerId") String customerId, - @Param("gridIds") String[] gridIds); + @Param("gridIds") String[] gridIds, + @Param("customerAreaCode") String customerAreaCode, + @Param("subCustomerIds")List subCustomerIds); /** * 根据客户id 查询网格(党支部)详细信息 @@ -116,7 +118,9 @@ public interface ScreenCustomerGridDao extends BaseDao * @Author zhangyong * @Date 16:57 2020-09-03 **/ - List selectListGridInfo(@Param("customerId")String customerId); + List selectListGridInfo(@Param("customerId")String customerId, + @Param("customerAreaCode") String customerAreaCode, + @Param("subCustomerIds")List subCustomerIds); /** * @Description 根据agencyId查询网格ID @@ -182,4 +186,12 @@ public interface ScreenCustomerGridDao extends BaseDao * @date 2020/9/18 10:47 上午 */ List selectAllGridInfo(@Param("customerId") String customerId); + + /** + * @Description 查询客户下的网格信息 + * @Param customerId + * @author zxc + * @date 2021/1/28 下午3:18 + */ + List selectGridInfoByCustomerId(@Param("customerId") String customerId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectGridDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectGridDailyDao.java new file mode 100644 index 0000000000..f9cbac7ffe --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectGridDailyDao.java @@ -0,0 +1,49 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.evaluationindex.screen; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.screen.ScreenProjectGridDailyDTO; +import com.epmet.entity.evaluationindex.screen.ScreenProjectGridDailyEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 项目(事件)分析按网格_按天统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-01-27 + */ +@Mapper +public interface ScreenProjectGridDailyDao extends BaseDao { + + + void insertBatch(@Param("list") List list, @Param("customerId") String customerId, @Param("createdBy") String createdBy, @Param("timeId") String timeId); + + int deleteByDateIdAndCustomerId(@Param("customerId") String customerId, @Param("dateId") String dateId); + + /** + * @Description 插入 + * @Param list + * @author zxc + * @date 2021/1/29 上午10:44 + */ + void insertScreenProjectGridDaily(@Param("list") List list); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectOrgDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectOrgDailyDao.java new file mode 100644 index 0000000000..731347f2a6 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectOrgDailyDao.java @@ -0,0 +1,50 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.evaluationindex.screen; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.pingyin.result.ProjectOrgDailyResultDTO; +import com.epmet.dto.screen.ScreenProjectOrgDailyDTO; +import com.epmet.entity.evaluationindex.screen.ScreenProjectOrgDailyEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 项目(事件)分析按组织_按天统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-01-27 + */ +@Mapper +public interface ScreenProjectOrgDailyDao extends BaseDao { + + + void insertBatch(@Param("list") List list, @Param("customerId") String customerId, @Param("createdBy") String createdBy, @Param("timeId") String timeId); + + int deleteByDateIdAndCustomerId(@Param("customerId") String customerId, @Param("dateId") String dateId); + + /** + * @Description 项目(事件)分析按组织_按天统计 + * @Param agencyInfos + * @author zxc + * @date 2021/2/1 下午3:51 + */ + List selectOrgProject(@Param("agencyInfos") List agencyInfos, @Param("dateId") String dateId); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectQuantityGridMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectQuantityGridMonthlyDao.java new file mode 100644 index 0000000000..13b8c56630 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectQuantityGridMonthlyDao.java @@ -0,0 +1,41 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.evaluationindex.screen; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.screen.ScreenProjectQuantityGridMonthlyDTO; +import com.epmet.entity.evaluationindex.screen.ScreenProjectQuantityGridMonthlyEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 项目(事件)数量分析按网格_按月统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-01-27 + */ +@Mapper +public interface ScreenProjectQuantityGridMonthlyDao extends BaseDao { + + void insertBatch(@Param("list") List list, @Param("customerId") String customerId, @Param("createdBy") String createdBy, @Param("timeId") String timeId); + + int deleteByMonthIdAndCustomerId(@Param("customerId") String customerId, @Param("monthId") String monthId); + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectQuantityOrgMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectQuantityOrgMonthlyDao.java new file mode 100644 index 0000000000..a11d394821 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectQuantityOrgMonthlyDao.java @@ -0,0 +1,63 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.evaluationindex.screen; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.pingyin.result.ProjectOrgMonthlyResultDTO; +import com.epmet.dto.screen.ScreenProjectQuantityOrgMonthlyDTO; +import com.epmet.entity.evaluationindex.screen.ScreenProjectQuantityOrgMonthlyEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 项目(事件)数量分析按组织_按月统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-01-27 + */ +@Mapper +public interface ScreenProjectQuantityOrgMonthlyDao extends BaseDao { + + + void insertBatch(@Param("list") List list, @Param("customerId") String customerId, @Param("createdBy") String createdBy, @Param("timeId") String timeId); + + int deleteByMonthIdAndCustomerId(@Param("customerId") String customerId, @Param("monthId") String monthId); + + /** + * @Description 项目(事件)数量查询【当月】 + * @Param agencyInfos + * @Param customerId + * @Param monthId + * @author zxc + * @date 2021/2/2 上午11:09 + */ + List selectQuantityOrgMonthly(@Param("agencyInfos") List agencyInfos, @Param("monthId") String monthId); + + /** + * @Description 项目(事件)数量查询【本月之前的累计】 + * @Param agencyInfos + * @Param monthId + * @author zxc + * @date 2021/2/2 下午3:03 + */ + List selectQuantityGrandOrgMonthly(@Param("agencyInfos") List agencyInfos, @Param("monthId") String monthId); + + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/StatsCustomerAgencyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/StatsCustomerAgencyDao.java index eb02051e91..9c1217bd02 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/StatsCustomerAgencyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/StatsCustomerAgencyDao.java @@ -2,6 +2,7 @@ package com.epmet.dao.org; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.AgencySubTreeDto; +import com.epmet.dto.org.result.CustomerAreaCodeResultDTO; import com.epmet.entity.org.CustomerAgencyEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -22,4 +23,12 @@ public interface StatsCustomerAgencyDao extends BaseDao { List selectSubAgencyByPid(@Param("pid")String pid); List listAgenciesByUpdatedTime(@Param("startTime") Date startTime, @Param("endTime") Date endTime); + + /** + * @Description 查询客户所属区域编码 + * @Param customerIds + * @author zxc + * @date 2021/1/14 上午11:07 + */ + List selectCustomerAreaCodeById(@Param("customerIds") List customerIds); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/plugins/ScreenBidInfoDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/plugins/ScreenBidInfoDao.java new file mode 100644 index 0000000000..b269279cfb --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/plugins/ScreenBidInfoDao.java @@ -0,0 +1,40 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.plugins; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.plugins.BidFormDTO; +import com.epmet.entity.plugins.ScreenBidInfoEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 146:竞标管理 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-01-22 + */ +@Mapper +public interface ScreenBidInfoDao extends BaseDao { + + int deleteBatch(@Param("customerId") String customerId); + + void insertBatch(@Param("list") List list, @Param("customerId") String customerId, @Param("dateId") String dateId); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/plugins/ScreenContractInfoDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/plugins/ScreenContractInfoDao.java new file mode 100644 index 0000000000..c24ae1026e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/plugins/ScreenContractInfoDao.java @@ -0,0 +1,40 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.plugins; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.plugins.ContractFormDTO; +import com.epmet.entity.plugins.ScreenContractInfoEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 146:合同基本信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-01-22 + */ +@Mapper +public interface ScreenContractInfoDao extends BaseDao { + + int deleteBatch(@Param("customerId") String customerId); + + void insertBatch(@Param("list") List list, @Param("customerId") String customerId, @Param("dateId") String dateId); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/plugins/ScreenCustomerWorkRecordDictDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/plugins/ScreenCustomerWorkRecordDictDao.java new file mode 100644 index 0000000000..9a1cd92056 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/plugins/ScreenCustomerWorkRecordDictDao.java @@ -0,0 +1,41 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.plugins; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.plugins.ScreenCustomerWorkRecordDictDTO; +import com.epmet.entity.plugins.ScreenCustomerWorkRecordDictEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 工作日志资源字典表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-02-04 + */ +@Mapper +public interface ScreenCustomerWorkRecordDictDao extends BaseDao { + + int deleteBatch(@Param("customerId") String customerId); + + void insertBatch(@Param("list") List list,@Param("customerId") String customerId,@Param("dateId") String dateId); + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/plugins/ScreenListInfoDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/plugins/ScreenListInfoDao.java new file mode 100644 index 0000000000..45627c662b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/plugins/ScreenListInfoDao.java @@ -0,0 +1,40 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.plugins; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.plugins.OneListFormDTO; +import com.epmet.entity.plugins.ScreenListInfoEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 146:一张清单列表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-01-22 + */ +@Mapper +public interface ScreenListInfoDao extends BaseDao { + + int deleteBatch(@Param("customerId") String customerId); + + void insertBatch(@Param("list") List list, @Param("customerId") String customerId, @Param("dateId") String dateId); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/plugins/ScreenWorkRecordOrgMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/plugins/ScreenWorkRecordOrgMonthlyDao.java new file mode 100644 index 0000000000..ccf7baed54 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/plugins/ScreenWorkRecordOrgMonthlyDao.java @@ -0,0 +1,42 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.plugins; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.plugins.ScreenWorkRecordOrgMonthlyDTO; +import com.epmet.entity.plugins.ScreenWorkRecordOrgMonthlyEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 工作日志-组织按月统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-02-04 + */ +@Mapper +public interface ScreenWorkRecordOrgMonthlyDao extends BaseDao { + + int deleteBatch(@Param("customerId") String customerId, @Param("monthId") String monthId); + + void insertBatch(@Param("list") List list, @Param("customerId") String customerId, @Param("monthId") String monthId); + + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/crm/CustomerEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/crm/CustomerEntity.java index a2fa408a43..c6dc6dba64 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/crm/CustomerEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/crm/CustomerEntity.java @@ -17,6 +17,7 @@ package com.epmet.entity.crm; +import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableName; import com.epmet.commons.mybatis.entity.BaseEpmetEntity; @@ -88,4 +89,6 @@ public class CustomerEntity extends BaseEpmetEntity { */ private String logo; + @TableField(exist = false) + private String areaCode; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/crm/CustomerRelationEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/crm/CustomerRelationEntity.java new file mode 100644 index 0000000000..9de6f223d2 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/crm/CustomerRelationEntity.java @@ -0,0 +1,81 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.crm; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 客户关系表(01.14 add) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-01-14 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("customer_relation") +public class CustomerRelationEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 父级客户id;如果是顶级客户,此列=0 + */ + private String parentCustomerId; + + /** + * 当前客户的所有父级客户id,以英文冒号隔开,如果是顶级客户,此列=0 + */ + private String pids; + + /** + * 当前客户类型取值: external:外部客户,internal:内部客户 + */ + private String customerType; + + /** + * 父级客户类型取值: external:外部客户,internal:内部客户;如果是顶级客户,此列=0 + */ + private String parentCustomerType; + + /** + * open,closed是否启用 + */ + private String status; + + /** + * 当前客户级别(社区级:community, + * 乡(镇、街道)级:street, + * 区县级: district, + * 市级: city + * 省级:province) + */ + private String level; + + /** + * 当前客户的地区编码,实际就是根组织的area_code + */ + private String areaCode; +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/FactIndexGovrnAblityDeptMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/FactIndexGovrnAblityDeptMonthlyEntity.java index 47501f13f4..e1d90758ee 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/FactIndexGovrnAblityDeptMonthlyEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/FactIndexGovrnAblityDeptMonthlyEntity.java @@ -25,7 +25,7 @@ import lombok.EqualsAndHashCode; import java.math.BigDecimal; /** - * 治理能力-部门相关数据 + * 治理能力-部门相关数据 * * @author generator generator@elink-cn.com * @since v1.0.0 2020-08-20 @@ -97,4 +97,51 @@ public class FactIndexGovrnAblityDeptMonthlyEntity extends BaseEpmetEntity { */ private BigDecimal satisfactionRatio; + /** + * V2升级新增字段, 详见说明文档 + * 2020-01-07 + */ + private BigDecimal respProjectRatioFz; + + /** + * V2升级新增字段, 详见说明文档 + * 2020-01-07 + */ + private BigDecimal respProjectRatioFm; + + /** + * V2升级新增字段, 详见说明文档 + * 2020-01-07 + */ + private BigDecimal handleProjectRatioFz; + + /** + * V2升级新增字段, 详见说明文档 + * 2020-01-07 + */ + private BigDecimal handleProjectRatioFm; + + /** + * V2升级新增字段, 详见说明文档 + * 2020-01-07 + */ + private BigDecimal closedProjectRatioFz; + + /** + * V2升级新增字段, 详见说明文档 + * 2020-01-07 + */ + private BigDecimal closedProjectRatioFm; + + /** + * V2升级新增字段, 详见说明文档 + * 2020-01-07 + */ + private BigDecimal satisfactionRatioFz; + + /** + * V2升级新增字段, 详见说明文档 + * 2020-01-07 + */ + private BigDecimal satisfactionRatioFm; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyEntity.java index 7b0c61a9fd..e8e9177ed1 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyEntity.java @@ -25,7 +25,7 @@ import lombok.EqualsAndHashCode; import java.math.BigDecimal; /** - * 治理能力-网格相关事实表 + * 治理能力-网格相关事实表 * * @author generator generator@elink-cn.com * @since v1.0.0 2020-08-20 @@ -107,4 +107,39 @@ public class FactIndexGovrnAblityGridMonthlyEntity extends BaseEpmetEntity { */ private BigDecimal satisfactionRatio; + /** + * V2升级新增字段, 详见说明文档 + * 2020-01-07 + */ + private BigDecimal transferRightRatioFz; + + /** + * V2升级新增字段, 详见说明文档 + * 2020-01-07 + */ + private BigDecimal transferRightRatioFm; + + /** + * V2升级新增字段, 详见说明文档 + * 2020-01-07 + */ + private BigDecimal satisfactionRatioFz; + + /** + * V2升级新增字段, 详见说明文档 + * 2020-01-07 + */ + private BigDecimal satisfactionRatioFm; + + /** + * V2升级新增字段, 详见说明文档 + * 2020-01-07 + */ + private BigDecimal issueToProjectRatioFz; + + /** + * V2升级新增字段, 详见说明文档 + * 2020-01-07 + */ + private BigDecimal issueToProjectRatioFm; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyEntity.java index fe8ee990b8..90a8245ab5 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyEntity.java @@ -106,4 +106,64 @@ public class FactIndexGovrnAblityOrgMonthlyEntity extends BaseEpmetEntity { * 街道办结项目的处理效率, data_type=street时有值 */ private BigDecimal handleProjectRatio; + + /** + * V2升级新增字段, 详见说明文档 + * 2020-01-07 + */ + private BigDecimal respProjectRatioFz; + + /** + * V2升级新增字段, 详见说明文档 + * 2020-01-07 + */ + private BigDecimal respProjectRatioFm; + + /** + * V2升级新增字段, 详见说明文档 + * 2020-01-07 + */ + private BigDecimal closedProjectRatioFz; + + /** + * V2升级新增字段, 详见说明文档 + * 2020-01-07 + */ + private BigDecimal closedProjectRatioFm; + + /** + * V2升级新增字段, 详见说明文档 + * 2020-01-07 + */ + private BigDecimal satisfactionRatioFz; + + /** + * V2升级新增字段, 详见说明文档 + * 2020-01-07 + */ + private BigDecimal satisfactionRatioFm; + + /** + * V2升级新增字段, 详见说明文档 + * 2020-01-07 + */ + private BigDecimal overdueProjectRatioFz; + + /** + * V2升级新增字段, 详见说明文档 + * 2020-01-07 + */ + private BigDecimal overdueProjectRatioFm; + + /** + * V2升级新增字段, 详见说明文档 + * 2020-01-07 + */ + private BigDecimal handleProjectRatioFz; + + /** + * V2升级新增字段, 详见说明文档 + * 2020-01-07 + */ + private BigDecimal handleProjectRatioFm; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/FactIndexPartyAblityGridMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/FactIndexPartyAblityGridMonthlyEntity.java index b38d4c4d7a..c19656db68 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/FactIndexPartyAblityGridMonthlyEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/FactIndexPartyAblityGridMonthlyEntity.java @@ -25,7 +25,7 @@ import lombok.EqualsAndHashCode; import java.math.BigDecimal; /** - * 党建能力-网格相关事实表 + * 党建能力-网格相关事实表 * * @author generator generator@elink-cn.com * @since v1.0.0 2020-08-20 @@ -132,4 +132,16 @@ public class FactIndexPartyAblityGridMonthlyEntity extends BaseEpmetEntity { */ private Integer joinThreeMeetsCount; + + /** + * V2升级字段:issueToProjectRatio的分子:评价周期内转为项目的数量 + * 2020-01-07 新增 + */ + private Integer shiftedProjectTotal; + + /** + * V2升级字段:issueToProjectRatio的分母:评价周期内网格内居民提出的议题数目 + * 2020-01-07 新增 + */ + private Integer issueTotal; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/FactIndexServiceAblityGridMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/FactIndexServiceAblityGridMonthlyEntity.java index fedcaf1637..c296fb4a42 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/FactIndexServiceAblityGridMonthlyEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcoll/FactIndexServiceAblityGridMonthlyEntity.java @@ -82,4 +82,27 @@ public class FactIndexServiceAblityGridMonthlyEntity extends BaseEpmetEntity { */ private BigDecimal partyVolunteerRatio; + /** + * V2升级字段:partyVolunteerRatio的分子:网格党员志愿者数 + * 2020-01-07 + */ + private Integer partyVolunteerTotal; + + /** + * V2升级字段:partyVolunteerRatio的分母:志愿者总数 + * 2020-01-07 + */ + private Integer volunteerTotal; + + /** + * V2升级字段:volunteerRatio的分子:居民且注册志愿者的总人数 + * 2020-01-07 + */ + private Integer volunteerUserTotal; + + /** + * V2升级字段:volunteerRatio的分母:网格内注册居民数 + * 2020-01-07 + */ + private Integer regUserTotal; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenCustomerAgencyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenCustomerAgencyEntity.java index 46903b52b5..ba06221d17 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenCustomerAgencyEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenCustomerAgencyEntity.java @@ -105,4 +105,13 @@ public class ScreenCustomerAgencyEntity extends BaseEpmetEntity { */ private String isDisplay; + /** + * desc: 是否参与上级计算yes:参与;no:不参与 add 01.14 + */ + private String upToCal; + + /** + * 当前组织的上级行政地区编码add0204;举例平阴县370124对应的是济南市3701 + */ + private String parentAreaCode; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenCustomerDeptEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenCustomerDeptEntity.java index 474243815a..d8adca7a34 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenCustomerDeptEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenCustomerDeptEntity.java @@ -77,4 +77,14 @@ public class ScreenCustomerDeptEntity extends BaseEpmetEntity { private String sourceType; + /** + * V2升级必传参数:当前网格所属行政地区编码,去除末尾0 + * 2020-01-07 + */ + private String areaCode; + + /** + * desc: 是否参与上级计算yes:参与;no:不参与 add 01.14 + */ + private String upToCal; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenCustomerGridEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenCustomerGridEntity.java index 0b98a125eb..4a0d8e53c8 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenCustomerGridEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenCustomerGridEntity.java @@ -81,4 +81,15 @@ public class ScreenCustomerGridEntity extends BaseEpmetEntity { private String allParentIds; private String sourceType; + + /** + * V2升级必传参数:当前网格所属行政地区编码,去除末尾0 + * 2020-01-07 + */ + private String areaCode; + + /** + * desc: 是否参与上级计算yes:参与;no:不参与 add 01.14 + */ + private String upToCal; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectGridDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectGridDailyEntity.java new file mode 100644 index 0000000000..485e9e9d41 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectGridDailyEntity.java @@ -0,0 +1,105 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.evaluationindex.screen; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; + +/** + * 项目(事件)分析按网格_按天统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-01-27 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("screen_project_grid_daily") +public class ScreenProjectGridDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 日期yyyyMMdd + */ + private String dateId; + + /** + * 网格id + */ + private String gridId; + + /** + * 网格所属的组织id + */ + private String pid; + + /** + * 网格所有的父级id,以英文:或者英文,隔开 + */ + private String pids; + + /** + * 截止到当前日期,网格内项目总数 + */ + private Integer projectTotal; + + /** + * 截止到当前日期,网格内已解决的项目总数 + */ + private Integer resolvedNum; + + /** + * 解决率=RESOLVED_NUM/PROJECT_TOTAL,存储小数即可,保留小数点后4位 + */ + private BigDecimal resolvedRatio; + + /** + * 对当前网格内项目,参与满意度评价的总次数 + */ + private Integer evaluateTotal; + + /** + * 对当前网格内项目,满意+非常满意的总次数 + */ + private Integer goodTotal; + + /** + * 对当前网格内项目,不满意总次数 + */ + private Integer badTotal; + + /** + * 满意率=good_total/evaluate_total + */ + private BigDecimal goodRatio; + + /** + * 不满意率=bad_total/evaluate_total + */ + private BigDecimal badRatio; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectOrgDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectOrgDailyEntity.java new file mode 100644 index 0000000000..59dada8436 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectOrgDailyEntity.java @@ -0,0 +1,110 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.evaluationindex.screen; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; + +/** + * 项目(事件)分析按组织_按天统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-01-27 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("screen_project_org_daily") +public class ScreenProjectOrgDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 日期yyyyMMdd + */ + private String dateId; + + /** + * 组织id + */ + private String orgId; + + /** + * 社区级:community,乡(镇、街道)级:street,区县级: district,市级: city省级:province + */ + private String orgType; + + /** + * 当前orgId所属的上级id + */ + private String pid; + + /** + * orgId所有的父级id,以英文:或者英文,隔开 + */ + private String pids; + + /** + * 截止到当前日期,网格内项目总数 + */ + private Integer projectTotal; + + /** + * 截止到当前日期,网格内已解决的项目总数 + */ + private Integer resolvedNum; + + /** + * 解决率=RESOLVED_NUM/PROJECT_TOTAL,存储小数即可,保留小数点后4位 + */ + private BigDecimal resolvedRatio; + + /** + * 对当前组织内项目,参与满意度评价的总次数 + */ + private Integer evaluateTotal; + + /** + * 对当前组织内项目,满意+非常满意的总次数 + */ + private Integer goodTotal; + + /** + * 对当前组织内项目,不满意总次数 + */ + private Integer badTotal; + + /** + * 满意率=good_total/evaluate_total + */ + private BigDecimal goodRatio; + + /** + * 不满意率=bad_total/evaluate_total + */ + private BigDecimal badRatio; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectQuantityGridMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectQuantityGridMonthlyEntity.java new file mode 100644 index 0000000000..03e3183037 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectQuantityGridMonthlyEntity.java @@ -0,0 +1,88 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.evaluationindex.screen; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 项目(事件)数量分析按网格_按月统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-01-27 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("screen_project_quantity_grid_monthly") +public class ScreenProjectQuantityGridMonthlyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 日期yyyyMMdd + */ + private String monthId; + + /** + * 网格id + */ + private String gridId; + + /** + * 网格所属的组织id + */ + private String pid; + + /** + * 网格所有的父级id,以英文:或者英文,隔开 + */ + private String pids; + + /** + * 当前网格,本月新增的项目数量:转项目日期在当前月份内 + */ + private Integer projectIncr; + + /** + * 截止到当前月份:累计项目总数 + */ + private Integer projectTotal; + + /** + * 截止到当前月份:累计未结项目总数 + */ + private Integer unClosedTotal; + + /** + * 截止到当前月份:累计已结项目 + */ + private Integer closedTotal; + + /** + * 本月新增结案项目数 + */ + private Integer closedIncr; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectQuantityOrgMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectQuantityOrgMonthlyEntity.java new file mode 100644 index 0000000000..4d798ad314 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectQuantityOrgMonthlyEntity.java @@ -0,0 +1,93 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.evaluationindex.screen; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 项目(事件)数量分析按组织_按月统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-01-27 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("screen_project_quantity_org_monthly") +public class ScreenProjectQuantityOrgMonthlyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 日期yyyyMMdd + */ + private String monthId; + + /** + * 组织id + */ + private String orgId; + + /** + * 社区级:community,乡(镇、街道)级:street,区县级: district,市级: city省级:province + */ + private String orgType; + + /** + * 当前orgId所属的上级id + */ + private String pid; + + /** + * orgId所有的父级id,以英文:或者英文,隔开 + */ + private String pids; + + /** + * 当前组织内,本月新增的项目数量:转项目日期在当前月份内 + */ + private Integer projectIncr; + + /** + * 截止到当前月份:累计项目总数 + */ + private Integer projectTotal; + + /** + * 截止到当前月份:累计未结项目总数 + */ + private Integer unClosedTotal; + + /** + * 截止到当前月份:累计已结项目 + */ + private Integer closedTotal; + + /** + * 本月新增结案项目数 + */ + private Integer closedIncr; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/org/CustomerAgencyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/org/CustomerAgencyEntity.java index 7381034578..eaf0c0d52a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/org/CustomerAgencyEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/org/CustomerAgencyEntity.java @@ -94,4 +94,8 @@ public class CustomerAgencyEntity extends BaseEpmetEntity { */ private String district; + /** + * 当前组织的上级行政地区编码add0204;举例平阴县370124对应的是济南市3701 + */ + private String parentAreaCode; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/org/CustomerDepartmentEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/org/CustomerDepartmentEntity.java index 0f46e25ffd..7e3f481d11 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/org/CustomerDepartmentEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/org/CustomerDepartmentEntity.java @@ -60,4 +60,8 @@ public class CustomerDepartmentEntity extends BaseEpmetEntity { */ private Integer totalUser; + /** + * 扩展属性:V2升级必传参数:当前部门所属行政地区编码,来源于部门所属组织的地区编码 + */ + private String areaCode; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/plugins/ScreenBidInfoEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/plugins/ScreenBidInfoEntity.java new file mode 100644 index 0000000000..c9d8658f10 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/plugins/ScreenBidInfoEntity.java @@ -0,0 +1,91 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.plugins; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 146:竞标管理 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-01-22 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("screen_bid_info") +public class ScreenBidInfoEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 截止日期eg:20200101 + */ + private String dateId; + + /** + * 竞标项目id + */ + private String bidId; + + /** + * 竞标项目名称 + */ + private String bidName; + + /** + * 状态编码 + */ + private String statusCode; + + /** + * 状态描述eg:已中标、未中标、投标中、 + */ + private String statusDesc; + + /** + * 金额单位万元 + */ + private Double amount; + + /** + * 发布时间 + */ + private Date releaseTime; + + /** + * 发布村镇,以英文逗号隔开 + */ + private String townIds; + + /** + * 发布村镇名称,以英文逗号隔开 + */ + private String townNames; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/plugins/ScreenContractInfoEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/plugins/ScreenContractInfoEntity.java new file mode 100644 index 0000000000..6d7d69ce3e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/plugins/ScreenContractInfoEntity.java @@ -0,0 +1,86 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.plugins; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 146:合同基本信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-01-22 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("screen_contract_info") +public class ScreenContractInfoEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 截止日期eg:20200101 + */ + private String dateId; + + /** + * 合同id + */ + private String contractId; + + /** + * 合同名称 + */ + private String contractName; + + /** + * 合同所属类别编码 + */ + private String categoryCode; + + /** + * 合同所属类别名称 + */ + private String categoryName; + + /** + * 合同到期日期:2020-12-31 + */ + private Date dueDate; + + /** + * 发布村镇,以英文逗号隔开 + */ + private String townIds; + + /** + * 发布村镇名称,以英文逗号隔开 + */ + private String townNames; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/plugins/ScreenCustomerWorkRecordDictEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/plugins/ScreenCustomerWorkRecordDictEntity.java new file mode 100644 index 0000000000..067a349205 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/plugins/ScreenCustomerWorkRecordDictEntity.java @@ -0,0 +1,96 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.plugins; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 工作日志资源字典表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-02-04 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("screen_customer_work_record_dict") +public class ScreenCustomerWorkRecordDictEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 数据更新至日期eg:20200101 + */ + private String dateId; + + /** + * 资源id + */ + private String dictId; + + /** + * 父资源ID;如果是一级分类pid=0 + */ + private String pid; + + /** + * 资源类型 + */ + private String resourceType; + + /** + * 资源编码 + */ + private String resourceCode; + + /** + * 资源标签名 + */ + private String resourceLabel; + + /** + * 显示标识:0否,1是 + */ + private String showFlag; + + /** + * 排序 + */ + private Integer sort; + + /** + * 数据类别 :party:支部建设; union:联合建设;党员志愿服务:voluntaryservice;所有的一级分类需要对应到这三个key中 + */ + private String dataType; + + /** + * 当前资源属于几级,例如:1、2、3、4.... + */ + private Integer level; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/plugins/ScreenListInfoEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/plugins/ScreenListInfoEntity.java new file mode 100644 index 0000000000..08e7c7e7ff --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/plugins/ScreenListInfoEntity.java @@ -0,0 +1,68 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.plugins; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 146:一张清单列表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-01-22 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("screen_list_info") +public class ScreenListInfoEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 截止日期eg:20200101 + */ + private String dateId; + + /** + * 清单id + */ + private String listId; + + /** + * 清单编码 + */ + private String listCode; + + /** + * 名称 + */ + private String listName; + + /** + * 排序 + */ + private Integer sort; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/plugins/ScreenWorkRecordOrgMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/plugins/ScreenWorkRecordOrgMonthlyEntity.java new file mode 100644 index 0000000000..a7bf893b08 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/plugins/ScreenWorkRecordOrgMonthlyEntity.java @@ -0,0 +1,78 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.plugins; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 工作日志-组织按月统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-02-04 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("screen_work_record_org_monthly") +public class ScreenWorkRecordOrgMonthlyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 月份Id:yyyyMM + */ + private String monthId; + + /** + * 组织Id + */ + private String orgId; + + /** + * 会议类型编码;对应screen_customer_work_record_dict的资源编码 + */ + private String meetingCode; + + /** + * 随手记类型编码;对应screen_customer_work_record_dict的资源编码 + */ + private String typeCode; + + /** + * 组织次数 + */ + private Integer organizeTotal; + + /** + * 参与人数 + */ + private Integer participateUserTotal; + + /** + * 平均参与人数 + */ + private Integer avgParticipateUserTotal; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimCustomerEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimCustomerEntity.java index a287006414..ef839eca62 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimCustomerEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimCustomerEntity.java @@ -43,4 +43,9 @@ public class DimCustomerEntity extends BaseEpmetEntity { */ private String customerName; + /** + * 客户所属行政地区编码,取值来自客户根组织的area_code(01.14 add) + */ + private String areaCode; + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/crm/CustomerRelationService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/crm/CustomerRelationService.java new file mode 100644 index 0000000000..25e3272436 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/crm/CustomerRelationService.java @@ -0,0 +1,44 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.crm; + + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.dto.indexcal.CustomerSubInfoDTO; +import com.epmet.entity.crm.CustomerRelationEntity; + +import java.util.List; +import java.util.Map; + +/** + * 客户关系表(01.14 add) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-01-14 + */ +public interface CustomerRelationService extends BaseService { + + /** + * @return java.util.Map + * @param customerIds + * @author yinzuomei + * @description 查询每个客户的area_code、以及下一级客户列表 + * @Date 2021/1/14 16:22 + **/ + Map getCustomerInfoMap(List customerIds); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/crm/impl/CustomerRelationServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/crm/impl/CustomerRelationServiceImpl.java new file mode 100644 index 0000000000..9b6c4ab7f1 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/crm/impl/CustomerRelationServiceImpl.java @@ -0,0 +1,61 @@ +/** + * 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.service.crm.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.constant.DataSourceConstant; +import com.epmet.dao.crm.CustomerRelationDao; +import com.epmet.dto.indexcal.CustomerSubInfoDTO; +import com.epmet.entity.crm.CustomerRelationEntity; +import com.epmet.service.crm.CustomerRelationService; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * 客户关系表(01.14 add) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-01-14 + */ +@DataSource(DataSourceConstant.STATS) +@Service +public class CustomerRelationServiceImpl extends BaseServiceImpl implements CustomerRelationService { + + + /** + * @param customerIds + * @return java.util.Map + * @author yinzuomei + * @description 查询每个客户的area_code、以及下一级客户列表 + * @Date 2021/1/14 16:22 + **/ + @Override + public Map getCustomerInfoMap(List customerIds) { + List list = baseDao.selectCustomerSubInfo(customerIds); + if(CollectionUtils.isEmpty(list)){ + return new HashMap<>(); + } + return list.stream().collect(Collectors.toMap(CustomerSubInfoDTO::getCustomerId, customer -> customer)); + } +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java index 8b7e1ae06c..3cb5f6e0e7 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java @@ -24,6 +24,7 @@ import com.epmet.dto.extract.result.GridProjectClosedTotalResultDTO; import com.epmet.dto.extract.result.OrgStatisticsResultDTO; import com.epmet.dto.extract.result.TransferRightRatioResultDTO; import com.epmet.dto.indexcollect.result.CpcIndexCommonDTO; +import com.epmet.dto.pingyin.result.*; import com.epmet.dto.screen.form.ProjectSourceMapFormDTO; import com.epmet.entity.evaluationindex.extract.FactOriginProjectMainDailyEntity; import com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity; @@ -263,4 +264,59 @@ public interface FactOriginProjectMainDailyService extends BaseService getNewProject(String customerId, List list); + + /** + * @Description 查询项目总数 + * @Param customerId + * @Param dateId + * @author zxc + * @date 2021/1/28 下午3:59 + */ + List selectProjectTotal(String customerId,String dateId,String monthId); + + /** + * @Description 查询已解决项目数 + * @Param customerId + * @Param dateId + * @author zxc + * @date 2021/1/28 下午4:15 + */ + List selectResolvedNum(String customerId, String dateId); + + /** + * @Description 查询 满意度评价次数 + * @Param customerId + * @Param dateId + * @author zxc + * @date 2021/1/29 上午9:10 + */ + List selectEvaluateCount(String customerId, String dateId,List activeCodes); + + /** + * @Description 查询本月新增项目数 + * @Param customerId + * @Param monthId + * @author zxc + * @date 2021/1/29 下午2:29 + */ + List selectProjectIncr(String customerId, String monthId); + + /** + * @Description 根据状态查询项目数 + * @Param customerId + * @Param monthId + * @Param status + * @author zxc + * @date 2021/1/29 下午3:25 + */ + List selectProjectCount(String customerId, String monthId, String status); + + /** + * @Description 本月新增结案项目数 + * @Param customerId + * @Param monthId + * @author zxc + * @date 2021/2/1 上午9:24 + */ + List selectClosedIncr(String customerId, String monthId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java index bdc82b519d..c5aaa76daa 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java @@ -32,6 +32,7 @@ import com.epmet.dto.extract.result.GridProjectClosedTotalResultDTO; import com.epmet.dto.extract.result.OrgStatisticsResultDTO; import com.epmet.dto.extract.result.TransferRightRatioResultDTO; import com.epmet.dto.indexcollect.result.CpcIndexCommonDTO; +import com.epmet.dto.pingyin.result.*; import com.epmet.dto.screen.form.ProjectSourceMapFormDTO; import com.epmet.entity.evaluationindex.extract.FactOriginProjectMainDailyEntity; import com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity; @@ -41,6 +42,7 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Map; @@ -259,4 +261,101 @@ public class FactOriginProjectMainDailyServiceImpl extends BaseServiceImpl getNewProject(String customerId, List list) { return baseDao.selectNewProject(customerId,list); } + + /** + * @Description 查询项目总数 + * @Param customerId + * @Param dateId + * @author zxc + * @date 2021/1/28 下午3:59 + */ + @Override + public List selectProjectTotal(String customerId, String dateId,String monthId) { + if (StringUtils.isNotBlank(customerId)){ + List projectTotalResultDTOS = baseDao.selectProjectTotal(customerId, dateId, monthId); + return projectTotalResultDTOS; + } + return new ArrayList<>(); + } + + /** + * @Description 查询已解决项目数 + * @Param customerId + * @Param dateId + * @author zxc + * @date 2021/1/28 下午4:15 + */ + @Override + public List selectResolvedNum(String customerId, String dateId) { + if (StringUtils.isNotBlank(customerId) && StringUtils.isNotBlank(dateId)){ + List resolvedNumResultDTOS = baseDao.selectResolvedNum(customerId, dateId); + return resolvedNumResultDTOS; + } + return new ArrayList<>(); + } + + /** + * @Description 查询 满意度评价次数 + * @Param customerId + * @Param dateId + * @author zxc + * @date 2021/1/29 上午9:10 + */ + @Override + public List selectEvaluateCount(String customerId, String dateId, List activeCodes) { + if (StringUtils.isNotBlank(customerId) && StringUtils.isNotBlank(dateId) && !CollectionUtils.isEmpty(activeCodes)){ + List evaluateTotalResultDTOS = baseDao.selectEvaluateCount(customerId, dateId, activeCodes); + return evaluateTotalResultDTOS; + } + return new ArrayList<>(); + } + + /** + * @Description 查询本月新增项目数 + * @Param customerId + * @Param monthId + * @author zxc + * @date 2021/1/29 下午2:29 + */ + @Override + public List selectProjectIncr(String customerId, String monthId) { + if (StringUtils.isNotBlank(customerId) && StringUtils.isNotBlank(monthId)){ + List projectIncrResultDTOS = baseDao.selectProjectIncr(customerId, monthId); + return projectIncrResultDTOS; + } + return new ArrayList<>(); + } + + /** + * @Description 根据状态查询项目数 + * @Param customerId + * @Param monthId + * @Param status + * @author zxc + * @date 2021/1/29 下午3:25 + */ + @Override + public List selectProjectCount(String customerId, String monthId, String status) { + if (StringUtils.isNotBlank(customerId) && StringUtils.isNotBlank(monthId)){ + List resultDTOS = baseDao.selectProjectCount(customerId, monthId, status); + return resultDTOS; + } + return new ArrayList<>(); + } + + /** + * @Description 本月新增结案项目数 + * @Param customerId + * @Param monthId + * @author zxc + * @date 2021/2/1 上午9:24 + */ + @Override + public List selectClosedIncr(String customerId, String monthId) { + if (StringUtils.isNotBlank(customerId) && StringUtils.isNotBlank(monthId)){ + List result = baseDao.selectClosedIncr(customerId, monthId); + return result; + } + return new ArrayList<>(); + } } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/IndexCalculateCommunityService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/IndexCalculateCommunityService.java index 09d344dd47..cf1e5f19eb 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/IndexCalculateCommunityService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/IndexCalculateCommunityService.java @@ -1,5 +1,7 @@ package com.epmet.service.evaluationindex.indexcal; +import com.epmet.dto.indexcal.CalculateCommonFormDTO; + /** * @Author zxc * @DateTime 2020/8/26 10:33 上午 @@ -8,10 +10,9 @@ public interface IndexCalculateCommunityService { /** * @Description 计算社区相关总分 - * @param customerId - * @param monthId + * @param formDTO * @author zxc * @date 2020/9/1 4:12 下午 */ - Boolean calCommunityAll(String customerId, String monthId); + Boolean calCommunityAll(CalculateCommonFormDTO formDTO); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/IndexCalculateDistrictService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/IndexCalculateDistrictService.java index 0e8ce09ccf..0ece36742b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/IndexCalculateDistrictService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/IndexCalculateDistrictService.java @@ -1,5 +1,7 @@ package com.epmet.service.evaluationindex.indexcal; +import com.epmet.dto.indexcal.CalculateCommonFormDTO; + /** * @Author zxc * @DateTime 2020/9/4 9:03 上午 @@ -8,11 +10,10 @@ public interface IndexCalculateDistrictService { /** * @Description 计算全区相关总分 - * @param customerId - * @param monthId + * @param form * @author zxc * @date 2020/9/2 3:12 下午 */ - Boolean calDistrictAll(String customerId, String monthId); + Boolean calDistrictAll(CalculateCommonFormDTO form); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/IndexCalculateStreetService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/IndexCalculateStreetService.java index c27b6db508..2e44de4a4e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/IndexCalculateStreetService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/IndexCalculateStreetService.java @@ -1,5 +1,7 @@ package com.epmet.service.evaluationindex.indexcal; +import com.epmet.dto.indexcal.CalculateCommonFormDTO; + /** * @Author zxc * @DateTime 2020/9/2 3:11 下午 @@ -8,11 +10,10 @@ public interface IndexCalculateStreetService { /** * @Description 计算街道相关总分 - * @param customerId - * @param monthId + * @param form * @author zxc * @date 2020/9/2 3:12 下午 */ - Boolean calStreetAll(String customerId, String monthId); + Boolean calStreetAll(CalculateCommonFormDTO form); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/CpcIndexCalculateServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/CpcIndexCalculateServiceImpl.java index b2e0158aa4..d52c6891c5 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/CpcIndexCalculateServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/CpcIndexCalculateServiceImpl.java @@ -201,7 +201,7 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { private void calculatePartScore(CalculateCommonFormDTO formDTO) { //计算最大最小值 - Map minAndMaxMap = factIndexPartyAblityCpcMonthlyDao.getExtremeValue(formDTO.getCustomerId(), formDTO.getMonthId()); + Map minAndMaxMap = factIndexPartyAblityCpcMonthlyDao.getExtremeValue(formDTO); if (CollectionUtils.isEmpty(minAndMaxMap)) { log.warn("cpcIndexCalculate getExtremeValue customerId:{} have not any fact record", formDTO.getCustomerId()); return; @@ -219,7 +219,8 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { List> list = null; groupIndexDetailsMap.keySet().forEach(indexCode -> deleteOldData(formDTO, indexCode)); do { - list = factIndexPartyAblityCpcMonthlyDao.getCountByMonthId(formDTO.getCustomerId(), formDTO.getMonthId(), (pageNo - 1) * pageSize, pageSize); + list = factIndexPartyAblityCpcMonthlyDao.getCountByMonthId(formDTO.getCustomerId(), formDTO.getMonthId(),(pageNo - 1) * pageSize, pageSize, + formDTO.getCustomerAreaCode(),formDTO.getSubCustomerIds()); if (!CollectionUtils.isEmpty(list)) { //遍历指标分组 计算分数 for (Map.Entry> entry : groupIndexDetailsMap.entrySet()) { @@ -232,6 +233,13 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { } while (!CollectionUtils.isEmpty(list) && list.size() == pageSize); } + /** + * @return void + * @param formDTO + * @param indexCode 当前计算指标编码 + * @description 根据客户id、月id、indexCode、allParentCode删除旧数据 + * @Date 2021/1/15 9:52 + **/ @Transactional(rollbackFor = Exception.class) public void deleteOldData(CalculateCommonFormDTO formDTO, String indexCode) { int effectRow; @@ -275,6 +283,7 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { CpcScoreEntity cpcScoreEntity = new CpcScoreEntity(); cpcScoreEntity.setYearId(String.valueOf(cpcCount.get(IndexCalConstant.YEAR_ID))); + //一定要赋值当前正在计算的客户id cpcScoreEntity.setCustomerId(formDTO.getCustomerId()); cpcScoreEntity.setAgencyId(String.valueOf(cpcCount.get(IndexCalConstant.AGENCY_ID))); cpcScoreEntity.setGridId(String.valueOf(cpcCount.get(IndexCalConstant.GRID_ID))); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/DeptScoreServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/DeptScoreServiceImpl.java index 00ebad6b5d..dd4219e170 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/DeptScoreServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/DeptScoreServiceImpl.java @@ -228,7 +228,9 @@ public class DeptScoreServiceImpl extends BaseServiceImpl> list = null; do { - list = factIndexGovrnAblityDeptMonthlyDao.selectListByMonthId(formDTO.getCustomerId(), formDTO.getMonthId(), (pageNo - 1) * pageSize, pageSize); + list = factIndexGovrnAblityDeptMonthlyDao.selectListByMonthId(formDTO.getCustomerId(), formDTO.getMonthId(), (pageNo - 1) * pageSize, pageSize, + formDTO.getCustomerAreaCode(), + formDTO.getSubCustomerIds()); if (!CollectionUtils.isEmpty(list)) { //遍历指标分组 计算分数 List> crrentFactRecordList = list; @@ -378,7 +380,7 @@ public class DeptScoreServiceImpl extends BaseServiceImpl minAndMaxMap = queryPartyAblityGridMinAndMax(formDTO.getCustomerId(), formDTO.getMonthId()); + Map minAndMaxMap = queryPartyAblityGridMinAndMax(formDTO); if (CollectionUtils.isEmpty(minAndMaxMap)) { log.warn("calculateGridDangJian queryPartyAblityGridMinAndMax customerId:{} monthId:{} have not any fact record", formDTO.getCustomerId(),formDTO.getMonthId()); return; @@ -218,7 +218,9 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { formDTO.getMonthId(), pageIndex, pageNo, - IndexCalConstant.PAGE_SIZE)); + IndexCalConstant.PAGE_SIZE, + formDTO.getCustomerAreaCode(), + formDTO.getSubCustomerIds())); //遍历每一个网格的记录 recordList.forEach(recordMap -> { //遍历所有的指标 @@ -430,11 +432,12 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { for (HashMap resultMap : resultMapList) { resultMap.forEach((gridId, calculateResult) -> { GridScoreEntity gridScoreEntity = new GridScoreEntity(); + //一定要赋值当前正在计算的客户id gridScoreEntity.setCustomerId(formDTO.getCustomerId()); gridScoreEntity.setGridId(gridId); gridScoreEntity.setIsTotal(isTotal); gridScoreEntity.setIndexCode(indexCode); - ScreenCustomerGridDTO screenCustomerGridDTO = screenCustomerGridDao.selectParentAgencyId(formDTO.getCustomerId(), gridId); + ScreenCustomerGridDTO screenCustomerGridDTO = screenCustomerGridDao.selectParentAgencyId(gridId); if (null != screenCustomerGridDTO) { if(StringUtils.isNotBlank(screenCustomerGridDTO.getParentAgencyId())){ gridScoreEntity.setAgencyId(screenCustomerGridDTO.getParentAgencyId()); @@ -610,7 +613,7 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { int totalPage = (int) Math.ceil((double) total / IndexCalConstant.PAGE_SIZE); log.info(String.format("共%s条数据,分%s次计算", total, totalPage)); //每一组指标的最大值,key:code_MIN/MAX - Map minAndMaxMap = queryGovrnAblityGridMinAndMax(formDTO.getCustomerId(), formDTO.getMonthId()); + Map minAndMaxMap = queryGovrnAblityGridMinAndMax(formDTO); if (CollectionUtils.isEmpty(minAndMaxMap)) { log.warn("calculateGridZhiLi queryGovrnAblityGridMinAndMax customerId:{} monthId:{} have not any fact record", formDTO.getCustomerId(),formDTO.getMonthId()); return; @@ -626,7 +629,9 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { formDTO.getMonthId(), pageIndex, pageNo, - IndexCalConstant.PAGE_SIZE)); + IndexCalConstant.PAGE_SIZE, + formDTO.getCustomerAreaCode(), + formDTO.getSubCustomerIds())); //遍历每一个网格的记录 recordList.forEach(recordMap -> { //遍历所有的指标 @@ -683,7 +688,7 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { int totalPage = (int) Math.ceil((double) total / IndexCalConstant.PAGE_SIZE); log.info(String.format("共%s条数据,分%s次计算", total, totalPage)); //每一组指标的最大值,key:code_MIN/MAX - Map minAndMaxMap = queryServiceAblityGridMinAndMax(formDTO.getCustomerId(), formDTO.getMonthId()); + Map minAndMaxMap = queryServiceAblityGridMinAndMax(formDTO); if (CollectionUtils.isEmpty(minAndMaxMap)) { log.warn("calculateGridFuWu queryServiceAblityGridMinAndMax customerId:{} monthId:{} have not any fact record", formDTO.getCustomerId(),formDTO.getMonthId()); return; @@ -699,7 +704,9 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { formDTO.getMonthId(), pageIndex, pageNo, - IndexCalConstant.PAGE_SIZE)); + IndexCalConstant.PAGE_SIZE, + formDTO.getCustomerAreaCode(), + formDTO.getSubCustomerIds())); //遍历每一个网格的记录 recordList.forEach(recordMap -> { //遍历所有的指标 @@ -838,15 +845,14 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { 党员参加“三会一课”人次*/ /** - * @param customerId - * @param monthId + * @param formDTO * @return java.util.Map * @author yinzuomei * @description 查询党建能力,网格相关,各五级指标最大值,最小值 * @Date 2020/8/27 12:47 **/ - public Map queryPartyAblityGridMinAndMax(String customerId, String monthId) { - return factIndexPartyAblityGridMonthlyDao.selectPartyAblityGridMinAndMax(customerId, monthId); + public Map queryPartyAblityGridMinAndMax(CalculateCommonFormDTO formDTO) { + return factIndexPartyAblityGridMonthlyDao.selectPartyAblityGridMinAndMax(formDTO); } @@ -863,15 +869,13 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { /** - * @param customerId - * @param monthId * @return java.util.Map * @author yinzuomei * @description 查询治理能力,网格相关,各五级指标最大值,最小值 * @Date 2020/8/27 12:48 **/ - public Map queryGovrnAblityGridMinAndMax(String customerId, String monthId) { - return factIndexGovrnAblityGridMonthlyDao.selectGovrnAblityGridMinAndMax(customerId, monthId); + public Map queryGovrnAblityGridMinAndMax(CalculateCommonFormDTO formDTO) { + return factIndexGovrnAblityGridMonthlyDao.selectGovrnAblityGridMinAndMax(formDTO); } /** @@ -886,15 +890,14 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { } /** - * @param customerId - * @param monthId + * @param formDTO * @return java.util.Map * @author yinzuomei * @description 查询 服务能力,网格相关,各五级指标最大值,最小值 * @Date 2020/8/27 12:50 **/ - public Map queryServiceAblityGridMinAndMax(String customerId, String monthId) { - return factIndexServiceAblityGridMonthlyDao.selectServiceAblityGridMinAndMax(customerId, monthId); + public Map queryServiceAblityGridMinAndMax(CalculateCommonFormDTO formDTO) { + return factIndexServiceAblityGridMonthlyDao.selectServiceAblityGridMinAndMax(formDTO); } 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 fa0fc396b3..8c03bf53f5 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 @@ -81,29 +81,52 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni private CommunitySelfSubScoreDao communitySelfSubScoreDao; /** - * @param customerId - * @param monthId + * @param form * @Description 计算社区相关总分 * @author zxc * @date 2020/9/1 4:12 下午 */ @Override - public Boolean calCommunityAll(String customerId, String monthId) { - Boolean aBoolean = communityPartyCalculate(customerId, monthId);//党建能力 - if (!aBoolean.equals(true)) { - throw new RenException("calculate community-party-ability failure ......"); - } - Boolean bBoolean = communityGovernAbilityCalculate(customerId, monthId);// 治理能力 - if (!bBoolean.equals(true)) { - throw new RenException("calculate community-govern-ability failure ......"); - } - Boolean cBoolean = communityServiceAbilityCalculate(customerId, monthId);// 服务能力 - if (!cBoolean.equals(true)) { - throw new RenException("calculate community-service-ability failure ......"); - } - Boolean dBoolean = communityRelate(customerId, monthId); - if (!dBoolean.equals(true)) { - throw new RenException("calculate community-all insert failure ......"); + public Boolean calCommunityAll(CalculateCommonFormDTO form) { + String customerId = form.getCustomerId(); + String monthId = form.getMonthId(); + if (StringUtils.isEmpty(form.getCustomerAreaCode())) { + Boolean aBoolean = communityPartyCalculate(customerId, monthId);//党建能力 + if (!aBoolean.equals(true)) { + throw new RenException("calculate community-party-ability failure ......"); + } + Boolean bBoolean = communityGovernAbilityCalculate(customerId, monthId);// 治理能力 + if (!bBoolean.equals(true)) { + throw new RenException("calculate community-govern-ability failure ......"); + } + Boolean cBoolean = communityServiceAbilityCalculate(customerId, monthId);// 服务能力 + if (!cBoolean.equals(true)) { + throw new RenException("calculate community-service-ability failure ......"); + } + Boolean dBoolean = communityRelate(customerId, monthId); + if (!dBoolean.equals(true)) { + throw new RenException("calculate community-all insert failure ......"); + } + }else { + // 党建能力 + Boolean aBoolean = communityPartyCalculateExistsSub(form); + if (!aBoolean.equals(true)) { + throw new RenException("calculate community-party-ability-exists-sub failure ......"); + } + // 治理能力 + Boolean bBoolean = communityGovernAbilityCalculateExistsSub(form); + if (!bBoolean.equals(true)) { + throw new RenException("calculate community-govern-ability-exists-sub failure ......"); + } + // 服务能力 + Boolean cBoolean = communityServiceAbilityCalculateExistsSub(form); + if (!cBoolean.equals(true)) { + throw new RenException("calculate community-service-ability-exists-sub failure ......"); + } + Boolean dBoolean = communityRelateExistsSub(form); + if (!dBoolean.equals(true)) { + throw new RenException("calculate community-all-exists-sub insert failure ......"); + } } //计算自身和下级 CalculateCommonFormDTO formDTO = new CalculateCommonFormDTO(); @@ -565,4 +588,269 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni result.setFiveLevel(resultFive); return result; } + + /** + * @Description 社区名义发文数量计算【党建能力】存在下级客户 + * @Param form + * @author zxc + * @date 2021/1/15 上午9:18 + */ + public Boolean communityPartyCalculateExistsSub(CalculateCommonFormDTO form) { + // 党建能力 + // 根据all_parent_index_code 获取指标明细 + List detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(form.getCustomerId(), IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode(), IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); + if (CollectionUtils.isEmpty(detailListByParentCode)) { + log.error(IndexCalConstant.INDEX_DETAIL_LIST_NULL); + return true; + } + List indexInputVOS = new ArrayList<>(); + Map pid = new HashMap<>(); + //下属所有网格的党建能力平均值 + detailListByParentCode.forEach(detail -> { + if (IndexCodeEnum.XIA_SHU_SUO_YOU_WGDDJNLPJZ.getCode().equals(detail.getIndexCode())) { + List subGridPartyAvgScore = factIndexGridScoreDao.selectSubGridAvgScoreByAreaCode(form.getMonthId(),IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),form.getCustomerAreaCode()); + if (CollectionUtils.isEmpty(subGridPartyAvgScore)) { + log.warn(IndexCalConstant.GRID_PARTY_AVG_NULL); + } else { + MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subGridPartyAvgScore.stream().map(o -> o.getScore()).collect(Collectors.toList())); + List> subPartyAvgList = ListUtils.partition(subGridPartyAvgScore, IndexCalConstant.PAGE_SIZE); + subPartyAvgList.forEach(party -> { + List index1SampleValues = new ArrayList<>(); + party.forEach(c -> { + pid.put(c.getAgencyId(), c.getParentId()); + SampleValue s = new SampleValue(c.getAgencyId(), c.getScore()); + index1SampleValues.add(s); + }); + BigDecimalScoreCalculator sc = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexCode(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), IndexCodeEnum.isAvgIndex(detail.getIndexCode()), sc); + indexInputVOS.add(index1VO); + }); + } + } else { + // 社区名义发文数量 + List> publishArticleCountList = factIndexPartyAblityOrgMonthlyDao.selectPublishArticleCountMapbyAreaCode( form.getMonthId(),form.getCustomerAreaCode()); + if (CollectionUtils.isEmpty(publishArticleCountList)) { + log.warn(IndexCalConstant.COMMUNITY_PUBLISH_ARTICLE_LIST_NULL); + } else { + String fieldNameByIndexCode = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode()); + if (StringUtils.isEmpty(fieldNameByIndexCode)) { + log.error(String.format(IndexCalConstant.INDEX_CODE_NULL, detail.getIndexCode())); + return; + } else { + List decimalList = publishArticleCountList.stream().map(m -> new BigDecimal(m.get(fieldNameByIndexCode).toString())).collect(Collectors.toList()); + MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(decimalList); + List>> publishArticleList = ListUtils.partition(publishArticleCountList, IndexCalConstant.PAGE_SIZE); + publishArticleList.forEach(publish -> { + ScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); + List index1SampleValues = new ArrayList<>(); + publish.forEach(c -> { + pid.put(c.get(IndexCalConstant.AGENCY_ID).toString(), c.get(IndexCalConstant.PARENT_ID).toString()); + SampleValue s = new SampleValue((String) c.get(IndexCalConstant.AGENCY_ID), new BigDecimal(String.valueOf(c.get(fieldNameByIndexCode)))); + index1SampleValues.add(s); + }); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexCode(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), IndexCodeEnum.isAvgIndex(detail.getIndexCode()), sc1); + indexInputVOS.add(index1VO); + }); + } + } + } + }); + BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); + log.info("communityPartyCalculateExistsSub getScoreCountOfSampleId param:{}", JSON.toJSONString(indexInputVOS)); + HashMap scoreTotalOfSampleId = batchScoreCalculator.getScoreTotalOfSampleId(indexInputVOS); + log.info("communityPartyCalculateExistsSub getScoreCountOfSampleId result:{}", JSON.toJSONString(scoreTotalOfSampleId)); + CommunityCalResultDTO result = getResultB(scoreTotalOfSampleId, form.getCustomerId(), form.getMonthId(), NumConstant.ZERO_STR, IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(), IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode(), pid); + deleteOldRecord(form.getCustomerId(),form.getMonthId()); + deleteAndInsert(result); + return true; + } + + /** + * @Description 社区治理能力 存在下级客户 + * @Param form + * @author zxc + * @date 2021/1/15 上午10:56 + */ + public Boolean communityGovernAbilityCalculateExistsSub(CalculateCommonFormDTO form) { + List detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(form.getCustomerId(), IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode(), IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); + if (CollectionUtils.isEmpty(detailListByParentCode)) { + log.error(IndexCalConstant.INDEX_DETAIL_LIST_NULL); + return true; + } + List indexInputVOS = new ArrayList<>(); + Map pid = new HashMap<>(); + detailListByParentCode.forEach(detail -> { + // 社区下属所有网格治理能力汇总(平均值) + if (IndexCodeEnum.SHE_QU_XIA_SHU_SYWGZLNLHZPJZ.getCode().equals(detail.getIndexCode())) { + List subGridGovernAvg = factIndexGridScoreDao.selectSubGridAvgScoreByAreaCode(form.getMonthId(),IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),form.getCustomerAreaCode()); + if (CollectionUtils.isEmpty(subGridGovernAvg)){ + log.warn("社区下级治理能力平均分集合为空"); + }else{ + MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subGridGovernAvg.stream().map(o -> o.getScore()).collect(Collectors.toList())); + List> governAvg = ListUtils.partition(subGridGovernAvg, IndexCalConstant.PAGE_SIZE); + governAvg.forEach(avg -> { + List index1SampleValues = new ArrayList<>(); + avg.forEach(c -> { + pid.put(c.getAgencyId(), c.getParentId()); + SampleValue s = new SampleValue(c.getAgencyId(), c.getScore()); + index1SampleValues.add(s); + }); + BigDecimalScoreCalculator sc = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexCode(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), IndexCodeEnum.isAvgIndex(detail.getIndexCode()), sc); + indexInputVOS.add(index1VO); + }); + } + } else { + // 治理能力的六个五级指标 + List> communityGovernAbility = factIndexGovrnAblityOrgMonthlyDao.selectCommunityGovernAbilityExistsSub(form.getMonthId(),form.getCustomerAreaCode()); + if (CollectionUtils.isEmpty(communityGovernAbility)){ + log.warn(IndexCalConstant.COMMUNITY_GOVERN_ABILITY_NULL); + }else{ + String fieldNameByIndexCode = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode()); + if (StringUtils.isEmpty(fieldNameByIndexCode)) { + log.error(String.format(IndexCalConstant.INDEX_CODE_NULL,detail.getIndexCode())); + return; + } + List decimalList = communityGovernAbility.stream().map(m -> new BigDecimal(m.get(fieldNameByIndexCode).toString())).collect(Collectors.toList()); + MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(decimalList); + List>> governAbilityList = ListUtils.partition(communityGovernAbility, IndexCalConstant.PAGE_SIZE); + governAbilityList.forEach(governAbility -> { + ScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); + List index1SampleValues = new ArrayList<>(); + governAbility.forEach(c -> { + pid.put(c.get(IndexCalConstant.AGENCY_ID).toString(), c.get(IndexCalConstant.PARENT_ID).toString()); + SampleValue s = new SampleValue((String) c.get(IndexCalConstant.AGENCY_ID), new BigDecimal(String.valueOf(c.get(fieldNameByIndexCode)))); + index1SampleValues.add(s); + }); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexCode(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), IndexCodeEnum.isAvgIndex(detail.getIndexCode()), sc1); + indexInputVOS.add(index1VO); + }); + } + } + }); + BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); + log.info("communityGovernAbilityCalculateExistsSub getScoreCountOfSampleId param:{}", JSON.toJSONString(indexInputVOS)); + HashMap scoreTotalOfSampleId = batchScoreCalculator.getScoreTotalOfSampleId(indexInputVOS); + log.info("communityGovernAbilityCalculateExistsSub getScoreCountOfSampleId result:{}", JSON.toJSONString(scoreTotalOfSampleId)); + CommunityCalResultDTO result = getResultB(scoreTotalOfSampleId, form.getCustomerId(), form.getMonthId(), NumConstant.ZERO_STR, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(), IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode(), pid); + deleteAndInsert(result); + return true; + } + + + /** + * @Description 社区服务能力 存在下级客户 + * @Param form + * @author zxc + * @date 2021/1/15 下午1:42 + */ + public Boolean communityServiceAbilityCalculateExistsSub(CalculateCommonFormDTO form) { + List detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(form.getCustomerId(), IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode(), IndexCodeEnum.FU_WU_NENG_LI.getCode()); + if (CollectionUtils.isEmpty(detailListByParentCode)) { + log.error(IndexCalConstant.INDEX_DETAIL_LIST_NULL); + return true; + } + List indexInputVOS = new ArrayList<>(); + Map pid = new HashMap<>(); + detailListByParentCode.forEach(detail -> { + String indexCode = detail.getIndexCode(); + if (IndexCodeEnum.SHE_QU_XIA_JI_SYWGFWNLDFPJZ.getCode().equals(indexCode)) { + List subGridServiceAvg = factIndexGridScoreDao.selectSubGridAvgScoreByAreaCode(form.getMonthId(),IndexCodeEnum.FU_WU_NENG_LI.getCode(),form.getCustomerAreaCode()); + if (CollectionUtils.isEmpty(subGridServiceAvg)) { + log.warn("查询社区下级所有网格服务能力得分平均值集合为空"); + } else { + MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subGridServiceAvg.stream().map(o -> o.getScore()).collect(Collectors.toList())); + List> serviceAvgList = ListUtils.partition(subGridServiceAvg, IndexCalConstant.PAGE_SIZE); + serviceAvgList.forEach(serviceAvg -> { + BigDecimalScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); + List index1SampleValues = new ArrayList<>(); + serviceAvg.forEach(c -> { + pid.put(c.getAgencyId(), c.getParentId()); + SampleValue s = new SampleValue(c.getAgencyId(), c.getScore()); + index1SampleValues.add(s); + }); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexCode(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), IndexCodeEnum.isAvgIndex(detail.getIndexCode()), sc1); + indexInputVOS.add(index1VO); + }); + } + } else { + List> communityActivityCountList = factIndexServiceAblityOrgMonthlyDao.selectActivityCountMapExistsSub(form.getMonthId(),form.getCustomerAreaCode()); + if (CollectionUtils.isEmpty(communityActivityCountList)) { + log.warn(IndexCalConstant.COMMUNITY_SERVICE_ABILITY_NULL); + }else{ + String fieldNameByIndexCode = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode()); + if (StringUtils.isEmpty(fieldNameByIndexCode)) { + log.error(String.format(IndexCalConstant.INDEX_CODE_NULL,detail.getIndexCode())); + return; + } + List decimalList = communityActivityCountList.stream().map(m -> new BigDecimal(m.get(fieldNameByIndexCode).toString())).collect(Collectors.toList()); + MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(decimalList); + List>> communityActivityList = ListUtils.partition(communityActivityCountList, IndexCalConstant.PAGE_SIZE); + communityActivityList.forEach(communityActivity -> { + ScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); + List index1SampleValues = new ArrayList<>(); + communityActivity.forEach(c -> { + pid.put(c.get(IndexCalConstant.AGENCY_ID).toString(), c.get(IndexCalConstant.PARENT_ID).toString()); + SampleValue s = new SampleValue((String) c.get(IndexCalConstant.AGENCY_ID), new BigDecimal(String.valueOf(c.get(fieldNameByIndexCode)))); + index1SampleValues.add(s); + }); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexCode(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), IndexCodeEnum.isAvgIndex(detail.getIndexCode()), sc1); + indexInputVOS.add(index1VO); + }); + } + } + }); + BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); + log.info("communityServiceAbilityCalculateExistsSub getScoreCountOfSampleId param:{}", JSON.toJSONString(indexInputVOS)); + HashMap scoreTotalOfSampleId = batchScoreCalculator.getScoreTotalOfSampleId(indexInputVOS); + log.info("communityServiceAbilityCalculateExistsSub getScoreCountOfSampleId result:{}", JSON.toJSONString(scoreTotalOfSampleId)); + CommunityCalResultDTO result = getResultB(scoreTotalOfSampleId, form.getCustomerId(), form.getMonthId(), NumConstant.ZERO_STR, IndexCodeEnum.FU_WU_NENG_LI.getCode(), IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode(), pid); + deleteAndInsert(result); + return true; + } + + /** + * @Description 社区相关计算 存在下级客户 + * @Param form + * @author zxc + * @date 2021/1/15 下午1:47 + */ + public Boolean communityRelateExistsSub(CalculateCommonFormDTO form) { + String customerId = form.getCustomerId(); + String monthId = form.getMonthId(); + List detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(form.getCustomerId(), IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode()); + List factIndexCommunityScoreEntities = factIndexCommunityScoreDao.selectCommunityInfoExistsSub(form.getCustomerAreaCode(),form.getMonthId()); + detailListByParentCode.forEach(detail -> { + factIndexCommunityScoreEntities.forEach(community -> { + if (detail.getIndexCode().equals(community.getIndexCode())) { + community.setScore(community.getScore().multiply(detail.getWeight())); + } + }); + }); + Map> collect = factIndexCommunityScoreEntities.stream().collect(Collectors.groupingBy(FactIndexCommunityScoreDTO::getAgencyId)); + List result = new ArrayList<>(); + collect.forEach((key, value) -> { + FactIndexCommunityScoreDTO score = new FactIndexCommunityScoreDTO(); + score.setIsTotal(NumConstant.ONE_STR); + score.setCustomerId(customerId); + score.setAgencyId(key); + score.setMonthId(monthId); + score.setYearId(DateUtils.getYearId(monthId)); + score.setQuarterId(DateUtils.getQuarterId(monthId)); + score.setIndexCode(IndexCalConstant.COMMUNITY_RELATE); + score.setAllParentIndexCode(NumConstant.ZERO_STR); + score.setWeight(new BigDecimal(NumConstant.ONE_NEG)); + value.forEach(community -> { + score.setScore(score.getScore().add(community.getScore())); + score.setParentAgencyId(community.getParentAgencyId()); + }); + result.add(score); + }); + if (!CollectionUtils.isEmpty(result)){ + factIndexCommunityScoreDao.insertCommunityPartyRecord(result); + } + return true; + } + + } 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 5b18396a66..592c114fd4 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 @@ -79,29 +79,52 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict private AgencySelfSubScoreDao agencySelfSubScoreDao; /** - * @param customerId - * @param monthId + * @param form * @Description 计算全区相关总分 * @author zxc * @date 2020/9/2 3:12 下午 */ @Override - public Boolean calDistrictAll(String customerId, String monthId) { - Boolean aBoolean = districtPartyCalculate(customerId, monthId);//党建能力 - if (!aBoolean.equals(true)) { - throw new RenException("calculate district-party-ability failure ......"); - } - Boolean bBoolean = districtGovernAbilityCalculate(customerId, monthId);// 治理能力 - if (!bBoolean.equals(true)) { - throw new RenException("calculate district-govern-ability failure ......"); - } - Boolean cBoolean = districtServiceAbilityCalculate(customerId, monthId);// 服务能力 - if (!cBoolean.equals(true)) { - throw new RenException("calculate district-service-ability failure ......"); - } - Boolean dBoolean = districtRelate(customerId, monthId); - if (!dBoolean.equals(true)) { - throw new RenException("calculate district-all insert failure ......"); + public Boolean calDistrictAll(CalculateCommonFormDTO form) { + String customerId = form.getCustomerId(); + String monthId = form.getMonthId(); + if (StringUtils.isEmpty(form.getCustomerAreaCode())) { + Boolean aBoolean = districtPartyCalculate(customerId, monthId);//党建能力 + if (!aBoolean.equals(true)) { + throw new RenException("calculate district-party-ability failure ......"); + } + Boolean bBoolean = districtGovernAbilityCalculate(customerId, monthId);// 治理能力 + if (!bBoolean.equals(true)) { + throw new RenException("calculate district-govern-ability failure ......"); + } + Boolean cBoolean = districtServiceAbilityCalculate(customerId, monthId);// 服务能力 + if (!cBoolean.equals(true)) { + throw new RenException("calculate district-service-ability failure ......"); + } + Boolean dBoolean = districtRelate(customerId, monthId); + if (!dBoolean.equals(true)) { + throw new RenException("calculate district-all insert failure ......"); + } + }else { + //党建能力 + Boolean aBoolean = districtPartyCalculateExistSub(form); + if (!aBoolean.equals(true)) { + throw new RenException("calculate district-party-ability-exists-sub failure ......"); + } + // 治理能力 + Boolean bBoolean = districtGovernAbilityCalculateExistSub(form); + if (!bBoolean.equals(true)) { + throw new RenException("calculate district-govern-ability-exists-sub failure ......"); + } + // 服务能力 + Boolean cBoolean = districtServiceAbilityCalculateExistSub(form); + if (!cBoolean.equals(true)) { + throw new RenException("calculate district-service-ability-exists-sub failure ......"); + } + Boolean dBoolean = districtRelateExistSub(form); + if (!dBoolean.equals(true)) { + throw new RenException("calculate district-all-exists-sub insert failure ......"); + } } //计算自身和下级 CalculateCommonFormDTO formDTO = new CalculateCommonFormDTO(); @@ -562,4 +585,269 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict return result; } + + /** + * @param form + * @Description 全区名义发文数量计算【党建能力】 存在下级客户 + * @author zxc + * @date 2020/8/26 10:46 上午 + */ + public Boolean districtPartyCalculateExistSub(CalculateCommonFormDTO form) { + // 党建能力 + // 根据all_parent_index_code 获取指标明细 + String customerId = form.getCustomerId(); + String monthId = form.getMonthId(); + 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 true; + } + List indexInputVOS = new ArrayList<>(); + Map pid = new HashMap<>(); + //党建能力平均值 + indexDetailList.forEach(detail -> { + if (IndexCodeEnum.QU_XIA_JI_JIE_DDJNLHZPJZ.getCode().equals(detail.getIndexCode())) { + List subGridPartyAvgScore = agencyScoreDao.selectAgencyScoreAvgExistsSub(monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),IndexCalConstant.STREET_LEVEL,form.getCustomerAreaCode(),NumConstant.SIX); + if (CollectionUtils.isEmpty(subGridPartyAvgScore)) { + log.warn(IndexCalConstant.DISTRICT_PARTY_AVG_NULL); + } else if (subGridPartyAvgScore.size() > NumConstant.ZERO) { + MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subGridPartyAvgScore.stream().map(o -> o.getScore()).collect(Collectors.toList())); + List> subPartyAvgList = ListUtils.partition(subGridPartyAvgScore, IndexCalConstant.PAGE_SIZE); + subPartyAvgList.forEach(party -> { + List index1SampleValues = new ArrayList<>(); + party.forEach(c -> { + if (!c.getParentId().equals(NumConstant.ZERO_STR)) { + pid.put(c.getParentId(), customerAgencyDao.selectPid(c.getParentId())); + SampleValue s = new SampleValue(c.getParentId(), c.getScore()); + index1SampleValues.add(s); + } + }); + BigDecimalScoreCalculator sc = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexCode(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), IndexCodeEnum.isAvgIndex(detail.getIndexCode()), sc); + indexInputVOS.add(index1VO); + }); + } + } else { + // 区名义发文数量 + List> publishArticleCountList = factIndexPartyAblityOrgMonthlyDao.selectPublishArticleCountMapExistSub(monthId,form.getCustomerAreaCode(),NumConstant.SIX); + if (CollectionUtils.isEmpty(publishArticleCountList)) { + log.warn(IndexCalConstant.DISTRICT_PUBLISH_ARTICLE_LIST_NULL); + } else { + String fieldNameByIndexCode = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode()); + if (StringUtils.isEmpty(fieldNameByIndexCode)) { + log.error(String.format(IndexCalConstant.INDEX_CODE_NULL, detail.getIndexCode())); + return; + } else { + List decimalList = publishArticleCountList.stream().map(m -> new BigDecimal(m.get(fieldNameByIndexCode).toString())).collect(Collectors.toList()); + MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(decimalList); + List>> publishArticleList = ListUtils.partition(publishArticleCountList, IndexCalConstant.PAGE_SIZE); + publishArticleList.forEach(publish -> { + ScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); + List index1SampleValues = new ArrayList<>(); + publish.forEach(c -> { + pid.put(c.get(IndexCalConstant.AGENCY_ID).toString(), c.get(IndexCalConstant.PARENT_ID).toString()); + SampleValue s = new SampleValue((String) c.get(IndexCalConstant.AGENCY_ID), new BigDecimal(String.valueOf(c.get(fieldNameByIndexCode)))); + index1SampleValues.add(s); + }); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexCode(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), IndexCodeEnum.isAvgIndex(detail.getIndexCode()), sc1); + indexInputVOS.add(index1VO); + }); + } + } + } + }); + BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); + HashMap scoreTotalOfSampleId = batchScoreCalculator.getScoreTotalOfSampleId(indexInputVOS); + log.info("districtPartyAbilityCalculateExistsSub getScoreTotalOfSampleId param:{}", JSON.toJSONString(indexInputVOS)); + log.info("districtPartyAbilityCalculateExistsSub getScoreCountOfSampleId result:{}", JSON.toJSONString(scoreTotalOfSampleId)); + AgencyCalResultDTO result = getResultB(scoreTotalOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(), IndexCodeEnum.QUAN_QU_XIANG_GUAN.getCode(), pid); + deleteOldRecord(customerId,monthId,IndexCalConstant.DISTRICT_LEVEL); + insertDetail(result); + return true; + } + + /** + * @param form + * @Description 全区治理能力 存在下级客户 + * @author zxc + * @date 2020/8/26 1:40 下午 + */ + public Boolean districtGovernAbilityCalculateExistSub(CalculateCommonFormDTO form) { + String customerId = form.getCustomerId(); + String monthId = form.getMonthId(); + 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 true; + } + List indexInputVOS = new ArrayList<>(); + Map pid = new HashMap<>(); + detailListByParentCode.forEach(detail -> { + if (IndexCodeEnum.SUO_YOU_JIE_DAO_ZLNLPJZ.getCode().equals(detail.getIndexCode())) { + List districtGovernAvgList = agencyScoreDao.selectAgencyScoreAvgExistsSub(monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),IndexCalConstant.STREET_LEVEL,form.getCustomerAreaCode(),NumConstant.SIX); + for (int i = 0; i < districtGovernAvgList.size(); i++) { + if (districtGovernAvgList.get(i).getAgencyId().equals(NumConstant.ZERO_STR)){ + districtGovernAvgList.remove(districtGovernAvgList.get(i)); + } + } + if (CollectionUtils.isEmpty(districtGovernAvgList)) { + log.warn("查询所有街道治理能力平均值集合为空"); + } else{ + MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(districtGovernAvgList.stream().map(o -> o.getScore()).collect(Collectors.toList())); + List> governAvg = ListUtils.partition(districtGovernAvgList, IndexCalConstant.PAGE_SIZE); + governAvg.forEach(avg -> { + List index1SampleValues = new ArrayList<>(); + avg.forEach(c -> { + if (!c.getParentId().equals(NumConstant.ZERO_STR)) { + pid.put(c.getParentId(), customerAgencyDao.selectPid(c.getParentId())); + SampleValue s = new SampleValue(c.getParentId(), c.getScore()); + index1SampleValues.add(s); + } + }); + BigDecimalScoreCalculator sc = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexCode(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), IndexCodeEnum.isAvgIndex(detail.getIndexCode()), sc); + indexInputVOS.add(index1VO); + }); + } + } else if (IndexCodeEnum.SUO_YOU_ZHI_SHU_BMZLNLPJZ.getCode().equals(detail.getIndexCode())){ + List deptScoreAvgList = deptScoreDao.selectGovernDeptScoreAvgExistsSub(monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),form.getCustomerAreaCode()); + for (int i = 0; i < deptScoreAvgList.size(); i++) { + if (deptScoreAvgList.get(i).getAgencyId().equals(NumConstant.ZERO_STR)){ + deptScoreAvgList.remove(deptScoreAvgList.get(i)); + } + } + if (CollectionUtils.isEmpty(deptScoreAvgList)) { + log.warn("查询所有直属部门治理能力平均值集合为空"); + } else{ + MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(deptScoreAvgList.stream().map(o -> o.getScore()).collect(Collectors.toList())); + List> governAvg = ListUtils.partition(deptScoreAvgList, IndexCalConstant.PAGE_SIZE); + governAvg.forEach(avg -> { + List index1SampleValues = new ArrayList<>(); + avg.forEach(c -> { + pid.put(c.getAgencyId(),c.getParentId()); + SampleValue s = new SampleValue(c.getAgencyId(), c.getScore()); + index1SampleValues.add(s); + }); + BigDecimalScoreCalculator sc = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexCode(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), IndexCodeEnum.isAvgIndex(detail.getIndexCode()), sc); + indexInputVOS.add(index1VO); + }); + } + }else{ + // TODO 治理能力暂无自身级别 + } + }); + BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); + HashMap scoreTotalOfSampleId = batchScoreCalculator.getScoreTotalOfSampleId(indexInputVOS); + log.info("districtGovernAbilityCalculateExistsSub getScoreTotalOfSampleId param:{}", JSON.toJSONString(indexInputVOS)); + log.info("districtGovernAbilityCalculateExistsSub getScoreCountOfSampleId result:{}", JSON.toJSONString(scoreTotalOfSampleId)); + AgencyCalResultDTO result = getResultB(scoreTotalOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(), IndexCodeEnum.QUAN_QU_XIANG_GUAN.getCode(), pid); + insertDetail(result); + return true; + } + + /** + * @param form + * @Description 全区服务能力 存在下级客户 + * @author zxc + * @date 2020/8/31 1:38 下午 + */ + public Boolean districtServiceAbilityCalculateExistSub(CalculateCommonFormDTO form) { + String customerId = form.getCustomerId(); + String monthId = form.getMonthId(); + 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 true; + } + List indexInputVOS = new ArrayList<>(); + Map pid = new HashMap<>(); + detailListByParentCode.forEach(detail -> { + String indexCode = detail.getIndexCode(); + if (IndexCodeEnum.QU_XIA_SHU_JIE_DFWNLHZPJZ.getCode().equals(indexCode)) { + List subStreetAvgList = agencyScoreDao.selectAgencyScoreAvgExistsSub(monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode(),IndexCalConstant.STREET_LEVEL,form.getCustomerAreaCode(),NumConstant.SIX); + for (int i = 0; i < subStreetAvgList.size(); i++) { + if (subStreetAvgList.get(i).getAgencyId().equals(NumConstant.ZERO_STR)){ + subStreetAvgList.remove(subStreetAvgList.get(i)); + } + } + if (CollectionUtils.isEmpty(subStreetAvgList)) { + log.warn("查询区下属街道服务能力汇总平均值集合为空"); + } else{ + MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subStreetAvgList.stream().map(o -> o.getScore()).collect(Collectors.toList())); + List> serviceAvgList = ListUtils.partition(subStreetAvgList, IndexCalConstant.PAGE_SIZE); + serviceAvgList.forEach(serviceAvg -> { + BigDecimalScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); + List index1SampleValues = new ArrayList<>(); + serviceAvg.forEach(c -> { + if (!c.getParentId().equals(NumConstant.ZERO_STR)) { + pid.put(c.getParentId(), customerAgencyDao.selectPid(c.getParentId())); + SampleValue s = new SampleValue(c.getParentId(), c.getScore()); + index1SampleValues.add(s); + } + }); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexCode(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), IndexCodeEnum.isAvgIndex(detail.getIndexCode()), sc1); + indexInputVOS.add(index1VO); + }); + } + } else { + // todo 暂时没有自身级别 + } + }); + BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); + if (!CollectionUtils.isEmpty(indexInputVOS)) { + HashMap scoreTotalOfSampleId = batchScoreCalculator.getScoreTotalOfSampleId(indexInputVOS); + log.info("districtServiceAbilityCalculateExistsSub getScoreTotalOfSampleId param:{}", JSON.toJSONString(indexInputVOS)); + log.info("districtServiceAbilityCalculateExistsSub getScoreCountOfSampleId result:{}", JSON.toJSONString(scoreTotalOfSampleId)); + AgencyCalResultDTO result = getResultB(scoreTotalOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.FU_WU_NENG_LI.getCode(), IndexCodeEnum.QUAN_QU_XIANG_GUAN.getCode(), pid); + insertDetail(result); + } + return true; + } + + /** + * @param form + * @Description 区相关计算 存在下级客户 + * @author zxc + * @date 2020/9/1 9:21 上午 + */ + public Boolean districtRelateExistSub(CalculateCommonFormDTO form) { + String customerId = form.getCustomerId(); + String monthId = form.getMonthId(); + List detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode()); + List agencyScoreList = agencyScoreDao.selectAgencyScoreInfoExistsSub(form.getCustomerAreaCode(),NumConstant.SIX,monthId, IndexCalConstant.DISTRICT_LEVEL); + detailListByParentCode.forEach(detail -> { + agencyScoreList.forEach(community -> { + if (detail.getIndexCode().equals(community.getIndexCode())) { + community.setScore(community.getScore().multiply(detail.getWeight())); + } + }); + }); + Map> collect = agencyScoreList.stream().collect(Collectors.groupingBy(AgencyScoreDTO::getAgencyId)); + List result = new ArrayList<>(); + collect.forEach((key, value) -> { + AgencyScoreDTO score = new AgencyScoreDTO(); + score.setIsTotal(NumConstant.ONE_STR); + score.setCustomerId(customerId); + score.setAgencyId(key); + score.setMonthId(monthId); + score.setYearId(DateUtils.getYearId(monthId)); + score.setQuarterId(DateUtils.getQuarterId(monthId)); + score.setDataType(IndexCalConstant.DISTRICT_LEVEL); + score.setIndexCode(IndexCodeEnum.QUAN_QU_XIANG_GUAN.getCode()); + score.setAllParentIndexCode(NumConstant.ZERO_STR); + score.setWeight(new BigDecimal(NumConstant.ONE_NEG)); + value.forEach(community -> { + score.setScore(score.getScore().add(community.getScore())); + score.setParentAgencyId(community.getParentAgencyId()); + }); + result.add(score); + }); + if (!CollectionUtils.isEmpty(result)){ + agencyScoreDao.insertStreetRecord(result); + } + return true; + } + + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateServiceImpl.java index 753dc70726..82142afec4 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateServiceImpl.java @@ -8,8 +8,10 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.constant.DataSourceConstant; import com.epmet.dao.evaluationindex.screen.ScreenCustomerAgencyDao; import com.epmet.dto.indexcal.CalculateCommonFormDTO; +import com.epmet.dto.indexcal.CustomerSubInfoDTO; import com.epmet.feign.EpmetCommonServiceOpenFeignClient; import com.epmet.redis.IndexCalRedis; +import com.epmet.service.crm.CustomerRelationService; import com.epmet.service.evaluationindex.indexcal.*; import com.epmet.service.evaluationindex.indexcoll.FactIndexCollectService; import com.epmet.util.DimIdGenerator; @@ -21,6 +23,7 @@ import org.springframework.stereotype.Service; import java.util.ArrayList; import java.util.Date; import java.util.List; +import java.util.Map; /** * @author liujianjun @@ -50,7 +53,8 @@ public class IndexCalculateServiceImpl implements IndexCalculateService { private FactIndexCollectService factIndexCollectService; @Autowired private ScreenCustomerAgencyDao screenCustomerAgencyDao; - + @Autowired + private CustomerRelationService customerRelationService; @Override public Boolean indexCalculate(CalculateCommonFormDTO formDTO) { @@ -71,15 +75,25 @@ public class IndexCalculateServiceImpl implements IndexCalculateService { } else { customerIds.add(formDTO.getCustomerId()); } + + //查询客户编码、以及下一级客户列表 add01.14 + Map customerInfoMap=this.getCustomerInfoMap(customerIds); + Boolean flag = false; for (String customerId : customerIds) { CalculateCommonFormDTO param = new CalculateCommonFormDTO(); param.setCustomerId(customerId); param.setMonthId(formDTO.getMonthId()); + //01.14 add + if (!customerInfoMap.isEmpty() && null != customerInfoMap.get(customerId)) { + param.setCustomerAreaCode(customerInfoMap.get(customerId).getCustomerAreaCode()); + param.setSubCustomerIds(customerInfoMap.get(customerId).getSubCustomerIds()); + } flag = calulateCustomerIndexScore(param); } return flag; } catch (Exception e) { + e.printStackTrace(); log.error("indexCalculate exception,param:{}", JSON.toJSONString(formDTO)); } finally { //清除缓存 @@ -122,7 +136,7 @@ public class IndexCalculateServiceImpl implements IndexCalculateService { //计算社区 start = System.currentTimeMillis(); try { - flag = indexCalculateCommunityService.calCommunityAll(customerId, formDTO.getMonthId()); + flag = indexCalculateCommunityService.calCommunityAll(formDTO); log.info("客户Id:{}【社区相关】计算完毕,总耗时:{}秒,result:{},result:{}", customerId, (System.currentTimeMillis() - start) / 1000, flag); } catch (Exception e) { log.error("indexCalculate calCommunityAll exception", e); @@ -131,7 +145,7 @@ public class IndexCalculateServiceImpl implements IndexCalculateService { //计算街道 start = System.currentTimeMillis(); try { - flag = indexCalculateStreetService.calStreetAll(customerId, formDTO.getMonthId()); + flag = indexCalculateStreetService.calStreetAll(formDTO); log.info("客户Id:{}【街道相关】计算完毕,总耗时:{}秒,result:{}", customerId, (System.currentTimeMillis() - start) / 1000, flag); } catch (Exception e) { log.error("indexCalculate calStreetAll exception", e); @@ -149,7 +163,7 @@ public class IndexCalculateServiceImpl implements IndexCalculateService { //计算全区 start = System.currentTimeMillis(); try { - flag = indexCalculateDistrictService.calDistrictAll(customerId, formDTO.getMonthId()); + flag = indexCalculateDistrictService.calDistrictAll(formDTO); log.info("客户Id:{}【全区相关】计算完毕,总耗时:{}秒,result:{}", customerId, (System.currentTimeMillis() - start) / 1000, flag); } catch (Exception e) { log.error("indexCalculate calDistrictAll exception", e); @@ -163,7 +177,7 @@ public class IndexCalculateServiceImpl implements IndexCalculateService { if (insertFlag || currentMonthId.equals(formDTO.getMonthId())) { start = System.currentTimeMillis(); try { - factIndexCollectService.insertScreenIndexDataMonthlyAndYearly(formDTO.getMonthId(), formDTO.getCustomerId()); + factIndexCollectService.insertScreenIndexDataMonthlyAndYearly(formDTO); log.info("客户Id:{}分数插入到大屏显示库完毕,总耗时:{}秒", customerId, (System.currentTimeMillis() - start) / 1000); } catch (Exception e) { log.error("indexCalculate insertScreenIndexDataMonthlyAndYearly exception", e); @@ -178,4 +192,14 @@ public class IndexCalculateServiceImpl implements IndexCalculateService { } return false; } + + /** + * @param customerIds + * @author yinzuomei + * @description 查询当前客户的area_code信息、以及下一级客户列表 + * @Date 2021/1/21 11:28 + **/ + private Map getCustomerInfoMap(List customerIds) { + return customerRelationService.getCustomerInfoMap(customerIds); + } } 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 4669ae0cda..c2d488ea41 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 @@ -82,29 +82,52 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ private AgencySelfSubScoreDao agencySelfSubScoreDao; /** - * @param customerId - * @param monthId + * @param form * @Description 计算街道相关总分 * @author zxc * @date 2020/9/2 3:12 下午 */ @Override - public Boolean calStreetAll(String customerId, String monthId) { - Boolean aBoolean = streetPartyCalculate(customerId, monthId);//党建能力 - if (!aBoolean.equals(true)) { - throw new RenException("calculate street-party-ability failure ......"); - } - Boolean bBoolean = streetGovernAbilityCalculate(customerId, monthId);// 治理能力 - if (!bBoolean.equals(true)) { - throw new RenException("calculate street-govern-ability failure ......"); - } - Boolean cBoolean = streetServiceAbilityCalculate(customerId, monthId);// 服务能力 - if (!cBoolean.equals(true)) { - throw new RenException("calculate street-service-ability failure ......"); - } - Boolean dBoolean = streetRelate(customerId, monthId); - if (!dBoolean.equals(true)) { - throw new RenException("calculate street-all insert failure ......"); + public Boolean calStreetAll(CalculateCommonFormDTO form) { + String customerId = form.getCustomerId(); + String monthId = form.getMonthId(); + if (StringUtils.isEmpty(form.getCustomerAreaCode())) { + Boolean aBoolean = streetPartyCalculate(customerId, monthId);//党建能力 + if (!aBoolean.equals(true)) { + throw new RenException("calculate street-party-ability failure ......"); + } + Boolean bBoolean = streetGovernAbilityCalculate(customerId, monthId);// 治理能力 + if (!bBoolean.equals(true)) { + throw new RenException("calculate street-govern-ability failure ......"); + } + Boolean cBoolean = streetServiceAbilityCalculate(customerId, monthId);// 服务能力 + if (!cBoolean.equals(true)) { + throw new RenException("calculate street-service-ability failure ......"); + } + Boolean dBoolean = streetRelate(customerId, monthId); + if (!dBoolean.equals(true)) { + throw new RenException("calculate street-all insert failure ......"); + } + }else { + //党建能力 + Boolean aBoolean = streetPartyCalculateExistsSub(form); + if (!aBoolean.equals(true)) { + throw new RenException("calculate street-party-ability-exists-sub failure ......"); + } + // 治理能力 + Boolean bBoolean = streetGovernAbilityCalculateExistsSub(form); + if (!bBoolean.equals(true)) { + throw new RenException("calculate street-govern-ability-exists-sub failure ......"); + } + // 服务能力 + Boolean cBoolean = streetServiceAbilityCalculateExistsSub(form); + if (!cBoolean.equals(true)) { + throw new RenException("calculate street-service-ability-exists-sub failure ......"); + } + Boolean dBoolean = streetRelateExistsSub(form); + if (!dBoolean.equals(true)) { + throw new RenException("calculate street-all-exists-sub insert failure ......"); + } } //计算自身和下级 CalculateCommonFormDTO formDTO = new CalculateCommonFormDTO(); @@ -568,4 +591,273 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ result.setFiveLevel(resultFive); return result; } + + /** + * @param form + * @Description 社区名义发文数量计算【党建能力】 + * @author zxc + * @date 2020/8/26 10:46 上午 + */ + public Boolean streetPartyCalculateExistsSub(CalculateCommonFormDTO form) { + // 党建能力 + // 根据all_parent_index_code 获取指标明细 + String customerId = form.getCustomerId(); + String monthId = form.getMonthId(); + 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 true; + } + List indexInputVOS = new ArrayList<>(); + Map pid = new HashMap<>(); + //下属所有社区的党建能力平均值 + detailListByParentCode.forEach(detail -> { + if (IndexCodeEnum.JIE_DAO_XIA_SHU_SYSQDJNLHZPJZ.getCode().equals(detail.getIndexCode())) { + List subCommPartyAvgScore = communityScoreDao.selectSubCommAvgScoreExistSub(monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),form.getCustomerAreaCode()); + if (CollectionUtils.isEmpty(subCommPartyAvgScore)) { + log.warn(IndexCalConstant.COMMUNITY_PARTY_AVG_NULL); + } else if (subCommPartyAvgScore.size() > NumConstant.ZERO) { + MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subCommPartyAvgScore.stream().map(o -> o.getScore()).collect(Collectors.toList())); + Integer indexEnd = NumConstant.TEN; + List> partition = ListUtils.partition(subCommPartyAvgScore, indexEnd); + partition.forEach(publish -> { + List index1SampleValues = new ArrayList<>(); + publish.forEach(c -> { + pid.put(c.getAgencyId(),c.getParentId()); + SampleValue s = new SampleValue(c.getAgencyId(), c.getScore()); + index1SampleValues.add(s); + }); + BigDecimalScoreCalculator sc = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexCode(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), IndexCodeEnum.isAvgIndex(detail.getIndexCode()), sc); + indexInputVOS.add(index1VO); + }); + } + } else { + // 街道名义发文数量 + List> mapList = factIndexPartyAblityOrgMonthlyDao.selectPublishArticleCountMapExistSub(monthId,form.getCustomerAreaCode(),NumConstant.NINE); + if (CollectionUtils.isEmpty(mapList)) { + log.warn(IndexCalConstant.STREET_PUBLISH_ARTICLE_LIST_NULL); + } else { + String fieldName = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode()); + if (StringUtils.isEmpty(fieldName)) { + log.error(String.format(IndexCalConstant.INDEX_CODE_NULL, detail.getIndexCode())); + return; + } else { + MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(mapList.stream().map(m -> new BigDecimal(m.get(fieldName).toString())).collect(Collectors.toList())); + List>> publishArticleList = ListUtils.partition(mapList, IndexCalConstant.PAGE_SIZE); + publishArticleList.forEach(publish -> { + ScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); + List index1SampleValues = new ArrayList<>(); + publish.forEach(c -> { + pid.put(c.get(IndexCalConstant.AGENCY_ID).toString(), c.get(IndexCalConstant.PARENT_ID).toString()); + SampleValue s = new SampleValue((String) c.get(IndexCalConstant.AGENCY_ID), new BigDecimal(String.valueOf(c.get(fieldName)))); + index1SampleValues.add(s); + }); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexCode(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), IndexCodeEnum.isAvgIndex(detail.getIndexCode()), sc1); + indexInputVOS.add(index1VO); + }); + } + } + } + }); + BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); + HashMap scoreTotalOfSampleId = batchScoreCalculator.getScoreTotalOfSampleId(indexInputVOS); + log.info("streetPartyAbilityCalculateExistsSub getScoreTotalOfSampleId param:{}", JSON.toJSONString(indexInputVOS)); + log.info("streetPartyAbilityCalculateExistsSub getScoreCountOfSampleId result:{}", JSON.toJSONString(scoreTotalOfSampleId)); + AgencyCalResultDTO result = getResultB(scoreTotalOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(), IndexCodeEnum.JIE_DAO_XIANG_GUAN.getCode(), pid); + deleteOldRecord(customerId, monthId, IndexCalConstant.STREET_LEVEL); + insertDetail(result); + return true; + } + + /** + * @Description 街道治理能力 + * @param form + * @author zxc + * @date 2020/8/26 1:40 下午 + */ + public Boolean streetGovernAbilityCalculateExistsSub(CalculateCommonFormDTO form) { + String customerId = form.getCustomerId(); + String monthId = form.getMonthId(); + 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 true; + } + List indexInputVOS = new ArrayList<>(); + Map pid = new HashMap<>(); + detailListByParentCode.forEach(detail -> { + if (IndexCodeEnum.JIE_DAO_XIA_SHU_SYSQZLNLHZ.getCode().equals(detail.getIndexCode())) { + List subGridGovernAvg = communityScoreDao.selectSubCommAvgScoreExistSub(monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),form.getCustomerAreaCode()); + if (CollectionUtils.isEmpty(subGridGovernAvg)){ + log.warn("查询街道下属所有社区治理能力汇总为空"); + }else if (subGridGovernAvg.size() > NumConstant.ZERO) { + MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subGridGovernAvg.stream().map(o -> o.getScore()).collect(Collectors.toList())); + List> governAvg = ListUtils.partition(subGridGovernAvg, IndexCalConstant.PAGE_SIZE); + governAvg.forEach(avg -> { + List index1SampleValues = new ArrayList<>(); + avg.forEach(c -> { + pid.put(c.getAgencyId(),c.getParentId()); + SampleValue s = new SampleValue(c.getAgencyId(), c.getScore()); + index1SampleValues.add(s); + }); + BigDecimalScoreCalculator sc = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexCode(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), IndexCodeEnum.isAvgIndex(detail.getIndexCode()), sc); + indexInputVOS.add(index1VO); + }); + } + } else { + // 治理能力的六个五级指标 + List> communityGovernAbility = factIndexGovrnAblityOrgMonthlyDao.selectCommunityGovernAbilityExistsSub(monthId,form.getCustomerAreaCode()); + if (CollectionUtils.isEmpty(communityGovernAbility)){ + log.warn(IndexCalConstant.STREET_GOVERN_ABILITY_NULL); + }else{ + String fieldNameByIndexCode = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode()); + if (StringUtils.isEmpty(fieldNameByIndexCode)) { + log.error(String.format(IndexCalConstant.INDEX_CODE_NULL,detail.getIndexCode())); + return; + } + List decimalList = communityGovernAbility.stream().map(m -> new BigDecimal(m.get(fieldNameByIndexCode).toString())).collect(Collectors.toList()); + MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(decimalList); + List>> governAbilityList = ListUtils.partition(communityGovernAbility, IndexCalConstant.PAGE_SIZE); + governAbilityList.forEach(governAbility -> { + ScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); + List index1SampleValues = new ArrayList<>(); + governAbility.forEach(c -> { + pid.put(c.get(IndexCalConstant.AGENCY_ID).toString(), c.get(IndexCalConstant.PARENT_ID).toString()); + SampleValue s = new SampleValue((String) c.get(IndexCalConstant.AGENCY_ID), new BigDecimal(String.valueOf(c.get(fieldNameByIndexCode)))); + index1SampleValues.add(s); + }); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexCode(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), IndexCodeEnum.isAvgIndex(detail.getIndexCode()), sc1); + indexInputVOS.add(index1VO); + }); + } + } + }); + BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); + HashMap scoreTotalOfSampleId = batchScoreCalculator.getScoreTotalOfSampleId(indexInputVOS); + log.info("streetGovernAbilityCalculateExistsSub getScoreTotalOfSampleId param:{}", JSON.toJSONString(indexInputVOS)); + log.info("streetGovernAbilityCalculateExistsSub getScoreCountOfSampleId result:{}", JSON.toJSONString(scoreTotalOfSampleId)); + AgencyCalResultDTO result = getResultB(scoreTotalOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(), IndexCodeEnum.JIE_DAO_XIANG_GUAN.getCode(), pid); + insertDetail(result); + return true; + } + + /** + * @Description 街道服务能力 + * @param form + * @author zxc + * @date 2020/8/31 1:38 下午 + */ + public Boolean streetServiceAbilityCalculateExistsSub(CalculateCommonFormDTO form) { + String customerId = form.getCustomerId(); + String monthId = form.getMonthId(); + 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 true; + } + List indexInputVOS = new ArrayList<>(); + Map pid = new HashMap<>(); + detailListByParentCode.forEach(detail -> { + String indexCode = detail.getIndexCode(); + if (IndexCodeEnum.JIE_DAO_XIA_SHU_SQFWNLDFPYZ.getCode().equals(indexCode)) { + List subCommServiceAvg = communityScoreDao.selectSubCommAvgScoreExistSub(monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode(),form.getCustomerAreaCode()); + if (CollectionUtils.isEmpty(subCommServiceAvg)) { + log.warn("查询街道下属社区服务能力得分平均值为空"); + } else if (subCommServiceAvg.size() > NumConstant.ZERO) { + MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subCommServiceAvg.stream().map(o -> o.getScore()).collect(Collectors.toList())); + List> serviceAvgList = ListUtils.partition(subCommServiceAvg, IndexCalConstant.PAGE_SIZE); + serviceAvgList.forEach(serviceAvg -> { + BigDecimalScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); + List index1SampleValues = new ArrayList<>(); + serviceAvg.forEach(c -> { + pid.put(c.getAgencyId(),c.getParentId()); + SampleValue s = new SampleValue(c.getAgencyId(), c.getScore()); + index1SampleValues.add(s); + }); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexCode(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), IndexCodeEnum.isAvgIndex(detail.getIndexCode()), sc1); + indexInputVOS.add(index1VO); + }); + } + } else { + List> communityActivityCountList = factIndexServiceAblityOrgMonthlyDao.selectActivityCountMapExistsSub(monthId,form.getCustomerAreaCode()); + if (CollectionUtils.isEmpty(communityActivityCountList)) { + log.warn(IndexCalConstant.STREET_SERVICE_ABILITY_NULL); + }else{ + String fieldNameByIndexCode = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode()); + if (StringUtils.isEmpty(fieldNameByIndexCode)) { + log.error(String.format(IndexCalConstant.INDEX_CODE_NULL,detail.getIndexCode())); + return; + } + List decimalList = communityActivityCountList.stream().map(m -> new BigDecimal(m.get(fieldNameByIndexCode).toString())).collect(Collectors.toList()); + MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(decimalList); + List>> communityActivityList = ListUtils.partition(communityActivityCountList, IndexCalConstant.PAGE_SIZE); + communityActivityList.forEach(communityActivity -> { + ScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); + List index1SampleValues = new ArrayList<>(); + communityActivity.forEach(c -> { + pid.put(c.get(IndexCalConstant.AGENCY_ID).toString(), c.get(IndexCalConstant.PARENT_ID).toString()); + SampleValue s = new SampleValue((String) c.get(IndexCalConstant.AGENCY_ID), new BigDecimal(String.valueOf(c.get(fieldNameByIndexCode)))); + index1SampleValues.add(s); + }); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexCode(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), IndexCodeEnum.isAvgIndex(detail.getIndexCode()), sc1); + indexInputVOS.add(index1VO); + }); + } + } + }); + BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); + HashMap scoreTotalOfSampleId = batchScoreCalculator.getScoreTotalOfSampleId(indexInputVOS); + log.info("streetServiceAbilityCalculateExistsSub getScoreTotalOfSampleId param:{}", JSON.toJSONString(indexInputVOS)); + log.info("streetServiceAbilityCalculateExistsSub getScoreCountOfSampleId result:{}", JSON.toJSONString(scoreTotalOfSampleId)); + AgencyCalResultDTO result = getResultB(scoreTotalOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.FU_WU_NENG_LI.getCode(), IndexCodeEnum.JIE_DAO_XIANG_GUAN.getCode(), pid); + insertDetail(result); + return true; + } + + /** + * @Description 街道相关计算 + * @param form + * @author zxc + * @date 2020/9/3 9:21 上午 + */ + public Boolean streetRelateExistsSub(CalculateCommonFormDTO form) { + String customerId = form.getCustomerId(); + String monthId = form.getMonthId(); + List detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode()); + List agencyScoreList = agencyScoreDao.selectAgencyScoreInfoExistsSub(form.getCustomerAreaCode(), NumConstant.NINE, monthId, IndexCalConstant.STREET_LEVEL); + detailListByParentCode.forEach(detail -> { + agencyScoreList.forEach(community -> { + if (detail.getIndexCode().equals(community.getIndexCode())) { + community.setScore(community.getScore().multiply(detail.getWeight())); + } + }); + }); + Map> collect = agencyScoreList.stream().collect(Collectors.groupingBy(AgencyScoreDTO::getAgencyId)); + List result = new ArrayList<>(); + collect.forEach((key, value) -> { + AgencyScoreDTO score = new AgencyScoreDTO(); + score.setIsTotal(NumConstant.ONE_STR); + score.setCustomerId(customerId); + score.setAgencyId(key); + score.setMonthId(monthId); + score.setYearId(DateUtils.getYearId(monthId)); + score.setQuarterId(DateUtils.getQuarterId(monthId)); + score.setIndexCode(IndexCodeEnum.JIE_DAO_XIANG_GUAN.getCode()); + score.setDataType(IndexCalConstant.STREET_LEVEL); + score.setAllParentIndexCode(NumConstant.ZERO_STR); + score.setWeight(new BigDecimal(NumConstant.ONE_NEG)); + value.forEach(street -> { + score.setScore(score.getScore().add(street.getScore())); + score.setParentAgencyId(street.getParentAgencyId()); + }); + result.add(score); + }); + if (!CollectionUtils.isEmpty(result)){ + agencyScoreDao.insertStreetRecord(result); + } + return true; + } + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexCollectService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexCollectService.java index 98d0fc95af..158ced77de 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexCollectService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexCollectService.java @@ -1,9 +1,8 @@ package com.epmet.service.evaluationindex.indexcoll; +import com.epmet.dto.indexcal.CalculateCommonFormDTO; import com.epmet.dto.indexcollect.form.*; -import java.util.List; - /** * 大屏数据采集api * @@ -110,11 +109,9 @@ public interface FactIndexCollectService { /** * 将网格、社区、区直部门、区/街道分支记录表中的数据,抽取到 指数-指数数据(每月数值) 指数-指数数据(按年统计) - * @param monthId 2020-8 - * @param customerId * @return void * @Author zhangyong * @Date 10:29 2020-09-03 **/ - void insertScreenIndexDataMonthlyAndYearly(String monthId, String customerId); + void insertScreenIndexDataMonthlyAndYearly(CalculateCommonFormDTO calculateCommonFormDTO); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexCollectServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexCollectServiceImpl.java index 2ea0aa08d0..a117021b91 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexCollectServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexCollectServiceImpl.java @@ -18,6 +18,7 @@ import com.epmet.dao.evaluationindex.indexcoll.*; import com.epmet.dao.evaluationindex.screen.*; import com.epmet.dto.ScreenCustomerGridDTO; import com.epmet.dto.indexcal.AgencyScoreDTO; +import com.epmet.dto.indexcal.CalculateCommonFormDTO; import com.epmet.dto.indexcal.DeptScoreDTO; import com.epmet.dto.indexcollect.form.*; import com.epmet.dto.screen.FactIndexCommunityScoreDTO; @@ -44,7 +45,6 @@ import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.concurrent.TimeUnit; -import java.util.concurrent.atomic.AtomicInteger; import java.util.stream.Collectors; /** @@ -225,9 +225,9 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { * @date 2020/10/20 2:59 下午 */ @Override - public void insertScreenIndexDataMonthlyAndYearly(String monthId, String customerId) { - if (NumConstant.SIX != monthId.length()) { - throw new RuntimeException("入参monthId格式不正确:monthId =" + monthId); + public void insertScreenIndexDataMonthlyAndYearly(CalculateCommonFormDTO formDTO) { + if (NumConstant.SIX != formDTO.getMonthId().length()) { + throw new RuntimeException("入参monthId格式不正确:monthId =" + formDTO.getMonthId()); } RLock lock = distributedLock.getLock(LockConstants.STATS_LOCK_NAME); try { @@ -236,26 +236,27 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { } allParentIds.cleanUp(); // 根据网格类型,删除 指数-指数数据(每月数值)表中 匹配的数据 - this.batchDelIndexDataMonthly(customerId, monthId, OrgTypeConstant.GRID); + this.batchDelIndexDataMonthly(formDTO.getCustomerId(), formDTO.getMonthId(), OrgTypeConstant.GRID); // 开始处理 网格相关分值表 - this.startHandleIndexGridScore(monthId, customerId); + this.startHandleIndexGridScore(formDTO); // 根据组织类型,删除 指数-指数数据(每月数值)表中 匹配的数据 - this.batchDelIndexDataMonthly(customerId, monthId, OrgTypeConstant.AGENCY); + this.batchDelIndexDataMonthly(formDTO.getCustomerId(), formDTO.getMonthId(), OrgTypeConstant.AGENCY); // 开始处理 社区相关分值表 - this.startHandleIndexCommunityScore(monthId, customerId); + this.startHandleIndexCommunityScore(formDTO); // 根据部门类型,删除 指数-指数数据(每月数值)表中 匹配的数据 - this.batchDelIndexDataMonthly(customerId, monthId, OrgTypeConstant.DEPARTMENT); + this.batchDelIndexDataMonthly(formDTO.getCustomerId(), formDTO.getMonthId(), OrgTypeConstant.DEPARTMENT); // 开始处理 区直部门分值表 - this.startHandleIndexDeptScore(monthId, customerId); + this.startHandleIndexDeptScore(formDTO); // 同样是 组织类型,所以不再重复删除了 // 开始处理 区/街道相关分数表 - this.startHandleIndexAgencyScore(monthId, customerId); + //todo + this.startHandleIndexAgencyScore(formDTO); // 根据年,汇总今年各项得到,计算平均值后 插入年表 screen_index_data_yearly - this.insertIndexDataYear(monthId, customerId); + this.insertIndexDataYear(formDTO.getMonthId(), formDTO.getCustomerId()); allParentIds.invalidateAll(); } finally { distributedLock.unLock(lock); @@ -266,13 +267,13 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { * 目标:将网格的 党建能力、治理能力、服务能力、总指数 得分。 整理后(4条合1条) 插入 指数-指数数据(月表) * 如果网格相关分值表 中的网格数量不全,需要从 网格(党支部)信息表 中,先查询到缺少的网格信息,赋上默认值后,插入 指数-指数数据(月表) * - * @param monthId - * @param customerId * @return void * @Author zhangyong * @Date 13:44 2020-09-04 **/ - private void startHandleIndexGridScore(String monthId, String customerId){ + private void startHandleIndexGridScore(CalculateCommonFormDTO formDTO){ + String customerId=formDTO.getCustomerId(); + String monthId=formDTO.getMonthId(); List mismatchGridList = new ArrayList<>(); // 查询网格相关分值记录 表已经存在的网格id List indexGridIds = factIndexGridScoreDao.selectListGridId(customerId, monthId); @@ -283,9 +284,9 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { gridIds[i] = indexGridIds.get(i); } // 进行不匹配查询(即返回网格相关分值表 中不存在的网格信息)。 - mismatchGridList = screenCustomerGridDao.selectListMismatchGridInfo(customerId, gridIds); + mismatchGridList = screenCustomerGridDao.selectListMismatchGridInfo(customerId, gridIds,formDTO.getCustomerAreaCode(),formDTO.getSubCustomerIds()); } else { - mismatchGridList = screenCustomerGridDao.selectListMismatchGridInfo(customerId, null); + mismatchGridList = screenCustomerGridDao.selectListMismatchGridInfo(customerId, null,formDTO.getCustomerAreaCode(),formDTO.getSubCustomerIds()); } if (!CollectionUtils.isEmpty(mismatchGridList)){ @@ -295,7 +296,7 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { // fact_index_grid_score 网格相关分值记录表 grid List gridScoreDTOS = factIndexGridScoreDao.selectListGridScore(customerId, monthId); // 开始处理实际分数 - this.insertIndexDataMonthlyByGridScore(monthId, customerId, gridScoreDTOS); + this.insertIndexDataMonthlyByGridScore(monthId, customerId, gridScoreDTOS,formDTO.getCustomerAreaCode(),formDTO.getSubCustomerIds()); } /** @@ -340,12 +341,12 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { * @Author zhangyong * @Date 14:17 2020-09-03 **/ - private void insertIndexDataMonthlyByGridScore(String monthId, String customerId, List gridScoreDTOS) { + private void insertIndexDataMonthlyByGridScore(String monthId, String customerId, List gridScoreDTOS,String customerAreaCode,List subCustomerIds) { List monthlyFormDTOList = new ArrayList<>(); // 根据网格id进行分组,最后组装一条数据 一个网格 对应 4条数据 Map> collect = gridScoreDTOS.stream().collect(Collectors.groupingBy(FactIndexGridScoreDTO::getGridId)); // 查询网格的 上级组织id 和 组织名称 - List parentGridList = screenCustomerGridDao.selectListGridInfo(customerId); + List parentGridList = screenCustomerGridDao.selectListGridInfo(customerId,customerAreaCode,subCustomerIds); if (!CollectionUtils.isEmpty(parentGridList)) { parentGridList.forEach(o -> { allParentIds.put(o.getGridId(), o.getAllParentIds()); @@ -399,13 +400,13 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { * 目标:将社区的 党建能力、治理能力、服务能力、总指数 得分。 整理后(4条合1条) 插入 指数-指数数据(月表) * 如果社区相关分值表 中的社区数量不全,需要从 组织机构信息 中,先查询到缺少的社区信息,赋上默认值后,在插入 指数-指数数据(月表) * - * @param monthId - * @param customerId * @return void * @Author zhangyong * @Date 13:44 2020-09-04 **/ - private void startHandleIndexCommunityScore(String monthId, String customerId){ + private void startHandleIndexCommunityScore(CalculateCommonFormDTO formDTO){ + String customerId=formDTO.getCustomerId(); + String monthId=formDTO.getMonthId(); List mismatchAgencyList = new ArrayList<>(); // 查询社区相关分值记录id List indexCommunityIds = factIndexCommunityScoreDao.selectListCommunityId(customerId, monthId); @@ -416,9 +417,9 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { communityIds[i] = indexCommunityIds.get(i); } // 进行不匹配查询(即返回社区相关分值表 中不存在的【社区级】 组织信息)。 - mismatchAgencyList = screenCustomerAgencyDao.selectListMismatcCommunityAgencyInfo(customerId, communityIds); + mismatchAgencyList = screenCustomerAgencyDao.selectListMismatcCommunityAgencyInfo(customerId, communityIds,formDTO.getCustomerAreaCode(),formDTO.getSubCustomerIds()); } else { - mismatchAgencyList = screenCustomerAgencyDao.selectListMismatcCommunityAgencyInfo(customerId, null); + mismatchAgencyList = screenCustomerAgencyDao.selectListMismatcCommunityAgencyInfo(customerId, null,formDTO.getCustomerAreaCode(),formDTO.getSubCustomerIds()); } if (!CollectionUtils.isEmpty(mismatchAgencyList)){ @@ -429,7 +430,7 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { // 查询社区相关分值记录 List communityScoreDTOS = factIndexCommunityScoreDao.selectListCommunityScore(customerId, monthId); // 开始处理实际分数 - this.insertIndexDataMonthlyByCommunityScore(monthId, customerId, communityScoreDTOS); + this.insertIndexDataMonthlyByCommunityScore(monthId, customerId, communityScoreDTOS,formDTO.getCustomerAreaCode(),formDTO.getSubCustomerIds()); } /** @@ -474,12 +475,14 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { * @Author zhangyong * @Date 14:17 2020-09-03 **/ - private void insertIndexDataMonthlyByCommunityScore(String monthId, String customerId, List communityScoreDTOS) { + private void insertIndexDataMonthlyByCommunityScore(String monthId, String customerId, List communityScoreDTOS, + String customerAreaCode, + List subCustomerIds) { List monthlyFormDTOList = new ArrayList<>(); // 根据组织id 进行分组,最后组装一条数据 一个组织id 对应 4条数据 Map> collect = communityScoreDTOS.stream().collect(Collectors.groupingBy(FactIndexCommunityScoreDTO::getAgencyId)); // 根据客户id,查询区/街道 组织名称、id - List parentAgencyList = screenCustomerAgencyDao.selectListAgencyInfo(customerId); + List parentAgencyList = screenCustomerAgencyDao.selectListAgencyInfo(customerId,customerAreaCode,subCustomerIds); if (!CollectionUtils.isEmpty(parentAgencyList)) { parentAgencyList.forEach(o -> { allParentIds.put(o.getAgencyId(), o.getPids()); @@ -534,13 +537,13 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { * 目标:将区直部门的 党建能力、治理能力、服务能力、总指数 得分。 整理后(4条合1条) 插入 指数-指数数据(月表) * 如果 区直部门分值表 中的部门数量不全,需要从 部门信息表 中,先查询到缺少的部门信息,赋上默认值后,在插入 指数-指数数据(月表) * - * @param monthId - * @param customerId * @return void * @Author zhangyong * @Date 13:44 2020-09-04 **/ - private void startHandleIndexDeptScore(String monthId, String customerId){ + private void startHandleIndexDeptScore(CalculateCommonFormDTO formDTO){ + String customerId=formDTO.getCustomerId(); + String monthId=formDTO.getMonthId(); List mismatchDeptList = new ArrayList<>(); // 查询社 区直部门分值表 List indexDeptIds = deptScoreDao.selectListDeptId(customerId, monthId); @@ -549,9 +552,9 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { for (int i = NumConstant.ZERO; i < indexDeptIds.size(); i++){ depeIds[i] = indexDeptIds.get(i); } - mismatchDeptList = screenCustomerDeptDao.selectListMismatchDeptInfo(customerId, depeIds); + mismatchDeptList = screenCustomerDeptDao.selectListMismatchDeptInfo(customerId, depeIds,formDTO.getCustomerAreaCode(),formDTO.getSubCustomerIds()); } else { - mismatchDeptList = screenCustomerDeptDao.selectListMismatchDeptInfo(customerId, null); + mismatchDeptList = screenCustomerDeptDao.selectListMismatchDeptInfo(customerId, null,formDTO.getCustomerAreaCode(),formDTO.getSubCustomerIds()); } if (!CollectionUtils.isEmpty(mismatchDeptList)) { @@ -568,7 +571,7 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { // 查询社 区直部门分值表 List deptScoreDTOS = deptScoreDao.selectListDeptScore(customerId, monthId); // 开始处理实际分数 - this.insertIndexDataMonthlyByDeptScore(monthId, customerId, deptScoreDTOS); + this.insertIndexDataMonthlyByDeptScore(monthId, customerId, deptScoreDTOS,formDTO.getCustomerAreaCode(),formDTO.getSubCustomerIds()); } /** @@ -613,11 +616,13 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { * @Author zhangyong * @Date 14:17 2020-09-03 **/ - private void insertIndexDataMonthlyByDeptScore(String monthId, String customerId, List deptScoreDTOS){ + private void insertIndexDataMonthlyByDeptScore(String monthId, String customerId, List deptScoreDTOS, + String customerAreaCode, + List subCustomerIds){ List monthlyFormDTOList = new ArrayList<>(); // 根据部门id 进行分组,最后组装一条数据 一个部门id 对应 4条数据 Map> collect = deptScoreDTOS.stream().collect(Collectors.groupingBy(DeptScoreDTO::getDeptId)); - List parentDeptList = screenCustomerDeptDao.selectListDeptInfo(customerId); + List parentDeptList = screenCustomerDeptDao.selectListDeptInfo(customerId,customerAreaCode,subCustomerIds); for(Map.Entry> deptScore : collect.entrySet()){ IndexDataMonthlyFormDTO monthlyFormDTO = new IndexDataMonthlyFormDTO(); // 给4个指数 赋默认值 @@ -666,13 +671,13 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { * 目标:将 区/街道的 党建能力、治理能力、服务能力、总指数 得分。 整理后(4条合1条) 插入 指数-指数数据(月表) * 如果 区/街道相关分数表 中的组织数量不全,需要从 组织机构信息 中,先查询到缺少的组织信息,赋上默认值后,在插入 区/街道相关分数表。 一对四 * - * @param monthId - * @param customerId * @return void * @Author zhangyong * @Date 13:44 2020-09-04 **/ - private void startHandleIndexAgencyScore(String monthId, String customerId){ + private void startHandleIndexAgencyScore(CalculateCommonFormDTO formDTO){ + String customerId=formDTO.getCustomerId(); + String monthId=formDTO.getMonthId(); List mismatchAgencyList = new ArrayList<>(); List indexAgencyIds = agencyScoreDaol.selectListAgencyId(customerId, monthId); if (indexAgencyIds.size() > NumConstant.ZERO){ @@ -680,9 +685,10 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { for (int i = NumConstant.ZERO; i < indexAgencyIds.size(); i++){ agencyIds[i] = indexAgencyIds.get(i); } - mismatchAgencyList = screenCustomerAgencyDao.selectListMismatcStreetAndDistrictAgencyInfo(customerId, agencyIds); + //todo 平阴县areaCode重复 + mismatchAgencyList = screenCustomerAgencyDao.selectListMismatcStreetAndDistrictAgencyInfo(customerId, agencyIds,formDTO.getCustomerAreaCode(),formDTO.getSubCustomerIds()); } else { - mismatchAgencyList = screenCustomerAgencyDao.selectListMismatcStreetAndDistrictAgencyInfo(customerId, null); + mismatchAgencyList = screenCustomerAgencyDao.selectListMismatcStreetAndDistrictAgencyInfo(customerId, null,formDTO.getCustomerAreaCode(),formDTO.getSubCustomerIds()); } if (!CollectionUtils.isEmpty(mismatchAgencyList)){ @@ -691,7 +697,7 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { // fact_index_agency_score 区/街道相关分数表 agency List agencyScoreDTOS = agencyScoreDaol.selectListAgencyScore(customerId, monthId); // 开始处理实际分数 - this.insertIndexDataMonthlyByAgencyScore(monthId, customerId, agencyScoreDTOS); + this.insertIndexDataMonthlyByAgencyScore(monthId, customerId, agencyScoreDTOS,formDTO.getCustomerAreaCode(),formDTO.getSubCustomerIds()); } /** @@ -704,11 +710,13 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { * @Author zhangyong * @Date 14:17 2020-09-03 **/ - private void insertIndexDataMonthlyByAgencyScore(String monthId, String customerId, List agencyScoreDTOS) { + private void insertIndexDataMonthlyByAgencyScore(String monthId, String customerId, List agencyScoreDTOS, + String customerAreaCode, + List subCustomerIds) { List monthlyFormDTOList = new ArrayList<>(); // 根据组织id(eg:社区或者街道id) 进行分组,最后组装一条数据 一个组织id 对应 4条数据 Map> collect = agencyScoreDTOS.stream().collect(Collectors.groupingBy(AgencyScoreDTO::getAgencyId)); - List parentAgencyList = screenCustomerAgencyDao.selectListAgencyInfo(customerId); + List parentAgencyList = screenCustomerAgencyDao.selectListAgencyInfo(customerId,customerAreaCode,subCustomerIds); int j = 0; if (!CollectionUtils.isEmpty(parentAgencyList)) { parentAgencyList.forEach(o -> { diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectGridDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectGridDailyService.java new file mode 100644 index 0000000000..2b710cefb3 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectGridDailyService.java @@ -0,0 +1,114 @@ +/** + * 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.service.evaluationindex.screen; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.screen.ScreenProjectGridDailyDTO; +import com.epmet.dto.screencoll.ScreenCollFormDTO; +import com.epmet.entity.evaluationindex.screen.ScreenProjectGridDailyEntity; + +import java.util.List; +import java.util.Map; + +/** + * 项目(事件)分析按网格_按天统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-01-27 + */ +public interface ScreenProjectGridDailyService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-01-27 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-01-27 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return ScreenProjectGridDailyDTO + * @author generator + * @date 2021-01-27 + */ + ScreenProjectGridDailyDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-01-27 + */ + void save(ScreenProjectGridDailyDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-01-27 + */ + void update(ScreenProjectGridDailyDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-01-27 + */ + void delete(String[] ids); + + /** + * @Description 数据采集 + * @param customerId + * @param data + * @return void + * @author wangc + * @date 2021.01.28 09:33 + */ + void collect(String customerId, ScreenCollFormDTO data); + + /** + * @Description 数据抽取【网格-日】 + * @Param + * @author zxc + * @date 2021/1/28 下午3:05 + */ + void extractionProjectGridDaily(String customerId,String dateId); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectOrgDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectOrgDailyService.java new file mode 100644 index 0000000000..587a6eef72 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectOrgDailyService.java @@ -0,0 +1,115 @@ +/** + * 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.service.evaluationindex.screen; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.screen.ScreenProjectOrgDailyDTO; +import com.epmet.dto.screencoll.ScreenCollFormDTO; +import com.epmet.entity.evaluationindex.screen.ScreenProjectOrgDailyEntity; + +import java.util.List; +import java.util.Map; + +/** + * 项目(事件)分析按组织_按天统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-01-27 + */ +public interface ScreenProjectOrgDailyService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-01-27 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-01-27 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return ScreenProjectOrgDailyDTO + * @author generator + * @date 2021-01-27 + */ + ScreenProjectOrgDailyDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-01-27 + */ + void save(ScreenProjectOrgDailyDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-01-27 + */ + void update(ScreenProjectOrgDailyDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-01-27 + */ + void delete(String[] ids); + + /** + * @Description 数据采集 + * @param customerId + * @param data + * @return void + * @author wangc + * @date 2021.01.28 09:33 + */ + void collect(String customerId, ScreenCollFormDTO data); + + /** + * @Description 数据抽取【机关-日】 + * @Param customerId + * @Param dateId + * @author zxc + * @date 2021/2/1 下午1:32 + */ + void extractionProjectOrgDaily(String customerId, String dateId); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectQuantityGridMonthlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectQuantityGridMonthlyService.java new file mode 100644 index 0000000000..6d5e5b909d --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectQuantityGridMonthlyService.java @@ -0,0 +1,114 @@ +/** + * 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.service.evaluationindex.screen; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.screen.ScreenProjectQuantityGridMonthlyDTO; +import com.epmet.dto.screencoll.ScreenCollFormDTO; +import com.epmet.entity.evaluationindex.screen.ScreenProjectQuantityGridMonthlyEntity; + +import java.util.List; +import java.util.Map; + +/** + * 项目(事件)数量分析按网格_按月统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-01-27 + */ +public interface ScreenProjectQuantityGridMonthlyService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-01-27 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-01-27 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return ScreenProjectQuantityGridMonthlyDTO + * @author generator + * @date 2021-01-27 + */ + ScreenProjectQuantityGridMonthlyDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-01-27 + */ + void save(ScreenProjectQuantityGridMonthlyDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-01-27 + */ + void update(ScreenProjectQuantityGridMonthlyDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-01-27 + */ + void delete(String[] ids); + /** + * @Description 数据采集 + * @param customerId + * @param data + * @return void + * @author wangc + * @date 2021.01.28 09:33 + */ + void collect(String customerId, ScreenCollFormDTO data); + + /** + * @Description 数据抽取 【网格-月】 + * @Param customerId + * @Param monthId + * @author zxc + * @date 2021/1/29 下午1:57 + */ + void extractionProjectGridMonthly(String customerId,String monthId); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectQuantityOrgMonthlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectQuantityOrgMonthlyService.java new file mode 100644 index 0000000000..88c451bcfc --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectQuantityOrgMonthlyService.java @@ -0,0 +1,115 @@ +/** + * 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.service.evaluationindex.screen; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.screen.ScreenProjectQuantityOrgMonthlyDTO; +import com.epmet.dto.screencoll.ScreenCollFormDTO; +import com.epmet.entity.evaluationindex.screen.ScreenProjectQuantityOrgMonthlyEntity; + +import java.util.List; +import java.util.Map; + +/** + * 项目(事件)数量分析按组织_按月统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-01-27 + */ +public interface ScreenProjectQuantityOrgMonthlyService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-01-27 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-01-27 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return ScreenProjectQuantityOrgMonthlyDTO + * @author generator + * @date 2021-01-27 + */ + ScreenProjectQuantityOrgMonthlyDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-01-27 + */ + void save(ScreenProjectQuantityOrgMonthlyDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-01-27 + */ + void update(ScreenProjectQuantityOrgMonthlyDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-01-27 + */ + void delete(String[] ids); + + /** + * @Description 数据采集 + * @param customerId + * @param data + * @return void + * @author wangc + * @date 2021.01.28 09:33 + */ + void collect(String customerId, ScreenCollFormDTO data); + + /** + * @Description 数据抽取【组织-月】 + * @Param customerId + * @Param monthId + * @author zxc + * @date 2021/2/2 上午10:43 + */ + void extractionProjectOrgMonthly(String customerId,String monthId); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerAgencyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerAgencyServiceImpl.java index 2cc97d3256..f89e48740e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerAgencyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerAgencyServiceImpl.java @@ -139,6 +139,7 @@ public class ScreenCustomerAgencyServiceImpl implements ScreenCustomerAgencyServ exists.setIsDisplay(NumConstant.ONE_STR); } exists.setAllParentNames(e.getAllParentName()); + exists.setParentAreaCode(e.getParentAreaCode()); updateAgency(exists); } } @@ -240,6 +241,7 @@ public class ScreenCustomerAgencyServiceImpl implements ScreenCustomerAgencyServ cae.setPid(e.getPid()); cae.setPids(e.getPids()); cae.setSourceType(OrgSourceTypeConstant.INTERNAL); + cae.setParentAreaCode(e.getParentAreaCode()); screenCustomerAgencyDao.insert(cae); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerDeptServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerDeptServiceImpl.java index 95e7f066c0..2e12d83d45 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerDeptServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerDeptServiceImpl.java @@ -75,6 +75,7 @@ public class ScreenCustomerDeptServiceImpl extends BaseServiceImpl + * 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.service.evaluationindex.screen.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.constant.DataSourceConstant; +import com.epmet.constant.PingYinConstants; +import com.epmet.dao.evaluationindex.screen.ScreenCustomerGridDao; +import com.epmet.dao.evaluationindex.screen.ScreenProjectGridDailyDao; +import com.epmet.dto.pingyin.result.EvaluateTotalResultDTO; +import com.epmet.dto.pingyin.result.ProjectTotalResultDTO; +import com.epmet.dto.pingyin.result.ResolvedNumResultDTO; +import com.epmet.dto.screen.ScreenProjectGridDailyDTO; +import com.epmet.dto.screencoll.ScreenCollFormDTO; +import com.epmet.entity.evaluationindex.screen.ScreenProjectGridDailyEntity; +import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectMainDailyService; +import com.epmet.service.evaluationindex.screen.ScreenProjectGridDailyService; +import com.google.common.collect.Lists; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.ListUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; + +import java.math.BigDecimal; +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 项目(事件)分析按网格_按天统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-01-27 + */ +@Service +@Slf4j +@DataSource(DataSourceConstant.EVALUATION_INDEX) +public class ScreenProjectGridDailyServiceImpl extends BaseServiceImpl implements ScreenProjectGridDailyService { + + @Autowired + private ScreenCustomerGridDao gridDao; + + @Autowired + private FactOriginProjectMainDailyService projectMainDailyService; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, ScreenProjectGridDailyDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, ScreenProjectGridDailyDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public ScreenProjectGridDailyDTO get(String id) { + ScreenProjectGridDailyEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, ScreenProjectGridDailyDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(ScreenProjectGridDailyDTO dto) { + ScreenProjectGridDailyEntity entity = ConvertUtils.sourceToTarget(dto, ScreenProjectGridDailyEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(ScreenProjectGridDailyDTO dto) { + ScreenProjectGridDailyEntity entity = ConvertUtils.sourceToTarget(dto, ScreenProjectGridDailyEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * @Description 数据采集 + * @param customerId + * @param data + * @return void + * @author wangc + * @date 2021.01.28 09:33 + */ + @Transactional(rollbackFor = Exception.class) + @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) + @Override + public void collect(String customerId, ScreenCollFormDTO data) { + if(data.getIsFirst()){ + int affectedRows = baseDao.deleteByDateIdAndCustomerId(customerId,data.getDateId()); + while(affectedRows > 0){ + affectedRows = baseDao.deleteByDateIdAndCustomerId(customerId,data.getDateId()); + } + } + Lists.partition(data.getDataList(), NumConstant.ONE_HUNDRED).forEach(list -> { + baseDao.insertBatch(list,customerId,"APP_USER",data.getDateId()); + }); + } + + /** + * @Description 数据抽取【网格-日】 + * @Param + * @author zxc + * @date 2021/1/28 下午3:05 + */ + @Override + public void extractionProjectGridDaily(String customerId, String dateId) { + // 查询客户下所有网格 + List gridInfos = gridDao.selectGridInfoByCustomerId(customerId); + if (CollectionUtils.isEmpty(gridInfos)){ + throw new RenException(String.format(PingYinConstants.GRID_INFO_IS_ZERO,customerId)); + } + // 查询 项目总数 + List projectTotal = projectMainDailyService.selectProjectTotal(customerId, dateId, null); + // 查询 项目解决数 + List resolvedNum = projectMainDailyService.selectResolvedNum(customerId, dateId); + //查询 参与满意度评价的总次数 + String[] activeCodesAll = {PingYinConstants.EVALUATE_BAD,PingYinConstants.EVALUATE_GOOD,PingYinConstants.EVALUATE_PERFECT}; + List evaluateTotal = projectMainDailyService.selectEvaluateCount(customerId, dateId, getActiveCode(activeCodesAll)); + //查询 满意+非常满意的总次数 + String[] activeCodesGood = {PingYinConstants.EVALUATE_GOOD,PingYinConstants.EVALUATE_PERFECT}; + List evaluateGood = projectMainDailyService.selectEvaluateCount(customerId, dateId, getActiveCode(activeCodesGood)); + + gridInfos.forEach(g -> { + g.setDateId(dateId); + // 项目总数赋值 + if (!CollectionUtils.isEmpty(projectTotal)){ + projectTotal.forEach(pt -> { + if (g.getGridId().equals(pt.getGridId())){ + g.setProjectTotal(pt.getProjectTotal()); + } + }); + } + // 项目解决数赋值 + if (!CollectionUtils.isEmpty(resolvedNum)){ + resolvedNum.forEach(rn -> { + if (g.getGridId().equals(rn.getGridId())){ + g.setResolvedNum(rn.getResolvedNum()); + } + }); + } + // 解决率 + g.setResolvedRatio(getRatio(g.getResolvedNum(),g.getProjectTotal())); + // 参与满意度评价的总次数 赋值 + if (!CollectionUtils.isEmpty(evaluateTotal)){ + evaluateTotal.forEach(et -> { + if (g.getGridId().equals(et.getOrgId())){ + g.setEvaluateTotal(et.getEvaluateCount()); + } + }); + } + // 满意+非常满意的总次数 赋值 + if (!CollectionUtils.isEmpty(evaluateGood)){ + evaluateGood.forEach(eg -> { + if (g.getGridId().equals(eg.getOrgId())){ + g.setGoodTotal(eg.getEvaluateCount()); + } + }); + } + // 不满意总次数 + g.setBadTotal(g.getEvaluateTotal()==NumConstant.ZERO ? NumConstant.ZERO : g.getEvaluateTotal() - g.getGoodTotal()); + // 满意率 + g.setGoodRatio(getRatio(g.getGoodTotal(),g.getEvaluateTotal())); + // 不满意率 + g.setBadRatio(getRatio(g.getBadTotal(),g.getEvaluateTotal())); + }); + log.info(gridInfos.toString()); + delScreenProjectGridDaily(customerId, dateId); + insertScreenProjectGridDaily(gridInfos); + } + + /** + * @Description activeCode处理 + * @Param actCode + * @author zxc + * @date 2021/1/29 上午9:33 + */ + public List getActiveCode(String[] actCode){ + List activeCodes = Arrays.asList(actCode); + return activeCodes; + } + + /** + * @Description + * @Param a + * @Param b 分母 + * @author zxc + * @date 2021/1/29 上午10:10 + */ + public BigDecimal getRatio(Integer a , Integer b){ + if (b==NumConstant.ZERO){ + return new BigDecimal(NumConstant.ZERO); + } + BigDecimal bigDecimalA = new BigDecimal(a); + BigDecimal bigDecimalB = new BigDecimal(b); + BigDecimal divide = bigDecimalA.divide(bigDecimalB, NumConstant.FOUR, BigDecimal.ROUND_HALF_UP); + return divide; + } + + /** + * @Description 新增 + * @Param list + * @author zxc + * @date 2021/2/1 上午10:24 + */ + @Transactional(rollbackFor = Exception.class) + public void insertScreenProjectGridDaily(List list){ + if (!CollectionUtils.isEmpty(list)){ + List> partition = ListUtils.partition(list, NumConstant.ONE_HUNDRED); + partition.forEach(p -> { + baseDao.insertScreenProjectGridDaily(p); + }); + } + } + + /** + * @Description 删除 + * @Param customerId + * @Param dateId + * @author zxc + * @date 2021/2/1 上午10:24 + */ + @Transactional(rollbackFor = Exception.class) + public void delScreenProjectGridDaily(String customerId,String dateId){ + Integer flag; + do { + flag = baseDao.deleteByDateIdAndCustomerId(customerId,dateId); + }while (flag > NumConstant.ZERO && flag == NumConstant.ONE_THOUSAND); + } +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectOrgDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectOrgDailyServiceImpl.java new file mode 100644 index 0000000000..3f69596cd3 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectOrgDailyServiceImpl.java @@ -0,0 +1,222 @@ +/** + * 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.service.evaluationindex.screen.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.constant.DataSourceConstant; +import com.epmet.constant.PingYinConstants; +import com.epmet.dao.evaluationindex.screen.ScreenCustomerAgencyDao; +import com.epmet.dao.evaluationindex.screen.ScreenProjectOrgDailyDao; +import com.epmet.dto.pingyin.result.ProjectOrgDailyResultDTO; +import com.epmet.dto.screen.ScreenProjectOrgDailyDTO; +import com.epmet.dto.screencoll.ScreenCollFormDTO; +import com.epmet.entity.evaluationindex.screen.ScreenProjectOrgDailyEntity; +import com.epmet.service.evaluationindex.screen.ScreenProjectOrgDailyService; +import com.google.common.collect.Lists; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.ListUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; + +import java.math.BigDecimal; +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 项目(事件)分析按组织_按天统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-01-27 + */ +@Service +@Slf4j +@DataSource(DataSourceConstant.EVALUATION_INDEX) +public class ScreenProjectOrgDailyServiceImpl extends BaseServiceImpl implements ScreenProjectOrgDailyService { + + @Autowired + private ScreenCustomerAgencyDao agencyDao; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, ScreenProjectOrgDailyDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, ScreenProjectOrgDailyDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public ScreenProjectOrgDailyDTO get(String id) { + ScreenProjectOrgDailyEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, ScreenProjectOrgDailyDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(ScreenProjectOrgDailyDTO dto) { + ScreenProjectOrgDailyEntity entity = ConvertUtils.sourceToTarget(dto, ScreenProjectOrgDailyEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(ScreenProjectOrgDailyDTO dto) { + ScreenProjectOrgDailyEntity entity = ConvertUtils.sourceToTarget(dto, ScreenProjectOrgDailyEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + + /** + * @Description 数据采集 + * @param customerId + * @param data + * @return void + * @author wangc + * @date 2021.01.28 09:33 + */ + @Transactional(rollbackFor = Exception.class) + @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) + @Override + public void collect(String customerId, ScreenCollFormDTO data) { + if(data.getIsFirst()){ + int affectedRows = baseDao.deleteByDateIdAndCustomerId(customerId,data.getDateId()); + while(affectedRows > 0){ + affectedRows = baseDao.deleteByDateIdAndCustomerId(customerId,data.getDateId()); + } + } + Lists.partition(data.getDataList(), NumConstant.ONE_HUNDRED).forEach(list -> { + baseDao.insertBatch(list,customerId,"APP_USER",data.getDateId()); + }); + } + + /** + * @Description 数据抽取【机关-日】 + * @Param customerId + * @Param dateId + * @author zxc + * @date 2021/2/1 下午1:32 + */ + @Override + public void extractionProjectOrgDaily(String customerId, String dateId) { + List agencyInfos = agencyDao.selectAgencyByCustomer(customerId); + if (CollectionUtils.isEmpty(agencyInfos)){ + throw new RenException(String.format(PingYinConstants.AGENCY_INFO_IS_ZERO,customerId)); + } + List projectOrgDaily = baseDao.selectOrgProject(agencyInfos, dateId); + if (CollectionUtils.isEmpty(projectOrgDaily)){ + log.info(String.format(PingYinConstants.SELECT_GRID_INFO_BY_ORG_IS_NULL,customerId)); + return; + } + projectOrgDaily.forEach(p -> { + p.setBadTotal(null == p.getBadTotal() ? NumConstant.ZERO : p.getBadTotal()); + p.setEvaluateTotal(null == p.getEvaluateTotal() ? NumConstant.ZERO : p.getEvaluateTotal()); + p.setGoodTotal(null == p.getGoodTotal() ? NumConstant.ZERO : p.getGoodTotal()); + p.setProjectTotal(null == p.getProjectTotal() ? NumConstant.ZERO : p.getProjectTotal()); + p.setResolvedNum(null == p.getResolvedNum() ? NumConstant.ZERO : p.getResolvedNum()); + }); + log.info(projectOrgDaily.toString()); + agencyInfos.forEach(a -> { + a.setDateId(dateId); + projectOrgDaily.forEach(p -> { + if (a.getAreaCode().equals(p.getAreaCode())){ + a.setResolvedRatio(getRatio(p.getResolvedNum(),p.getProjectTotal())); + a.setBadRatio(getRatio(p.getBadTotal(),p.getEvaluateTotal())); + a.setGoodRatio(getRatio(p.getGoodTotal(),p.getEvaluateTotal())); + a.setBadTotal(p.getBadTotal()); + a.setEvaluateTotal(p.getEvaluateTotal()); + a.setGoodTotal(p.getGoodTotal()); + a.setProjectTotal(p.getProjectTotal()); + a.setResolvedNum(p.getResolvedNum()); + } + }); + }); + log.info(agencyInfos.toString()); + del(customerId, dateId); + insert(agencyInfos,customerId,dateId); + } + + /** + * @Description + * @Param a + * @Param b 分母 + * @author zxc + * @date 2021/1/29 上午10:10 + */ + public BigDecimal getRatio(Integer a , Integer b){ + if (b == NumConstant.ZERO){ + return new BigDecimal(NumConstant.ZERO); + } + BigDecimal bigDecimalA = new BigDecimal(a); + BigDecimal bigDecimalB = new BigDecimal(b); + BigDecimal divide = bigDecimalA.divide(bigDecimalB, NumConstant.FOUR, BigDecimal.ROUND_HALF_UP); + return divide; + } + + @Transactional(rollbackFor = Exception.class) + public void insert(List agencyInfos,String customerId,String dateId){ + if (!CollectionUtils.isEmpty(agencyInfos)){ + List> partition = ListUtils.partition(agencyInfos, NumConstant.ONE_HUNDRED); + partition.forEach(p -> { + baseDao.insertBatch(p,customerId,PingYinConstants.CREATED_BY,dateId); + }); + } + } + + @Transactional(rollbackFor = Exception.class) + public void del(String customerId,String dateId){ + Integer flag; + do { + flag = baseDao.deleteByDateIdAndCustomerId(customerId, dateId); + }while (flag > NumConstant.ZERO && flag == NumConstant.ONE_THOUSAND); + } +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectQuantityGridMonthlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectQuantityGridMonthlyServiceImpl.java new file mode 100644 index 0000000000..405c5fc3a3 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectQuantityGridMonthlyServiceImpl.java @@ -0,0 +1,253 @@ +/** + * 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.service.evaluationindex.screen.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.constant.DataSourceConstant; +import com.epmet.constant.PingYinConstants; +import com.epmet.dao.evaluationindex.screen.ScreenCustomerGridDao; +import com.epmet.dao.evaluationindex.screen.ScreenProjectQuantityGridMonthlyDao; +import com.epmet.dto.pingyin.result.ClosedIncrResultDTO; +import com.epmet.dto.pingyin.result.ProjectIncrResultDTO; +import com.epmet.dto.pingyin.result.ProjectTotalResultDTO; +import com.epmet.dto.pingyin.result.UnClosedTotalResultDTO; +import com.epmet.dto.screen.ScreenProjectGridDailyDTO; +import com.epmet.dto.screen.ScreenProjectQuantityGridMonthlyDTO; +import com.epmet.dto.screencoll.ScreenCollFormDTO; +import com.epmet.entity.evaluationindex.screen.ScreenProjectQuantityGridMonthlyEntity; +import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectMainDailyService; +import com.epmet.service.evaluationindex.screen.ScreenProjectQuantityGridMonthlyService; +import com.google.common.collect.Lists; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.ListUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 项目(事件)数量分析按网格_按月统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-01-27 + */ +@Service +@Slf4j +@DataSource(DataSourceConstant.EVALUATION_INDEX) +public class ScreenProjectQuantityGridMonthlyServiceImpl extends BaseServiceImpl implements ScreenProjectQuantityGridMonthlyService { + + @Autowired + private ScreenCustomerGridDao gridDao; + + @Autowired + private FactOriginProjectMainDailyService projectMainDailyService; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, ScreenProjectQuantityGridMonthlyDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, ScreenProjectQuantityGridMonthlyDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public ScreenProjectQuantityGridMonthlyDTO get(String id) { + ScreenProjectQuantityGridMonthlyEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, ScreenProjectQuantityGridMonthlyDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(ScreenProjectQuantityGridMonthlyDTO dto) { + ScreenProjectQuantityGridMonthlyEntity entity = ConvertUtils.sourceToTarget(dto, ScreenProjectQuantityGridMonthlyEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(ScreenProjectQuantityGridMonthlyDTO dto) { + ScreenProjectQuantityGridMonthlyEntity entity = ConvertUtils.sourceToTarget(dto, ScreenProjectQuantityGridMonthlyEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * @Description 数据采集 + * @param customerId + * @param data + * @return void + * @author wangc + * @date 2021.01.28 09:33 + */ + @Transactional(rollbackFor = Exception.class) + @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) + @Override + public void collect(String customerId, ScreenCollFormDTO data) { + if(data.getIsFirst()){ + int affectedRows = baseDao.deleteByMonthIdAndCustomerId(customerId,data.getMonthId()); + while(affectedRows > 0){ + affectedRows = baseDao.deleteByMonthIdAndCustomerId(customerId,data.getMonthId()); + } + } + Lists.partition(data.getDataList(), NumConstant.ONE_HUNDRED).forEach(list -> { + baseDao.insertBatch(list,customerId,"APP_USER",data.getMonthId()); + }); + } + + /** + * @Description 数据抽取 【网格-月】 + * @Param customerId + * @Param monthId + * @author zxc + * @date 2021/1/29 下午1:57 + */ + @Override + public void extractionProjectGridMonthly(String customerId, String monthId) { + // 查询客户下所有网格 + List screenProjectGridDailyDTOS = gridDao.selectGridInfoByCustomerId(customerId); + if (CollectionUtils.isEmpty(screenProjectGridDailyDTOS)){ + throw new RenException(String.format(PingYinConstants.GRID_INFO_IS_ZERO,customerId)); + } + List gridInfos = ConvertUtils.sourceToTarget(screenProjectGridDailyDTOS, ScreenProjectQuantityGridMonthlyDTO.class); + + // 本月新增的项目数量 转项目日期在当前月份内 + List projectIncr = projectMainDailyService.selectProjectIncr(customerId, monthId); + // 截止到当前月份:累计项目总数 + List projectTotal = projectMainDailyService.selectProjectTotal(customerId, null, monthId); + // 截止到当前月份:累计未结项目总数 + List projectUnClosed = projectMainDailyService.selectProjectCount(customerId, monthId, PingYinConstants.UN_CLOSED); + // 截止到当前月份:累计已结项目 + List projectClosed = projectMainDailyService.selectProjectCount(customerId, monthId, PingYinConstants.CLOSED); + // 本月新增结案项目数 + List closedIncr = projectMainDailyService.selectClosedIncr(customerId, monthId); + gridInfos.forEach(g -> { + g.setMonthId(monthId); + // 本月新增的项目数量 转项目日期在当前月份内 + if (!CollectionUtils.isEmpty(projectIncr)){ + projectIncr.forEach(p -> { + if (g.getGridId().equals(p.getGridId())){ + g.setProjectIncr(p.getProjectIncr()); + } + }); + } + // 截止到当前月份:累计项目总数 + if (!CollectionUtils.isEmpty(projectTotal)){ + projectTotal.forEach(p -> { + if (g.getGridId().equals(p.getGridId())){ + g.setProjectTotal(p.getProjectTotal()); + } + }); + } + // 截止到当前月份:累计未结项目总数 + if (!CollectionUtils.isEmpty(projectUnClosed)){ + projectUnClosed.forEach(p -> { + if (g.getGridId().equals(p.getGridId())){ + g.setUnClosedTotal(p.getProjectCount()); + } + }); + } + // 截止到当前月份:累计已结项目 + if (!CollectionUtils.isEmpty(projectClosed)){ + projectClosed.forEach(p -> { + if (g.getGridId().equals(p.getGridId())){ + g.setClosedTotal(p.getProjectCount()); + } + }); + } + // 本月新增结案项目数 + if (!CollectionUtils.isEmpty(closedIncr)){ + closedIncr.forEach(p -> { + if (g.getGridId().equals(p.getGridId())){ + g.setClosedIncr(p.getClosedIncr()); + } + }); + } + }); + log.info(gridInfos.toString()); + del(customerId, monthId); + insert(gridInfos,customerId,monthId); + } + + /** + * @Description 删除 + * @Param customerId + * @Param monthId + * @author zxc + * @date 2021/2/1 上午10:13 + */ + @Transactional(rollbackFor = Exception.class) + public void del(String customerId,String monthId){ + Integer flag; + do { + flag = baseDao.deleteByMonthIdAndCustomerId(customerId, monthId); + }while (flag > NumConstant.ZERO && flag == NumConstant.ONE_THOUSAND); + } + + /** + * @Description 新增 + * @Param list + * @author zxc + * @date 2021/2/1 上午10:16 + */ + @Transactional(rollbackFor = Exception.class) + public void insert(List list,String customerId,String monthId){ + if (!CollectionUtils.isEmpty(list)){ + List> partition = ListUtils.partition(list, NumConstant.ONE_HUNDRED); + partition.forEach(p -> { + baseDao.insertBatch(p,customerId,PingYinConstants.CREATED_BY,monthId); + }); + } + } + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectQuantityOrgMonthlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectQuantityOrgMonthlyServiceImpl.java new file mode 100644 index 0000000000..15b8a46201 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectQuantityOrgMonthlyServiceImpl.java @@ -0,0 +1,213 @@ +/** + * 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.service.evaluationindex.screen.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.constant.DataSourceConstant; +import com.epmet.constant.PingYinConstants; +import com.epmet.dao.evaluationindex.screen.ScreenCustomerAgencyDao; +import com.epmet.dao.evaluationindex.screen.ScreenProjectQuantityOrgMonthlyDao; +import com.epmet.dto.pingyin.result.ProjectOrgMonthlyResultDTO; +import com.epmet.dto.screen.ScreenProjectOrgDailyDTO; +import com.epmet.dto.screen.ScreenProjectQuantityOrgMonthlyDTO; +import com.epmet.dto.screencoll.ScreenCollFormDTO; +import com.epmet.entity.evaluationindex.screen.ScreenProjectQuantityOrgMonthlyEntity; +import com.epmet.service.evaluationindex.screen.ScreenProjectQuantityOrgMonthlyService; +import com.google.common.collect.Lists; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.ListUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 项目(事件)数量分析按组织_按月统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-01-27 + */ +@Service +@Slf4j +@DataSource(DataSourceConstant.EVALUATION_INDEX) +public class ScreenProjectQuantityOrgMonthlyServiceImpl extends BaseServiceImpl implements ScreenProjectQuantityOrgMonthlyService { + + @Autowired + private ScreenCustomerAgencyDao agencyDao; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, ScreenProjectQuantityOrgMonthlyDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, ScreenProjectQuantityOrgMonthlyDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public ScreenProjectQuantityOrgMonthlyDTO get(String id) { + ScreenProjectQuantityOrgMonthlyEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, ScreenProjectQuantityOrgMonthlyDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(ScreenProjectQuantityOrgMonthlyDTO dto) { + ScreenProjectQuantityOrgMonthlyEntity entity = ConvertUtils.sourceToTarget(dto, ScreenProjectQuantityOrgMonthlyEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(ScreenProjectQuantityOrgMonthlyDTO dto) { + ScreenProjectQuantityOrgMonthlyEntity entity = ConvertUtils.sourceToTarget(dto, ScreenProjectQuantityOrgMonthlyEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * @Description 数据采集 + * @param customerId + * @param data + * @return void + * @author wangc + * @date 2021.01.28 09:33 + */ + @Transactional(rollbackFor = Exception.class) + @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) + @Override + public void collect(String customerId, ScreenCollFormDTO data) { + if(data.getIsFirst()){ + int affectedRows = baseDao.deleteByMonthIdAndCustomerId(customerId,data.getMonthId()); + while(affectedRows > 0){ + affectedRows = baseDao.deleteByMonthIdAndCustomerId(customerId,data.getMonthId()); + } + } + Lists.partition(data.getDataList(), NumConstant.ONE_HUNDRED).forEach(list -> { + baseDao.insertBatch(list,customerId,"APP_USER",data.getMonthId()); + }); + } + + /** + * @Description 数据抽取【组织-月】 + * @Param customerId + * @Param monthId + * @author zxc + * @date 2021/2/2 上午10:43 + */ + @Override + public void extractionProjectOrgMonthly(String customerId, String monthId) { + List screenProjectOrgDailyDTOS = agencyDao.selectAgencyByCustomer(customerId); + if (CollectionUtils.isEmpty(screenProjectOrgDailyDTOS)){ + throw new RenException(String.format(PingYinConstants.AGENCY_INFO_IS_ZERO,customerId)); + } + List agencyInfos = ConvertUtils.sourceToTarget(screenProjectOrgDailyDTOS, ScreenProjectQuantityOrgMonthlyDTO.class); + List projectOrg = baseDao.selectQuantityOrgMonthly(agencyInfos, monthId); + if (!CollectionUtils.isEmpty(projectOrg)){ + projectOrg.forEach(p -> { + p.setClosedIncr(null == p.getClosedIncr() ? NumConstant.ZERO : p.getClosedIncr()); + p.setProjectIncr(null == p.getProjectIncr() ? NumConstant.ZERO : p.getProjectIncr()); + }); + } + List projectGrandOrg = baseDao.selectQuantityGrandOrgMonthly(agencyInfos, monthId); + if (!CollectionUtils.isEmpty(projectGrandOrg)){ + projectGrandOrg.forEach(p -> { + p.setClosedTotal(null == p.getClosedTotal() ? NumConstant.ZERO : p.getClosedTotal()); + p.setProjectTotal(null == p.getProjectTotal() ? NumConstant.ZERO : p.getProjectTotal()); + p.setUnClosedTotal(null == p.getUnClosedTotal() ? NumConstant.ZERO : p.getUnClosedTotal()); + }); + } + agencyInfos.forEach(a -> { + a.setMonthId(monthId); + if (!CollectionUtils.isEmpty(projectOrg)){ + projectOrg.forEach(p -> { + if (a.getAreaCode().equals(p.getAreaCode())){ + a.setClosedIncr(p.getClosedIncr()); + a.setProjectIncr(p.getProjectIncr()); + } + }); + } + if (!CollectionUtils.isEmpty(projectGrandOrg)){ + projectGrandOrg.forEach(p -> { + if (a.getAreaCode().equals(p.getAreaCode())){ + a.setClosedTotal(p.getClosedTotal()); + a.setProjectTotal(p.getProjectTotal()); + a.setUnClosedTotal(p.getUnClosedTotal()); + } + }); + } + }); + log.info(agencyInfos.toString()); + del(customerId, monthId); + insert(agencyInfos,customerId,monthId); + } + + @Transactional(rollbackFor = Exception.class) + public void del(String customerId,String monthId){ + Integer flag; + do { + flag = baseDao.deleteByMonthIdAndCustomerId(customerId, monthId); + }while (flag > NumConstant.ZERO && flag == NumConstant.ONE_THOUSAND); + } + + @Transactional(rollbackFor = Exception.class) + public void insert(List agencyInfos,String customerId,String monthId){ + if (!CollectionUtils.isEmpty(agencyInfos)){ + List> partition = ListUtils.partition(agencyInfos, NumConstant.ONE_HUNDRED); + partition.forEach(p -> { + baseDao.insertBatch(p,customerId,PingYinConstants.CREATED_BY,monthId); + }); + } + } + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ShiBeiScreenCollServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ShiBeiScreenCollServiceImpl.java index cd26e20bd2..774fde473b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ShiBeiScreenCollServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ShiBeiScreenCollServiceImpl.java @@ -405,7 +405,7 @@ public class ShiBeiScreenCollServiceImpl implements ShiBeiScreenCollService { @Transactional(rollbackFor = Exception.class) public Integer initBizOrg(CustomerBizOrgFormDTO formDTO) { ValidatorUtils.validateEntity(formDTO); - List entityList = screenCustomerAgencyDao.selectListAgencyInfo(formDTO.getCustomerId()); + List entityList = screenCustomerAgencyDao.selectListAgencyInfo(formDTO.getCustomerId(),null,null); List list = new ArrayList<>(); if (CollectionUtils.isEmpty(entityList)) { return 0; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsDimServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsDimServiceImpl.java index 5c09458416..6338145260 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsDimServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsDimServiceImpl.java @@ -1,6 +1,7 @@ package com.epmet.service.impl; import com.epmet.constant.RobotConstant; +import com.epmet.dto.org.result.CustomerAreaCodeResultDTO; import com.epmet.entity.crm.CustomerEntity; import com.epmet.entity.org.CustomerAgencyEntity; import com.epmet.entity.org.CustomerDepartmentEntity; @@ -199,6 +200,14 @@ public class StatsDimServiceImpl implements StatsDimService { List customers = customerService.listValidCustomersByCreateTime(lastInitTime, initTime); + // 添加 areaCode + if (!CollectionUtils.isEmpty(customers)){ + List customerIds = customers.stream().map(m -> m.getId()).collect(Collectors.toList()); + List areaCodes = customerAgencyService.selectCustomerAreaCodeById(customerIds); + if (!CollectionUtils.isEmpty(areaCodes)){ + customers.forEach(c -> areaCodes.stream().filter(a -> c.getId().equals(a.getCustomerId())).forEach(a -> c.setAreaCode(a.getAreaCode()))); + } + } return customers; } @@ -212,6 +221,14 @@ public class StatsDimServiceImpl implements StatsDimService { if (lastCreatedDim != null) { // 说明不是首次初始化 List customers = customerService.listValidCustomersByUpdatedTime(lastCreatedDim.getUpdatedTime(), initTime); + // 添加 areaCode + if (!CollectionUtils.isEmpty(customers)){ + List customerIds = customers.stream().map(m -> m.getId()).collect(Collectors.toList()); + List areaCodes = customerAgencyService.selectCustomerAreaCodeById(customerIds); + if (!CollectionUtils.isEmpty(areaCodes)){ + customers.forEach(c -> areaCodes.stream().filter(a -> c.getId().equals(a.getCustomerId())).forEach(a -> c.setAreaCode(a.getAreaCode()))); + } + } return customers; } return new ArrayList<>(); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/CustomerAgencyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/CustomerAgencyService.java index 96669f2ae9..b93c4563ec 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/CustomerAgencyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/CustomerAgencyService.java @@ -1,5 +1,6 @@ package com.epmet.service.org; +import com.epmet.dto.org.result.CustomerAreaCodeResultDTO; import com.epmet.entity.org.CustomerAgencyEntity; import java.util.Date; @@ -9,4 +10,12 @@ public interface CustomerAgencyService { List listAgenciesByCreateTime(Date statsStartTime, Date statsEndTime); List listAgenciesByUpdatedTime(Date updatedTime, Date now); + + /** + * @Description 查询客户所属区域编码 + * @Param customerIds + * @author zxc + * @date 2021/1/14 上午11:07 + */ + List selectCustomerAreaCodeById(List customerIds); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerAgencyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerAgencyServiceImpl.java index 4813309176..702da0930d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerAgencyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerAgencyServiceImpl.java @@ -3,11 +3,14 @@ package com.epmet.service.org.impl; import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.constant.DataSourceConstant; import com.epmet.dao.org.StatsCustomerAgencyDao; +import com.epmet.dto.org.result.CustomerAreaCodeResultDTO; import com.epmet.entity.org.CustomerAgencyEntity; import com.epmet.service.org.CustomerAgencyService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; +import java.util.ArrayList; import java.util.Date; import java.util.List; @@ -27,4 +30,19 @@ public class CustomerAgencyServiceImpl implements CustomerAgencyService { public List listAgenciesByUpdatedTime(Date startTime, Date endTime) { return customerAgencyDao.listAgenciesByUpdatedTime(startTime, endTime); } + + /** + * @Description 查询客户所属区域编码 + * @Param customerIds + * @author zxc + * @date 2021/1/14 上午11:07 + */ + @Override + public List selectCustomerAreaCodeById(List customerIds) { + if (!CollectionUtils.isEmpty(customerIds)){ + List resultDTOS = customerAgencyDao.selectCustomerAreaCodeById(customerIds); + return resultDTOS; + } + return new ArrayList<>(); + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/plugins/OfsService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/plugins/OfsService.java new file mode 100644 index 0000000000..e2aa01aced --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/plugins/OfsService.java @@ -0,0 +1,41 @@ +package com.epmet.service.plugins; + +import com.epmet.dto.plugins.BidFormDTO; +import com.epmet.dto.plugins.ContractFormDTO; +import com.epmet.dto.plugins.OneListFormDTO; +import com.epmet.dto.screencoll.ScreenCollFormDTO; + +/** + * 146体系数据采集 + * + * @author yinzuomei@elink-cn.com + * @date 2021/1/22 10:18 + */ +public interface OfsService { + /** + * @return void + * @param formDTO + * @author yinzuomei + * @description 【146】一张清单 + * @Date 2021/1/22 10:19 + **/ + void collOneList(ScreenCollFormDTO formDTO); + + /** + * @return void + * @param formDTO + * @author yinzuomei + * @description 【146】合同监管 + * @Date 2021/1/22 10:19 + **/ + void collContract(ScreenCollFormDTO formDTO); + + /** + * @return void + * @param formDTO + * @author yinzuomei + * @description 【146】竞标管理 + * @Date 2021/1/22 10:19 + **/ + void collBid(ScreenCollFormDTO formDTO); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/plugins/ScreenCustomerWorkRecordDictService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/plugins/ScreenCustomerWorkRecordDictService.java new file mode 100644 index 0000000000..6f5ac2573e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/plugins/ScreenCustomerWorkRecordDictService.java @@ -0,0 +1,106 @@ +/** + * 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.service.plugins; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.plugins.ScreenCustomerWorkRecordDictDTO; +import com.epmet.dto.screencoll.ScreenCollFormDTO; +import com.epmet.entity.plugins.ScreenCustomerWorkRecordDictEntity; + +import java.util.List; +import java.util.Map; + +/** + * 工作日志资源字典表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-02-04 + */ +public interface ScreenCustomerWorkRecordDictService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-02-04 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-02-04 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return ScreenCustomerWorkRecordDictDTO + * @author generator + * @date 2021-02-04 + */ + ScreenCustomerWorkRecordDictDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-02-04 + */ + void save(ScreenCustomerWorkRecordDictDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-02-04 + */ + void update(ScreenCustomerWorkRecordDictDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-02-04 + */ + void delete(String[] ids); + + /** + * @Description 数据录入 + * @param customerId + * @param data + * @return void + * @author wangc + * @date 2021.02.04 15:27 + */ + void collect(String customerId, ScreenCollFormDTO data); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/plugins/ScreenWorkRecordOrgMonthlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/plugins/ScreenWorkRecordOrgMonthlyService.java new file mode 100644 index 0000000000..a9368a66bc --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/plugins/ScreenWorkRecordOrgMonthlyService.java @@ -0,0 +1,106 @@ +/** + * 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.service.plugins; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.plugins.ScreenWorkRecordOrgMonthlyDTO; +import com.epmet.dto.screencoll.ScreenCollFormDTO; +import com.epmet.entity.plugins.ScreenWorkRecordOrgMonthlyEntity; + +import java.util.List; +import java.util.Map; + +/** + * 工作日志-组织按月统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-02-04 + */ +public interface ScreenWorkRecordOrgMonthlyService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-02-04 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-02-04 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return ScreenWorkRecordOrgMonthlyDTO + * @author generator + * @date 2021-02-04 + */ + ScreenWorkRecordOrgMonthlyDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-02-04 + */ + void save(ScreenWorkRecordOrgMonthlyDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-02-04 + */ + void update(ScreenWorkRecordOrgMonthlyDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-02-04 + */ + void delete(String[] ids); + + /** + * @Description 数据录入 + * @param customerId + * @param data + * @return void + * @author wangc + * @date 2021.02.04 15:27 + */ + void collect(String customerId, ScreenCollFormDTO data); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/plugins/impl/OfsServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/plugins/impl/OfsServiceImpl.java new file mode 100644 index 0000000000..cb05167baa --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/plugins/impl/OfsServiceImpl.java @@ -0,0 +1,104 @@ +package com.epmet.service.plugins.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.constant.DataSourceConstant; +import com.epmet.dao.plugins.ScreenBidInfoDao; +import com.epmet.dao.plugins.ScreenContractInfoDao; +import com.epmet.dao.plugins.ScreenListInfoDao; +import com.epmet.dto.plugins.BidFormDTO; +import com.epmet.dto.plugins.ContractFormDTO; +import com.epmet.dto.plugins.OneListFormDTO; +import com.epmet.dto.screencoll.ScreenCollFormDTO; +import com.epmet.service.plugins.OfsService; +import com.google.common.collect.Lists; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +/** + * 描述一下 + * + * @author yinzuomei@elink-cn.com + * @date 2021/1/22 10:20 + */ +@Service +@Slf4j +@DataSource(DataSourceConstant.EVALUATION_INDEX) +public class OfsServiceImpl implements OfsService { + @Autowired + private ScreenBidInfoDao screenBidInfoDao; + @Autowired + private ScreenContractInfoDao screenContractInfoDao; + @Autowired + private ScreenListInfoDao screenListInfoDao; + + /** + * @param formDTO + * @return void + * @author yinzuomei + * @description 【146】一张清单 + * @Date 2021/1/22 10:19 + **/ + @Override + public void collOneList(ScreenCollFormDTO formDTO) { + if (CollectionUtils.isEmpty(formDTO.getDataList())) { + return; + } + if (formDTO.getIsFirst()) { + int affectRows = screenListInfoDao.deleteBatch(formDTO.getCustomerId()); + while (affectRows >= NumConstant.ONE) { + affectRows = screenListInfoDao.deleteBatch(formDTO.getCustomerId()); + } + } + Lists.partition(formDTO.getDataList(), NumConstant.ONE_HUNDRED).forEach(list -> { + screenListInfoDao.insertBatch(list, + formDTO.getCustomerId(), + formDTO.getDateId()); + }); + } + + @Override + public void collContract(ScreenCollFormDTO formDTO) { + if (CollectionUtils.isEmpty(formDTO.getDataList())) { + return; + } + if (formDTO.getIsFirst()) { + int affectRows = screenContractInfoDao.deleteBatch(formDTO.getCustomerId()); + while (affectRows >= NumConstant.ONE) { + affectRows = screenContractInfoDao.deleteBatch(formDTO.getCustomerId()); + } + } + Lists.partition(formDTO.getDataList(), NumConstant.ONE_HUNDRED).forEach(list -> { + screenContractInfoDao.insertBatch(list, + formDTO.getCustomerId(), + formDTO.getDateId()); + }); + } + + /** + * @param formDTO + * @return void + * @author yinzuomei + * @description 【146】竞标管理 + * @Date 2021/1/22 10:19 + **/ + @Override + public void collBid(ScreenCollFormDTO formDTO) { + if (CollectionUtils.isEmpty(formDTO.getDataList())) { + return; + } + if (formDTO.getIsFirst()) { + int affectRows = screenBidInfoDao.deleteBatch(formDTO.getCustomerId()); + while (affectRows >= NumConstant.ONE) { + affectRows = screenBidInfoDao.deleteBatch(formDTO.getCustomerId()); + } + } + Lists.partition(formDTO.getDataList(), NumConstant.ONE_HUNDRED).forEach(list -> { + screenBidInfoDao.insertBatch(list, + formDTO.getCustomerId(), + formDTO.getDateId()); + }); + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/plugins/impl/ScreenCustomerWorkRecordDictServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/plugins/impl/ScreenCustomerWorkRecordDictServiceImpl.java new file mode 100644 index 0000000000..31a0cd49ee --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/plugins/impl/ScreenCustomerWorkRecordDictServiceImpl.java @@ -0,0 +1,122 @@ +/** + * 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.service.plugins.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.constant.DataSourceConstant; +import com.epmet.dao.plugins.ScreenCustomerWorkRecordDictDao; +import com.epmet.dto.plugins.ScreenCustomerWorkRecordDictDTO; +import com.epmet.dto.screencoll.ScreenCollFormDTO; +import com.epmet.entity.plugins.ScreenCustomerWorkRecordDictEntity; +import com.epmet.service.plugins.ScreenCustomerWorkRecordDictService; +import com.google.common.collect.Lists; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 工作日志资源字典表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-02-04 + */ +@Service +public class ScreenCustomerWorkRecordDictServiceImpl extends BaseServiceImpl implements ScreenCustomerWorkRecordDictService { + + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, ScreenCustomerWorkRecordDictDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, ScreenCustomerWorkRecordDictDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public ScreenCustomerWorkRecordDictDTO get(String id) { + ScreenCustomerWorkRecordDictEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, ScreenCustomerWorkRecordDictDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(ScreenCustomerWorkRecordDictDTO dto) { + ScreenCustomerWorkRecordDictEntity entity = ConvertUtils.sourceToTarget(dto, ScreenCustomerWorkRecordDictEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(ScreenCustomerWorkRecordDictDTO dto) { + ScreenCustomerWorkRecordDictEntity entity = ConvertUtils.sourceToTarget(dto, ScreenCustomerWorkRecordDictEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + @Transactional(rollbackFor = Exception.class) + @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) + @Override + public void collect(String customerId, ScreenCollFormDTO data) { + if(data.getIsFirst()){ + int affectedRows = baseDao.deleteBatch(customerId); + while(affectedRows > 0){ + affectedRows = baseDao.deleteBatch(customerId); + } + } + Lists.partition(data.getDataList(), NumConstant.ONE_HUNDRED).forEach(list -> { + baseDao.insertBatch(list,customerId,data.getDateId()); + }); + } + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/plugins/impl/ScreenWorkRecordOrgMonthlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/plugins/impl/ScreenWorkRecordOrgMonthlyServiceImpl.java new file mode 100644 index 0000000000..a1264c91ae --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/plugins/impl/ScreenWorkRecordOrgMonthlyServiceImpl.java @@ -0,0 +1,130 @@ +/** + * 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.service.plugins.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.constant.DataSourceConstant; +import com.epmet.dao.plugins.ScreenWorkRecordOrgMonthlyDao; +import com.epmet.dto.plugins.ScreenWorkRecordOrgMonthlyDTO; +import com.epmet.dto.screencoll.ScreenCollFormDTO; +import com.epmet.entity.plugins.ScreenWorkRecordOrgMonthlyEntity; +import com.epmet.service.plugins.ScreenWorkRecordOrgMonthlyService; +import com.google.common.collect.Lists; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 工作日志-组织按月统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-02-04 + */ +@Service +public class ScreenWorkRecordOrgMonthlyServiceImpl extends BaseServiceImpl implements ScreenWorkRecordOrgMonthlyService { + + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, ScreenWorkRecordOrgMonthlyDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, ScreenWorkRecordOrgMonthlyDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public ScreenWorkRecordOrgMonthlyDTO get(String id) { + ScreenWorkRecordOrgMonthlyEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, ScreenWorkRecordOrgMonthlyDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(ScreenWorkRecordOrgMonthlyDTO dto) { + ScreenWorkRecordOrgMonthlyEntity entity = ConvertUtils.sourceToTarget(dto, ScreenWorkRecordOrgMonthlyEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(ScreenWorkRecordOrgMonthlyDTO dto) { + ScreenWorkRecordOrgMonthlyEntity entity = ConvertUtils.sourceToTarget(dto, ScreenWorkRecordOrgMonthlyEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * @Description 数据录入 + * @param customerId + * @param data + * @return void + * @author wangc + * @date 2021.02.04 15:27 + */ + @Transactional(rollbackFor = Exception.class) + @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) + @Override + public void collect(String customerId, ScreenCollFormDTO data) { + if(data.getIsFirst()){ + int affectedRows = baseDao.deleteBatch(customerId,data.getMonthId()); + while(affectedRows > 0){ + affectedRows = baseDao.deleteBatch(customerId,data.getMonthId()); + } + } + Lists.partition(data.getDataList(), NumConstant.ONE_HUNDRED).forEach(list -> { + baseDao.insertBatch(list,customerId,data.getMonthId()); + }); + } + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimCustomerServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimCustomerServiceImpl.java index 367b06629b..feae456fb3 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimCustomerServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimCustomerServiceImpl.java @@ -128,6 +128,7 @@ public class DimCustomerServiceImpl extends BaseServiceImpl + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml index 1ea4b350fd..3d21f70ce7 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml @@ -440,4 +440,98 @@ CUSTOMER_ID = #{customerId} AND MONTH_ID = #{monthId} + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencyScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencyScoreDao.xml index 9de83a3a9a..0ce20b42dd 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencyScoreDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencyScoreDao.xml @@ -124,4 +124,54 @@ AND MONTH_ID = #{monthId} ORDER BY AGENCY_ID + + + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CommunityScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CommunityScoreDao.xml index 8be2f83314..b028814062 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CommunityScoreDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CommunityScoreDao.xml @@ -122,4 +122,52 @@ AND MONTH_ID = #{monthId} ORDER BY AGENCY_ID + + + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/DeptScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/DeptScoreDao.xml index b70d136989..05f3193d0c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/DeptScoreDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/DeptScoreDao.xml @@ -150,4 +150,27 @@ AND m.CUSTOMER_ID =#{customerId} AND m.MONTH_ID =#{monthId} + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/GridScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/GridScoreDao.xml index 7f3912fa6f..51a1600474 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/GridScoreDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/GridScoreDao.xml @@ -179,4 +179,27 @@ ORDER BY GRID_ID + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityDeptMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityDeptMonthlyDao.xml index b4475c72cd..f782210785 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityDeptMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityDeptMonthlyDao.xml @@ -52,7 +52,15 @@ CREATED_BY, CREATED_TIME, UPDATED_BY, - UPDATED_TIME + UPDATED_TIME, + RESP_PROJECT_RATIO_FZ, + RESP_PROJECT_RATIO_FM, + HANDLE_PROJECT_RATIO_FZ, + HANDLE_PROJECT_RATIO_FM, + CLOSED_PROJECT_RATIO_FZ, + CLOSED_PROJECT_RATIO_FM, + SATISFACTION_RATIO_FZ, + SATISFACTION_RATIO_FM ) values ( @@ -74,7 +82,15 @@ 'APP_USER', now(), 'APP_USER', - now() + now(), + #{item.respProjectRatioFz}, + #{item.respProjectRatioFm}, + #{item.handleProjectRatioFz}, + #{item.handleProjectRatioFm}, + #{item.closedProjectRatioFz}, + #{item.closedProjectRatioFm}, + #{item.satisfactionRatioFz}, + #{item.satisfactionRatioFm} ) @@ -85,10 +101,24 @@ count( 1 ) AS total FROM fact_index_govrn_ablity_dept_monthly m + inner join screen_customer_dept scd + on( + m.DEPT_ID=scd.DEPT_ID + and scd.DEL_FLAG='0' + and scd.UP_TO_CAL='yes' + ) WHERE m.DEL_FLAG = '0' - AND m.CUSTOMER_ID =#{customerId} AND m.MONTH_ID=#{monthId} + + + and scd.AREA_CODE LIKE concat( #{customerAreaCode}, '%') + + + AND m.CUSTOMER_ID =#{customerId} + and scd.CUSTOMER_ID=#{customerId} + + @@ -111,10 +141,24 @@ MAX(M.SATISFACTION_RATIO) as SATISFACTION_RATIO_MAX FROM fact_index_govrn_ablity_dept_monthly m + inner join screen_customer_dept scd + on( + m.DEPT_ID=scd.DEPT_ID + and scd.DEL_FLAG='0' + and scd.UP_TO_CAL='yes' + ) WHERE m.DEL_FLAG = '0' - AND m.CUSTOMER_ID =#{customerId} AND m.MONTH_ID =#{monthId} + + + and scd.AREA_CODE LIKE concat( #{customerAreaCode}, '%') + + + AND m.CUSTOMER_ID =#{customerId} + and scd.CUSTOMER_ID=#{customerId} + + @@ -132,10 +176,24 @@ SATISFACTION_RATIO FROM fact_index_govrn_ablity_dept_monthly m + inner join screen_customer_dept scd + on( + m.DEPT_ID=scd.DEPT_ID + and scd.DEL_FLAG='0' + and scd.UP_TO_CAL='yes' + ) WHERE m.DEL_FLAG = '0' - AND m.CUSTOMER_ID =#{customerId} AND m.MONTH_ID =#{monthId} + + + and scd.AREA_CODE LIKE concat( #{customerAreaCode}, '%') + + + AND m.CUSTOMER_ID =#{customerId} + and scd.CUSTOMER_ID=#{customerId} + + ORDER BY m.DEPT_ID ASC LIMIT #{offset},#{pageSize} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.xml index e30d52c675..755e3aab60 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.xml @@ -56,7 +56,13 @@ CREATED_BY, CREATED_TIME, UPDATED_BY, - UPDATED_TIME + UPDATED_TIME, + TRANSFER_RIGHT_RATIO_FZ, + TRANSFER_RIGHT_RATIO_FM, + SATISFACTION_RATIO_FZ, + SATISFACTION_RATIO_FM, + ISSUE_TO_PROJECT_RATIO_FZ, + ISSUE_TO_PROJECT_RATIO_FM ) values ( @@ -80,7 +86,13 @@ 'APP_USER', now(), 'APP_USER', - now() + now(), + #{item.transferRightRatioFz}, + #{item.transferRightRatioFm}, + #{item.satisfactionRatioFz}, + #{item.satisfactionRatioFm}, + #{item.issueToProjectRatioFz}, + #{item.issueToProjectRatioFm} ) @@ -101,16 +113,30 @@ m.SATISFACTION_RATIO FROM fact_index_govrn_ablity_grid_monthly m + inner join screen_customer_grid scg + on( + m.GRID_ID=scg.GRID_ID + and scg.DEL_FLAG='0' + and scg.UP_TO_CAL='yes' + ) WHERE m.DEL_FLAG = '0' - and m.CUSTOMER_ID=#{customerId} and m.MONTH_ID=#{monthId} + + + and scg.AREA_CODE LIKE concat( #{customerAreaCode}, '%') + + + and m.CUSTOMER_ID=#{customerId} + and scg.CUSTOMER_ID=#{customerId} + + order by m.GRID_ID asc LIMIT #{pageIndex}, #{pageSize} - SELECT m.CUSTOMER_ID, m.GRID_ID, @@ -133,10 +159,24 @@ MAX(m.SATISFACTION_RATIO) AS SATISFACTION_RATIO_MAX FROM fact_index_govrn_ablity_grid_monthly m + inner join screen_customer_grid scg + on( + m.GRID_ID=scg.GRID_ID + and scg.DEL_FLAG='0' + and scg.UP_TO_CAL='yes' + ) WHERE m.DEL_FLAG = '0' - and m.CUSTOMER_ID=#{customerId} and m.MONTH_ID=#{monthId} + + + and scg.AREA_CODE LIKE concat( #{customerAreaCode}, '%') + + + and m.CUSTOMER_ID=#{customerId} + and scg.CUSTOMER_ID=#{customerId} + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.xml index 3a4250d1ad..7cb270630c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.xml @@ -63,7 +63,17 @@ CREATED_BY, CREATED_TIME, UPDATED_BY, - UPDATED_TIME + UPDATED_TIME, + RESP_PROJECT_RATIO_FZ, + RESP_PROJECT_RATIO_FM, + CLOSED_PROJECT_RATIO_FZ, + CLOSED_PROJECT_RATIO_FM, + SATISFACTION_RATIO_FZ, + SATISFACTION_RATIO_FM, + OVERDUE_PROJECT_RATIO_FZ, + OVERDUE_PROJECT_RATIO_FM, + HANDLE_PROJECT_RATIO_FZ, + HANDLE_PROJECT_RATIO_FM ) values ( @@ -87,7 +97,17 @@ 'APP_USER', now(), 'APP_USER', - now() + now(), + #{item.respProjectRatioFz}, + #{item.respProjectRatioFm}, + #{item.closedProjectRatioFz}, + #{item.closedProjectRatioFm}, + #{item.satisfactionRatioFz}, + #{item.satisfactionRatioFm}, + #{item.overdueProjectRatioFz}, + #{item.overdueProjectRatioFm}, + #{item.handleProjectRatioFz}, + #{item.handleProjectRatioFm} ) @@ -129,4 +149,29 @@ AND MONTH_ID = #{monthId} AND data_type = #{type} + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexPartyAblityCpcMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexPartyAblityCpcMonthlyDao.xml index 788af38336..9610514dcf 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexPartyAblityCpcMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexPartyAblityCpcMonthlyDao.xml @@ -69,59 +69,85 @@ - - SELECT - MIN( CREATE_TOPIC_COUNT ) CREATE_TOPIC_COUNT_MIN, - MAX( CREATE_TOPIC_COUNT ) CREATE_TOPIC_COUNT_MAX, - MIN( JOIN_TOPIC_COUNT ) JOIN_TOPIC_COUNT_MIN, - MAX( JOIN_TOPIC_COUNT ) JOIN_TOPIC_COUNT_MAX, - MIN( SHIFT_ISSUE_COUNT ) SHIFT_ISSUE_COUNT_MIN, - MAX( SHIFT_ISSUE_COUNT ) SHIFT_ISSUE_COUNT_MAX, - MIN( SHIFT_PROJECT_COUNT ) SHIFT_PROJECT_COUNT_MIN, - MAX( SHIFT_PROJECT_COUNT ) SHIFT_PROJECT_COUNT_MAX, - MIN( JOIN_THREE_MEETS_COUNT ) JOIN_THREE_MEETS_COUNT_MIN, - MAX( JOIN_THREE_MEETS_COUNT ) JOIN_THREE_MEETS_COUNT_MAX, - MIN( GROUP_USER_COUNT ) GROUP_USER_COUNT_MIN, - MAX( GROUP_USER_COUNT ) GROUP_USER_COUNT_MAX, - MIN( GROUP_ACTIVE_USER_COUNT ) GROUP_ACTIVE_USER_COUNT_MIN, - MAX( GROUP_ACTIVE_USER_COUNT ) GROUP_ACTIVE_USER_COUNT_MAX, - MIN( GROUP_TOPIC_COUNT ) GROUP_TOPIC_COUNT_MIN, - MAX( GROUP_TOPIC_COUNT ) GROUP_TOPIC_COUNT_MAX, - MIN( TOPIC_TO_ISSUE_RATIO ) TOPIC_TO_ISSUE_RATIO_MIN, - MAX( TOPIC_TO_ISSUE_RATIO ) TOPIC_TO_ISSUE_RATIO_MAX + MIN( cpc.CREATE_TOPIC_COUNT ) CREATE_TOPIC_COUNT_MIN, + MAX( cpc.CREATE_TOPIC_COUNT ) CREATE_TOPIC_COUNT_MAX, + MIN( cpc.JOIN_TOPIC_COUNT ) JOIN_TOPIC_COUNT_MIN, + MAX( cpc.JOIN_TOPIC_COUNT ) JOIN_TOPIC_COUNT_MAX, + MIN( cpc.SHIFT_ISSUE_COUNT ) SHIFT_ISSUE_COUNT_MIN, + MAX( cpc.SHIFT_ISSUE_COUNT ) SHIFT_ISSUE_COUNT_MAX, + MIN( cpc.SHIFT_PROJECT_COUNT ) SHIFT_PROJECT_COUNT_MIN, + MAX( cpc.SHIFT_PROJECT_COUNT ) SHIFT_PROJECT_COUNT_MAX, + MIN( cpc.JOIN_THREE_MEETS_COUNT ) JOIN_THREE_MEETS_COUNT_MIN, + MAX( cpc.JOIN_THREE_MEETS_COUNT ) JOIN_THREE_MEETS_COUNT_MAX, + MIN( cpc.GROUP_USER_COUNT ) GROUP_USER_COUNT_MIN, + MAX( cpc.GROUP_USER_COUNT ) GROUP_USER_COUNT_MAX, + MIN( cpc.GROUP_ACTIVE_USER_COUNT ) GROUP_ACTIVE_USER_COUNT_MIN, + MAX( cpc.GROUP_ACTIVE_USER_COUNT ) GROUP_ACTIVE_USER_COUNT_MAX, + MIN( cpc.GROUP_TOPIC_COUNT ) GROUP_TOPIC_COUNT_MIN, + MAX( cpc.GROUP_TOPIC_COUNT ) GROUP_TOPIC_COUNT_MAX, + MIN( cpc.TOPIC_TO_ISSUE_RATIO ) TOPIC_TO_ISSUE_RATIO_MIN, + MAX( cpc.TOPIC_TO_ISSUE_RATIO ) TOPIC_TO_ISSUE_RATIO_MAX FROM - fact_index_party_ablity_cpc_monthly - WHERE - CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} - AND MONTH_ID = #{monthId,jdbcType=VARCHAR} - AND DEL_FLAG = '0' + fact_index_party_ablity_cpc_monthly cpc + inner join screen_customer_grid scg on( + cpc.GRID_ID=scg.GRID_ID + and scg.DEL_FLAG='0' + and scg.UP_TO_CAL='yes' + ) + WHERE cpc.DEL_FLAG = '0' + AND cpc.MONTH_ID = #{monthId,jdbcType=VARCHAR} + + + and scg.AREA_CODE LIKE concat( #{customerAreaCode}, '%') + + + and cpc.CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} + and scg.CUSTOMER_ID=#{customerId,jdbcType=VARCHAR} + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexPartyAblityGridMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexPartyAblityGridMonthlyDao.xml index 9208f9a533..a1d0e85e45 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexPartyAblityGridMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexPartyAblityGridMonthlyDao.xml @@ -66,7 +66,9 @@ CREATED_BY, CREATED_TIME, UPDATED_BY, - UPDATED_TIME + UPDATED_TIME, + SHIFTED_PROJECT_TOTAL, + ISSUE_TOTAL ) values ( @@ -95,7 +97,9 @@ 'APP_USER', now(), 'APP_USER', - now() + now(), + #{item.shiftedProjectTotal}, + #{item.issueTotal} ) @@ -122,16 +126,30 @@ m.JOIN_THREE_MEETS_COUNT FROM fact_index_party_ablity_grid_monthly m + inner join screen_customer_grid scg + on( + m.GRID_ID=scg.GRID_ID + and scg.DEL_FLAG='0' + and scg.UP_TO_CAL='yes' + ) WHERE m.DEL_FLAG = '0' - AND m.CUSTOMER_ID =#{customerId} AND m.MONTH_ID =#{monthId} - order by m.GRID_ID asc + + + and scg.AREA_CODE LIKE concat( #{customerAreaCode}, '%') + + + AND m.CUSTOMER_ID =#{customerId} + and scg.CUSTOMER_ID=#{customerId} + + + order by m.GRID_ID asc LIMIT #{pageIndex}, #{pageSize} - SELECT m.CUSTOMER_ID, m.GRID_ID, @@ -164,10 +182,24 @@ MAX(m.JOIN_THREE_MEETS_COUNT) AS JOIN_THREE_MEETS_COUNT_MAX FROM fact_index_party_ablity_grid_monthly m + inner join screen_customer_grid scg + on( + m.GRID_ID=scg.GRID_ID + and scg.DEL_FLAG='0' + and scg.UP_TO_CAL='yes' + ) WHERE m.DEL_FLAG = '0' - AND m.CUSTOMER_ID =#{customerId} AND m.MONTH_ID =#{monthId} + + + and scg.AREA_CODE LIKE concat( #{customerAreaCode}, '%') + + + AND m.CUSTOMER_ID =#{customerId} + and scg.CUSTOMER_ID=#{customerId} + + @@ -176,10 +208,24 @@ count(1) as total FROM fact_index_party_ablity_grid_monthly m + inner join screen_customer_grid scg + on( + m.GRID_ID=scg.GRID_ID + and scg.DEL_FLAG='0' + and scg.UP_TO_CAL='yes' + ) WHERE m.DEL_FLAG = '0' - AND m.CUSTOMER_ID =#{customerId} AND m.MONTH_ID =#{monthId} + + + and scg.AREA_CODE LIKE concat( #{customerAreaCode}, '%') + + + AND m.CUSTOMER_ID =#{customerId} + and scg.CUSTOMER_ID=#{customerId} + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexPartyAblityOrgMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexPartyAblityOrgMonthlyDao.xml index cf9146cc1f..7454e9d0cd 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexPartyAblityOrgMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexPartyAblityOrgMonthlyDao.xml @@ -112,4 +112,44 @@ AND month_id = #{monthId} + + + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexServiceAblityGridMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexServiceAblityGridMonthlyDao.xml index 2a4d8a7039..fa6f11e4a3 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexServiceAblityGridMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexServiceAblityGridMonthlyDao.xml @@ -46,7 +46,11 @@ CREATED_BY, CREATED_TIME, UPDATED_BY, - UPDATED_TIME + UPDATED_TIME, + PARTY_VOLUNTEER_TOTAL, + VOLUNTEER_TOTAL, + VOLUNTEER_USER_TOTAL, + REG_USER_TOTAL ) values ( @@ -65,7 +69,11 @@ 'APP_USER', now(), 'APP_USER', - now() + now(), + #{item.partyVolunteerTotal}, + #{item.volunteerTotal}, + #{item.volunteerUserTotal}, + #{item.regUserTotal} ) @@ -90,7 +98,7 @@ - SELECT m.CUSTOMER_ID, m.GRID_ID, @@ -103,10 +111,24 @@ MAX(m.PARTY_VOLUNTEER_RATIO) AS PARTY_VOLUNTEER_RATIO_MAX FROM fact_index_service_ablity_grid_monthly m + inner join screen_customer_grid scg + on( + m.GRID_ID=scg.GRID_ID + and scg.DEL_FLAG='0' + and scg.UP_TO_CAL='yes' + ) WHERE m.DEL_FLAG = '0' - and m.CUSTOMER_ID=#{customerId} and m.MONTH_ID=#{monthId} + + + and scg.AREA_CODE LIKE concat( #{customerAreaCode}, '%') + + + and m.CUSTOMER_ID=#{customerId} + and scg.CUSTOMER_ID=#{customerId} + + @@ -115,10 +137,24 @@ count(1) as total FROM fact_index_service_ablity_grid_monthly m + inner join screen_customer_grid scg + on( + m.GRID_ID=scg.GRID_ID + and scg.DEL_FLAG='0' + and scg.UP_TO_CAL='yes' + ) WHERE m.DEL_FLAG = '0' - AND m.CUSTOMER_ID =#{customerId} AND m.MONTH_ID =#{monthId} + + + and scg.AREA_CODE LIKE concat( #{customerAreaCode}, '%') + + + AND m.CUSTOMER_ID =#{customerId} + and scg.CUSTOMER_ID=#{customerId} + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexServiceAblityOrgMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexServiceAblityOrgMonthlyDao.xml index a72642ef9a..f4b85f33cc 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexServiceAblityOrgMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexServiceAblityOrgMonthlyDao.xml @@ -111,4 +111,24 @@ AND customer_id = #{customerId} AND month_id = #{monthId} + + + 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 97eea5c398..31d45d2e3c 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 @@ -31,7 +31,8 @@ CREATED_TIME, UPDATED_BY, UPDATED_TIME, - DATA_END_TIME + DATA_END_TIME, + PARENT_AREA_CODE ) values ( @@ -54,7 +55,8 @@ now(), 'APP_USER', now(), - #{item.dataEndTime} + #{item.dataEndTime}, + #{item.parentAreaCode} ) @@ -70,8 +72,15 @@ screen_customer_agency WHERE DEL_FLAG = '0' - AND CUSTOMER_ID =#{customerId} AND `LEVEL` = 'community' + + + and AREA_CODE LIKE concat( #{customerAreaCode}, '%') + + + AND CUSTOMER_ID =#{customerId} + + AND AGENCY_ID NOT IN @@ -90,7 +99,14 @@ screen_customer_agency WHERE DEL_FLAG = '0' - AND CUSTOMER_ID =#{customerId} + + + and AREA_CODE LIKE concat( #{customerAreaCode}, '%') + + + AND CUSTOMER_ID =#{customerId} + + @@ -122,8 +138,15 @@ screen_customer_agency WHERE DEL_FLAG = '0' - AND CUSTOMER_ID = #{customerId} AND (`LEVEL` = 'street' OR `LEVEL` = 'district') + + + and AREA_CODE LIKE concat( #{customerAreaCode}, '%') + + + AND CUSTOMER_ID = #{customerId} + + ) agency WHERE agencyId NOT IN @@ -340,4 +363,18 @@ del_flag = '0' AND CUSTOMER_ID = #{customerId} + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerDeptDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerDeptDao.xml index 26c34d328b..0f5499d456 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerDeptDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerDeptDao.xml @@ -26,7 +26,8 @@ CREATED_TIME, UPDATED_BY, UPDATED_TIME, - DATA_END_TIME + DATA_END_TIME, + AREA_CODE ) values ( @@ -44,7 +45,8 @@ now(), 'APP_USER', now(), - #{item.dataEndTime} + #{item.dataEndTime}, + #{item.areaCode} ) @@ -58,7 +60,6 @@ screen_customer_dept m WHERE m.DEL_FLAG = '0' - AND m.CUSTOMER_ID =#{customerId} AND m.DEPT_ID =#{deptId} @@ -71,7 +72,14 @@ screen_customer_dept WHERE DEL_FLAG = '0' - AND CUSTOMER_ID =#{customerId} + + + and AREA_CODE LIKE concat( #{customerAreaCode}, '%') + + + AND CUSTOMER_ID =#{customerId} + + AND DEPT_ID NOT IN @@ -89,7 +97,14 @@ screen_customer_dept WHERE DEL_FLAG = '0' - AND CUSTOMER_ID =#{customerId} + + + and AREA_CODE LIKE concat( #{customerAreaCode}, '%') + + + AND CUSTOMER_ID =#{customerId} + + @@ -113,7 +114,14 @@ screen_customer_grid WHERE DEL_FLAG = '0' - AND CUSTOMER_ID =#{customerId} + + + and AREA_CODE LIKE concat( #{customerAreaCode}, '%') + + + AND CUSTOMER_ID =#{customerId} + + AND GRID_ID NOT IN @@ -132,7 +140,14 @@ screen_customer_grid WHERE DEL_FLAG = '0' - AND CUSTOMER_ID =#{customerId} + + + and AREA_CODE LIKE concat( #{customerAreaCode}, '%') + + + AND CUSTOMER_ID =#{customerId} + + @@ -328,4 +343,20 @@ del_flag = '0' AND CUSTOMER_ID = #{customerId} + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectGridDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectGridDailyDao.xml new file mode 100644 index 0000000000..9b10fe1d04 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectGridDailyDao.xml @@ -0,0 +1,157 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + INSERT INTO screen_project_grid_daily + ( + id, + customer_id, + date_id, + grid_id, + pid, + pids, + project_total, + resolved_num, + resolved_ratio, + evaluate_total, + good_total, + bad_total, + good_ratio, + bad_ratio, + del_flag, + revision, + created_by, + created_time, + updated_by, + updated_time + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + + #{customerId}, + + #{timeId}, + + #{item.gridId}, + + #{item.pid}, + + #{item.pids}, + + #{item.projectTotal}, + + #{item.resolvedNum}, + + #{item.resolvedRatio}, + + #{item.evaluateTotal}, + + #{item.goodTotal}, + + #{item.badTotal}, + + #{item.goodRatio}, + + #{item.badRatio}, + + '0', + + 0, + + #{createdBy}, + + now(), + + #{createdBy}, + + now() + ) + + + + INSERT INTO screen_project_grid_daily + ( + id, + customer_id, + date_id, + grid_id, + pid, + pids, + project_total, + resolved_num, + resolved_ratio, + evaluate_total, + good_total, + bad_total, + good_ratio, + bad_ratio, + del_flag, + revision, + created_by, + created_time, + updated_by, + updated_time + ) values + + ( + REPLACE(UUID(), '-', ''), + #{item.customerId}, + #{item.dateId}, + #{item.gridId}, + #{item.pid}, + #{item.pids}, + #{item.projectTotal}, + #{item.resolvedNum}, + #{item.resolvedRatio}, + #{item.evaluateTotal}, + #{item.goodTotal}, + #{item.badTotal}, + #{item.goodRatio}, + #{item.badRatio}, + #{item.delFlag}, + #{item.revision}, + #{item.createdBy}, + now(), + #{item.createdBy}, + now() + ) + + + + + + delete from screen_project_grid_daily + where customer_id = #{customerId} + and date_id = #{dateId} + limit 1000 + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectOrgDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectOrgDailyDao.xml new file mode 100644 index 0000000000..6bf6208ce0 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectOrgDailyDao.xml @@ -0,0 +1,129 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + INSERT INTO screen_project_org_daily + ( + id, + customer_id, + date_id, + org_id, + org_type, + pid, + pids, + project_total, + resolved_num, + resolved_ratio, + evaluate_total, + good_total, + bad_total, + good_ratio, + bad_ratio, + del_flag, + revision, + created_by, + created_time, + updated_by, + updated_time + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + + #{customerId}, + + #{timeId}, + + #{item.orgId}, + + #{item.orgType}, + + #{item.pid}, + + #{item.pids}, + + #{item.projectTotal}, + + #{item.resolvedNum}, + + #{item.resolvedRatio}, + + #{item.evaluateTotal}, + + #{item.goodTotal}, + + #{item.badTotal}, + + #{item.goodRatio}, + + #{item.badRatio}, + + '0', + + 0, + + #{createdBy}, + + now(), + + #{createdBy}, + + now() + ) + + + + + + delete from screen_project_org_daily + where customer_id = #{customerId} + and date_id = #{dateId} + limit 1000 + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectQuantityGridMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectQuantityGridMonthlyDao.xml new file mode 100644 index 0000000000..00be9d5443 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectQuantityGridMonthlyDao.xml @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + INSERT INTO screen_project_quantity_grid_monthly + ( + id, + customer_id, + month_id, + grid_id, + pid, + pids, + project_incr, + project_total, + un_closed_total, + closed_total, + closed_incr, + del_flag, + revision, + created_by, + created_time, + updated_by, + updated_time + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + + #{customerId}, + + #{timeId}, + + #{item.gridId}, + + #{item.pid}, + + #{item.pids}, + + #{item.projectIncr}, + + #{item.projectTotal}, + + #{item.unClosedTotal}, + + #{item.closedTotal}, + + #{item.closedIncr}, + + '0', + + 0, + + #{createdBy}, + + now(), + + #{createdBy}, + + now() + ) + + + + + + delete from screen_project_quantity_grid_monthly + where customer_id = #{customerId} + and month_id = #{monthId} + limit 1000 + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectQuantityOrgMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectQuantityOrgMonthlyDao.xml new file mode 100644 index 0000000000..a1a946f7ab --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectQuantityOrgMonthlyDao.xml @@ -0,0 +1,131 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + INSERT INTO screen_project_quantity_org_monthly + ( + id, + customer_id, + month_id, + org_id, + org_type, + pid, + pids, + project_incr, + project_total, + un_closed_total, + closed_total, + closed_incr, + del_flag, + revision, + created_by, + created_time, + updated_by, + updated_time + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + + #{customerId}, + + #{timeId}, + + #{item.orgId}, + + #{item.orgType}, + + #{item.pid}, + + #{item.pids}, + + #{item.projectIncr}, + + #{item.projectTotal}, + + #{item.unClosedTotal}, + + #{item.closedTotal}, + + #{item.closedIncr}, + + '0', + + 0, + + #{createdBy}, + + now(), + + #{createdBy}, + + now() + ) + + + + + + delete from screen_project_quantity_org_monthly + where customer_id = #{customerId} + and month_id = #{monthId} + limit 1000 + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/CustomerDepartmentDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/CustomerDepartmentDao.xml index 365ae56b8a..0e373b7d3d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/CustomerDepartmentDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/CustomerDepartmentDao.xml @@ -4,15 +4,20 @@ @@ -20,20 +25,23 @@ \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/StatsCustomerAgencyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/StatsCustomerAgencyDao.xml index 268782eb3d..945b47260e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/StatsCustomerAgencyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/StatsCustomerAgencyDao.xml @@ -94,10 +94,28 @@ total_user, province, city, - district + district, + PARENT_AREA_CODE as parentAreaCode from customer_agency where UPDATED_TIME >= #{startTime} and UPDATED_TIME #{endTime} + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/plugins/ScreenBidInfoDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/plugins/ScreenBidInfoDao.xml new file mode 100644 index 0000000000..cb3d221dc5 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/plugins/ScreenBidInfoDao.xml @@ -0,0 +1,54 @@ + + + + + + delete from screen_bid_info where CUSTOMER_ID=#{customerId} + + + + INSERT INTO `screen_bid_info` ( + `ID`, + `CUSTOMER_ID`, + `DATE_ID`, + `BID_ID`, + `BID_NAME`, + `STATUS_CODE`, + `STATUS_DESC`, + `AMOUNT`, + `RELEASE_TIME`, + `TOWN_IDS`, + `TOWN_NAMES`, + `DEL_FLAG`, + `REVISION`, + `CREATED_BY`, + `CREATED_TIME`, + `UPDATED_BY`, + `UPDATED_TIME` + ) + VALUES + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{customerId}, + #{dateId}, + #{item.bidId}, + #{item.bidName}, + #{item.statusCode}, + #{item.statusDesc}, + #{item.amount}, + #{item.releaseTime}, + #{item.townIds}, + #{item.townNames}, + '0', + 0, + 'APP_USER', + NOW(), + 'APP_USER', + NOW() + ) + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/plugins/ScreenContractInfoDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/plugins/ScreenContractInfoDao.xml new file mode 100644 index 0000000000..24abf9f9f9 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/plugins/ScreenContractInfoDao.xml @@ -0,0 +1,52 @@ + + + + + + + delete from screen_contract_info where CUSTOMER_ID=#{customerId} + + + + INSERT INTO `screen_contract_info` ( + `ID`, + `CUSTOMER_ID`, + `DATE_ID`, + `CONTRACT_ID`, + `CONTRACT_NAME`, + `CATEGORY_CODE`, + `CATEGORY_NAME`, + `DUE_DATE`, + `TOWN_IDS`, + `TOWN_NAMES`, + `DEL_FLAG`, + `REVISION`, + `CREATED_BY`, + `CREATED_TIME`, + `UPDATED_BY`, + `UPDATED_TIME` + ) + VALUES + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{customerId}, + #{dateId}, + #{item.contractId}, + #{item.contractName}, + #{item.categoryCode}, + #{item.categoryName}, + #{item.dueDate}, + #{item.townIds}, + #{item.townNames}, + '0', + 0, + 'APP_USER', + NOW(), + 'APP_USER', + NOW() + ) + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/plugins/ScreenCustomerWorkRecordDictDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/plugins/ScreenCustomerWorkRecordDictDao.xml new file mode 100644 index 0000000000..d86ef25c96 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/plugins/ScreenCustomerWorkRecordDictDao.xml @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + INSERT INTO screen_customer_work_record_dict + ( + id, + customer_id, + date_id, + dict_id, + pid, + resource_type, + resource_code, + resource_label, + show_flag, + sort, + data_type, + `level`, + del_flag, + revision, + created_by, + created_time, + updated_by, + updated_time + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + + #{customerId}, + + #{dateId}, + + #{item.dictId}, + + #{item.pid}, + + #{item.resourceType}, + + #{item.resourceCode}, + + #{item.resourceLabel}, + + #{item.showFlag}, + + #{item.sort}, + + #{item.dataType}, + + #{item.level}, + + '0', + + 0, + + 'APP_USER', + + now(), + + 'APP_USER', + + now() + ) + + + + + delete from screen_customer_work_record_dict + where customer_id = #{customerId} + limit 1000 + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/plugins/ScreenListInfoDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/plugins/ScreenListInfoDao.xml new file mode 100644 index 0000000000..1695f1a726 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/plugins/ScreenListInfoDao.xml @@ -0,0 +1,32 @@ + + + + + + + delete from screen_list_info where CUSTOMER_ID=#{customerId} + + + + INSERT INTO `screen_list_info` ( `ID`, `CUSTOMER_ID`, `DATE_ID`, `LIST_ID`, `LIST_CODE`, `LIST_NAME`, `SORT`, + `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME` ) + VALUES + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{customerId}, + #{dateId}, + #{item.listId}, + #{item.listCode}, + #{item.listName}, + #{item.sort}, + '0', + 0, + 'APP_USER', + NOW(), + 'APP_USER', + NOW() + ) + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/plugins/ScreenWorkRecordOrgMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/plugins/ScreenWorkRecordOrgMonthlyDao.xml new file mode 100644 index 0000000000..8c9c216b5e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/plugins/ScreenWorkRecordOrgMonthlyDao.xml @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + INSERT INTO screen_work_record_org_monthly + ( + id, + customer_id, + month_id, + org_id, + meeting_code, + type_code, + organize_total, + participate_user_total, + avg_participate_user_total, + del_flag, + revision, + created_by, + created_time, + updated_by, + updated_time + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + + #{customerId}, + + #{monthId}, + + #{item.orgId}, + + #{item.meetingCode}, + + #{item.typeCode}, + + #{item.organizeTotal}, + + #{item.participateUserTotal}, + + #{item.avgParticipateUserTotal}, + + '0', + + 0, + + 'APP_USER', + + now(), + + 'APP_USER', + + now() + ) + + + + + delete from screen_work_record_org_monthly + where customer_id = #{customerId} + and month_id = #{monthId} + limit 1000 + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimCustomerDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimCustomerDao.xml index 54914e24d0..457801d6b5 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimCustomerDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimCustomerDao.xml @@ -15,6 +15,7 @@ + + + SELECT + cr.* + FROM + customer_relation cr + WHERE + cr.DEL_FLAG = '0' + AND cr.CUSTOMER_ID =#{customerId} + + + + + \ No newline at end of file