diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/NumConstant.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/NumConstant.java index e906535166..1d727fb297 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/NumConstant.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/NumConstant.java @@ -38,6 +38,7 @@ public interface NumConstant { int ONE_THOUSAND = 1000; int MAX = 99999999; int EIGHTY_EIGHT = 88; + int EIGHTY = 80; double ZERO_DOT_ZERO = 0.0; diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/ExtractConstant.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/ExtractConstant.java index 7bf337367d..b8ee4f09ee 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/ExtractConstant.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/ExtractConstant.java @@ -18,4 +18,18 @@ public interface ExtractConstant { String ISSUE_PROCESS = "查询查询议题process集合为空"; + String SHIFT_PROJECT = "shift_project"; + + String CLOSED = "closed"; + + String GRID_ORG_TYPE = "grid"; + + String RETURN_ACTION_CODE = "return"; + + String EVALUATE_BAD = "bad"; + + String EVALUATE_GOOD = "good"; + + String EVALUATE_PERFECT = "perfect"; + } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/ProjectEvaluateConstant.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/ProjectEvaluateConstant.java new file mode 100644 index 0000000000..a2c15b100e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/ProjectEvaluateConstant.java @@ -0,0 +1,19 @@ +package com.epmet.constant; + +import com.epmet.commons.tools.constant.NumConstant; + +/** + * @Author zxc + * @DateTime 2020/9/18 3:49 下午 + */ +public interface ProjectEvaluateConstant { + +// BigDecimal BAD = new BigDecimal(NumConstant.SIXTY); +// BigDecimal GOOD = new BigDecimal(NumConstant.EIGHTY); +// BigDecimal PERFECT = new BigDecimal(NumConstant.ONE_HUNDRED); + + Integer BAD = NumConstant.SIXTY; + Integer GOOD = NumConstant.EIGHTY; + Integer PERFECT = NumConstant.ONE_HUNDRED; + +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactOriginGroupMainDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactOriginGroupMainDailyDTO.java new file mode 100644 index 0000000000..8292361039 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactOriginGroupMainDailyDTO.java @@ -0,0 +1,155 @@ +/** + * 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.extract; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import com.epmet.dto.group.result.ExtractGroupMemberActionRecordResultDTO; +import lombok.Data; + + +/** + * 业务数据抽取-小组相关 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-16 + */ +@Data +public class FactOriginGroupMainDailyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 组的Id + */ + private String id; + + private String customerId; + + /** + * 状态:(审核通过 - approved 、 审核中 - under_auditting、 审核未通过 - rejected 、 已屏蔽 - hidden、 已关闭 - closed) +Ps: 如果一个小组被拒绝,当前小组的状态将永久停留在“审核未通过” + */ + private String groupState; + + /** + * 小组所在网格Id + */ + private String gridId; + + /** + * 小组所在机关Id + */ + private String agencyId; + + /** + * 小组所在组织的父机关Id + */ + private String parentId; + + /** + * 小组所在组织所有父类Id集合 + */ + private String pids; + + /** + * 建群申请审核通过的时期 + */ + private String dateId; + + /** + * 建群申请审核通过的周期 + */ + private String weekId; + + /** + * 建群申请审核通过的月份 + */ + private String monthId; + + /** + * 建群申请审核通过的季度 + */ + private String quarterId; + + /** + * 建群申请审核通过的年 + */ + private String yearId; + + /** + * 群众人数 + */ + private Integer resiMemberCount; + + /** + * 组内总人数 + */ + private Integer memberTotal; + + /** + * 群主ID + */ + private String groupOwnerId; + + /** + * 群主是否热心居民 可以update + */ + private Integer isOwnerHearted; + + /** + * 群主是否党员 可以update + */ + private Integer isOwnerParty; + + /** + * 删除标识 默认为0 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * + */ + private String createdBy; + + /** + * + */ + private Date createdTime; + + /** + * + */ + private String updatedBy; + + /** + * + */ + private Date updatedTime; + + + private List members = new ArrayList(); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactOriginProjectOrgPeriodDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactOriginProjectOrgPeriodDailyDTO.java new file mode 100644 index 0000000000..e9bb3e944e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactOriginProjectOrgPeriodDailyDTO.java @@ -0,0 +1,128 @@ +/** + * 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.extract; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 业务数据抽取-机关项目响应时间 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-16 + */ +@Data +public class FactOriginProjectOrgPeriodDailyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * + */ + private String id; + + private String customerId; + + /** + * 项目ID + */ + private String projectId; + + /** + * + */ + private String orgId; + + /** + * grid agenct dept + */ + private String orgType; + + /** + * 如果是机关,则为父级机关(若已是顶级机关则为0);如果是网格和部门,则为所属机关 + */ + private String pid; + + /** + * 最后一个节点是PID,若无则为空 + */ + private String pids; + + /** + * 流转到的日期 + */ + private Date informedDate; + + /** + * 流转走或结案的日期 + */ + private Date handledDate; + + /** + * 响应时长,从流转到自己到流转走共耗时/小时(不算法定节假日和周末) + */ + private Integer totalPeriod; + + /** + * 截至第一次响应时长,从流转到第一次处理(响应、结案、流转)耗时,大于等于上一项值 + */ + private Integer periodTillReplyFirstly; + + /** + * resloved 、 unresolved + */ + private String isResolved; + + /** + * 办结的操作,return(回退)、transfer(流转)、closed(结案),但是不包括response(响应)! + * */ + private String operation; + + /** + * 删除标识 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * + */ + private Date createdTime; + + /** + * + */ + private String createdBy; + + /** + * + */ + private Date updatedTime; + + /** + * + */ + private String updatedBy; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/ExtractFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/ExtractFormDTO.java index 50b3a91f5c..0b392c0053 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/ExtractFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/ExtractFormDTO.java @@ -15,11 +15,21 @@ public class ExtractFormDTO implements Serializable { private static final long serialVersionUID = -6180252151765854242L; - public interface ExtractForm extends CustomerClientShowGroup{} + public interface ExtractForm extends CustomerClientShowGroup { + } - @NotBlank(message = "客户ID不能为空",groups = ExtractForm.class) + @NotBlank(message = "客户ID不能为空", groups = ExtractForm.class) private String customerId; - @NotBlank(message = "dateId不能为空",groups = ExtractForm.class) + @NotBlank(message = "dateId不能为空", groups = ExtractForm.class) private String dateId; + + /** + * 开始时间 + */ + private String startDate; + /** + * 结束时间 + */ + private String endDate; } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/ExtractIndexFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/ExtractIndexFormDTO.java new file mode 100644 index 0000000000..c188b64a57 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/ExtractIndexFormDTO.java @@ -0,0 +1,20 @@ +package com.epmet.dto.extract.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * desc:抽取指标数据 参数dto + */ +@Data +public class ExtractIndexFormDTO implements Serializable { + + + private static final long serialVersionUID = 1248641210655148366L; + + private String customerId; + + private String monthId; + +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/GovernAbilityGridMonthlyFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/GovernAbilityGridMonthlyFormDTO.java new file mode 100644 index 0000000000..890e663083 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/GovernAbilityGridMonthlyFormDTO.java @@ -0,0 +1,148 @@ +/** + * 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.extract.form; + +import java.io.Serializable; +import java.util.Date; + +import com.epmet.commons.tools.constant.NumConstant; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 治理能力-网格相关事实表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-18 + */ +@Data +public class GovernAbilityGridMonthlyFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID 主键 + */ + private String id; + + /** + * 客户Id + */ + private String customerId; + + /** + * 网格所属机关Id + */ + private String agencyId; + + /** + * 网格Id + */ + private String gridId; + + /** + * 月维度Id:yyyyMM + */ + private String monthId; + + /** + * 季度Id:yyyyQ1,yyyyQ2,yyyyQ3,yyyyQ4 + */ + private String quarterId; + + /** + * 年Id:yyyy + */ + private String yearId; + + /** + * 网格总议题数 + */ + private Integer issueTotal; + + /** + * 网格人均议题数目 + */ + private Integer avgIssueCount; + + /** + * 网格议题转项目率 + */ + private BigDecimal issueToProjectRatio; + + /** + * 网格总项目数 + */ + private Integer projectTotal; + + /** + * 网格自治项目数 统计期网格自身内办结的项目数目 + */ + private Integer selfSolveProjectCount; + + /** + * 网格办结项目数 统计期内办结的项目数目 + */ + private Integer resolveProjectCount; + + /** + * 网格吹哨部门准确率 + */ + private BigDecimal transferRightRatio; + + /** + * 网格内解决的项目的满意度 + */ + private BigDecimal satisfactionRatio; + + /** + * 删除标识 0未删除;1已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 更新人 + */ + private String updatedBy; + + public GovernAbilityGridMonthlyFormDTO() { + this.issueTotal = NumConstant.ZERO; + this.avgIssueCount = NumConstant.ZERO; + this.issueToProjectRatio = new BigDecimal(NumConstant.ZERO); + this.projectTotal = NumConstant.ZERO; + this.selfSolveProjectCount = NumConstant.ZERO; + this.resolveProjectCount = NumConstant.ZERO; + this.transferRightRatio = new BigDecimal(NumConstant.ZERO); + this.satisfactionRatio = new BigDecimal(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/extract/form/GridHeartedFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/GridHeartedFormDTO.java new file mode 100644 index 0000000000..f570700d01 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/GridHeartedFormDTO.java @@ -0,0 +1,20 @@ +package com.epmet.dto.extract.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description + * @ClassName GridHeartedFormDTO + * @Auth wangc + * @Date 2020-09-20 12:42 + */ +@Data +public class GridHeartedFormDTO implements Serializable { + private static final long serialVersionUID = 9069263069122734316L; + + private String userId; + + private String gridId; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/GridIssueCountResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/GridIssueCountResultDTO.java new file mode 100644 index 0000000000..207cd8e8df --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/GridIssueCountResultDTO.java @@ -0,0 +1,30 @@ +package com.epmet.dto.extract.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/9/18 10:12 上午 + */ +@Data +public class GridIssueCountResultDTO implements Serializable { + + private static final long serialVersionUID = -1222149631076688225L; + + /** + * 网格总议题数目 + */ + private Integer issueTotal; + + /** + * 网格人均议题数目 + */ + private Integer avgIssueCount; + + /** + * 网格ID + */ + private String gridId; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/PartyAbilityGridMonthlyFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/PartyAbilityGridMonthlyFormDTO.java new file mode 100644 index 0000000000..de69be568b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/PartyAbilityGridMonthlyFormDTO.java @@ -0,0 +1,178 @@ +/** + * 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.extract.form; + +import java.io.Serializable; +import java.util.Date; + +import com.epmet.commons.tools.constant.NumConstant; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 党建能力-网格相关事实表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-19 + */ +@Data +public class PartyAbilityGridMonthlyFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID 主键 + */ + private String id; + + /** + * 客户Id + */ + private String customerId; + + /** + * 机关Id + */ + private String agencyId; + + /** + * 网格Id + */ + private String gridId; + + /** + * 月维度Id:yyyyMM + */ + private String monthId; + + /** + * 季度Id yyyyQ1,yyyyQ2,yyyyQ3,yyyyQ4 + */ + private String quarterId; + + /** + * 年Idyyyy + */ + private String yearId; + + /** + * 网格群众用户数 + */ + private Integer userCount; + + /** + * 网格党员用户数 + */ + private Integer partyCount; + + /** + * 网格活跃群众用户数 + */ + private Integer activeUserCount; + + /** + * 网格活跃党员用户数 + */ + private Integer activePartyCount; + + /** + * 网格党员人均提出话题数 + */ + private Integer partyAvgTopicCount; + + /** + * 网格群众人均提出话题数 + */ + private Integer userAvgTopicCount; + + /** + * 网格党员人均提出的议题转项目数 + */ + private Integer partyAvgShiftProjectCount; + + /** + * 网格群众人均提出的议题转项目数 + */ + private Integer userAvgShiftProjectCount; + + /** + * 建群党员数(累计值) 去重 + */ + private Integer createGroupPartyCount; + + /** + * 网格发文数 + */ + private Integer publishArticleCount; + + /** + * 网格议题转项目率 + */ + private BigDecimal issueToProjectRatio; + + /** + * 组织三会一课次数 + */ + private Integer createThreeMeetsCount; + + /** + * 党员参加三会一课人次 + */ + private Integer joinThreeMeetsCount; + + /** + * 删除标识 0未删除;1已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 更新人 + */ + private String updatedBy; + + public PartyAbilityGridMonthlyFormDTO() { + this.userCount = NumConstant.ZERO; + this.partyCount = NumConstant.ZERO; + this.activeUserCount = NumConstant.ZERO; + this.activePartyCount = NumConstant.ZERO; + this.partyAvgTopicCount = NumConstant.ZERO; + this.userAvgTopicCount = NumConstant.ZERO; + this.partyAvgShiftProjectCount = NumConstant.ZERO; + this.userAvgShiftProjectCount = NumConstant.ZERO; + this.createGroupPartyCount = NumConstant.ZERO; + this.publishArticleCount = NumConstant.ZERO; + this.issueToProjectRatio = new BigDecimal(NumConstant.ZERO); + this.createThreeMeetsCount = NumConstant.ZERO; + this.joinThreeMeetsCount = 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/extract/result/AutoNoMyResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/AutoNoMyResultDTO.java new file mode 100644 index 0000000000..234142eb80 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/AutoNoMyResultDTO.java @@ -0,0 +1,30 @@ +package com.epmet.dto.extract.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/9/18 5:22 下午 + */ +@Data +public class AutoNoMyResultDTO implements Serializable { + + private static final long serialVersionUID = 5812052000386418907L; + + /** + * 动作code + */ + private String actionCode; + + /** + * 网格ID + */ + private String gridId; + + /** + * 项目ID + */ + private String projectId; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/CalSatisfactionResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/CalSatisfactionResultDTO.java new file mode 100644 index 0000000000..811f33c30b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/CalSatisfactionResultDTO.java @@ -0,0 +1,16 @@ +package com.epmet.dto.extract.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/9/18 4:01 下午 + */ +@Data +public class CalSatisfactionResultDTO implements Serializable { + + private static final long serialVersionUID = -7514945819312915670L; + +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/CreateTopicCountResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/CreateTopicCountResultDTO.java new file mode 100644 index 0000000000..1aa548f014 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/CreateTopicCountResultDTO.java @@ -0,0 +1,25 @@ +package com.epmet.dto.extract.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/9/19 1:55 下午 + */ +@Data +public class CreateTopicCountResultDTO implements Serializable { + + private static final long serialVersionUID = 500844515980125608L; + + /** + * 网格ID + */ + private String gridId; + + /** + * 网格 党员/群众 人均提出话题数 + */ + private Integer createTopicCount; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/GridProjectClosedTotalResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/GridProjectClosedTotalResultDTO.java new file mode 100644 index 0000000000..512e594ad2 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/GridProjectClosedTotalResultDTO.java @@ -0,0 +1,25 @@ +package com.epmet.dto.extract.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/9/18 2:02 下午 + */ +@Data +public class GridProjectClosedTotalResultDTO implements Serializable { + + private static final long serialVersionUID = 5144371528837124674L; + + /** + * 网格ID + */ + private String gridId; + + /** + * 网格办结项目数 + */ + private Integer resolveProjectCount; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/GridProjectCountResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/GridProjectCountResultDTO.java new file mode 100644 index 0000000000..6d0a8cf1d7 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/GridProjectCountResultDTO.java @@ -0,0 +1,31 @@ +package com.epmet.dto.extract.result; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * @Author zxc + * @DateTime 2020/9/18 1:22 下午 + */ +@Data +public class GridProjectCountResultDTO implements Serializable { + + private static final long serialVersionUID = -1348707512443965601L; + + /** + * 网格总项目数 + */ + private Integer projectTotal; + + /** + * 网格ID + */ + private String gridId; + + /** + * 网格议题转项目率 + */ + private BigDecimal issueToProjectRatio; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/GridUserCountResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/GridUserCountResultDTO.java new file mode 100644 index 0000000000..8b97bdc505 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/GridUserCountResultDTO.java @@ -0,0 +1,30 @@ +package com.epmet.dto.extract.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/9/19 10:59 上午 + */ +@Data +public class GridUserCountResultDTO implements Serializable { + + private static final long serialVersionUID = -2912049598149499392L; + + /** + * 注册居民本月增量 + */ + private Integer userCount; + + /** + * 注册党员本月增量 + */ + private Integer partyCount; + + /** + * 网格ID + */ + private String gridId; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/NotReturnProjectResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/NotReturnProjectResultDTO.java new file mode 100644 index 0000000000..70f0efd484 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/NotReturnProjectResultDTO.java @@ -0,0 +1,32 @@ +package com.epmet.dto.extract.result; + +import com.epmet.commons.tools.constant.NumConstant; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * @Author zxc + * @DateTime 2020/9/18 2:46 下午 + */ +@Data +public class NotReturnProjectResultDTO implements Serializable { + + private static final long serialVersionUID = -2931817313224740122L; + + /** + * 网格ID + */ + private String gridId; + + /** + * 未被退回的项目 + */ + private Integer notReturnProject = NumConstant.ZERO; + + /** + * 网格吹哨部门准确率 + */ + private BigDecimal transferRightRatio = new BigDecimal(NumConstant.ZERO); +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/OrgResponseTimeResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/OrgResponseTimeResultDTO.java new file mode 100644 index 0000000000..88735859d3 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/OrgResponseTimeResultDTO.java @@ -0,0 +1,25 @@ +package com.epmet.dto.extract.result; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * @Description 各机关响应时间 + * @ClassName OrgResponseTimeResultDTO + * @Auth wangc + * @Date 2020-09-21 02:03 + */ +@Data +public class OrgResponseTimeResultDTO implements Serializable { + private static final long serialVersionUID = 6017440139236985959L; + + private String agencyId; + + private BigDecimal responseTime; + + private BigDecimal projectTotal; + + private BigDecimal distinctProjectTotal; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/OrgStatisticsResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/OrgStatisticsResultDTO.java new file mode 100644 index 0000000000..ad170c5b96 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/OrgStatisticsResultDTO.java @@ -0,0 +1,21 @@ +package com.epmet.dto.extract.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/9/18 14:39 + */ +@Data +public class OrgStatisticsResultDTO implements Serializable { + private static final long serialVersionUID = 9221060553279124719L; + private String customerId; + private String agencyId; + private String orgId; + private Integer count; + private Integer sum; + private String ratio; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/PartyActiveResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/PartyActiveResultDTO.java new file mode 100644 index 0000000000..53bc3f2658 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/PartyActiveResultDTO.java @@ -0,0 +1,25 @@ +package com.epmet.dto.extract.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/9/21 9:35 上午 + */ +@Data +public class PartyActiveResultDTO implements Serializable { + + private static final long serialVersionUID = 4694666116463447613L; + + /** + * 网格ID + */ + private String gridId; + + /** + * 动作操作用户ID + */ + private String userId; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/PartyCreateGroupCountResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/PartyCreateGroupCountResultDTO.java new file mode 100644 index 0000000000..c95ae4bad3 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/PartyCreateGroupCountResultDTO.java @@ -0,0 +1,25 @@ +package com.epmet.dto.extract.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/9/19 3:30 下午 + */ +@Data +public class PartyCreateGroupCountResultDTO implements Serializable { + + private static final long serialVersionUID = -4193777575465275095L; + + /** + * 网格ID + */ + private String gridId; + + /** + * 建群党员数 + */ + private Integer partyCreateGroupCount; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/ProjectEvaluateResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/ProjectEvaluateResultDTO.java new file mode 100644 index 0000000000..1e9c927663 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/ProjectEvaluateResultDTO.java @@ -0,0 +1,37 @@ +package com.epmet.dto.extract.result; + +import com.epmet.commons.tools.constant.NumConstant; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * @Author zxc + * @DateTime 2020/9/18 3:23 下午 + */ +@Data +public class ProjectEvaluateResultDTO implements Serializable { + + private static final long serialVersionUID = 6042094904405338630L; + + /** + * 动作code + */ + private String actionCode; + + /** + * 网格ID + */ + private String gridId; + + /** + * 满意度评价对应的分数 + */ + private Integer score = NumConstant.ZERO; + + /** + * 项目ID + */ + private String projectId; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/ProjectParticipatedAgencyResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/ProjectParticipatedAgencyResultDTO.java new file mode 100644 index 0000000000..1cd9de713b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/ProjectParticipatedAgencyResultDTO.java @@ -0,0 +1,24 @@ +package com.epmet.dto.extract.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 参与过项目的agencyDTO + * @ClassName ProjectParticipatedAgencyResultDTO + * @Auth wangc + * @Date 2020-09-20 23:40 + */ +@Data +public class ProjectParticipatedAgencyResultDTO implements Serializable { + private static final long serialVersionUID = 1071619125612033138L; + + private String projectId; + + private String agencyId; + + private String level; + + private int score; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/PublishCountResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/PublishCountResultDTO.java new file mode 100644 index 0000000000..2044dcd8fa --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/PublishCountResultDTO.java @@ -0,0 +1,25 @@ +package com.epmet.dto.extract.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/9/19 2:41 下午 + */ +@Data +public class PublishCountResultDTO implements Serializable { + + private static final long serialVersionUID = -955208044108055887L; + + /** + * 网格ID + */ + private String gridId; + + /** + * 发文数量 + */ + private Integer publishCount; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/ShiftProjectCountResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/ShiftProjectCountResultDTO.java new file mode 100644 index 0000000000..7519e32c48 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/ShiftProjectCountResultDTO.java @@ -0,0 +1,25 @@ +package com.epmet.dto.extract.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/9/19 2:23 下午 + */ +@Data +public class ShiftProjectCountResultDTO implements Serializable { + + private static final long serialVersionUID = -262809191405218048L; + + /** + * 网格ID + */ + private String gridId; + + /** + * 网格 党员/群众 人均提出的议题转项目数 + */ + private Integer shiftProjectCount; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/ExtractGroupMemberActionRecordResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/ExtractGroupMemberActionRecordResultDTO.java new file mode 100644 index 0000000000..47aa8e8783 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/ExtractGroupMemberActionRecordResultDTO.java @@ -0,0 +1,41 @@ +package com.epmet.dto.group.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * @Description + * @ClassName ExtractGroupMemberActionRecordResultDTO + * @Auth wangc + * @Date 2020-09-18 21:18 + */ +@Data +public class ExtractGroupMemberActionRecordResultDTO implements Serializable { + private static final long serialVersionUID = -74883228267461785L; + private String customerId; + + private String groupId; + + private String memberId; + + private String leaderFlag; + + private String dateId; + + private String weekId; + + private String monthId; + + private String quarterId; + + private String yearId; + + private Date joinDate; + + /** + * 目前只有join leader也是join + * */ + private String actionCode; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/FinishOrgDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/FinishOrgDTO.java new file mode 100644 index 0000000000..ab5c9ef2ce --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/FinishOrgDTO.java @@ -0,0 +1,20 @@ +package com.epmet.dto.project; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/9/20 21:08 + */ +@Data +public class FinishOrgDTO implements Serializable { + + private static final long serialVersionUID = -5684606755705833962L; + private String projectId; + private String orgIdPath; + private String pIdPath; + +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/ProcessInfoDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/ProcessInfoDTO.java index 070f1ceb0b..845c943aa9 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/ProcessInfoDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/ProcessInfoDTO.java @@ -14,6 +14,8 @@ import java.util.Date; public class ProcessInfoDTO implements Serializable { private static final long serialVersionUID = 4586424046147127143L; private String agencyId; + private String departmentId; + private String gridId; private String projectId; /** * 处理:结案close,退回return,部门流转transfer,创建项目created diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/result/ProjectOrgPeriodResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/result/ProjectOrgPeriodResultDTO.java new file mode 100644 index 0000000000..b3e101295d --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/result/ProjectOrgPeriodResultDTO.java @@ -0,0 +1,95 @@ +package com.epmet.dto.project.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * @Description 从数据库中查询出的 项目 - 机关(网格、部门、机关)的响应时长 + * FIXME 注:查询的全都是已经结案的项目!!!!!!!!!!!!如果查询流转中的项目,需要修改逻辑(较为复杂) + * @ClassName ProjectOrgPeriodResultDTO + * @Auth wangc + * @Date 2020-09-16 15:28 + */ +@Data +public class ProjectOrgPeriodResultDTO implements Serializable { + private static final long serialVersionUID = 6216112710806237600L; + + /** + * 节点Id + * */ + private String processId; + + /** + * 项目Id + * */ + private String projectId; + + + /** + * 对这个节点的处理,如果未处理则为null + * created transfer close return response(查不出response,因为response类型的节点不会与process_staff产生关联,需要另取) + * */ + private String operation; + + /** + * 是这个节点的操作,相当于上一个人的操作,而不是对于这个节点的处理 + * created transfer close return response + * */ + private String lastAction; + + /** + * 节点所属的机关,即上个节点推到这个节点的负责部门 + * */ + private String departmentName; + + /** + * 当前节点所属的Agency,如果负责的是部门或者网格则是其所属的机关 + * */ + private String orgId; + + /** + * 如果是部门处理,则有值,否则null + * */ + private String departmentId; + + /** + * 如果是网格处理,则有值,否则null + * */ + private String gridId; + + /** + * 当前所属的机关的所有Pid集合以及当前的机关Id,所以此项不会未null,至少也是它的所属Agency + * */ + private String orgIdPath; + + /** + * 从节点流入到节点流出,且当前负责单位确实解决(包括退回)了的情况下,所耗费的时间(以分钟为单位) + * 如果未当前负责单位一直停留在unresolved状态,即使做出response、或者项目被其他单位结案,该项依旧是0,不参与办结的计时 + * 如果负责单位只是做出回应,但未处理(即没有让节点流走),需要查出其相应的第一次响应时间,另取 + * */ + private Integer totalPeriod; + + /** + * 节点流入时间 + * */ + private Date informedDate; + + /** + * 节点流出时间,如果未解决则未null + * */ + private Date handledDate; + + /** + * 第一次响应时间 + * */ + private Date periodTillReplyFirstly; + + private String customerId; + + private String staffId; + + private String isResolved; + +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/result/ProjectOrgRelationWhenResponseResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/result/ProjectOrgRelationWhenResponseResultDTO.java new file mode 100644 index 0000000000..892e173491 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/result/ProjectOrgRelationWhenResponseResultDTO.java @@ -0,0 +1,49 @@ +package com.epmet.dto.project.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * @Description 查询机关在项目节点上响应的结果 + * 查询的是存在“响应”的所有相关工作人员节点,如果同一个人对同一个项目已经做过一次处理(并未做出响应)而在第二次流转到自己时 + * 做出了响应,也会连带查询出其第一次未响应过的数据 + * @ClassName ProjectOrgRelationWhenResponseResultDTO + * @Auth wangc + * @Date 2020-09-16 17:27 + */ +@Data +public class ProjectOrgRelationWhenResponseResultDTO implements Serializable { + private static final long serialVersionUID = 1962332392048752037L; + + /** + * 项目Id + * */ + private String projectId; + + /** + * 节点Id + * */ + private String processId; + + /** + * 节点动作的发起人 + * */ + private String staffId; + + /** + * 负责人所属的单位名称:xx机关-xx部门 、 xx机关-xx网格 、 xx机关 + * */ + private String departmentName; + + /** + * 动作分类 + * */ + private String operation; + + /** + * 节点创建时间,动作发起时间 + * */ + private Date createdTime; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/result/GridAttributesResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/result/GridAttributesResultDTO.java new file mode 100644 index 0000000000..17fd652a8c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/result/GridAttributesResultDTO.java @@ -0,0 +1,36 @@ +package com.epmet.dto.stats.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description + * @ClassName GridAttributesResultDTO + * @Auth wangc + * @Date 2020-09-20 12:50 + */ +@Data +public class GridAttributesResultDTO implements Serializable { + private static final long serialVersionUID = 466974582608407121L; + + /** + * 网格ID + */ + private String gridId; + + /** + * 网格所属机关ID + */ + private String agencyId; + + /** + * 机关的上级ID + */ + private String parentId; + + /** + * 所有上级Id + * */ + private String pids; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/DataStatisticalOpenFeignClient.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/DataStatisticalOpenFeignClient.java index 5abd41f58b..4430b7295e 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/DataStatisticalOpenFeignClient.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/DataStatisticalOpenFeignClient.java @@ -3,6 +3,8 @@ package com.epmet.feign; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.StatsFormDTO; +import com.epmet.dto.extract.form.ExtractFormDTO; +import com.epmet.dto.extract.form.ExtractIndexFormDTO; import com.epmet.dto.group.form.GroupStatsFormDTO; import com.epmet.dto.issue.form.IssueJobFromDTO; import com.epmet.dto.stats.form.CustomerIdAndDateIdFormDTO; @@ -175,8 +177,8 @@ public interface DataStatisticalOpenFeignClient { Result execTopicStatistical(@RequestParam(value = "date", required = false) String date); /** + * @Description 统计党员 * @param customerIdAndDateIdFormDTO - * @Description 统计党员 * @author zxc * @date 2020/9/17 3:10 下午 */ @@ -190,4 +192,23 @@ public interface DataStatisticalOpenFeignClient { */ @PostMapping("/data/stats/indexcalculate/process-pendding-cals") Result processPenddingCalculate(); + + /** + * desc: 【日】抽取业务数据到统计库 小组 话题 议题 项目 + * + * @date: 2020/6/22 9:09 + * @author: jianjun liu + */ + @PostMapping(value = "data/stats/factorigin/extractall") + Result factOriginExtractAll(@RequestBody(required = false) ExtractFormDTO formDTO); + + /** + * desc: 【月】抽取统计数据到指标库 + * + * @date: 2020/6/22 9:09 + * @author: jianjun liu + */ + @PostMapping(value = "data/stats/indexorigin/extractall") + Result indexOriginExtractAll(@RequestBody(required = false) ExtractIndexFormDTO formDTO); + } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/DataStatisticalOpenFeignClientFallBack.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/DataStatisticalOpenFeignClientFallBack.java index 85a0737f0b..b672d53351 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/DataStatisticalOpenFeignClientFallBack.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/DataStatisticalOpenFeignClientFallBack.java @@ -4,6 +4,8 @@ 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.StatsFormDTO; +import com.epmet.dto.extract.form.ExtractFormDTO; +import com.epmet.dto.extract.form.ExtractIndexFormDTO; import com.epmet.dto.group.form.GroupStatsFormDTO; import com.epmet.dto.issue.form.IssueJobFromDTO; import com.epmet.dto.stats.form.CustomerIdAndDateIdFormDTO; @@ -181,4 +183,28 @@ public class DataStatisticalOpenFeignClientFallBack implements DataStatisticalOp public Result processPenddingCalculate() { return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "processPenddingCalculate"); } + + /** + * desc: 【日】抽取业务数据到统计库 小组 话题 议题 项目 + * + * @param formDTO + * @date: 2020/6/22 9:09 + * @author: jianjun liu + */ + @Override + public Result factOriginExtractAll(ExtractFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "factOriginExtractAll", formDTO); + } + + /** + * desc: 【月】抽取统计数据到指标库 + * + * @param formDTO + * @date: 2020/6/22 9:09 + * @author: jianjun liu + */ + @Override + public Result indexOriginExtractAll(ExtractIndexFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "indexOriginExtractAll", formDTO); + } } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/FactExtractOpenFeignClientFallBack.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/FactExtractOpenFeignClientFallBack.java new file mode 100644 index 0000000000..b06cc18485 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/FactExtractOpenFeignClientFallBack.java @@ -0,0 +1,210 @@ +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.StatsFormDTO; +import com.epmet.dto.extract.form.ExtractFormDTO; +import com.epmet.dto.extract.form.ExtractIndexFormDTO; +import com.epmet.dto.group.form.GroupStatsFormDTO; +import com.epmet.dto.issue.form.IssueJobFromDTO; +import com.epmet.dto.stats.form.CustomerIdAndDateIdFormDTO; +import com.epmet.feign.DataStatisticalOpenFeignClient; +import org.springframework.stereotype.Component; + +/** + * desc: + * + * @return: + * @date: 2020/6/22 9:38 + * @author: jianjun liu + * email:liujianjun@git.elinkit.com.cn + */ +@Component +public class FactExtractOpenFeignClientFallBack implements DataStatisticalOpenFeignClient { + + /** + * desc: 【日】统计文章总数及在线文章总数 包含 机关 部门 网格 + * + * @date: 2020/6/22 9:09 + * @author: jianjun liu + */ + @Override + public Result articleSummaryDailyStatsjob(StatsFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "articleSummaryDailyStatsjob", formDTO); + } + + /** + * desc: 定时任务 【日】统计文章总数及在线文章总数 包含 机关 部门 网格 + * + * @return: + * @date: 2020/6/22 9:09 + * @author: jianjun liu + */ + @Override + public Result tagUsedDailyStatsjob(StatsFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "tagUsedDailyStatsjob", formDTO); + } + + /** + * desc: 【月】 统计发表文章最多的分类 包含 机关 部门 网格 + * + * @date: 2020/6/22 9:09 + * @author: jianjun liu + */ + @Override + public Result tagUsedMonthlyStatsjob(StatsFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "tagUsedMonthlyStatsjob", formDTO); + } + + /** + * desc: 【季,年】 统计发表文章最多的分类 包含 机关 部门 网格 + * + * @date: 2020/6/22 9:09 + * @author: jianjun liu + */ + @Override + public Result tagUsedQuarterlyStatsjob(StatsFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "tagUsedQuarterlyStatsjob", formDTO); + } + + /** + * desc: 【日】 统计阅读最多的标签 包含 机关 网格 + * + * @date: 2020/6/22 9:09 + * @author: jianjun liu + */ + @Override + public Result tagViewedDailyStatsjob(StatsFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "tagViewedDailyStatsjob", formDTO); + } + + /** + * desc: 【月】 统计阅读最多的标签 包含 机关 网格 + * + * @date: 2020/6/22 9:09 + * @author: jianjun liu + */ + @Override + public Result tagViewedMonthlyStatsjob(StatsFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "tagViewedMonthlyStatsjob", formDTO); + } + + /** + * desc: 【季,年】 统计阅读最多的标签 包含 机关 网格 + * + * @param formDTO + * @date: 2020/6/22 9:09 + * @author: jianjun liu + */ + @Override + public Result tagViewedQuarterlyStatsjob(StatsFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "tagViewedQuarterlyStatsjob", formDTO); + } + + @Override + public Result groupGridDaily(GroupStatsFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "groupGridDaily", formDTO); + } + + @Override + public Result groupAgencyDaily(GroupStatsFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "groupAgencyDaily", formDTO); + } + + @Override + public Result groupAgencyMonthly(GroupStatsFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "groupAgencyMonthly", formDTO); + } + + @Override + public Result agencyGridIssueStats() { + return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "agencyGridIssueStats"); + } + + @Override + public Result agencyGridIssueStatsOfDate(IssueJobFromDTO fromDTO) { + return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "agencyGridIssueStatsOfDate"); + } + + /** + * @Description 数据统计-项目-机关日月统计 + * @Author sun + */ + @Override + public Result agencyProjectStats(StatsFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "agencyProjectStats", formDTO); + } + + /** + * @Description 数据统计-项目-网格日月统计 + * @Author sun + */ + @Override + public Result gridProjectStats(StatsFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "gridProjectStats", formDTO); + } + + @Override + public Result initAllDims() { + return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "initAllDims"); + } + + /** + * @param + * @return + * @Description 执行用户统计 + * @author wangc + * @date 2020.06.29 09:26 + **/ + @Override + public Result execUserStatistical(String date) { + return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "execUserStatistical", date); + } + + /** + * @param + * @return + * @Description 执行话题统计 + * @author wangc + * @date 2020.06.29 09:27 + **/ + @Override + public Result execTopicStatistical(String date) { + return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "execTopicStatistical", date); + } + + @Override + public Result getPartyInfo(CustomerIdAndDateIdFormDTO customerIdAndDateIdFormDTO) { + return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "getPartyInfo", customerIdAndDateIdFormDTO); + } + + @Override + public Result processPenddingCalculate() { + return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "processPenddingCalculate"); + } + + /** + * desc: 【日】抽取业务数据到统计库 小组 话题 议题 项目 + * + * @param formDTO + * @date: 2020/6/22 9:09 + * @author: jianjun liu + */ + @Override + public Result factOriginExtractAll(ExtractFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "factOriginExtractAll", formDTO); + } + + /** + * desc: 【月】抽取统计数据到指标库 + * + * @param formDTO + * @date: 2020/6/22 9:09 + * @author: jianjun liu + */ + @Override + public Result indexOriginExtractAll(ExtractIndexFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "indexOriginExtractAll", formDTO); + } +} 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 6db7fd4245..92611df2cf 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 @@ -15,6 +15,7 @@ import com.epmet.dao.evaluationindex.screen.ScreenCustomerGridDao; import com.epmet.dao.stats.DimCustomerDao; import com.epmet.dao.stats.DimDateDao; import com.epmet.dto.AgencySubTreeDto; +import com.epmet.dto.extract.form.ExtractFormDTO; import com.epmet.dto.indexcal.CalculateCommonFormDTO; import com.epmet.dto.stats.form.CustomerIdAndDateIdFormDTO; import com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityGridMonthlyEntity; @@ -25,6 +26,8 @@ import com.epmet.entity.stats.DimAgencyEntity; import com.epmet.entity.stats.DimCustomerEntity; import com.epmet.entity.stats.DimDateEntity; import com.epmet.service.StatsDemoService; +import com.epmet.service.evaluationindex.extract.CalGridIndexService; +import com.epmet.service.evaluationindex.extract.FactOriginProjectLogDailyService; import com.epmet.service.evaluationindex.extract.FactOriginTopicMainDailyService; import com.epmet.service.evaluationindex.indexcal.*; import com.epmet.service.stats.DimAgencyService; @@ -37,6 +40,7 @@ import org.springframework.web.bind.annotation.*; import java.math.BigDecimal; import java.time.LocalDateTime; import java.util.List; +import java.util.Map; import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutorService; import java.util.concurrent.Future; @@ -81,6 +85,8 @@ public class DemoController { private DimCustomerDao dimCustomerDao; @Autowired private FactOriginTopicMainDailyService factOriginTopicMainDailyService; + @Autowired + private FactOriginProjectLogDailyService factOriginProjectLogDailyService; @GetMapping("testAlarm") public void testAlarm() { @@ -503,15 +509,21 @@ public class DemoController { @PostMapping("inserttopicorigin") public Result topicDataCleaning(@RequestParam("customerId") String customerId, @RequestParam("dateId")String dateId) { if (StringUtils.isNotBlank(customerId) && StringUtils.isNotBlank(dateId)) { - factOriginTopicMainDailyService.topicCleaning(customerId,dateId); + ExtractFormDTO param = new ExtractFormDTO(); + param.setDateId(dateId); + param.setCustomerId(customerId); + Boolean aBoolean = factOriginTopicMainDailyService.topicCleaning(param); }else{ QueryWrapper customerEntityQueryWrapper = new QueryWrapper<>(); List customerEntityList=dimCustomerDao.selectList(customerEntityQueryWrapper); QueryWrapper wrapper = new QueryWrapper<>(); List dimDateEntityList= dimDateDao.selectList(wrapper); for(DimCustomerEntity customerEntity:customerEntityList){ - for(DimDateEntity dateEntity:dimDateEntityList){ - factOriginTopicMainDailyService.topicCleaning(customerEntity.getId(),dateEntity.getId()); + for(DimDateEntity dateEntity:dimDateEntityList) { + ExtractFormDTO param = new ExtractFormDTO(); + param.setDateId(dateEntity.getId()); + param.setCustomerId(customerEntity.getId()); + factOriginTopicMainDailyService.topicCleaning(param); } } } @@ -526,4 +538,38 @@ public class DemoController { partymemberService.statsPartyMember(customerIdAndDateIdFormDTO); return new Result(); } + + @Autowired + private CalGridIndexService calGridIndexService; + + @PostMapping("gridparty") + public void gridParty(){ +// String customerId = "3ef7e4bb195eb9e622d68b52509aa940"; + String customerId = "epmettest"; + String monthId = "202008"; + calGridIndexService.calGridIndexPartyAbility(customerId,monthId); + } + + @PostMapping("gridgovern") + public void gridGovern(){ +// String customerId = "3ef7e4bb195eb9e622d68b52509aa940"; + String customerId = "epmettest"; + String monthId = "202008"; + calGridIndexService.calGridIndexGovernAbility(customerId,monthId); + } + + @PostMapping("handlemap") + public Result> handleMap(){ + return new Result>().ok( + factOriginProjectLogDailyService.getProjectHandledAgency("3ef7e4bb195eb9e622d68b52509aa940","202006","month")); + } + + @PostMapping("responseration") + public Result> responseRatio(){ + return new Result>().ok( + factOriginProjectLogDailyService.getAgencyResponseRatio("3ef7e4bb195eb9e622d68b52509aa940","202006","month") + ); + } + + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactOriginController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactOriginController.java deleted file mode 100644 index 7bda36e19f..0000000000 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactOriginController.java +++ /dev/null @@ -1,84 +0,0 @@ -package com.epmet.controller; - -import com.epmet.commons.tools.utils.Result; -import com.epmet.commons.tools.validator.ValidatorUtils; -import com.epmet.dto.extract.form.ExtractFormDTO; -import com.epmet.dto.extract.form.ProjectFormDTO; -import com.epmet.service.evaluationindex.extract.IssueExtractService; -import com.epmet.service.evaluationindex.extract.ProjectExtractService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.PostMapping; -import com.epmet.service.evaluationindex.extract.FactOriginTopicMainDailyService; -import org.apache.commons.lang3.StringUtils; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -import java.util.Date; - - -/** - * 原始数据清洗 - * - * @author yinzuomei@elink-cn.com - * @date 2020/9/15 11:06 - */ -@RestController -@RequestMapping("factorigin") -public class FactOriginController { - - @Autowired - private IssueExtractService issueExtractService; - @Autowired - private FactOriginTopicMainDailyService factOriginTopicMainDailyService; - @Autowired - private ProjectExtractService projectExtractService; - - /** - * @Description 议题抽取(main) - * @param extractFormDTO - * @author zxc - * @date 2020/9/15 2:02 下午 - */ - @PostMapping("issueextractmain") - public Result issueExtractMain(@RequestBody ExtractFormDTO extractFormDTO){ - ValidatorUtils.validateEntity(extractFormDTO, ExtractFormDTO.ExtractForm.class); - issueExtractService.issueExtractMain(extractFormDTO); - return new Result(); - } - - /** - * @Description 议题抽取(log) - * @param extractFormDTO - * @author zxc - * @date 2020/9/16 9:41 上午 - */ - @PostMapping("issueextractlog") - public Result issueExtractLog(@RequestBody ExtractFormDTO extractFormDTO){ - ValidatorUtils.validateEntity(extractFormDTO, ExtractFormDTO.ExtractForm.class); - issueExtractService.issueExtractLog(extractFormDTO); - return new Result(); - } - - /** - * @param customerId yyyyMMdd - * @param dateId yyyyMMdd - * @return com.epmet.commons.tools.utils.Result - * @author yinzuomei - * @description 话题 (fact_origin_topic_main_daily 话题主表_日统计 fact_origin_topic_log_daily 话题明细_日统计) - * @Date 2020/9/15 13:39 - **/ - @PostMapping("topic") - public Result topicDataCleaning(String customerId,String dateId) { - if (StringUtils.isNotBlank(customerId) && StringUtils.isNotBlank(dateId)) { - factOriginTopicMainDailyService.topicCleaning(customerId,dateId); - } - return new Result(); - } - - @PostMapping("project") - public Result projectData(@RequestBody ProjectFormDTO formDTO) { - projectExtractService.saveOriginProjectDaily(formDTO.getCustomerId(), formDTO.getDate()); - return new Result(); - } -} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexOriginExtractController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexOriginExtractController.java new file mode 100644 index 0000000000..1f2b86020a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexOriginExtractController.java @@ -0,0 +1,37 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.extract.form.ExtractIndexFormDTO; +import com.epmet.service.evaluationindex.extract.dataToIndex.IndexOriginExtractService; +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; + + +/** + * 原始数据清洗 + * + * @author yinzuomei@elink-cn.com + * @date 2020/9/15 11:06 + */ +@RestController +@RequestMapping("indexorigin") +public class IndexOriginExtractController { + @Autowired + private IndexOriginExtractService indexOriginExtractService; + + + /** + * desc:抽取统计数据到指标库 + * + * @param extractFormDTO 默认统计上一个月 + * @return + */ + @PostMapping("extractall") + public Result extractAll(@RequestBody ExtractIndexFormDTO extractFormDTO) { + indexOriginExtractService.indexOriginExtractAll(extractFormDTO); + return new Result(); + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginGroupMainDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginGroupMainDailyDao.java new file mode 100644 index 0000000000..e80d25e5ae --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginGroupMainDailyDao.java @@ -0,0 +1,139 @@ +/** + * 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.extract; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.extract.result.PartyCreateGroupCountResultDTO; +import com.epmet.dto.extract.FactOriginGroupMainDailyDTO; +import com.epmet.dto.extract.form.GridHeartedFormDTO; +import com.epmet.dto.group.result.ExtractGroupMemberActionRecordResultDTO; +import com.epmet.entity.evaluationindex.extract.FactOriginGroupMainDailyEntity; +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 2020-09-16 + */ +@Mapper +public interface FactOriginGroupMainDailyDao extends BaseDao { + + /** + * @Description 查询建群党员数 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/9/19 3:49 下午 + */ + List selectPartyCreateGroupCount(@Param("customerId") String customerId,@Param("monthId") String monthId); + + + /** + * @Description 查询是否存在该客户下的数据 + * @param customerId + * @return + * @author wangc + * @date 2020.09.18 23:30 + **/ + int selectIfExist(@Param("customerId")String customerId); + + /** + * @Description 按照客户Id清除组数据 + * @param customerId + * @return + * @author wangc + * @date 2020.09.20 09:58 + **/ + void deleteBatchByCustomerId(@Param("customerId")String customerId); + + /** + * @Description 按照客户Id清除组员数据 + * @param customerId + * @return + * @author wangc + * @date 2020.09.20 09:58 + **/ + void deleteBatchMemberByCustomerId(@Param("customerId")String customerId); + + /** + * @Description 按照组Id清除组和组员数据 + * @param customerId + * @return + * @author wangc + * @date 2020.09.20 12:16 + **/ + void deleteBatchByGroupId(@Param("customerId")String customerId,@Param("list") List list); + + /** + * @Description 更新群主的党员信息 + * @param list + * @return + * @author wangc + * @date 2020.09.20 12:44 + **/ + int updatePartyFlag(@Param("list") List list,@Param("customerId")String customerId); + + /** + * @Description 更新群主的热心居民信息 + * @param list + * @return + * @author wangc + * @date 2020.09.20 12:44 + **/ + int updateHeartedFlag(@Param("list") List list,@Param("customerId")String customerId); + + /** + * @Description 批量插入组主表 + * @param list + * @return + * @author wangc + * @date 2020.09.20 15:37 + **/ + int insertBatchMain(@Param("list") List list); + + /** + * @Description 批量插入组员表 + * @param list + * @return + * @author wangc + * @date 2020.09.20 15:37 + **/ + int insertBatchMembers(List list); + /** + * @param customerId + * @param groupOwnerId + * @return java.util.List + * @author yinzuomei + * @description 查询当前用户建的所有群id + * @Date 2020/9/20 21:22 + **/ + List selectGroupIds(@Param("customerId") String customerId, @Param("groupOwnerId") String groupOwnerId); + + /** + * @return java.util.List + * @param groupIdList + * @author yinzuomei + * @description 查询组成员数(去重) + * @Date 2020/9/20 21:29 + **/ + List selectGroupMemberList(@Param("list") List groupIdList); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueLogDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueLogDailyDao.java index a98372928e..1e4ab97477 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueLogDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueLogDailyDao.java @@ -19,6 +19,7 @@ package com.epmet.dao.evaluationindex.extract; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.extract.form.IssueLogDailyFormDTO; +import com.epmet.dto.extract.result.PartyActiveResultDTO; import com.epmet.entity.evaluationindex.extract.FactOriginIssueLogDailyEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -51,4 +52,24 @@ public interface FactOriginIssueLogDailyDao extends BaseDao selectPartyActiveIssueVote(@Param("customerId")String customerId,@Param("monthId") String monthId,@Param("isParty") Integer isParty); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueMainDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueMainDailyDao.java index 1866a593a5..c115125ba8 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueMainDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueMainDailyDao.java @@ -18,12 +18,16 @@ package com.epmet.dao.evaluationindex.extract; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.extract.form.GridIssueCountResultDTO; import com.epmet.dto.extract.form.IssueMainDailyFormDTO; +import com.epmet.dto.extract.result.GridProjectCountResultDTO; +import com.epmet.dto.extract.result.ShiftProjectCountResultDTO; import com.epmet.entity.evaluationindex.extract.FactOriginIssueMainDailyEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import java.util.List; +import java.util.Map; /** * 议题主表 @@ -50,4 +54,51 @@ public interface FactOriginIssueMainDailyDao extends BaseDao selectIssueTotal(@Param("customerId") String customerId,@Param("monthId") String monthId); + + /** + * @Description 网格总项目数 + * @param customerId + * @param monthId + * @param status + * @author zxc + * @date 2020/9/18 1:21 下午 + */ + List selectGridProjectCount(@Param("customerId") String customerId,@Param("monthId") String monthId, @Param("status") String status); + /** + * @return java.util.List> + * @param customerId + * @param monthId + * @author yinzuomei + * @description 党员提出的话题转议题数 + * @Date 2020/9/18 13:58 + **/ + List> selectShiftIssueCount(@Param("customerId") String customerId,@Param("monthId") String monthId); + + /** + * @Description 查询网格 党员/群众 人均提出的议题转项目数 + * @param customerId + * @param monthId + * @param isParty + * @author zxc + * @date 2020/9/19 2:26 下午 + */ + List selectShiftProjectCountPlus(@Param("customerId") String customerId,@Param("monthId") String monthId,@Param("isParty") Integer isParty); + + /** + * @return java.lang.Integer + * @param topicIdList + * @author yinzuomei + * @description 查询本周期和上周期内,自建群内话题转为议题的数量的总和 + * @Date 2020/9/20 22:54 + **/ + Integer selectIssueTotalTwoMonth(@Param("list") List topicIdList); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectLogDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectLogDailyDao.java index a4729ec8ec..d57370166e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectLogDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectLogDailyDao.java @@ -18,8 +18,12 @@ package com.epmet.dao.evaluationindex.extract; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.extract.result.*; import com.epmet.entity.evaluationindex.extract.FactOriginProjectLogDailyEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * 项目明细_日统计 @@ -29,5 +33,86 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface FactOriginProjectLogDailyDao extends BaseDao { - -} \ No newline at end of file + /** + * 机关被吹哨次数 + * @author zhaoqifeng + * @date 2020/9/18 14:46 + * @param customerId + * @param monthId + * @param level + * @return java.util.List + */ + List selectAgencyTransferCount(@Param("customerId") String customerId, @Param("monthId") String monthId, + @Param("level")String level); + + /** + * @Description 查询未被退回的项目数 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/9/18 2:50 下午 + */ + List selectNotReturnProject(@Param("customerId") String customerId,@Param("monthId") String monthId,@Param("actionCode") String actionCode,@Param("orgType") String orgType); + + /** + * @Description 查询项目评价信息 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/9/18 3:28 下午 + */ + List selectProjectEvaluate(@Param("customerId") String customerId,@Param("monthId") String monthId); + + /** + * @Description 网格项目自治率查询 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/9/18 5:25 下午 + */ + List selectProjectAutoNoMy(@Param("customerId") String customerId,@Param("monthId") String monthId); + + /** + * 根据日期删除数据 + * @author zhaoqifeng + * @date 2020/9/18 17:32 + * @param customerId + * @param date + * @return void + */ + void deleteByDate(@Param("customerId") String customerId, @Param("date") String date); + + /** + * 办结项目满意度 + * @author zhaoqifeng + * @date 2020/9/20 16:44 + * @param customerId + * @param monthId + * @param level + * @return java.util.List + */ + List selectSatisfaction(@Param("customerId") String customerId, @Param("monthId") String monthId, + @Param("level")String level); + + /** + * 区直部门被吹哨次数 + * @author zhaoqifeng + * @date 2020/9/18 14:46 + * @param customerId + * @param monthId + * @param level + * @return java.util.List + */ + List selectDepTransferCount(@Param("customerId") String customerId, @Param("monthId") String monthId, + @Param("level")String level); + + /** + * @Description 查询各项目经受了多少机关 + * @param customerId + * @return + * @author wangc + * @date 2020.09.20 23:46 + **/ + List selectProjectParticipatedAgency(@Param("customerId") String customerId, @Param("dimId") String dimId, + @Param("dateType")String dateType); +} 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 1fc4f9b9a9..53301ae998 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 @@ -19,11 +19,14 @@ package com.epmet.dao.evaluationindex.extract; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.extract.FactOriginProjectMainDailyDTO; +import com.epmet.dto.extract.result.OrgStatisticsResultDTO; +import com.epmet.dto.extract.result.GridProjectClosedTotalResultDTO; import com.epmet.entity.evaluationindex.extract.FactOriginProjectMainDailyEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import java.util.List; +import java.util.Map; /** * 项目主表_日统计 @@ -51,4 +54,56 @@ public interface FactOriginProjectMainDailyDao extends BaseDao */ List getPendingList(@Param("customerId") String customerId); + + /** + * 项目超期数 + * @author zhaoqifeng + * @date 2020/9/18 16:28 + * @param customerId + * @param monthId + * @return java.util.List + */ + List selectOverdueCount(@Param("customerId") String customerId, @Param("monthId") String monthId); + + /** + * @Description 网格办结项目数 + * @param customerId + * @param monthId + * @param status + * @author zxc + * @date 2020/9/18 2:06 下午 + */ + List selectGridClosedProject(@Param("customerId") String customerId,@Param("monthId") String monthId,@Param("status") String status); + + /** + * 根据日期删除数据 + * @author zhaoqifeng + * @date 2020/9/18 17:32 + * @param customerId + * @param date + * @return void + */ + void deleteByDate(@Param("customerId") String customerId, @Param("date") String date); + void deleteByDate(@Param("date") String date); + + /** + * @return java.util.List> + * @param customerId + * @param monthId + * @author yinzuomei + * @description 党员提出的议题转项目数 + * @Date 2020/9/18 14:11 + **/ + List> selectShiftProjectCount(@Param("customerId") String customerId, @Param("monthId") String monthId); + + /** + * @return java.lang.Integer + * @param customerId + * @param monthId + * @param topicIdList + * @author yinzuomei + * @description 9、自建群活跃度——议题转项目率 用 + * @Date 2020/9/20 22:27 + **/ + Integer selectCountByPartyUser(@Param("customerId") String customerId, @Param("monthId")String monthId, @Param("list")List topicIdList); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectOrgPeriodDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectOrgPeriodDailyDao.java new file mode 100644 index 0000000000..72932604b2 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectOrgPeriodDailyDao.java @@ -0,0 +1,99 @@ +/** + * 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.extract; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.extract.result.OrgResponseTimeResultDTO; +import com.epmet.dto.extract.result.OrgStatisticsResultDTO; +import com.epmet.entity.evaluationindex.extract.FactOriginProjectOrgPeriodDailyEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.springframework.web.bind.annotation.PostMapping; + +import java.util.List; + +/** + * 业务数据抽取-机关项目响应时间 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-16 + */ +@Mapper +public interface FactOriginProjectOrgPeriodDailyDao extends BaseDao { + + /** + * @Description 查询是否存在数据,如果没有则视为第一次扫描该表,需要根据业务查询全部数据 + * @param + * @return + * @author wangc + * @date 2020.09.17 13:43 + **/ + int selectIfExisted(@Param("customerId") String customerId); + + /** + * @Description 在插入之前,先删除所有与这个项目相关的历时信息 + * @param list + * @return + * @author wangc + * @date 2020.09.17 14:43 + **/ + void deleteByProjectId(@Param("projectId") String projectId); + + /** + * 获取项目响应度 + * @author zhaoqifeng + * @date 2020/9/18 15:52 + * @param customerId + * @param monthId + * @param level + * @param orgType + * @return java.util.List + */ + List selectResponsiveness(@Param("customerId") String customerId, @Param("monthId") String monthId, + @Param("level")String level, + @Param("orgType")String orgType); + + void deleteByProjectId(@Param("list") List list); + + /** + * @Description 批量插入 + * @param list + * @return + * @author wangc + * @date 2020.09.18 17:11 + **/ + void insertBatch(@Param("list") List list); + + /** + * @Description 查找网格、部门对项目的响应系数 + * @param customerId + * @return + * @author wangc + * @date 2020.09.21 02:13 + **/ + List selectSubOrgResponseCoefficient(@Param("customerId") String customerId,@Param("dimId") String dimId, @Param("dateType") String dateType); + + /** + * @Description 查找机关对项目的响应系数 + * @param customerId + * @return + * @author wangc + * @date 2020.09.21 02:13 + **/ + List selectAgencyResponseCoefficient(@Param("customerId") String customerId,@Param("dimId") String dimId, @Param("dateType") String dateType); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginTopicLogDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginTopicLogDailyDao.java index ef66cc0c73..198625b577 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginTopicLogDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginTopicLogDailyDao.java @@ -18,11 +18,13 @@ package com.epmet.dao.evaluationindex.extract; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.extract.result.PartyActiveResultDTO; import com.epmet.entity.evaluationindex.extract.FactOriginTopicLogDailyEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import java.util.List; +import java.util.Map; /** * 话题明细_日统计 @@ -52,4 +54,54 @@ public interface FactOriginTopicLogDailyDao extends BaseDao list); + + /** + * @return java.util.List> + * @param customerId + * @param monthId + * @author yinzuomei + * @description 查询客户下,这个月内,每个党员评论话题的次数 + * @Date 2020/9/18 13:36 + **/ + List> selectJoinTopicCount(@Param("customerId") String customerId, @Param("monthId") String monthId); + + /** + * @return java.util.List> + * @param customerId + * @param monthId + * @author yinzuomei + * @description 党员自建群活跃度——话题数 + * @Date 2020/9/18 15:05 + **/ + List> selectGroupTopicCount(@Param("customerId") String customerId, @Param("monthId") String monthId); + + /** + * @return java.lang.Integer + * @param userId + * @param customerId + * @param monthId + * @author yinzuomei + * @description 查询当前用户在本月内评论的次数 + * @Date 2020/9/20 21:46 + **/ + Integer selectUserCommentCount(@Param("userId") String userId, @Param("customerId") String customerId, @Param("monthId") String monthId); + + /** + * @return java.util.List + * @param groupIdList + * @author yinzuomei + * @description 组内的所有话题id + * @Date 2020/9/20 22:18 + **/ + List selectTopicIds(@Param("list") List groupIdList); + + /** + * @Description 查询 话题评论【党员/群众】 + * @param customerId + * @param monthId + * @param isParty + * @author zxc + * @date 2020/9/21 9:37 上午 + */ + List selectPartyActiveTopic(@Param("customerId")String customerId,@Param("monthId") String monthId,@Param("isParty") Integer isParty); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginTopicMainDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginTopicMainDailyDao.java index 26738dc2b3..8da1ea3774 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginTopicMainDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginTopicMainDailyDao.java @@ -18,11 +18,13 @@ package com.epmet.dao.evaluationindex.extract; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.extract.result.CreateTopicCountResultDTO; import com.epmet.entity.evaluationindex.extract.FactOriginTopicMainDailyEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import java.util.List; +import java.util.Map; /** * 话题主表_日统计 @@ -54,4 +56,23 @@ public interface FactOriginTopicMainDailyDao extends BaseDao list); + + /** + * @param customerId + * @param monthId + * @author yinzuomei + * @description 党员提出话题数:返回每个党员这个月内,提出的话题数 + * @Date 2020/9/18 11:05 + **/ + List> selectPartyCreateTopicCount(@Param("customerId") String customerId, @Param("monthId") String monthId); + + /** + * @Description 查询网格 党员/群众 人均提出话题数 + * @param customerId + * @param monthId + * @param isParty + * @author zxc + * @date 2020/9/19 1:58 下午 + */ + List selectCreateTopicCount(@Param("customerId") String customerId, @Param("monthId") String monthId,@Param("isParty")Integer isParty); } \ No newline at end of file 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 5e0c308c5f..1d8b7eb7ba 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 @@ -18,6 +18,8 @@ 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; @@ -101,4 +103,36 @@ public interface FactIndexGovrnAblityGridMonthlyDao extends BaseDao selectAllGridInfo(String customerId); + /** + * @Description 查询全部网格信息 + * @param customerId + * @author zxc + * @date 2020/9/19 10:50 上午 + */ + List selectAllGridInfoToParty(String customerId); + + /** + * @Description 批量插入治理能力 + * @param lists + * @author zxc + * @date 2020/9/19 4:28 下午 + */ + void insertGovernAbilityRecord(@Param("lists") List lists); + + /** + * @Description 删除治理能力旧纪录 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/9/19 4:31 下午 + */ + void deleteOldGovernAbilityRecord(@Param("customerId")String customerId,@Param("monthId")String monthId); } 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 ef770f48b5..c3c85c1ffd 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 @@ -66,4 +66,15 @@ public interface FactIndexGovrnAblityOrgMonthlyDao extends BaseDao> selectCommunityGovernAbility(@Param("customerId")String customerId, @Param("monthId")String monthId,@Param("level")String level); + + /** + * 根据组织类型删除数据 + * @author zhaoqifeng + * @date 2020/9/20 20:52 + * @param customerId + * @param monthId + * @param type + * @return java.lang.Integer + */ + Integer deleteByCustomer(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("type") String type); } 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 824b7a04a1..619b621d7a 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 @@ -62,4 +62,13 @@ public interface FactIndexPartyAblityCpcMonthlyDao extends BaseDao> getCountByMonthId(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("offset") Integer offset, @Param("pageSize") Integer pageSize); Map getExtremeValue(@Param("customerId") String customerId, @Param("monthId") String monthId); + + /** + * @return int + * @param list + * @author yinzuomei + * @description 批量插入 入参为entity + * @Date 2020/9/18 10:30 + **/ + int insertBatchEntity(@Param("list") List list); } 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 6e2dbcaee5..387e01ec6f 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 @@ -18,6 +18,7 @@ package com.epmet.dao.evaluationindex.indexcoll; import com.epmet.commons.mybatis.dao.BaseDao; +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.GridPartyAbilityFormDTO; @@ -97,4 +98,21 @@ public interface FactIndexPartyAblityGridMonthlyDao extends BaseDao lists); + + /** + * @Description 删除旧的党建能力记录 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/9/19 10:45 上午 + */ + void deleteOldPartyAbility(@Param("customerId")String customerId,@Param("monthId")String monthId); } 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 220e9a91f1..f9ab1ba754 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 @@ -77,4 +77,15 @@ public interface FactIndexPartyAblityOrgMonthlyDao extends BaseDao> selectPublishArticleCountMap(@Param("customerId")String customerId, @Param("monthId")String monthId,@Param("level")String level); + + /** + * 根据组织类型删除数据 + * @author zhaoqifeng + * @date 2020/9/20 20:52 + * @param customerId + * @param monthId + * @param type + * @return java.lang.Integer + */ + Integer deleteByCustomer(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("type") String type); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/group/GroupDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/group/GroupDataDao.java index db1bc08318..32059b58b3 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/group/GroupDataDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/group/GroupDataDao.java @@ -1,5 +1,6 @@ package com.epmet.dao.group; +import com.epmet.dto.extract.FactOriginGroupMainDailyDTO; import com.epmet.dto.group.form.GridGroupPeopleFormDTO; import com.epmet.dto.group.form.GridGroupPeopleTotalFormDTO; import com.epmet.dto.group.form.GridGroupTotalFormDTO; @@ -80,4 +81,13 @@ public interface GroupDataDao { * @author zxc */ List getAgencyGrid(@Param("gridIds")List gridIds); + + /** + * @Description 抽取小组数据 + * @param customerId + * @return + * @author wangc + * @date 2020.09.18 22:45 + **/ + List groupExtracting(@Param("customerId")String customerId,@Param("dateId") String dateId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectProcessDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectProcessDao.java index 8f0027e473..72beea8ca3 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectProcessDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectProcessDao.java @@ -18,7 +18,10 @@ package com.epmet.dao.project; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.project.FinishOrgDTO; import com.epmet.dto.project.ProcessInfoDTO; +import com.epmet.dto.project.result.ProjectOrgPeriodResultDTO; +import com.epmet.dto.project.result.ProjectOrgRelationWhenResponseResultDTO; import com.epmet.entity.project.ProjectEntity; import com.epmet.entity.project.ProjectProcessEntity; import org.apache.ibatis.annotations.Mapper; @@ -81,4 +84,33 @@ public interface ProjectProcessDao extends BaseDao { * @return java.util.List */ List selectClosedProjectList(@Param("customerId") String customerId, @Param("date") String date); + /** + * @Description 查询项目-机关各个节点历时详情 + * @param customerId + * @param projectStatus 项目状态 pending closed 如果是null则全查 + * @param dateId + * @return + * @author wangc + * @date 2020.09.17 09:43 + **/ + List selectProjectOrgPeriod(@Param("customerId") String customerId,@Param("projectStatus")String projectStatus,@Param("dateId") String dateId); + + /** + * @Description 查询项目-机关各个节点的响应列表 + * @param projects + * @return + * @author wangc + * @date 2020.09.17 17:56 + **/ + List selectResponseTrace(@Param("projects") List projects); + + /** + * 获取办结组织 + * @author zhaoqifeng + * @date 2020/9/18 18:01 + * @param customerId + * @param date + * @return java.util.List + */ + List selectFinishOrg(@Param("customerId") String customerId, @Param("date") String date); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimAgencyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimAgencyDao.java index 7e20babbeb..487bc79f97 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimAgencyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimAgencyDao.java @@ -135,4 +135,14 @@ public interface DimAgencyDao extends BaseDao { * @date 2020/9/15 6:15 下午 */ List selectAgencyInfo(@Param("agencyIds")List agencyIds); + + /** + * 根据级别获取组织信息 + * @author zhaoqifeng + * @date 2020/9/20 17:31 + * @param customerId + * @param level + * @return java.util.List + */ + List selectDimAgencyByLevel(@Param("customerId")String customerId, @Param("level")String level); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimCustomerPartymemberDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimCustomerPartymemberDao.java index afab95849a..eee170f6f7 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimCustomerPartymemberDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimCustomerPartymemberDao.java @@ -19,6 +19,7 @@ package com.epmet.dao.stats; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.stats.form.DimCustomerPartyMemberFormDTO; +import com.epmet.entity.evaluationindex.indexcoll.FactIndexPartyAblityCpcMonthlyEntity; import com.epmet.entity.stats.DimCustomerPartymemberEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -50,4 +51,13 @@ public interface DimCustomerPartymemberDao extends BaseDao + * @param customerId 客户id + * @author yinzuomei + * @description 查询客户下所有的党员, 构造好党员相关-党建能力初始值 + * @Date 2020/9/18 9:00 + **/ + List selectPartyMemberList(String customerId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimGridDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimGridDao.java index dd2338bb69..310dbc6ee5 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimGridDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimGridDao.java @@ -21,6 +21,7 @@ import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.group.AgencyDTO; import com.epmet.dto.group.result.AgencyGridInfoResultDTO; import com.epmet.dto.group.result.SubAgencyIdResultDTO; +import com.epmet.dto.stats.result.GridAttributesResultDTO; import com.epmet.dto.stats.result.GridBelongAgencyResultDTO; import com.epmet.entity.stats.DimGridEntity; import org.apache.ibatis.annotations.Mapper; @@ -69,4 +70,13 @@ public interface DimGridDao extends BaseDao { * @date 2020/9/17 2:34 下午 */ List selectGridBelongAgencyInfo(@Param("gridIds") List gridIds); + + /** + * @Description 查询网格的所有所属上级属性 + * @param gridIds + * @return + * @author wangc + * @date 2020.09.20 13:01 + **/ + List selectGridAttributes(@Param("customerId") String customerId,@Param("gridIds") List gridIds); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactArticlePublishedAgencyDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactArticlePublishedAgencyDailyDao.java index 5a7e9dbfc7..3e20141c80 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactArticlePublishedAgencyDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactArticlePublishedAgencyDailyDao.java @@ -18,10 +18,13 @@ package com.epmet.dao.stats; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.stats.FactArticlePublishedAgencyDailyDTO; import com.epmet.entity.stats.FactArticlePublishedAgencyDailyEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; +import java.util.List; + /** * 文章发布数量【机关】日统计表 * @@ -38,4 +41,16 @@ public interface FactArticlePublishedAgencyDailyDao extends BaseDao + */ + List selectArticleCount(@Param("customerId")String customerId, @Param("monthId")String monthId, + @Param("level")String level); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactArticlePublishedGridDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactArticlePublishedGridDailyDao.java index 24b8ca6115..ddd8ebd63f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactArticlePublishedGridDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactArticlePublishedGridDailyDao.java @@ -18,6 +18,7 @@ package com.epmet.dao.stats; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.extract.result.PublishCountResultDTO; import com.epmet.entity.stats.FactArticlePublishedAgencyDailyEntity; import com.epmet.entity.stats.FactArticlePublishedGridDailyEntity; import org.apache.ibatis.annotations.Mapper; @@ -51,4 +52,13 @@ public interface FactArticlePublishedGridDailyDao extends BaseDao selectArticlePublishCount(@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/stats/user/FactRegUserGridMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactRegUserGridMonthlyDao.java index 940609d9bc..479ecf5902 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactRegUserGridMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactRegUserGridMonthlyDao.java @@ -18,6 +18,7 @@ package com.epmet.dao.stats.user; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.extract.result.GridUserCountResultDTO; import com.epmet.dto.stats.user.FactRegUserGridMonthlyDTO; import com.epmet.entity.stats.user.FactRegUserGridMonthlyEntity; import org.apache.ibatis.annotations.Mapper; @@ -38,4 +39,13 @@ public interface FactRegUserGridMonthlyDao extends BaseDao selectGridUserCount(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/dao/user/UserDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/user/UserDao.java index 9e50c2d7d4..22372cbed4 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/user/UserDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/user/UserDao.java @@ -1,5 +1,6 @@ package com.epmet.dao.user; +import com.epmet.dto.extract.form.GridHeartedFormDTO; import com.epmet.dto.extract.result.UserPartyResultDTO; import com.epmet.dto.user.result.CommonTotalAndIncCountResultDTO; import org.apache.ibatis.annotations.Mapper; @@ -105,5 +106,9 @@ public interface UserDao { * @author zxc * @date 2020/9/15 4:23 下午 */ - List selectUserIsParty(@Param("userIds") List userIds);; + List selectUserIsParty(@Param("userIds") List userIds); + + List selectPartymembersByCustomerId(@Param("customerId")String customerId); + + List selectWarmHeartedByCustomerId(@Param("customerId")String customerId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginGroupMainDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginGroupMainDailyEntity.java new file mode 100644 index 0000000000..8bb0ba12a1 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginGroupMainDailyEntity.java @@ -0,0 +1,119 @@ +/** + * 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.extract; + +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 2020-09-16 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_origin_group_main_daily") +public class FactOriginGroupMainDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + private String customerId; + + /** + * 状态:(审核通过 - approved 、 审核中 - under_auditting、 审核未通过 - rejected 、 已屏蔽 - hidden、 已关闭 - closed) +Ps: 如果一个小组被拒绝,当前小组的状态将永久停留在“审核未通过” + */ + private String groupState; + + /** + * 小组所在网格Id + */ + private String gridId; + + /** + * 小组所在机关Id + */ + private String agencyId; + + /** + * 小组所在组织的父机关Id + */ + private String parentId; + + /** + * 小组所在组织所有父类Id集合 + */ + private String pids; + + /** + * 建群申请审核通过的时期 + */ + private String dateId; + + /** + * 建群申请审核通过的周期 + */ + private String weekId; + + /** + * 建群申请审核通过的月份 + */ + private String monthId; + + /** + * 建群申请审核通过的季度 + */ + private String quarterId; + + /** + * 建群申请审核通过的年 + */ + private String yearId; + + /** + * 群众人数 + */ + private Integer resiMemberCount; + + /** + * 组内总人数 + */ + private Integer memberTotal; + + /** + * 群主ID + */ + private String groupOwnerId; + + /** + * 建组时群主是否热心居民,不更新 + */ + private Integer isOwnerHearted; + + /** + * 建组时群主是否党员,不更新 + */ + private Integer isOwnerParty; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginProjectOrgPeriodDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginProjectOrgPeriodDailyEntity.java new file mode 100644 index 0000000000..b5f0d2d53b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginProjectOrgPeriodDailyEntity.java @@ -0,0 +1,98 @@ +/** + * 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.extract; + +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 2020-09-16 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_origin_project_org_period_daily") +public class FactOriginProjectOrgPeriodDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + private String customerId; + + /** + * 项目ID + */ + private String projectId; + + /** + * + */ + private String orgId; + + /** + * grid agenct dept + */ + private String orgType; + + /** + * 如果是机关,则为父级机关(若已是顶级机关则为0);如果是网格和部门,则为所属机关 + */ + private String pid; + + /** + * 最后一个节点是PID,若无则为空 + */ + private String pids; + + /** + * 流转到的日期 + */ + private Date informedDate; + + /** + * 流转走或结案的日期 + */ + private Date handledDate; + + /** + * 响应时长,从流转到自己到流转走共耗时/小时(不算法定节假日和周末) + */ + private Integer totalPeriod; + + /** + * 截至第一次响应时长,从流转到第一次处理(响应、结案、流转)耗时,大于等于上一项值 + */ + private Date periodTillReplyFirstly; + + /** + * resloved 、 unresolved + */ + private String isResolved; + + /** + * 办结的操作,return(回退)、transfer(流转)、closed(结案),但是不包括response(响应)! + * */ + private String operation; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/CalCpcIndexService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/CalCpcIndexService.java new file mode 100644 index 0000000000..dbbfa63563 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/CalCpcIndexService.java @@ -0,0 +1,19 @@ +package com.epmet.service.evaluationindex.extract; + +/** + * 党员相关 + * + * @author yinzuomei@elink-cn.com + * @date 2020/9/17 14:05 + */ +public interface CalCpcIndexService { + /** + * @return void + * @param customerId 客户id + * @param monthId yyyyMM + * @author yinzuomei + * @description 党员相关-党建能力 + * @Date 2020/9/17 14:08 + **/ + void calCpcPartyAbility(String customerId, String monthId); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/CalGridIndexService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/CalGridIndexService.java new file mode 100644 index 0000000000..762b77e9fc --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/CalGridIndexService.java @@ -0,0 +1,36 @@ +package com.epmet.service.evaluationindex.extract; + +/** + * @Author zxc + * @DateTime 2020/9/18 9:52 上午 + */ +public interface CalGridIndexService { + + /** + * @Description 计算网格指标党建能力 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/9/18 9:56 上午 + */ + Boolean calGridIndexPartyAbility(String customerId,String monthId); + + /** + * @Description 计算网格指标治理能力 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/9/18 9:56 上午 + */ + Boolean calGridIndexGovernAbility(String customerId,String monthId); + + /** + * @Description 计算网格指标服务能力 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/9/18 9:56 上午 + */ + Boolean calGridIndexServiceAbility(String customerId,String monthId); + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/FactIndexGovernAbilityGridMonthlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/FactIndexGovernAbilityGridMonthlyService.java new file mode 100644 index 0000000000..a5d5e6bb9c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/FactIndexGovernAbilityGridMonthlyService.java @@ -0,0 +1,33 @@ +package com.epmet.service.evaluationindex.extract; + +import com.epmet.dto.extract.form.GovernAbilityGridMonthlyFormDTO; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 治理能力-网格相关事实表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-19 + */ +public interface FactIndexGovernAbilityGridMonthlyService{ + + /** + * @Description 批量插入治理能力 + * @param lists + * @author zxc + * @date 2020/9/19 4:28 下午 + */ + void insertGovernAbilityRecord(@Param("lists") List lists); + + /** + * @Description 删除治理能力旧纪录 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/9/19 4:31 下午 + */ + void deleteOldGovernAbilityRecord(@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/service/evaluationindex/extract/FactIndexPartyAbilityGridMonthlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/FactIndexPartyAbilityGridMonthlyService.java new file mode 100644 index 0000000000..198bcf57dc --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/FactIndexPartyAbilityGridMonthlyService.java @@ -0,0 +1,31 @@ +package com.epmet.service.evaluationindex.extract; + +import com.epmet.dto.extract.form.PartyAbilityGridMonthlyFormDTO; + +import java.util.List; + +/** + * 党建能力-网格相关事实表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-19 + */ +public interface FactIndexPartyAbilityGridMonthlyService{ + + /** + * @Description 网格党建能力插入 + * @param lists + * @author zxc + * @date 2020/9/19 10:32 上午 + */ + void insertPartyAbility(List lists); + + /** + * @Description 删除旧的党建能力记录 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/9/19 10:45 上午 + */ + void deleteOldPartyAbility(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/FactIndexServiceAbilityGridMonthlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/FactIndexServiceAbilityGridMonthlyService.java new file mode 100644 index 0000000000..793af948e6 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/FactIndexServiceAbilityGridMonthlyService.java @@ -0,0 +1,11 @@ +package com.epmet.service.evaluationindex.extract; + +/** + * 服务能力-网格相关事实表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-19 + */ +public interface FactIndexServiceAbilityGridMonthlyService{ + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/FactOriginExtractService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/FactOriginExtractService.java new file mode 100644 index 0000000000..886a7daf3c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/FactOriginExtractService.java @@ -0,0 +1,18 @@ +package com.epmet.service.evaluationindex.extract; + +import com.epmet.dto.extract.form.ExtractFormDTO; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/9/15 14:00 + */ +public interface FactOriginExtractService { + + /** + * desc:抽取所有业务数据到统计库 + * + * @param extractFormDTO + */ + void extractAll(ExtractFormDTO extractFormDTO); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/FactOriginProjectLogDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/FactOriginProjectLogDailyService.java index 8099ef503b..da91898aa6 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/FactOriginProjectLogDailyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/FactOriginProjectLogDailyService.java @@ -20,8 +20,13 @@ package com.epmet.service.evaluationindex.extract; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; import com.epmet.dto.extract.FactOriginProjectLogDailyDTO; +import com.epmet.dto.extract.result.OrgStatisticsResultDTO; +import com.epmet.dto.extract.result.AutoNoMyResultDTO; +import com.epmet.dto.extract.result.NotReturnProjectResultDTO; +import com.epmet.dto.extract.result.ProjectEvaluateResultDTO; import com.epmet.entity.evaluationindex.extract.FactOriginProjectLogDailyEntity; +import java.math.BigDecimal; import java.util.List; import java.util.Map; @@ -92,4 +97,93 @@ public interface FactOriginProjectLogDailyService extends BaseService + */ + List getAgencyTransferCount(String customerId, String monthId, String level); + + /** + * @Description 查询未被退回的项目数 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/9/18 2:50 下午 + */ + List selectNotReturnProject(String customerId,String monthId,String actionCode,String orgType); + + /** + * @Description 查询项目评价信息 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/9/18 3:28 下午 + */ + List selectProjectEvaluate(String customerId,String monthId); + + /** + * 根据日期删除数据 + * @author zhaoqifeng + * @date 2020/9/18 17:30 + * @param customerId + * @param date + * @return void + */ + void deleteByDate(String customerId, String date); + + /** + * @Description 网格项目自治率查询 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/9/18 5:25 下午 + */ + List selectProjectAutoNoMy(String customerId,String monthId); + + /** + * 办结项目满意度 + * @author zhaoqifeng + * @date 2020/9/20 16:43 + * @param customerId + * @param monthId + * @param level + * @return java.util.List + */ + List getSatisfaction(String customerId, String monthId, String level); + + /** + * 机关被吹哨次数 + * @author zhaoqifeng + * @date 2020/9/18 14:53 + * @param customerId + * @param monthId + * @param level + * @return java.util.List + */ + List getDepTransferCount(String customerId, String monthId, String level); + + /** + * @Description 查询各机关办结了多少项目 + * @param customerId + * @return + * @author wangc + * @date 2020.09.20 23:46 + **/ + Map getProjectHandledAgency(String customerId, String dimId,String dateType); + + /** + * @Description 计算机关响应度 + * @param customerId + * @return + * @author wangc + * @date 2020.09.21 02:16 + **/ + Map getAgencyResponseRatio(String customerId, String dimId,String dateType); + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/FactOriginProjectMainDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/FactOriginProjectMainDailyService.java index 749fdc4897..cf6307d212 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/FactOriginProjectMainDailyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/FactOriginProjectMainDailyService.java @@ -20,6 +20,8 @@ package com.epmet.service.evaluationindex.extract; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; import com.epmet.dto.extract.FactOriginProjectMainDailyDTO; +import com.epmet.dto.extract.result.GridProjectClosedTotalResultDTO; +import com.epmet.dto.extract.result.OrgStatisticsResultDTO; import com.epmet.entity.evaluationindex.extract.FactOriginProjectMainDailyEntity; import java.util.List; @@ -110,4 +112,55 @@ public interface FactOriginProjectMainDailyService extends BaseService */ List getPendingList(String customerId); + + /** + * @Description 网格办结项目数 + * @param customerId + * @param monthId + * @param status + * @author zxc + * @date 2020/9/18 2:06 下午 + */ + List selectGridClosedProject(String customerId,String monthId,String status); + + /** + * 项目超期数 + * @author zhaoqifeng + * @date 2020/9/18 16:29 + * @param customerId + * @param monthId + * @return java.util.List + */ + List getOverdueCount(String customerId, String monthId); + + /** + * 根据日期删除数据 + * @author zhaoqifeng + * @date 2020/9/18 17:30 + * @param customerId + * @param date + * @return void + */ + void deleteByDate(String customerId, String date); + + /** + * @return java.util.List> + * @param customerId + * @param monthId + * @author yinzuomei + * @description 党员提出的议题转项目数 + * @Date 2020/9/18 14:11 + **/ + List> selectShiftProjectCount(String customerId, String monthId); + + /** + * @return java.lang.Integer + * @param customerId + * @param monthId + * @param topicIdList + * @author yinzuomei + * @description 9、自建群活跃度——议题转项目率 用 + * @Date 2020/9/20 22:25 + **/ + Integer selectCountByPartyUser(String customerId, String monthId, List topicIdList); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/FactOriginTopicLogDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/FactOriginTopicLogDailyService.java index 76c118972b..3946572305 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/FactOriginTopicLogDailyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/FactOriginTopicLogDailyService.java @@ -19,6 +19,7 @@ package com.epmet.service.evaluationindex.extract; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.extract.result.PartyActiveResultDTO; import com.epmet.entity.evaluationindex.extract.FactOriginTopicLogDailyEntity; import java.util.List; @@ -32,4 +33,53 @@ import java.util.Map; */ public interface FactOriginTopicLogDailyService extends BaseService { + /** + * @return java.util.List> + * @param customerId + * @param monthId + * @author yinzuomei + * @description 查询客户下,这个月内,每个党员评论话题的次数 + * @Date 2020/9/18 13:35 + **/ + List> selectJoinTopicCount(String customerId, String monthId); + + /** + * @return java.util.List> + * @param customerId + * @param monthId + * @author yinzuomei + * @description 党员自建群活跃度——话题数 + * @Date 2020/9/18 14:33 + **/ + List> selectGroupTopicCount(String customerId, String monthId); + + /** + * @return int + * @param userId + * @param customerId + * @param monthId + * @author yinzuomei + * @description + * @Date 2020/9/20 21:43 + **/ + Integer selectUserCommentCount(String userId,String customerId, String monthId ); + + /** + * @return java.util.List + * @param groupIdList + * @author yinzuomei + * @description 组内的所有话题id + * @Date 2020/9/20 22:17 + **/ + List selectTopicIds(List groupIdList); + + /** + * @Description 查询 话题评论【党员/群众】 + * @param customerId + * @param monthId + * @param isParty + * @author zxc + * @date 2020/9/21 9:37 上午 + */ + List selectPartyActiveTopic(String customerId, String monthId,Integer isParty); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/FactOriginTopicMainDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/FactOriginTopicMainDailyService.java index cb68dadf3c..11440f0bd8 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/FactOriginTopicMainDailyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/FactOriginTopicMainDailyService.java @@ -18,10 +18,12 @@ package com.epmet.service.evaluationindex.extract; import com.epmet.commons.mybatis.service.BaseService; -import com.epmet.dto.topic.TopicOriginInfoDTO; +import com.epmet.dto.extract.form.ExtractFormDTO; +import com.epmet.dto.extract.result.CreateTopicCountResultDTO; import com.epmet.entity.evaluationindex.extract.FactOriginTopicMainDailyEntity; import java.util.List; +import java.util.Map; /** @@ -34,13 +36,29 @@ public interface FactOriginTopicMainDailyService extends BaseService> + * @param customerId + * @param monthId yyyyMM + * @author yinzuomei + * @description 党员提出话题数:返回每个党员这个月内,提出的话题数 + * @Date 2020/9/18 11:03 + **/ + List> selectPartyCreateTopicCount(String customerId, String monthId); + /** + * @Description 查询网格 党员/群众 人均提出话题数 + * @param customerId + * @param monthId + * @param isParty + * @author zxc + * @date 2020/9/19 1:58 下午 + */ + List selectCreateTopicCount(String customerId, String monthId,Integer isParty); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/GroupExtractService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/GroupExtractService.java new file mode 100644 index 0000000000..c43a4d01c7 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/GroupExtractService.java @@ -0,0 +1,34 @@ +package com.epmet.service.evaluationindex.extract; + +import com.epmet.dto.extract.result.PartyCreateGroupCountResultDTO; + +import java.util.List; + +import com.epmet.dto.extract.form.ExtractFormDTO; + +/** + * @Desc 业务数据抽取 - 组相关 + * @Author wangc + * @DateTime 2020/9/14 5:07 下午 + */ +public interface GroupExtractService { + + /** + * @Description 查询建群党员数 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/9/19 3:49 下午 + */ + List selectPartyCreateGroupCount(String customerId,String monthId); + + + /** + * @Description 业务抽取 - 小组祥光 + * @param param + * @return + * @author wangc + * @date 2020.09.18 21:07 + **/ + void extractGroupData(ExtractFormDTO param); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/IssueExtractService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/IssueExtractService.java index 4d05ba19d7..45f9c1ff0a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/IssueExtractService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/IssueExtractService.java @@ -1,6 +1,15 @@ package com.epmet.service.evaluationindex.extract; import com.epmet.dto.extract.form.ExtractFormDTO; +import com.epmet.dto.extract.form.GridIssueCountResultDTO; +import com.epmet.dto.extract.result.GridProjectCountResultDTO; +import com.epmet.dto.extract.result.PartyActiveResultDTO; +import com.epmet.dto.extract.result.ShiftProjectCountResultDTO; + +import java.util.List; + +import java.util.List; +import java.util.Map; /** * @Author zxc @@ -23,4 +32,73 @@ public interface IssueExtractService { * @date 2020/9/16 9:41 上午 */ Boolean issueExtractLog(ExtractFormDTO extractFormDTO); + + /** + * @Description 查询网格议题总数,网格人均议题数目 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/9/18 10:20 上午 + */ + List selectIssueTotal(String customerId, String monthId); + + /** + * @Description 网格总项目数 + * @param customerId + * @param monthId + * @param status + * @author zxc + * @date 2020/9/18 1:21 下午 + */ + List selectGridProjectCount(String customerId, String monthId,String status); + + /** + * @return java.util.List> + * @param customerId + * @param monthId + * @author yinzuomei + * @description 党员提出的话题转议题数 + * @Date 2020/9/18 13:57 + **/ + List> selectShiftIssueCount(String customerId, String monthId); + + /** + * @Description 查询网格 党员/群众 人均提出的议题转项目数 + * @param customerId + * @param monthId + * @param isParty + * @author zxc + * @date 2020/9/19 2:26 下午 + */ + List selectShiftProjectCountPlus(String customerId, String monthId,Integer isParty); + + /** + * @return java.lang.Integer + * @param userId 用户id + * @param customerId + * @param monthId + * @author yinzuomei + * @description 查询用户在这个月内表决的总次数 + * @Date 2020/9/20 21:50 + **/ + Integer selectCountUserVote(String userId, String customerId, String monthId); + + /** + * @return java.lang.Integer + * @param topicIdList + * @author yinzuomei + * @description + * @Date 2020/9/20 22:50 + **/ + Integer selectIssueTotalTwoMonth(List topicIdList); + + /** + * @Description 查询 议题表决【党员/群众】 + * @param customerId + * @param monthId + * @param isParty + * @author zxc + * @date 2020/9/21 9:37 上午 + */ + List selectPartyActiveIssueVote(String customerId, String monthId, Integer isParty); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/ProjectExtractService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/ProjectExtractService.java index 88efc32884..31d56460c9 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/ProjectExtractService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/ProjectExtractService.java @@ -1,5 +1,8 @@ package com.epmet.service.evaluationindex.extract; + +import com.epmet.dto.extract.form.ExtractFormDTO; + import java.util.Date; /** @@ -10,13 +13,22 @@ import java.util.Date; public interface ProjectExtractService { + /** + * 项目主表、明细日统计 + * + * @param extractFormDTO + * @return + * @author zhaoqifeng + * @date 2020/9/15 14:38 + */ + void saveOriginProjectDaily(ExtractFormDTO extractFormDTO); + /** - * 项目主表、明细日统计 - * @author zhaoqifeng - * @date 2020/9/15 14:38 - * @param customerId - * @param date + * @Description 抽取项目节点历时逻辑 + * @param param * @return - */ - void saveOriginProjectDaily(String customerId, Date date); + * @author wangc + * @date 2020.09.17 14:05 + **/ + void extractProjectPeriodData(ExtractFormDTO param); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/ProjectPeriodExtractService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/ProjectPeriodExtractService.java new file mode 100644 index 0000000000..30c06fdd24 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/ProjectPeriodExtractService.java @@ -0,0 +1,21 @@ +package com.epmet.service.evaluationindex.extract; + +import com.epmet.dto.extract.form.ExtractFormDTO; + +/** + * @Desc 业务数据抽取 - 项目节点历时 + * @Author wangc + * @DateTime 2020/9/14 5:07 下午 + */ +public interface ProjectPeriodExtractService { + + /** + * @Description 抽取项目节点历时逻辑 + * @param param + * @return + * @author wangc + * @date 2020.09.17 14:05 + **/ + void extractProjectPeriodData(ExtractFormDTO param); + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/IndexOriginExtractService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/IndexOriginExtractService.java new file mode 100644 index 0000000000..773e902e00 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/IndexOriginExtractService.java @@ -0,0 +1,18 @@ +package com.epmet.service.evaluationindex.extract.dataToIndex; + +import com.epmet.dto.extract.form.ExtractIndexFormDTO; + +/** + * desc:将统计库对象数据抽取到指标库 服务接口 + * + * @author yinzuomei@elink-cn.com + * @date 2020/9/17 14:05 + */ +public interface IndexOriginExtractService { + /** + * desc:从统计库对象抽取指标数据 + * + * @param formDTO + */ + void indexOriginExtractAll(ExtractIndexFormDTO formDTO); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexOriginExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexOriginExtractServiceImpl.java new file mode 100644 index 0000000000..febf3fc41e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexOriginExtractServiceImpl.java @@ -0,0 +1,105 @@ +package com.epmet.service.evaluationindex.extract.dataToIndex.impl; + +import com.alibaba.fastjson.JSON; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.dto.extract.form.ExtractIndexFormDTO; +import com.epmet.service.evaluationindex.extract.CalCpcIndexService; +import com.epmet.service.evaluationindex.extract.CalGridIndexService; +import com.epmet.service.evaluationindex.extract.dataToIndex.IndexOriginExtractService; +import com.epmet.service.stats.DimCustomerService; +import com.epmet.util.DimIdGenerator; +import com.google.common.util.concurrent.ThreadFactoryBuilder; +import lombok.extern.slf4j.Slf4j; +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.Date; +import java.util.List; +import java.util.concurrent.*; + +/** + * desc:指标原始数据抽取服务实现类 + */ +@Slf4j +@Service +public class IndexOriginExtractServiceImpl implements IndexOriginExtractService { + ThreadFactory namedThreadFactory = new ThreadFactoryBuilder() + .setNameFormat("indexOriginExtract-pool-%d").build(); + ExecutorService threadPool = new ThreadPoolExecutor(2, 8, + 10L, TimeUnit.MINUTES, + new LinkedBlockingQueue<>(500), namedThreadFactory, new ThreadPoolExecutor.CallerRunsPolicy()); + + @Autowired + private CalCpcIndexService calCpcIndexService; + @Autowired + private CalGridIndexService calGridIndexService; + @Autowired + private DimCustomerService dimCustomerService; + + /** + * desc:从统计库对象抽取指标数据 + * + * @param formDTO + */ + @Override + public void indexOriginExtractAll(ExtractIndexFormDTO formDTO) { + String monthId = formDTO.getMonthId(); + String customerId = formDTO.getCustomerId(); + if (StringUtils.isBlank(monthId)) { + monthId = DimIdGenerator.getDateDimId(DateUtils.addDateMonths(new Date(), -1)); + } + List customerIds = new ArrayList<>(); + if (StringUtils.isNotBlank(customerId)) { + customerIds.add(customerId); + } + int pageNo = NumConstant.ONE; + int pageSize = NumConstant.ONE_HUNDRED; + customerIds = dimCustomerService.selectCustomerIdPage(pageNo, pageSize); + if (CollectionUtils.isEmpty(customerIds)) { + log.error("indexOriginExtractAll 获取客户Id为空"); + return; + } + + String finalMonthId = monthId; + customerIds.forEach(cId -> { + ExtractIndexFormDTO param = new ExtractIndexFormDTO(); + param.setCustomerId(cId); + param.setMonthId(finalMonthId); + submitJob(param); + }); + } + + + private void submitJob(ExtractIndexFormDTO param) { + final String customerId = param.getCustomerId(); + final String monthId = param.getMonthId(); + threadPool.submit(() -> { + try { + calCpcIndexService.calCpcPartyAbility(customerId, monthId); + } catch (Exception e) { + log.error("抽取【党员相关数据】发生异常,参数:" + JSON.toJSONString(param), e); + } + }); + threadPool.submit(() -> { + try { + calGridIndexService.calGridIndexGovernAbility(customerId, monthId); + } catch (Exception e) { + log.error("抽取【网格治理能力数据】发生异常,参数:" + JSON.toJSONString(param), e); + } + try { + calGridIndexService.calGridIndexPartyAbility(customerId, monthId); + } catch (Exception e) { + log.error("抽取【网格党建能力数据】发生异常,参数:" + JSON.toJSONString(param), e); + } + try { + calGridIndexService.calGridIndexServiceAbility(customerId, monthId); + } catch (Exception e) { + log.error("抽取【网格服务能力数据】发生异常,参数:" + JSON.toJSONString(param), e); + } + }); + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/CalCpcIndexServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/CalCpcIndexServiceImpl.java new file mode 100644 index 0000000000..4c930bec8a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/CalCpcIndexServiceImpl.java @@ -0,0 +1,435 @@ +package com.epmet.service.evaluationindex.extract.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.constant.IndexCalConstant; +import com.epmet.dao.evaluationindex.extract.FactOriginGroupMainDailyDao; +import com.epmet.dao.evaluationindex.indexcoll.FactIndexPartyAblityCpcMonthlyDao; +import com.epmet.entity.evaluationindex.indexcoll.FactIndexPartyAblityCpcMonthlyEntity; +import com.epmet.service.evaluationindex.extract.*; +import com.epmet.service.stats.DimCustomerPartymemberService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.collections4.ListUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.math.BigDecimal; +import java.text.NumberFormat; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * 党员相关 + * + * @author yinzuomei@elink-cn.com + * @date 2020/9/17 14:06 + */ +@Slf4j +@Service +public class CalCpcIndexServiceImpl implements CalCpcIndexService { + @Autowired + private DimCustomerPartymemberService dimCustomerPartymemberService; + @Autowired + private FactIndexPartyAblityCpcMonthlyDao factIndexPartyAblityCpcMonthlyDao; + @Autowired + private FactOriginTopicMainDailyService factOriginTopicMainDailyService; + @Autowired + private FactOriginTopicLogDailyService factOriginTopicLogDailyService; + @Autowired + private IssueExtractService issueExtractService; + @Autowired + private FactOriginProjectMainDailyService factOriginProjectMainDailyService; + @Autowired + private FactOriginGroupMainDailyDao factOriginGroupMainDailyDao; + + /** + * @param customerId 客户id + * @param monthId yyyyMM + * @return void + * @author yinzuomei + * @description 党员相关-党建能力 + * @Date 2020/9/17 14:08 + **/ + @Override + public void calCpcPartyAbility(String customerId, String monthId) { + //1、构造初始值 + List indexPartyAblityCpcList = dimCustomerPartymemberService.selectPartyMemberList(customerId); + if (CollectionUtils.isEmpty(indexPartyAblityCpcList)) { + log.info("dim_customer_partymember do not any records"); + return; + } + String quarterId= DateUtils.getQuarterId(monthId); + String yearId=DateUtils.getYearId(monthId); + //2、删除之前统计过的 + deleteFactIndexPartyAblityCpcMonthly(customerId, monthId); + + + //1、党员提出话题数 + Map createTopicCountMap = calCreateTopicCount(customerId, monthId); + //2、党员参与话题数(支持、反对、评论、浏览)---目前只统计 党员评论话题次数之和 + Map joinTopicCountMap = calJoinTopicCount(customerId, monthId); + //3、党员提出的话题转议题数 + Map shiftIssueCountMap = calShiftIssueCount(customerId, monthId); + //4、党员提出的议题转项目数 + Map shiftProjectCountMap = calShiftProjectCount(customerId, monthId); + //5、参加“三会一课”次数 默认0 + + //可以先查询出每个党员的 自建群 + Map> userCreatedGroups = queryUserCreatedGroups(customerId, indexPartyAblityCpcList); + //6、党员自建群群众人数 (todo 和monthId无关??) + Map groupUserCountMap = calgroupUserCount(customerId, monthId, indexPartyAblityCpcList, userCreatedGroups); + //7、党员自建群活跃群众人数 + Map groupActiveUserCountMap = calGroupActiveUserCount(customerId, monthId, indexPartyAblityCpcList, userCreatedGroups); + //8、党员自建群活跃度——话题数 (todo 校验sql正确性) + Map groupTopicCountMap = calGroupTopicCount(customerId, monthId); + //9、自建群活跃度——议题转项目率 + Map topicToIssueRatioMap = caltopicToIssueRatio(customerId, monthId, indexPartyAblityCpcList, userCreatedGroups); + + //3、计算实际值,更新 + for (FactIndexPartyAblityCpcMonthlyEntity indexPartyAblityCpcEntity : indexPartyAblityCpcList) { + indexPartyAblityCpcEntity.setMonthId(monthId); + indexPartyAblityCpcEntity.setQuarterId(quarterId); + indexPartyAblityCpcEntity.setYearId(yearId); + //1、党员提出话题数 + if (createTopicCountMap.containsKey(indexPartyAblityCpcEntity.getUserId())) { + indexPartyAblityCpcEntity.setCreateTopicCount(createTopicCountMap.get(indexPartyAblityCpcEntity.getUserId())); + } + //2、党员参与话题数(支持、反对、评论、浏览)---目前只统计 党员评论话题次数之和 + if (joinTopicCountMap.containsKey(indexPartyAblityCpcEntity.getUserId())) { + indexPartyAblityCpcEntity.setJoinTopicCount(joinTopicCountMap.get(indexPartyAblityCpcEntity.getUserId())); + } + //3、党员提出的话题转议题数 + if (shiftIssueCountMap.containsKey(indexPartyAblityCpcEntity.getUserId())) { + indexPartyAblityCpcEntity.setShiftIssueCount(shiftIssueCountMap.get(indexPartyAblityCpcEntity.getUserId())); + } + //4、党员提出的议题转项目数 + if (shiftProjectCountMap.containsKey(indexPartyAblityCpcEntity.getUserId())) { + indexPartyAblityCpcEntity.setShiftProjectCount(shiftProjectCountMap.get(indexPartyAblityCpcEntity.getUserId())); + } + //5、参加“三会一课”次数 目前没有此业务,默认0 + //6、党员自建群群众人数 + if (groupUserCountMap.containsKey(indexPartyAblityCpcEntity.getUserId())) { + indexPartyAblityCpcEntity.setGroupUserCount(groupUserCountMap.get(indexPartyAblityCpcEntity.getUserId())); + } + //7、党员自建群活跃群众人数 + if (groupActiveUserCountMap.containsKey(indexPartyAblityCpcEntity.getUserId())) { + indexPartyAblityCpcEntity.setGroupActiveUserCount(groupActiveUserCountMap.get(indexPartyAblityCpcEntity.getUserId())); + } + //8、党员自建群活跃度——话题数 + if (groupTopicCountMap.containsKey(indexPartyAblityCpcEntity.getUserId())) { + indexPartyAblityCpcEntity.setGroupTopicCount(groupTopicCountMap.get(indexPartyAblityCpcEntity.getUserId())); + } + //9、自建群活跃度——议题转项目率 + if (topicToIssueRatioMap.containsKey(indexPartyAblityCpcEntity.getUserId())) { + indexPartyAblityCpcEntity.setTopicToIssueRatio(topicToIssueRatioMap.get(indexPartyAblityCpcEntity.getUserId())); + } + } + //4、分批插入批量插入 + List> partition = ListUtils.partition(indexPartyAblityCpcList, IndexCalConstant.INSERT_SIZE); + partition.forEach(list -> { + this.FactIndexPartyAblityCpcMonthlyEntity(list); + }); + + } + + + /** + * @param customerId + * @param partyMemberList + * @return java.util.Map> + * @author yinzuomei + * @description 查询每个党员的自建群 + * @Date 2020/9/20 22:07 + **/ + private Map> queryUserCreatedGroups(String customerId, List partyMemberList) { + Map> map = new HashMap<>(); + for (FactIndexPartyAblityCpcMonthlyEntity partyMember : partyMemberList) { + //查询当前党员建了多少个组 + List groupIdList = factOriginGroupMainDailyDao.selectGroupIds(customerId, partyMember.getUserId()); + if (CollectionUtils.isEmpty(groupIdList)) { + map.put(partyMember.getUserId(), new ArrayList<>()); + continue; + } else { + map.put(partyMember.getUserId(), groupIdList); + } + } + return map; + } + + /** + * @param customerId + * @param monthId + * @return java.lang.Integer + * @author yinzuomei + * @description 1、查询出客户下所有党员对应的-党员提出话题数 + * @Date 2020/9/18 10:59 + **/ + private Map calCreateTopicCount(String customerId, String monthId) { + List> mapList = factOriginTopicMainDailyService.selectPartyCreateTopicCount(customerId, monthId); + Map resultMap = new HashMap<>(); + for (Map map : mapList) { + for (Map.Entry m : map.entrySet()) { + resultMap.put(m.getKey(), m.getValue()); + } + } + return resultMap; + } + + /** + * @param customerId + * @param monthId + * @return java.util.Map + * @author yinzuomei + * @description 2、查询客户下,这个月内,每个党员评论话题的次数 + * @Date 2020/9/18 13:33 + **/ + private Map calJoinTopicCount(String customerId, String monthId) { + List> mapList = factOriginTopicLogDailyService.selectJoinTopicCount(customerId, monthId); + Map resultMap = new HashMap<>(); + for (Map map : mapList) { + for (Map.Entry m : map.entrySet()) { + resultMap.put(m.getKey(), m.getValue()); + } + } + return resultMap; + } + + + /** + * @param customerId + * @param monthId + * @return java.util.Map + * @author yinzuomei + * @description 3、党员提出的话题转议题数 + * @Date 2020/9/18 13:53 + **/ + private Map calShiftIssueCount(String customerId, String monthId) { + List> mapList = issueExtractService.selectShiftIssueCount(customerId, monthId); + Map resultMap = new HashMap<>(); + for (Map map : mapList) { + for (Map.Entry m : map.entrySet()) { + resultMap.put(m.getKey(), m.getValue()); + } + } + return resultMap; + } + + /** + * @param customerId + * @param monthId + * @return java.util.Map + * @author yinzuomei + * @description 4、党员提出的议题转项目数 + * @Date 2020/9/18 14:10 + **/ + private Map calShiftProjectCount(String customerId, String monthId) { + //查询fact_origin_project_main_daily 表 中议题的议题的状态为 shift_ + List> mapList = factOriginProjectMainDailyService.selectShiftProjectCount(customerId, monthId); + Map resultMap = new HashMap<>(); + for (Map map : mapList) { + for (Map.Entry m : map.entrySet()) { + resultMap.put(m.getKey(), m.getValue()); + } + } + return resultMap; + } + + /** + * @param customerId + * @param monthId + * @return java.util.Map + * @author yinzuomei + * @description 6、党员自建群群众人数 + * @Date 2020/9/18 15:38 + **/ + private Map calgroupUserCount(String customerId, String monthId, + List partyMemberList, + Map> userCreatedGroups) { + /*含义:评价周期内,党员自建群中群众成员数。 + 数据来源:用户社群关系表。 + 计算方法:对党员i的所有j个自建群,从用户社群关系表中统计属于每个自建群的群众用户总人数,并对j个群众用户总数进行不重复累加。 + 对评价结果的影响:正向。*/ + Map map = new HashMap<>(); + for (FactIndexPartyAblityCpcMonthlyEntity partyMember : partyMemberList) { + //查询当前党员建了多少个组 + List groupIdList = userCreatedGroups.get(partyMember.getUserId()); + if (CollectionUtils.isEmpty(groupIdList)) { + map.put(partyMember.getUserId(), NumConstant.ZERO); + continue; + } + //去重组里面的成员 + List memberIdList = factOriginGroupMainDailyDao.selectGroupMemberList(groupIdList); + if (CollectionUtils.isEmpty(memberIdList)) { + map.put(partyMember.getUserId(), NumConstant.ZERO); + continue; + } else { + map.put(partyMember.getUserId(), memberIdList.size()); + } + } + return map; + } + + /** + * @param customerId + * @param monthId + * @param partyMemberList + * @return java.util.Map + * @author yinzuomei + * @description 7、党员自建群活跃群众人数 + * @Date 2020/9/20 21:36 + **/ + private Map calGroupActiveUserCount(String customerId, String monthId, + List partyMemberList, + Map> userCreatedGroups) { + /*含义:评价周期内,党员自建群中活跃群众成员数。所谓活跃群成员,即评价周期内参与话题、事件评论、点赞、点踩总次数大于给定阈值的群众用户。 + 数据来源:话题用户阅读表、话题评论用户表态表、话题评论表、事件点赞点踩表、事件评论点赞点踩表、事件评论表、用户信息表。 + 计算方法: + a)判断群中的群众成员是否活跃 + for each 群众成员 i + 统计i的话题阅读次数、话题评论次数、话题评论表态次数、事件点赞点踩次数、事件评论点赞点踩次数、事件评论总次数。 + If 总次数>阈值 + 成员i为活跃群众成员 + b)不重复累加活跃群众成员数 + 对评价结果的影响:正向。*/ + //结合目前产品,数据来源:话题评论、议题表决 + Map map = new HashMap<>(); + for (FactIndexPartyAblityCpcMonthlyEntity partyMember : partyMemberList) { + int groupActiveUserCount = 0; + //1、查询当前党员建了多少个组 + List groupIdList = userCreatedGroups.get(partyMember.getUserId()); + if (CollectionUtils.isEmpty(groupIdList)) { + map.put(partyMember.getUserId(), NumConstant.ZERO); + continue; + } + //2、去重组里面的成员 + List memberIdList = factOriginGroupMainDailyDao.selectGroupMemberList(groupIdList); + if (CollectionUtils.isEmpty(memberIdList)) { + map.put(partyMember.getUserId(), NumConstant.ZERO); + continue; + } + //3、判断每个成员是否 “活跃” + for (String memberId : memberIdList) { + //1、判断成员在本月内是否评论过 + Integer topicCommentCount = factOriginTopicLogDailyService.selectUserCommentCount(memberId, customerId, monthId); + if (topicCommentCount > 0) { + groupActiveUserCount++; + continue; + } + //2、判断成员在本月内是否表决过(支持or反对)议题 + Integer voteCount = issueExtractService.selectCountUserVote(memberId, customerId, monthId); + if (voteCount > 0) { + groupActiveUserCount++; + } + } + //赋值每个党员的 -- 党员自建群活跃群众人数 + map.put(partyMember.getUserId(), groupActiveUserCount); + } + return map; + } + + + /** + * @param customerId + * @param monthId + * @return java.util.Map + * @author yinzuomei + * @description 8、党员自建群活跃度——话题数 + * @Date 2020/9/18 14:31 + **/ + private Map calGroupTopicCount(String customerId, String monthId) { + /*含义:评价周期内,党员自建群中话题发布数。 + 数据来源:话题表。 + 计算方法:从话题表中统计党员自建群i的话题总数;对所有自建群话题数累加。 + 对评价结果的影响:正向。*/ + List> mapList = factOriginTopicLogDailyService.selectGroupTopicCount(customerId, monthId); + Map resultMap = new HashMap<>(); + for (Map map : mapList) { + for (Map.Entry m : map.entrySet()) { + resultMap.put(m.getKey(), m.getValue()); + } + } + return resultMap; + } + + /** + * @param userCreatedGroups 党员自建群 + * @return java.util.Map + * @author yinzuomei + * @description 9、自建群活跃度——议题转项目率 + * @Date 2020/9/20 22:11 + **/ + private Map caltopicToIssueRatio(String customerId, + String monthId, + List partyMemberList, + Map> userCreatedGroups) { + Map map = new HashMap<>(); + for (FactIndexPartyAblityCpcMonthlyEntity partyMember : partyMemberList) { + //如果党员自建群为空,直接赋值0 + if (CollectionUtils.isEmpty(userCreatedGroups.get(partyMember.getUserId()))) { + map.put(partyMember.getUserId(), BigDecimal.ZERO); + continue; + } + //自建群出来的话题 + List groupIdList = userCreatedGroups.get(partyMember.getUserId()); + List topicIdList = factOriginTopicLogDailyService.selectTopicIds(groupIdList); + if (CollectionUtils.isEmpty(topicIdList)) { + map.put(partyMember.getUserId(), BigDecimal.ZERO); + continue; + } + //分子 + //本月内新增的项目(and 源于自建群中的话题) + Integer projectTotal = factOriginProjectMainDailyService.selectCountByPartyUser(customerId, monthId, topicIdList); + if (null == projectTotal || projectTotal == NumConstant.ZERO) { + map.put(partyMember.getUserId(), BigDecimal.ZERO); + continue; + } + //分母 + //本评价周期+上一个评价周期内自建群中的议题数 + Integer issueTotal = issueExtractService.selectIssueTotalTwoMonth(topicIdList); + if (null == issueTotal || issueTotal == NumConstant.ZERO) { + map.put(partyMember.getUserId(), BigDecimal.ZERO); + continue; + } + NumberFormat numberFormat = NumberFormat.getInstance(); + numberFormat.setMaximumFractionDigits(6); + String topicToIssueRatioStr = numberFormat.format((float) projectTotal / issueTotal); + BigDecimal topicToIssueRatio = new BigDecimal(topicToIssueRatioStr); + map.put(partyMember.getUserId(), topicToIssueRatio); + } + return map; + } + + /** + * @param customerId + * @param monthId + * @return void + * @author yinzuomei + * @description 删除这个客户这个月 党员相关-党建能力的数据 + * @Date 2020/9/18 10:20 + **/ + @DataSource(value = DataSourceConstant.EVALUATION_INDEX) + public void deleteFactIndexPartyAblityCpcMonthly(String customerId, String monthId) { + int deleteNum; + do { + deleteNum = factIndexPartyAblityCpcMonthlyDao.deleteFactIndexPartyAblityCpcMonthly(customerId, monthId); + } while (deleteNum > NumConstant.ZERO); + } + + /** + * @param list + * @return void + * @author yinzuomei + * @description 批量插入党员相关党建能力表 + * @Date 2020/9/18 10:27 + **/ + @DataSource(value = DataSourceConstant.EVALUATION_INDEX) + private void FactIndexPartyAblityCpcMonthlyEntity(List list) { + factIndexPartyAblityCpcMonthlyDao.insertBatchEntity(list); + } + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/CalGridIndexServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/CalGridIndexServiceImpl.java new file mode 100644 index 0000000000..aa240d30aa --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/CalGridIndexServiceImpl.java @@ -0,0 +1,425 @@ +package com.epmet.service.evaluationindex.extract.impl; + +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.constant.ExtractConstant; +import com.epmet.constant.ProjectEvaluateConstant; +import com.epmet.dao.evaluationindex.indexcoll.FactIndexGovrnAblityGridMonthlyDao; +import com.epmet.dto.extract.form.GovernAbilityGridMonthlyFormDTO; +import com.epmet.dto.extract.form.GridIssueCountResultDTO; +import com.epmet.dto.extract.form.PartyAbilityGridMonthlyFormDTO; +import com.epmet.dto.extract.result.*; +import com.epmet.service.evaluationindex.extract.*; +import com.epmet.service.stats.FactArticlePublishedGridDailyService; +import com.epmet.service.stats.user.FactRegUserGridMonthlyService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.BeanUtils; +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.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.atomic.AtomicReference; +import java.util.stream.Collectors; + +/** + * @Author zxc + * @DateTime 2020/9/18 9:53 上午 + */ +@Service +@Slf4j +public class CalGridIndexServiceImpl implements CalGridIndexService { + + @Autowired + private IssueExtractService issueExtractService; + @Autowired + private FactIndexGovernAbilityGridMonthlyService governAbilityGridMonthlyService; + @Autowired + private FactIndexPartyAbilityGridMonthlyService partyAbilityGridMonthlyService; + @Autowired + private FactIndexGovrnAblityGridMonthlyDao governAbilityDao; + @Autowired + private FactOriginProjectMainDailyService projectMainService; + @Autowired + private FactOriginProjectLogDailyService projectLogService; + @Autowired + private FactRegUserGridMonthlyService userGridMonthlyService; + @Autowired + private FactOriginTopicMainDailyService topicMainService; + @Autowired + private FactArticlePublishedGridDailyService articlePublishedGridDailyService; + @Autowired + private GroupExtractService groupExtractService; + @Autowired + private FactOriginTopicLogDailyService topicLogService; + + /** + * @Description 计算网格指标党建能力 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/9/18 9:56 上午 + */ + @Override + public Boolean calGridIndexPartyAbility(String customerId, String monthId) { + List result = governAbilityDao.selectAllGridInfoToParty(customerId); + if (CollectionUtils.isEmpty(result)){ + throw new RenException("客户【"+customerId+"】未查出网格信息"); + } + // 网格群众用户数 , 网格党员用户数 + List gridUserCountList = userGridMonthlyService.selectGridUserCount(customerId, monthId); + // 网格党员人均提出话题数 + List partyCreateTopicCountList = topicMainService.selectCreateTopicCount(customerId, monthId, NumConstant.ONE); + // 网格群众人均提出话题数 + List massCreateTopicCountList = topicMainService.selectCreateTopicCount(customerId, monthId, NumConstant.ZERO); + // 网格党员人均提出的议题转项目数 + List partyShiftProjectCountList = issueExtractService.selectShiftProjectCountPlus(customerId, monthId, NumConstant.ONE); + // 网格群众人均提出的议题转项目数 + List massShiftProjectCountList = issueExtractService.selectShiftProjectCountPlus(customerId, monthId, NumConstant.ZERO); + // 网格的发文数量 + List publishCountList = articlePublishedGridDailyService.selectArticlePublishCount(customerId, monthId); + // 网格议题转项目率 + List gridIssueTotalList = issueExtractService.selectIssueTotal(customerId, monthId); + List gridProjectTotalList = issueExtractService.selectGridProjectCount(customerId, monthId, ExtractConstant.SHIFT_PROJECT); + List gridIssueShiftProjectRatio = getGridIssueShiftProjectRatio(gridIssueTotalList, gridProjectTotalList); + // 建群党员数 + List partyCreateGroupCountList = groupExtractService.selectPartyCreateGroupCount(customerId, monthId); + //结合目前产品,数据来源:话题评论、议题表决 + //网格活跃群众用户数 + Map gridMassActiveMap = new HashMap<>(16); + List massActiveList = topicLogService.selectPartyActiveTopic(customerId, monthId, NumConstant.ZERO); + List massActiveIssueVote = issueExtractService.selectPartyActiveIssueVote(customerId, monthId, NumConstant.ZERO); + massActiveList.addAll(massActiveIssueVote); + if (!CollectionUtils.isEmpty(massActiveList)) { + Map> collectMap = massActiveList.stream().collect(Collectors.groupingBy(PartyActiveResultDTO::getGridId)); + collectMap.forEach((gridId, massActive) -> { + List userIds = massActive.stream().map(mass -> mass.getUserId()).distinct().collect(Collectors.toList()); + gridMassActiveMap.put(gridId, userIds.size()); + }); + } + //网格活跃党员用户数 + Map gridPartyActiveMap = new HashMap<>(16); + List partyActiveList = topicLogService.selectPartyActiveTopic(customerId, monthId, NumConstant.ONE); + List partyActiveIssueVote = issueExtractService.selectPartyActiveIssueVote(customerId, monthId, NumConstant.ONE); + partyActiveList.addAll(partyActiveIssueVote); + if (!CollectionUtils.isEmpty(partyActiveList)){ + Map> collectMap = massActiveList.stream().collect(Collectors.groupingBy(PartyActiveResultDTO::getGridId)); + collectMap.forEach((gridId, partyActive) -> { + List userIds = partyActive.stream().map(party -> party.getUserId()).distinct().collect(Collectors.toList()); + gridPartyActiveMap.put(gridId, userIds.size()); + }); + } + + String quarterId = DateUtils.getQuarterId(monthId); + String yearId = DateUtils.getYearId(monthId); + result.forEach(r -> { + r.setMonthId(monthId); + r.setQuarterId(quarterId); + r.setYearId(yearId); + // 1. 网格群众用户数 , 网格党员用户数 + if (!CollectionUtils.isEmpty(gridUserCountList)){ + gridUserCountList.forEach(count -> { + if (r.getGridId().equals(count.getGridId())){ + BeanUtils.copyProperties(count,r); + } + }); + } + // 2. 网格党员人均提出话题数 + if (!CollectionUtils.isEmpty(partyCreateTopicCountList)){ + partyCreateTopicCountList.forEach(party -> { + if (r.getGridId().equals(party.getGridId())){ + r.setPartyAvgTopicCount(party.getCreateTopicCount()); + } + }); + } + // 3. 网格群众人均提出话题数 + if (!CollectionUtils.isEmpty(massCreateTopicCountList)){ + massCreateTopicCountList.forEach(mass -> { + if (r.getGridId().equals(mass.getGridId())){ + r.setUserAvgTopicCount(mass.getCreateTopicCount()); + } + }); + } + // 4. 网格党员人均提出的议题转项目数 + if (!CollectionUtils.isEmpty(partyShiftProjectCountList)){ + partyShiftProjectCountList.forEach(party -> { + if (r.getGridId().equals(party.getGridId())){ + r.setPartyAvgShiftProjectCount(party.getShiftProjectCount()); + } + }); + } + // 5. 网格群众人均提出的议题转项目数 + if (!CollectionUtils.isEmpty(massShiftProjectCountList)){ + massShiftProjectCountList.forEach(mass -> { + if (r.getGridId().equals(mass.getGridId())){ + r.setPartyAvgShiftProjectCount(mass.getShiftProjectCount()); + } + }); + } + // 6. 网格的发文数量 + if (!CollectionUtils.isEmpty(publishCountList)){ + publishCountList.forEach(publish -> { + if (r.getGridId().equals(publish.getGridId())){ + r.setPublishArticleCount(publish.getPublishCount()); + } + }); + } + // 7. 网格议题转项目率 + if (!CollectionUtils.isEmpty(gridIssueShiftProjectRatio)){ + gridIssueShiftProjectRatio.forEach(ratio -> { + if (r.getGridId().equals(ratio.getGridId())){ + r.setIssueToProjectRatio(ratio.getIssueToProjectRatio()); + } + }); + } + // 8. 建群党员数 + if (!CollectionUtils.isEmpty(partyCreateGroupCountList)){ + partyCreateGroupCountList.forEach(party -> { + if (r.getGridId().equals(party.getGridId())){ + r.setCreateGroupPartyCount(party.getPartyCreateGroupCount()); + } + }); + } + // 9. 网格活跃群众用户数 + if (null != gridMassActiveMap){ + gridMassActiveMap.forEach((k,v) -> { + if (r.getGridId().equals(k)){ + r.setActiveUserCount(v); + } + }); + } + // 10. 网格活跃党员用户数 + if (null != gridPartyActiveMap){ + gridPartyActiveMap.forEach((k,v) -> { + if (r.getGridId().equals(k)){ + r.setActivePartyCount(v); + } + }); + } + }); + delAndInsertPartyAbility(result,customerId,monthId); + return true; + } + + /** + * @Description 计算网格指标治理能力 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/9/18 9:56 上午 + */ + @Override + public Boolean calGridIndexGovernAbility(String customerId, String monthId) { + + List result = governAbilityDao.selectAllGridInfo(customerId); + if (CollectionUtils.isEmpty(result)){ + throw new RenException("客户【"+customerId+"】未查出网格信息"); + } + //网格总议题数目,网格人均议题数目 + List gridIssueTotalList = issueExtractService.selectIssueTotal(customerId, monthId); + //网格总项目数 + List gridProjectTotalList = issueExtractService.selectGridProjectCount(customerId, monthId, ExtractConstant.SHIFT_PROJECT); + //网格议题转项目率 + List gridIssueShiftProjectRatio = getGridIssueShiftProjectRatio(gridIssueTotalList, gridProjectTotalList); + //网格自治项目数 从议题创建到项目关闭,包括处理人,自始至终没有出过议题所属网格 + List projectAutoNoMyList = projectLogService.selectProjectAutoNoMy(customerId, monthId); + Map autoMap = new HashMap<>(16); + if (!CollectionUtils.isEmpty(projectAutoNoMyList)){ + Map> groupByGrid = projectAutoNoMyList.stream().collect(Collectors.groupingBy(AutoNoMyResultDTO::getGridId)); + groupByGrid.forEach((gridId,projectList) -> { + Map> groupByProject = projectList.stream().collect(Collectors.groupingBy(AutoNoMyResultDTO::getProjectId)); + AtomicReference autoSelf = new AtomicReference<>(true); + AtomicReference count = new AtomicReference<>(NumConstant.ZERO); + groupByProject.forEach((projectId,projects) -> { + String disposeGrid = projects.get(NumConstant.ZERO).getGridId(); + projects.forEach(p -> { + if (!disposeGrid.equals(p.getGridId())){ + autoSelf.set(false); + } + }); + if (autoSelf.get()) { + count.getAndSet(count.get() + NumConstant.ONE); + } + }); + autoMap.put(gridId,count.get()); + }); + } + //网格办结项目数 + List gridProjectClosedTotalList = projectMainService.selectGridClosedProject(customerId, monthId, ExtractConstant.CLOSED); + //网格吹哨部门准确率 【没被退回的项目数/项目总数 】 + List notReturnProjectList = projectLogService.selectNotReturnProject(customerId, monthId, ExtractConstant.RETURN_ACTION_CODE, ExtractConstant.GRID_ORG_TYPE); + if (!CollectionUtils.isEmpty(gridIssueShiftProjectRatio) && !CollectionUtils.isEmpty(notReturnProjectList)){ + notReturnProjectList.forEach(not -> { + gridIssueShiftProjectRatio.forEach(total -> { + if (not.getGridId().equals(total.getGridId())){ + not.setTransferRightRatio(getRound(new BigDecimal(not.getNotReturnProject()/total.getProjectTotal()))); + } + }); + }); + } + //网格内解决的项目的满意度 + //项目评价(分值定义下非常满意100,满意80,不满意(一般)60)的人数的平均分(每个项目的参加人数的分数和/评论人数=一个项目的平均分)+其他项目得分/已关闭项目总数 + List projectEvaluateList = projectLogService.selectProjectEvaluate(customerId, monthId); + Map resultSatisfactionScore = new HashMap<>(16); + if (!CollectionUtils.isEmpty(projectEvaluateList)){ + Map> groupByGrid = projectEvaluateList.stream().collect(Collectors.groupingBy(ProjectEvaluateResultDTO::getGridId)); + groupByGrid.forEach((gridId,projectEvaluateInfoList) -> { + Map scoreMap = new HashMap<>(16); + Map> groupByProject = projectEvaluateInfoList.stream().collect(Collectors.groupingBy(ProjectEvaluateResultDTO::getProjectId)); + groupByProject.forEach((projectId,projectList) -> { + projectList.forEach(project -> { + switch (project.getActionCode()) { + case ExtractConstant.EVALUATE_BAD: + project.setScore(ProjectEvaluateConstant.BAD); + break; + case ExtractConstant.EVALUATE_GOOD: + project.setScore(ProjectEvaluateConstant.GOOD); + break; + case ExtractConstant.EVALUATE_PERFECT: + project.setScore(ProjectEvaluateConstant.PERFECT); + break; + default: + log.warn("calGridIndexGovernAbility orther projectEvaluate,actionCode:{}", project.getActionCode()); + } + }); + Integer projectAllScore = projectList.stream().mapToInt(ProjectEvaluateResultDTO::getScore).sum(); + scoreMap.put(projectId,projectAllScore/projectList.size()); + }); + AtomicReference allScore = new AtomicReference<>(0); + scoreMap.forEach((k,v) -> { + allScore.set(++v); + }); + resultSatisfactionScore.put(gridId,getRound(new BigDecimal(allScore.get()/scoreMap.size()))); + }); + } + String quarterId = DateUtils.getQuarterId(monthId); + String yearId = DateUtils.getYearId(monthId); + result.forEach(r -> { + r.setMonthId(monthId); + r.setQuarterId(quarterId); + r.setYearId(yearId); + // 1. 网格总议题数目,网格人均议题数目 + if (!CollectionUtils.isEmpty(gridIssueTotalList)) { + gridIssueTotalList.forEach(total -> { + if (r.getGridId().equals(total.getGridId())) { + BeanUtils.copyProperties(total, r); + } + }); + } + // 2. 网格总项目数,网格议题转项目率 + if (!CollectionUtils.isEmpty(gridIssueTotalList)){ + gridIssueShiftProjectRatio.forEach(projectTotal -> { + if (r.getGridId().equals(projectTotal.getGridId())){ + r.setProjectTotal(projectTotal.getProjectTotal()); + r.setIssueToProjectRatio(projectTotal.getIssueToProjectRatio()); + } + }); + } + // 3. 网格办结项目数 + if (!CollectionUtils.isEmpty(gridProjectClosedTotalList)){ + gridProjectClosedTotalList.forEach(closed -> { + if (r.getGridId().equals(closed.getGridId())){ + r.setResolveProjectCount(closed.getResolveProjectCount()); + } + }); + } + // 4. 网格吹哨部门准确率 + if (!CollectionUtils.isEmpty(notReturnProjectList)) { + notReturnProjectList.forEach(not -> { + if (r.getGridId().equals(not.getGridId())) { + r.setTransferRightRatio(not.getTransferRightRatio()); + } + }); + } + // 5. 网格内解决的项目的满意度 + resultSatisfactionScore.forEach((k, v) -> { + if (r.getGridId().equals(k)) { + r.setSatisfactionRatio(v); + } + }); + // 6. 网格自治项目数 + autoMap.forEach((k, v) -> { + if (r.getGridId().equals(k)) { + r.setSelfSolveProjectCount(v); + } + }); + }); + delAndInsertGovernAbility(result,customerId,monthId); + return true; + } + + /** + * @Description 计算网格指标服务能力 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/9/18 9:56 上午 + */ + @Override + public Boolean calGridIndexServiceAbility(String customerId, String monthId) { + return null; + } + + /** + * @Description 小数四舍五入【保留六位小数】 + * @param d + * @author zxc + * @date 2020/9/18 2:01 下午 + */ + public BigDecimal getRound(BigDecimal d){ + return d.setScale(NumConstant.SIX, BigDecimal.ROUND_HALF_UP); + } + + /** + * @Description + * @param gridIssueTotalList + * @param gridProjectTotalList + * @author zxc + * @date 2020/9/19 2:53 下午 + */ + public List getGridIssueShiftProjectRatio(List gridIssueTotalList,List gridProjectTotalList){ + if (!CollectionUtils.isEmpty(gridIssueTotalList) && !CollectionUtils.isEmpty(gridProjectTotalList)) { + gridProjectTotalList.forEach(project -> { + gridIssueTotalList.forEach(issue -> { + if (project.getGridId().equals(issue.getGridId())) { + project.setIssueToProjectRatio(getRound(new BigDecimal(project.getProjectTotal() / issue.getIssueTotal()))); + } + }); + }); + } + return gridProjectTotalList; + } + + /** + * @Description 删除并插入党建能力的记录 + * @param result + * @author zxc + * @date 2020/9/19 4:06 下午 + */ + @Transactional(rollbackFor = Exception.class) + public void delAndInsertPartyAbility(List result,String customerId,String monthId){ + if (!CollectionUtils.isEmpty(result)){ + partyAbilityGridMonthlyService.deleteOldPartyAbility(customerId, monthId); + partyAbilityGridMonthlyService.insertPartyAbility(result); + } + } + + /** + * @Description 删除并插入治理能力的记录 + * @param result + * @author zxc + * @date 2020/9/19 4:06 下午 + */ + @Transactional(rollbackFor = Exception.class) + public void delAndInsertGovernAbility(List result,String customerId,String monthId){ + if (!CollectionUtils.isEmpty(result)){ + governAbilityGridMonthlyService.deleteOldGovernAbilityRecord(customerId, monthId); + governAbilityGridMonthlyService.insertGovernAbilityRecord(result); + } + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/FactIndexGovernAbilityGridMonthlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/FactIndexGovernAbilityGridMonthlyServiceImpl.java new file mode 100644 index 0000000000..64096f1935 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/FactIndexGovernAbilityGridMonthlyServiceImpl.java @@ -0,0 +1,37 @@ +package com.epmet.service.evaluationindex.extract.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.constant.DataSourceConstant; +import com.epmet.dao.evaluationindex.indexcoll.FactIndexGovrnAblityGridMonthlyDao; +import com.epmet.dto.extract.form.GovernAbilityGridMonthlyFormDTO; +import com.epmet.service.evaluationindex.extract.FactIndexGovernAbilityGridMonthlyService; +import lombok.extern.slf4j.Slf4j; +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 2020-09-19 + */ +@Service +@Slf4j +@DataSource(DataSourceConstant.EVALUATION_INDEX) +public class FactIndexGovernAbilityGridMonthlyServiceImpl implements FactIndexGovernAbilityGridMonthlyService { + + @Autowired + private FactIndexGovrnAblityGridMonthlyDao governAbilityDao; + + @Override + public void insertGovernAbilityRecord(List lists) { + governAbilityDao.insertGovernAbilityRecord(lists); + } + + @Override + public void deleteOldGovernAbilityRecord(String customerId, String monthId) { + governAbilityDao.deleteOldGovernAbilityRecord(customerId, 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/impl/FactIndexPartyAbilityGridMonthlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/FactIndexPartyAbilityGridMonthlyServiceImpl.java new file mode 100644 index 0000000000..922e429ac9 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/FactIndexPartyAbilityGridMonthlyServiceImpl.java @@ -0,0 +1,37 @@ +package com.epmet.service.evaluationindex.extract.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.constant.DataSourceConstant; +import com.epmet.dao.evaluationindex.indexcoll.FactIndexPartyAblityGridMonthlyDao; +import com.epmet.dto.extract.form.PartyAbilityGridMonthlyFormDTO; +import com.epmet.service.evaluationindex.extract.FactIndexPartyAbilityGridMonthlyService; +import lombok.extern.slf4j.Slf4j; +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 2020-09-19 + */ +@Service +@Slf4j +@DataSource(DataSourceConstant.EVALUATION_INDEX) +public class FactIndexPartyAbilityGridMonthlyServiceImpl implements FactIndexPartyAbilityGridMonthlyService { + + @Autowired + private FactIndexPartyAblityGridMonthlyDao partyAbilityGridDao; + + @Override + public void insertPartyAbility(List lists) { + partyAbilityGridDao.insertPartyAbility(lists); + } + + @Override + public void deleteOldPartyAbility(String customerId, String monthId) { + partyAbilityGridDao.deleteOldPartyAbility(customerId, 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/impl/FactIndexServiceAbilityGridMonthlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/FactIndexServiceAbilityGridMonthlyServiceImpl.java new file mode 100644 index 0000000000..3d5e2019e2 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/FactIndexServiceAbilityGridMonthlyServiceImpl.java @@ -0,0 +1,20 @@ +package com.epmet.service.evaluationindex.extract.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.constant.DataSourceConstant; +import com.epmet.service.evaluationindex.extract.FactIndexServiceAbilityGridMonthlyService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +/** + * 服务能力-网格相关事实表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-19 + */ +@Service +@Slf4j +@DataSource(DataSourceConstant.EVALUATION_INDEX) +public class FactIndexServiceAbilityGridMonthlyServiceImpl implements FactIndexServiceAbilityGridMonthlyService { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/FactOriginExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/FactOriginExtractServiceImpl.java new file mode 100644 index 0000000000..0a10a193db --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/FactOriginExtractServiceImpl.java @@ -0,0 +1,107 @@ +package com.epmet.service.evaluationindex.extract.impl; + +import com.alibaba.fastjson.JSON; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.dto.extract.form.ExtractFormDTO; +import com.epmet.service.evaluationindex.extract.*; +import com.epmet.service.stats.DimCustomerService; +import com.epmet.util.DimIdGenerator; +import com.google.common.util.concurrent.ThreadFactoryBuilder; +import lombok.extern.slf4j.Slf4j; +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.Date; +import java.util.List; +import java.util.concurrent.*; + +/** + * desc:抽取业务数据 到 统计库 汇聚类 + */ +@Slf4j +@Service +public class FactOriginExtractServiceImpl implements FactOriginExtractService { + ThreadFactory namedThreadFactory = new ThreadFactoryBuilder() + .setNameFormat("factOriginExtract-pool-%d").build(); + ExecutorService threadPool = new ThreadPoolExecutor(4, 8, + 10L, TimeUnit.MINUTES, + new LinkedBlockingQueue<>(500), namedThreadFactory, new ThreadPoolExecutor.CallerRunsPolicy()); + + @Autowired + private IssueExtractService issueExtractService; + @Autowired + private FactOriginTopicMainDailyService factOriginTopicMainDailyService; + @Autowired + private ProjectExtractService projectExtractService; + @Autowired + private DimCustomerService dimCustomerService; + @Autowired + private GroupExtractService groupExtractService; + + + @Override + public void extractAll(ExtractFormDTO extractFormDTO) { + String dateId = extractFormDTO.getDateId(); + String customerId = extractFormDTO.getCustomerId(); + if (StringUtils.isBlank(dateId)) { + dateId = DimIdGenerator.getDateDimId(DateUtils.addDateDays(new Date(), -1)); + } + List customerIds = new ArrayList<>(); + if (StringUtils.isNotBlank(customerId)) { + customerIds.add(customerId); + } + int pageNo = NumConstant.ONE; + int pageSize = NumConstant.ONE_HUNDRED; + customerIds = dimCustomerService.selectCustomerIdPage(pageNo, pageSize); + if (CollectionUtils.isEmpty(customerIds)) { + log.error("extractAll 获取客户Id为空"); + return; + } + + String finalDateId = dateId; + customerIds.forEach(cId -> { + ExtractFormDTO param = new ExtractFormDTO(); + param.setCustomerId(cId); + param.setDateId(finalDateId); + submitJob(param); + }); + + } + + private void submitJob(ExtractFormDTO param) { + threadPool.submit(() -> { + try { + groupExtractService.extractGroupData(param); + } catch (Exception e) { + log.error("抽取【小组数据】发生异常,参数:" + JSON.toJSONString(param), e); + } + }); + threadPool.submit(() -> { + try { + factOriginTopicMainDailyService.topicCleaning(param); + } catch (Exception e) { + log.error("抽取【话题数据】发生异常,参数:" + JSON.toJSONString(param), e); + } + }); + threadPool.submit(() -> { + try { + issueExtractService.issueExtractMain(param); + issueExtractService.issueExtractLog(param); + } catch (Exception e) { + log.error("抽取【议题数据】发生异常,参数:" + JSON.toJSONString(param), e); + } + }); + threadPool.submit(() -> { + try { + projectExtractService.saveOriginProjectDaily(param); + projectExtractService.extractProjectPeriodData(param); + } catch (Exception e) { + log.error("抽取【项目数据】发生异常,参数:" + JSON.toJSONString(param), e); + } + }); + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/FactOriginProjectLogDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/FactOriginProjectLogDailyServiceImpl.java index e0d99443f7..50781824a9 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/FactOriginProjectLogDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/FactOriginProjectLogDailyServiceImpl.java @@ -21,19 +21,25 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.dao.evaluationindex.extract.FactOriginProjectLogDailyDao; +import com.epmet.dao.evaluationindex.extract.FactOriginProjectOrgPeriodDailyDao; import com.epmet.dto.extract.FactOriginProjectLogDailyDTO; +import com.epmet.dto.extract.result.*; import com.epmet.entity.evaluationindex.extract.FactOriginProjectLogDailyEntity; import com.epmet.service.evaluationindex.extract.FactOriginProjectLogDailyService; 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; +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.util.*; +import java.util.stream.Collectors; /** * 项目明细_日统计 @@ -44,6 +50,8 @@ import java.util.Map; @Service public class FactOriginProjectLogDailyServiceImpl extends BaseServiceImpl implements FactOriginProjectLogDailyService { + @Autowired + private FactOriginProjectOrgPeriodDailyDao projectOrgPeriodDailyDao; @Override public PageData page(Map params) { @@ -97,4 +105,135 @@ public class FactOriginProjectLogDailyServiceImpl extends BaseServiceImpl getAgencyTransferCount(String customerId, String monthId, String level) { + return baseDao.selectAgencyTransferCount(customerId, monthId, level); + } + + /** + * @Description 查询未被退回的项目数 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/9/18 2:50 下午 + */ + @Override + public List selectNotReturnProject(String customerId, String monthId, String actionCode, String orgType) { + return baseDao.selectNotReturnProject(customerId, monthId, actionCode, orgType); + } + + /** + * @Description 查询项目评价信息 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/9/18 3:28 下午 + */ + @Override + public List selectProjectEvaluate(String customerId, String monthId) { + return baseDao.selectProjectEvaluate(customerId, monthId); + } + + @Override + public void deleteByDate(String customerId, String date) { + baseDao.deleteByDate(customerId, date); + } + + /** + * @Description 网格项目自治率查询 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/9/18 5:25 下午 + */ + @Override + public List selectProjectAutoNoMy(String customerId, String monthId) { + return baseDao.selectProjectAutoNoMy(customerId, monthId); + } + + @Override + public List getSatisfaction(String customerId, String monthId, String level) { + return baseDao.selectSatisfaction(customerId, monthId, level); + } + + @Override + public List getDepTransferCount(String customerId, String monthId, String level) { + return baseDao.selectDepTransferCount(customerId, monthId, level); + } + + /** + * @Description 查询各项目经受了多少机关 + * @param customerId + * @return + * @author wangc + * @date 2020.09.20 23:46 + **/ + @Override + public Map getProjectHandledAgency(String customerId, String dimId, String dateType) { + Map result = new HashMap<>(); + List projectAgency = baseDao.selectProjectParticipatedAgency(customerId,dimId,dateType); + if(!CollectionUtils.isEmpty(projectAgency)){ + Map> map + = projectAgency.stream().collect(Collectors.groupingBy(ProjectParticipatedAgencyResultDTO :: getProjectId)); + + map.forEach((key ,agencies) ->{ + if(!CollectionUtils.isEmpty(agencies)) { + String highest = agencies.get(NumConstant.ZERO).getLevel(); + for (int i = NumConstant.ZERO; i < agencies.size(); i++) { + if(StringUtils.equals(agencies.get(i).getLevel(),highest)){ + if(null != result.get(agencies.get(i).getAgencyId())){ + result.put(key,result.get(agencies.get(i).getAgencyId()) + NumConstant.ONE); + }else{ + result.put(key,NumConstant.ONE); + } + }else break; + } + } + }); + } + return result; + } + + /** + * @Description 计算机关响应度 + * @param customerId + * @return + * @author wangc + * @date 2020.09.21 02:16 + **/ + @Override + public Map getAgencyResponseRatio(String customerId, String dimId, String dateType) { + List gridDeptResponse = projectOrgPeriodDailyDao.selectSubOrgResponseCoefficient(customerId, dimId, dateType); + List agencyResponse = projectOrgPeriodDailyDao.selectAgencyResponseCoefficient(customerId, dimId, dateType); + Map consumingMap = new HashMap<>(); + Map timeMap = new HashMap<>(); + if(!CollectionUtils.isEmpty(agencyResponse)){ + agencyResponse.forEach(response -> { + consumingMap.put(response.getAgencyId(),response.getResponseTime()); + //注意,这里取的是去重后的项目次数,例如一个部门被项目流转了多次,项目数只算一次 + //如果需要改成不去重,只需response.getProjectTotal() + timeMap.put(response.getAgencyId(),response.getDistinctProjectTotal()); + }); + } + if(!CollectionUtils.isEmpty(gridDeptResponse)){ + gridDeptResponse.forEach(response -> { + if(null != consumingMap.get(response.getAgencyId())){ + consumingMap.put(response.getAgencyId(),consumingMap.get(response.getAgencyId()).add(response.getResponseTime())); + timeMap.put(response.getAgencyId(),timeMap.get(response.getAgencyId()).add(response.getDistinctProjectTotal())); + }else{ + consumingMap.put(response.getAgencyId(),response.getResponseTime()); + timeMap.put(response.getAgencyId(),response.getDistinctProjectTotal()); + } + }); + } + Map ratioMap = new HashMap<>(); + if(!CollectionUtils.isEmpty(consumingMap)) { + consumingMap.keySet().forEach(agencyId -> { + ratioMap.put(agencyId, consumingMap.get(agencyId).divide(timeMap.get(agencyId), NumConstant.SIX, RoundingMode.HALF_UP)); + }); + } + return ratioMap; + } + + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/FactOriginProjectMainDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/FactOriginProjectMainDailyServiceImpl.java index 006476a093..eef67a5b71 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/FactOriginProjectMainDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/FactOriginProjectMainDailyServiceImpl.java @@ -21,16 +21,21 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.dao.evaluationindex.extract.FactOriginProjectMainDailyDao; import com.epmet.dto.extract.FactOriginProjectMainDailyDTO; +import com.epmet.dto.extract.result.OrgStatisticsResultDTO; +import com.epmet.dto.extract.result.GridProjectClosedTotalResultDTO; import com.epmet.entity.evaluationindex.extract.FactOriginProjectMainDailyEntity; import com.epmet.service.evaluationindex.extract.FactOriginProjectMainDailyService; import org.apache.commons.lang3.StringUtils; 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; @@ -106,4 +111,61 @@ public class FactOriginProjectMainDailyServiceImpl extends BaseServiceImpl getOverdueCount(String customerId, String monthId) { + return baseDao.selectOverdueCount(customerId, monthId); + } + + /** + * @Description 网格办结项目数 + * @param customerId + * @param monthId + * @param status + * @author zxc + * @date 2020/9/18 2:06 下午 + */ + @Override + public List selectGridClosedProject(String customerId, String monthId, String status) { + return baseDao.selectGridClosedProject(customerId, monthId,status); + } + + @Override + public void deleteByDate(String customerId, String date) { + baseDao.deleteByDate(customerId, date); + } + + /** + * @param customerId + * @param monthId + * @return java.util.List> + * @author yinzuomei + * @description 党员提出的议题转项目数 + * @Date 2020/9/18 14:11 + **/ + @Override + public List> selectShiftProjectCount(String customerId, String monthId) { + //查询项目主表fact_origin_project_main_daily,这个月内新增的项目,按话题发布人分组 + /*含义:评价周期内,党员提出的议题转数目数。 + 数据来源:项目表。 + 计算方法:从项目表中按照用户ID和党员标识统计。 + 对评价结果的影响:正向。*/ + return baseDao.selectShiftProjectCount(customerId,monthId); + } + + /** + * @param customerId + * @param monthId + * @param topicIdList + * @return java.lang.Integer + * @author yinzuomei + * @description 9、自建群活跃度——议题转项目率 用 + * @Date 2020/9/20 22:25 + **/ + @Override + public Integer selectCountByPartyUser(String customerId, String monthId, List topicIdList) { + if(CollectionUtils.isEmpty(topicIdList)){ + return NumConstant.ZERO; + } + return baseDao.selectCountByPartyUser(customerId,monthId,topicIdList); + } } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/FactOriginTopicLogDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/FactOriginTopicLogDailyServiceImpl.java index b95bc36cb7..e2f4b39e16 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/FactOriginTopicLogDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/FactOriginTopicLogDailyServiceImpl.java @@ -17,11 +17,19 @@ package com.epmet.service.evaluationindex.extract.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.evaluationindex.extract.FactOriginTopicLogDailyDao; +import com.epmet.dto.extract.result.PartyActiveResultDTO; import com.epmet.entity.evaluationindex.extract.FactOriginTopicLogDailyEntity; import com.epmet.service.evaluationindex.extract.FactOriginTopicLogDailyService; import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; /** * 话题明细_日统计 @@ -29,8 +37,77 @@ import org.springframework.stereotype.Service; * @author generator generator@elink-cn.com * @since v1.0.0 2020-09-15 */ +@DataSource(DataSourceConstant.STATS) @Service public class FactOriginTopicLogDailyServiceImpl extends BaseServiceImpl implements FactOriginTopicLogDailyService { + /** + * @param customerId + * @param monthId + * @return java.util.List> + * @author yinzuomei + * @description 查询客户下,这个月内,每个党员评论话题的次数 + * @Date 2020/9/18 13:35 + **/ + @Override + public List> selectJoinTopicCount(String customerId, String monthId) { + //这个月内新增的话题评论,按人分组,不限制评论时的身份,以当前用户最新身份为准 + return baseDao.selectJoinTopicCount(customerId,monthId); + } + + /** + * @param customerId + * @param monthId + * @return java.util.List> + * @author yinzuomei + * @description 党员自建群活跃度——话题数 + * @Date 2020/9/18 14:33 + **/ + @Override + public List> selectGroupTopicCount(String customerId, String monthId) { + return baseDao.selectGroupTopicCount(customerId,monthId); + } + + /** + * @return java.lang.Integer + * @param userId + * @param customerId + * @param monthId + * @author yinzuomei + * @description 查询当前用户在本月内评论的次数 + * @Date 2020/9/20 21:45 + **/ + @Override + public Integer selectUserCommentCount(String userId,String customerId, String monthId) { + return baseDao.selectUserCommentCount(userId,customerId,monthId); + } + + /** + * @param groupIdList + * @return java.util.List + * @author yinzuomei + * @description 组内的所有话题id + * @Date 2020/9/20 22:17 + **/ + @Override + public List selectTopicIds(List groupIdList) { + if(CollectionUtils.isEmpty(groupIdList)){ + return new ArrayList<>(); + } + return baseDao.selectTopicIds(groupIdList); + } + + /** + * @Description 查询 话题评论【党员/群众】 + * @param customerId + * @param monthId + * @param isParty + * @author zxc + * @date 2020/9/21 9:37 上午 + */ + @Override + public List selectPartyActiveTopic(String customerId, String monthId, Integer isParty) { + return baseDao.selectPartyActiveTopic(customerId, monthId, isParty); + } } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/FactOriginTopicMainDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/FactOriginTopicMainDailyServiceImpl.java index 6b4c2391fd..b82592861a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/FactOriginTopicMainDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/FactOriginTopicMainDailyServiceImpl.java @@ -17,15 +17,19 @@ package com.epmet.service.evaluationindex.extract.impl; +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.exception.RenException; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.constant.DataSourceConstant; import com.epmet.constant.DimObjectActionConstant; import com.epmet.constant.IndexCalConstant; import com.epmet.dao.evaluationindex.extract.FactOriginTopicLogDailyDao; import com.epmet.dao.evaluationindex.extract.FactOriginTopicMainDailyDao; +import com.epmet.dto.extract.form.ExtractFormDTO; +import com.epmet.dto.extract.result.CreateTopicCountResultDTO; import com.epmet.dto.org.GridInfoDTO; import com.epmet.dto.topic.TopicOriginInfoDTO; import com.epmet.entity.evaluationindex.extract.FactOriginTopicLogDailyEntity; @@ -53,6 +57,7 @@ import java.util.stream.Collectors; * @author generator generator@elink-cn.com * @since v1.0.0 2020-09-15 */ +@DataSource(value = DataSourceConstant.STATS) @Slf4j @Service public class FactOriginTopicMainDailyServiceImpl extends BaseServiceImpl implements FactOriginTopicMainDailyService { @@ -64,25 +69,26 @@ public class FactOriginTopicMainDailyServiceImpl extends BaseServiceImpl topicOriginInfoList = topicService.queryTopicOriginInfoList(customerId, dateId); if (CollectionUtils.isEmpty(topicOriginInfoList)) { - log.info(String.format("customerId%s,dateId%s,doesn't have any topic operation record",customerId,dateId)); + log.info(String.format("customerId%s,dateId%s,doesn't have any topic operation record", customerId, dateId)); return true; } - Map gridMap=getGridInfoMap(customerId); - Map map=this.constructFactOriginData(topicOriginInfoList,gridMap); - List mainDailyEntityList= (List) map.get("main"); - List logDailyEntityList= (List) map.get("log"); + Map gridMap = getGridInfoMap(customerId); + Map map = this.constructFactOriginData(topicOriginInfoList, gridMap); + List mainDailyEntityList = (List) map.get("main"); + List logDailyEntityList = (List) map.get("log"); //删除之前统计的数据 deleteFactOriginData(customerId,dateId); //批量保存主表 @@ -92,6 +98,7 @@ public class FactOriginTopicMainDailyServiceImpl extends BaseServiceImpl getGridInfoMap(String customerId) { Map map=new HashMap<>(); List list=customerGridService.queryGridInfoList(customerId); @@ -222,5 +229,29 @@ public class FactOriginTopicMainDailyServiceImpl extends BaseServiceImpl> selectPartyCreateTopicCount(String customerId, String monthId) { + //这个月内新增的话题,按人分组,不限制发话题人的身份,也就是说以用户最新的身份为准 + return baseDao.selectPartyCreateTopicCount(customerId,monthId); + } + /** + * @Description 查询网格 党员/群众 人均提出话题数 + * @param customerId + * @param monthId + * @param isParty + * @author zxc + * @date 2020/9/19 1:58 下午 + */ + @Override + public List selectCreateTopicCount(String customerId, String monthId,Integer isParty) { + return baseDao.selectCreateTopicCount(customerId, monthId, isParty); + } } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/GroupExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/GroupExtractServiceImpl.java new file mode 100644 index 0000000000..089fa9fdbd --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/GroupExtractServiceImpl.java @@ -0,0 +1,145 @@ +package com.epmet.service.evaluationindex.extract.impl; + +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.dao.evaluationindex.extract.FactOriginGroupMainDailyDao; +import com.epmet.dto.extract.FactOriginGroupMainDailyDTO; +import com.epmet.dto.extract.form.ExtractFormDTO; +import com.epmet.dto.extract.form.GridHeartedFormDTO; +import com.epmet.dto.extract.result.PartyCreateGroupCountResultDTO; +import com.epmet.dto.group.result.ExtractGroupMemberActionRecordResultDTO; +import com.epmet.dto.stats.result.GridAttributesResultDTO; +import com.epmet.service.evaluationindex.extract.GroupExtractService; +import com.epmet.service.group.GroupDataService; +import com.epmet.service.stats.DimGridService; +import com.epmet.service.user.UserService; +import com.epmet.util.DimIdGenerator; +import lombok.extern.slf4j.Slf4j; +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.text.SimpleDateFormat; +import java.util.Date; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.function.Function; +import java.util.stream.Collectors; + +/** + * @Description 业务数据抽取 - 组相关 + * @ClassName GroupExtractServiceImpl + * @Auth wangc + * @Date 2020-09-16 14:47 + */ +@Service +@Slf4j +public class GroupExtractServiceImpl implements GroupExtractService { + + @Autowired + private FactOriginGroupMainDailyDao groupMainDailyDao; + + /** + * @Description 查询建群党员数 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/9/19 3:49 下午 + */ + @Override + public List selectPartyCreateGroupCount(String customerId, String monthId) { + return groupMainDailyDao.selectPartyCreateGroupCount(customerId, monthId); + } + @Autowired + private GroupDataService groupDataService; + @Autowired + private FactOriginGroupMainDailyDao factOriginGroupMainDailyDao; + @Autowired + private UserService userService; + @Autowired + private DimGridService dimGridService; + + /** + * @Description 业务抽取 - 小组祥光 + * @param param + * @return + * @author wangc + * @date 2020.09.18 21:07 + **/ + @Override + public void extractGroupData(ExtractFormDTO param) { + int count = factOriginGroupMainDailyDao.selectIfExist(param.getCustomerId()); + + if(StringUtils.isBlank(param.getDateId())){ + Date yesterday = DateUtils.addDateDays(new Date(), -1); + SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); + param.setDateId(format.format(yesterday)); + } + //原生数据,如果是首次,则为全部组,如果非首次,则只有新创建以及新进人的组 + //但是每个组每天都要更新一次组长的身份信息 + List originGroupData = groupDataService.extractGroupData( + count <= NumConstant.ZERO, + param.getCustomerId(), param.getDateId()); + + List memberList = new LinkedList<>(); + if (!CollectionUtils.isEmpty(originGroupData)) { + List gridList = dimGridService.getGridAttributes(param.getCustomerId(),originGroupData.stream().map(FactOriginGroupMainDailyDTO::getGridId).distinct().collect(Collectors.toList())); + + if (!CollectionUtils.isEmpty(gridList)) { + Map gridMap = + gridList.stream().collect(Collectors.toMap(GridAttributesResultDTO::getGridId, Function.identity(), (key1, key2) -> key2)); + if (!CollectionUtils.isEmpty(originGroupData)) { + originGroupData.forEach(group -> { + if (!CollectionUtils.isEmpty(group.getMembers())) { + group.setMemberTotal(group.getMembers().size()); + group.getMembers().forEach(member -> { + DimIdGenerator.DimIdBean dateInfo = DimIdGenerator.getDimIdBean(member.getJoinDate()); + member.setDateId(dateInfo.getDateId()); + member.setWeekId(dateInfo.getWeekId()); + member.setMonthId(dateInfo.getMonthId()); + member.setQuarterId(dateInfo.getQuarterId()); + member.setYearId(dateInfo.getYearId()); + + memberList.add(member); + }); + } + GridAttributesResultDTO attr = gridMap.get(group.getGridId()); + if (null != attr) { + group.setAgencyId(attr.getAgencyId()); + group.setParentId(attr.getParentId()); + group.setPids(attr.getPids()); + } + if(null != group.getCreatedTime()){ + DimIdGenerator.DimIdBean dateInfo = DimIdGenerator.getDimIdBean(group.getCreatedTime()); + group.setDateId(dateInfo.getDateId()); + group.setWeekId(dateInfo.getWeekId()); + group.setMonthId(dateInfo.getMonthId()); + group.setQuarterId(dateInfo.getQuarterId()); + group.setYearId(dateInfo.getYearId()); + } + }); + } + + + if (count <= NumConstant.ZERO) { + //isFirst + factOriginGroupMainDailyDao.deleteBatchMemberByCustomerId(param.getCustomerId()); + factOriginGroupMainDailyDao.insertBatchMain(originGroupData); + factOriginGroupMainDailyDao.insertBatchMembers(memberList); + } else { + factOriginGroupMainDailyDao.deleteBatchByGroupId(param.getCustomerId(),originGroupData.stream().map(FactOriginGroupMainDailyDTO :: getId).distinct().collect(Collectors.toList())); + factOriginGroupMainDailyDao.insertBatchMembers(memberList); + } + } + + + List partyIds = userService.getPartymembersByCustomerId(param.getCustomerId()); + List heartedIds = userService.getWarmHeartedByCustomerId(param.getCustomerId()); + + factOriginGroupMainDailyDao.updatePartyFlag(partyIds,param.getCustomerId()); + factOriginGroupMainDailyDao.updateHeartedFlag(heartedIds,param.getCustomerId()); + } + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/IssueExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/IssueExtractServiceImpl.java index d277675b03..2c6414b910 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/IssueExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/IssueExtractServiceImpl.java @@ -1,21 +1,20 @@ package com.epmet.service.evaluationindex.extract.impl; +import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.tools.dto.form.TimeListResultDTO; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.constant.DataSourceConstant; import com.epmet.constant.ExtractConstant; import com.epmet.dao.evaluationindex.extract.FactOriginIssueLogDailyDao; import com.epmet.dao.evaluationindex.extract.FactOriginIssueMainDailyDao; import com.epmet.dao.stats.DimAgencyDao; import com.epmet.dto.extract.form.ExtractFormDTO; +import com.epmet.dto.extract.form.GridIssueCountResultDTO; import com.epmet.dto.extract.form.IssueLogDailyFormDTO; import com.epmet.dto.extract.form.IssueMainDailyFormDTO; -import com.epmet.dto.extract.result.SatisfactionInfoResultDTO; -import com.epmet.dto.extract.result.AgencyInfoResultDTO; -import com.epmet.dto.extract.result.IssueInfoResultDTO; -import com.epmet.dto.extract.result.IssueProcessInfoResultDTO; -import com.epmet.dto.extract.result.TopicInfoResultDTO; +import com.epmet.dto.extract.result.*; import com.epmet.service.Issue.IssueService; import com.epmet.service.evaluationindex.extract.IssueExtractService; import com.epmet.service.topic.TopicService; @@ -26,7 +25,6 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; -import javax.validation.constraints.NotBlank; import java.util.ArrayList; import java.util.List; import java.util.Map; @@ -67,7 +65,8 @@ public class IssueExtractServiceImpl implements IssueExtractService { List listResult = issueService.selectIssueInfo(customerId, dateId); List result = new ArrayList<>(); if (CollectionUtils.isEmpty(listResult)){ - throw new RenException(ExtractConstant.ISSUE_INFO); + log.warn("issueExtractMain selectIssueInfo return empty,customerId:{},dateId:{}", customerId, dateId); + return true; } listResult.forEach(issue -> { IssueMainDailyFormDTO issueMainDailyFormDTO = ConvertUtils.sourceToTarget(issue, IssueMainDailyFormDTO.class); @@ -162,7 +161,8 @@ public class IssueExtractServiceImpl implements IssueExtractService { // 1. 查询议题process List listResult = issueService.selectIssueProcessInfo(customerId, dateId); if (CollectionUtils.isEmpty(listResult)){ - throw new RenException(ExtractConstant.ISSUE_PROCESS); + log.warn("issueExtractMain issueExtractLog return empty,customerId:{},dateId:{}", customerId, dateId); + return true; } listResult.forEach(issueProcess -> { IssueLogDailyFormDTO issueLogDailyFormDTO = ConvertUtils.sourceToTarget(issueProcess, IssueLogDailyFormDTO.class); @@ -226,6 +226,31 @@ public class IssueExtractServiceImpl implements IssueExtractService { return true; } + /** + * @Description 查询网格议题总数,网格人均议题数目 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/9/18 10:20 上午 + */ + @Override + public List selectIssueTotal(String customerId, String monthId) { + return issueMainDailyDao.selectIssueTotal(customerId, monthId); + } + + /** + * @Description 网格总项目数 + * @param customerId + * @param monthId + * @param status + * @author zxc + * @date 2020/9/18 1:21 下午 + */ + @Override + public List selectGridProjectCount(String customerId, String monthId, String status) { + return issueMainDailyDao.selectGridProjectCount(customerId, monthId, status); + } + /** * @Description 议题附表删除插入 * @param customerId @@ -240,4 +265,76 @@ public class IssueExtractServiceImpl implements IssueExtractService { issueLogDailyDao.insertIssueLogList(result); } + + + /** + * @param customerId + * @param monthId + * @return java.util.List> + * @author yinzuomei + * @description 党员提出的话题转议题数 + * @Date 2020/9/18 13:57 + **/ + @DataSource(DataSourceConstant.STATS) + @Override + public List> selectShiftIssueCount(String customerId, String monthId) { + //查询fact_origin_issue_main_daily 表,转议题的时间在评价周期内的,按发布话题的人分组 + /*含义:评价周期内,党员提出的话题转为议题的数目。 + 数据来源:议题表。 + 计算方法:从议题表中按照用户ID和党员标识统计。 + 对评价结果的影响:正向。*/ + return issueMainDailyDao.selectShiftIssueCount(customerId,monthId); + } + + /** + * @Description 查询网格 党员/群众 人均提出的议题转项目数 + * @param customerId + * @param monthId + * @param isParty + * @author zxc + * @date 2020/9/19 2:26 下午 + */ + @Override + public List selectShiftProjectCountPlus(String customerId, String monthId, Integer isParty) { + return issueMainDailyDao.selectShiftProjectCountPlus(customerId, monthId, isParty); + } + + /** + * @param userId 用户id + * @param customerId + * @param monthId + * @return java.lang.Integer + * @author yinzuomei + * @description 查询用户在这个月内表决的总次数 + * @Date 2020/9/20 21:50 + **/ + @Override + public Integer selectCountUserVote(String userId, String customerId, String monthId) { + return issueLogDailyDao.selectCountUserVote(userId,customerId,monthId); + } + + /** + * @param topicIdList + * @return java.lang.Integer + * @author yinzuomei + * @description 查询本周期和上周期内,自建群内话题转为议题的数量的总和 + * @Date 2020/9/20 22:48 + **/ + @Override + public Integer selectIssueTotalTwoMonth(List topicIdList) { + return issueMainDailyDao.selectIssueTotalTwoMonth(topicIdList); + } + + /** + * @Description 查询 议题表决【党员/群众】 + * @param customerId + * @param monthId + * @param isParty + * @author zxc + * @date 2020/9/21 9:37 上午 + */ + @Override + public List selectPartyActiveIssueVote(String customerId, String monthId, Integer isParty) { + return issueLogDailyDao.selectPartyActiveIssueVote(customerId, monthId, isParty); + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/ProjectExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/ProjectExtractServiceImpl.java index f6a262571a..26cb96daf1 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/ProjectExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/ProjectExtractServiceImpl.java @@ -1,18 +1,24 @@ package com.epmet.service.evaluationindex.extract.impl; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.commons.tools.utils.Result; +import com.epmet.dao.evaluationindex.extract.FactOriginProjectOrgPeriodDailyDao; import com.epmet.dto.ProjectDTO; import com.epmet.dto.extract.FactOriginProjectMainDailyDTO; +import com.epmet.dto.extract.form.ExtractFormDTO; import com.epmet.dto.form.WorkDayFormDTO; import com.epmet.dto.issue.IssueDTO; import com.epmet.dto.party.PartyMemberDTO; +import com.epmet.dto.project.FinishOrgDTO; import com.epmet.dto.project.ProcessInfoDTO; +import com.epmet.dto.project.result.ProjectOrgPeriodResultDTO; import com.epmet.dto.result.WorkDayResultDTO; import com.epmet.dto.topic.ResiTopicDTO; import com.epmet.entity.evaluationindex.extract.FactOriginProjectLogDailyEntity; import com.epmet.entity.evaluationindex.extract.FactOriginProjectMainDailyEntity; +import com.epmet.entity.evaluationindex.extract.FactOriginProjectOrgPeriodDailyEntity; import com.epmet.entity.project.ProjectProcessEntity; import com.epmet.feign.EpmetCommonServiceOpenFeignClient; import com.epmet.service.Issue.IssueService; @@ -24,12 +30,15 @@ import com.epmet.service.project.ProjectProcessService; import com.epmet.service.project.ProjectService; import com.epmet.service.topic.TopicService; import com.epmet.util.DimIdGenerator; +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.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Date; +import java.util.LinkedList; import java.util.List; import java.util.stream.Collectors; @@ -57,29 +66,42 @@ public class ProjectExtractServiceImpl implements ProjectExtractService { private ProjectProcessService projectProcessService; @Autowired private EpmetCommonServiceOpenFeignClient epmetCommonServiceOpenFeignClient; - + @Autowired + private FactOriginProjectOrgPeriodDailyDao factOriginProjectOrgPeriodDailyDao; @Override - public void saveOriginProjectDaily(String customerId, Date date) { - String dateString = null; - if (null != date) { - dateString = DateUtils.format(date); - } + public void saveOriginProjectDaily(ExtractFormDTO extractFormDTO) { + String dateString = extractFormDTO.getDateId(); + String customerId = extractFormDTO.getCustomerId(); //获取已关闭项目列表 List closedList = projectProcessService.getClosedProjectList(customerId, dateString); List pendingList = factOriginProjectMainDailyService.getPendingList(customerId); - List closeProjects = - pendingList.stream().flatMap(pending -> closedList.stream().filter(closed -> pending.getId().equals(closed.getProjectId())).map(process -> { - FactOriginProjectMainDailyEntity entity = new FactOriginProjectMainDailyEntity(); - entity.setId(process.getId()); - entity.setProjectStatus("close"); - entity.setCreatedTime(DateUtils.stringToDate(pending.getDateId(), DateUtils.DATE_PATTERN_YYYYMMDD)); - entity.setUpdatedTime(process.getUpdatedTime()); - return entity; - })).collect(Collectors.toList()); - //更新状态 - if (null != closeProjects && !closeProjects.isEmpty()) { - factOriginProjectMainDailyService.updateBatchById(closeProjects); + List finishOrgList= projectProcessService.getFinishOrg(customerId, dateString); + if (null != closedList && !closedList.isEmpty()) { + List closeProjects = + pendingList.stream().flatMap(pending -> closedList.stream().filter(closed -> pending.getId().equals(closed.getProjectId())).map(process -> { + FactOriginProjectMainDailyEntity entity = new FactOriginProjectMainDailyEntity(); + entity.setId(process.getId()); + entity.setProjectStatus("close"); + entity.setCreatedTime(DateUtils.stringToDate(pending.getDateId(), DateUtils.DATE_PATTERN_YYYYMMDD)); + entity.setUpdatedTime(process.getUpdatedTime()); + return entity; + })).collect(Collectors.toList()); + + if (null != finishOrgList && !finishOrgList.isEmpty()) { + closeProjects.forEach(close -> finishOrgList.stream().filter(finish -> close.getId().equals(finish.getProjectId())).forEach(dto -> { + String[] orgIds = dto.getPIdPath().split(":"); + if (orgIds.length > NumConstant.ONE) { + close.setFinishOrgIds(orgIds[orgIds.length - 1]); + } else { + close.setFinishOrgIds(orgIds[0]); + } + })); + } + //更新状态 + if (!closeProjects.isEmpty()) { + factOriginProjectMainDailyService.updateBatchById(closeProjects); + } } //获取项目信息 List projectList = projectService.getProjectInfo(customerId, dateString); @@ -132,8 +154,19 @@ public class ProjectExtractServiceImpl implements ProjectExtractService { list.forEach(entity -> partyMemberList.stream().filter(partyMemberDTO -> partyMemberDTO.getGridId().equals(entity.getGridId()) && partyMemberDTO.getUserId().equals(entity.getTopicCreatorId())).forEach(partyMember -> { entity.setIsParty(NumConstant.ONE_STR); })); + list.forEach(entity -> finishOrgList.stream().filter(finish -> entity.getId().equals(finish.getProjectId())).forEach(dto -> { + String[] orgIds = dto.getPIdPath().split(":"); + if (orgIds.length > NumConstant.ONE) { + entity.setFinishOrgIds(orgIds[orgIds.length - 1]); + } else { + entity.setFinishOrgIds(orgIds[0]); + } + })); //插入数据 - factOriginProjectMainDailyService.insertBatch(list); + if (!list.isEmpty()) { + factOriginProjectMainDailyService.deleteByDate(customerId, dateString); + factOriginProjectMainDailyService.insertBatch(list); + } } //节点发起人 @@ -157,9 +190,9 @@ public class ProjectExtractServiceImpl implements ProjectExtractService { return entity; }).collect(Collectors.toList()); - //节点接收人 - List processStaffList = projectProcessService.getProcessStaffByCustomer(customerId, dateString); - logList.addAll(processStaffList.stream().map(process -> { + //项目评论人 + List satisfactionRecordList = projectProcessService.getSatisfactionRecord(customerId, dateString); + logList.addAll(satisfactionRecordList.stream().map(process -> { //获取日期相关维度 DimIdGenerator.DimIdBean dimId = DimIdGenerator.getDimIdBean(process.getCreatedTime()); FactOriginProjectLogDailyEntity entity = new FactOriginProjectLogDailyEntity(); @@ -172,14 +205,19 @@ public class ProjectExtractServiceImpl implements ProjectExtractService { entity.setProjectId(process.getProjectId()); entity.setOperationUserId(process.getStaffId()); entity.setActionCode(process.getOperation()); - entity.setIsActive(NumConstant.ZERO); + entity.setIsActive(NumConstant.ONE); entity.setOrgType("grid"); return entity; }).collect(Collectors.toList())); - //项目评论人 - List satisfactionRecordList = projectProcessService.getSatisfactionRecord(customerId, dateString); - logList.addAll(satisfactionRecordList.stream().map(process -> { + List projectMainList = factOriginProjectMainDailyService.getProjectByCustomer(customerId); + logList.forEach(log -> projectMainList.stream().filter(project -> log.getProjectId().equals(project.getId())).forEach(main -> { + log.setOrgId(main.getGridId()); + })); + + //节点接收人 + List processStaffList = projectProcessService.getProcessStaffByCustomer(customerId, dateString); + logList.addAll(processStaffList.stream().map(process -> { //获取日期相关维度 DimIdGenerator.DimIdBean dimId = DimIdGenerator.getDimIdBean(process.getCreatedTime()); FactOriginProjectLogDailyEntity entity = new FactOriginProjectLogDailyEntity(); @@ -192,17 +230,88 @@ public class ProjectExtractServiceImpl implements ProjectExtractService { entity.setProjectId(process.getProjectId()); entity.setOperationUserId(process.getStaffId()); entity.setActionCode(process.getOperation()); - entity.setIsActive(NumConstant.ONE); - entity.setOrgType("grid"); + entity.setIsActive(NumConstant.ZERO); + if (StringUtils.isNotBlank(process.getDepartmentId())) { + entity.setOrgType("department"); + entity.setOrgId(process.getDepartmentId()); + } + if (StringUtils.isNotBlank(process.getGridId())) { + entity.setOrgType("grid"); + entity.setOrgId(process.getGridId()); + } return entity; }).collect(Collectors.toList())); - List projectMainList = factOriginProjectMainDailyService.getProjectByCustomer(customerId); - logList.forEach(log -> projectMainList.stream().filter(project -> log.getProjectId().equals(project.getId())).forEach(main -> { - log.setOrgId(main.getGridId()); - })); + if (!logList.isEmpty()) { + factOriginProjectLogDailyService.deleteByDate(customerId, dateString); + factOriginProjectLogDailyService.insertBatch(logList); + } + } + } - factOriginProjectLogDailyService.insertBatch(logList); + /** + * @Description 抽取项目节点历时逻辑 + * @param param + * @return + * @author wangc + * @date 2020.09.17 14:05 + **/ + @Override + public void extractProjectPeriodData(ExtractFormDTO param) { + int trace = factOriginProjectOrgPeriodDailyDao.selectIfExisted(param.getCustomerId()); + Boolean isFirst = trace <= NumConstant.ZERO ? true : false; + if(StringUtils.isBlank(param.getDateId())){ + Date yesterday = new Date(System.currentTimeMillis() - 1000 * 60 * 60 * 24); + SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); + param.setDateId(format.format(yesterday)); + } + List extractData = + projectProcessService.getProjectPeriod(isFirst,param.getCustomerId(),param.getDateId()); + List formattingData = new LinkedList<>(); + extractData.forEach(original -> { + FactOriginProjectOrgPeriodDailyEntity dest + = ConvertUtils.sourceToTarget(original,FactOriginProjectOrgPeriodDailyEntity.class); + if(StringUtils.isNotBlank(original.getDepartmentId())){ + dest.setOrgType("dept"); + dest.setPid(original.getOrgId()); + dest.setPids(original.getOrgIdPath()); + }else if(StringUtils.isNotBlank(original.getGridId())){ + dest.setOrgType("grid"); + dest.setPid(original.getOrgId()); + dest.setPids(original.getOrgIdPath()); + }else{ + dest.setOrgType("agency"); + dest.setPids(""); + String[] array = original.getOrgIdPath().split(":"); + if(null == array || array.length <= NumConstant.ZERO){ + dest.setPid(NumConstant.ZERO_STR); + } + if(array[NumConstant.ZERO] == original.getOrgId() && array.length == NumConstant.ONE){ + dest.setPid(NumConstant.ZERO_STR); + } + if(array.length > NumConstant.ONE && original.getOrgId() == array[array.length - NumConstant.ONE]){ + dest.setPid(array[array.length - NumConstant.TWO]); + dest.setPids(original.getOrgIdPath().replace(original.getOrgId(),"")); + } + if(StringUtils.isNotBlank(dest.getPids())){ + while(dest.getPids().endsWith(":")){ + dest.setPids(dest.getPids().substring(NumConstant.ZERO,dest.getPids().length() - NumConstant.ONE)); + } + while(dest.getPids().startsWith(":")){ + dest.setPids(dest.getPids().replaceFirst(":","")); + } + } + dest.setPids(dest.getPids().replaceAll(" ","")); + } + + formattingData.add(dest); + }); + if(!CollectionUtils.isEmpty(formattingData)) { + List projectIds = formattingData.stream().map(FactOriginProjectOrgPeriodDailyEntity::getProjectId).distinct().collect(Collectors.toList()); + if (!CollectionUtils.isEmpty(projectIds)) { + factOriginProjectOrgPeriodDailyDao.deleteByProjectId(projectIds); + factOriginProjectOrgPeriodDailyDao.insertBatch(formattingData); + } } } @@ -235,4 +344,6 @@ public class ProjectExtractServiceImpl implements ProjectExtractService { } return result; } + + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/ProjectPeriodExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/ProjectPeriodExtractServiceImpl.java new file mode 100644 index 0000000000..37f6237c88 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/ProjectPeriodExtractServiceImpl.java @@ -0,0 +1,104 @@ +package com.epmet.service.evaluationindex.extract.impl; + +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.dao.evaluationindex.extract.FactOriginProjectOrgPeriodDailyDao; +import com.epmet.dto.extract.form.ExtractFormDTO; +import com.epmet.dto.project.result.ProjectOrgPeriodResultDTO; +import com.epmet.entity.evaluationindex.extract.FactOriginProjectOrgPeriodDailyEntity; +import com.epmet.service.evaluationindex.extract.ProjectPeriodExtractService; +import com.epmet.service.project.ProjectProcessService; +import lombok.extern.slf4j.Slf4j; +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.text.SimpleDateFormat; +import java.util.Date; +import java.util.LinkedList; +import java.util.List; +import java.util.stream.Collectors; + +/** + * @Description 业务数据抽取 - 项目节点历时 + * @ClassName ProjectPeriodExtractServiceImpl + * @Auth wangc + * @Date 2020-09-17 13:52 + */ +@Service +@Slf4j +public class ProjectPeriodExtractServiceImpl implements ProjectPeriodExtractService { + + @Autowired + private FactOriginProjectOrgPeriodDailyDao factOriginProjectOrgPeriodDailyDao; + @Autowired + private ProjectProcessService projectProcessService; + + /** + * @Description 抽取项目节点历时逻辑 + * @param param + * @return + * @author wangc + * @date 2020.09.17 14:05 + **/ + @Override + public void extractProjectPeriodData(ExtractFormDTO param) { + int trace = factOriginProjectOrgPeriodDailyDao.selectIfExisted(param.getCustomerId()); + Boolean isFirst = trace <= NumConstant.ZERO ? true : false; + if(StringUtils.isBlank(param.getDateId())){ + Date yesterday = new Date(System.currentTimeMillis() - 1000 * 60 * 60 * 24); + SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); + param.setDateId(format.format(yesterday)); + } + List extractData = + projectProcessService.getProjectPeriod(isFirst,param.getCustomerId(),param.getDateId()); + List formattingData = new LinkedList<>(); + extractData.forEach(original -> { + FactOriginProjectOrgPeriodDailyEntity dest + = ConvertUtils.sourceToTarget(original,FactOriginProjectOrgPeriodDailyEntity.class); + if(StringUtils.isNotBlank(original.getDepartmentId())){ + dest.setOrgType("dept"); + dest.setPid(original.getOrgId()); + dest.setPids(original.getOrgIdPath()); + }else if(StringUtils.isNotBlank(original.getGridId())){ + dest.setOrgType("grid"); + dest.setPid(original.getOrgId()); + dest.setPids(original.getOrgIdPath()); + }else{ + dest.setOrgType("agency"); + dest.setPids(""); + String[] array = original.getOrgIdPath().split(":"); + if(null == array || array.length <= NumConstant.ZERO){ + dest.setPid(NumConstant.ZERO_STR); + } + if(array[NumConstant.ZERO] == original.getOrgId() && array.length == NumConstant.ONE){ + dest.setPid(NumConstant.ZERO_STR); + } + if(array.length > NumConstant.ONE && original.getOrgId() == array[array.length - NumConstant.ONE]){ + dest.setPid(array[array.length - NumConstant.TWO]); + dest.setPids(original.getOrgIdPath().replace(original.getOrgId(),"")); + } + if(StringUtils.isNotBlank(dest.getPids())){ + while(dest.getPids().endsWith(":")){ + dest.setPids(dest.getPids().substring(NumConstant.ZERO,dest.getPids().length() - NumConstant.ONE)); + } + while(dest.getPids().startsWith(":")){ + dest.setPids(dest.getPids().replaceFirst(":","")); + } + } + dest.setPids(dest.getPids().replaceAll(" ","")); + } + + formattingData.add(dest); + }); + if(!CollectionUtils.isEmpty(formattingData)) { + List projectIds = formattingData.stream().map(FactOriginProjectOrgPeriodDailyEntity::getProjectId).distinct().collect(Collectors.toList()); + if (!CollectionUtils.isEmpty(projectIds)) { + factOriginProjectOrgPeriodDailyDao.deleteByProjectId(projectIds); + factOriginProjectOrgPeriodDailyDao.insertBatch(formattingData); + } + } + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyService.java new file mode 100644 index 0000000000..c2e3b3a179 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyService.java @@ -0,0 +1,22 @@ +package com.epmet.service.evaluationindex.indexcoll; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityOrgMonthlyEntity; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/9/20 20:29 + */ +public interface FactIndexGovrnAblityOrgMonthlyService extends BaseService { + /** + * 根据客户清空数据 + * @author zhaoqifeng + * @date 2020/9/20 20:33 + * @param customerId + * @param monthId + * @param type + * @return void + */ + void deleteByCustomer(String customerId, String monthId, String type); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexPartyAblityOrgMonthlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexPartyAblityOrgMonthlyService.java new file mode 100644 index 0000000000..0227a835f8 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexPartyAblityOrgMonthlyService.java @@ -0,0 +1,22 @@ +package com.epmet.service.evaluationindex.indexcoll; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.evaluationindex.indexcoll.FactIndexPartyAblityOrgMonthlyEntity; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/9/20 23:00 + */ +public interface FactIndexPartyAblityOrgMonthlyService extends BaseService { + /** + * 根据客户清空数据 + * @author zhaoqifeng + * @date 2020/9/20 20:33 + * @param customerId + * @param monthId + * @param type + * @return void + */ + void deleteByCustomer(String customerId, String monthId, String type); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/IndexCollCommunityService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/IndexCollCommunityService.java new file mode 100644 index 0000000000..f69747ce74 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/IndexCollCommunityService.java @@ -0,0 +1,21 @@ +package com.epmet.service.evaluationindex.indexcoll; + +/** + * 社区相关统计 + * + * @author zhaoqifeng + * @date 2020/9/18 10:33 + */ +public interface IndexCollCommunityService { + /** + * 社区能力统计 + * + * @author zhaoqifeng + * @date 2020/9/18 13:52 + * @param customerId + * @param dateId + * @return void + */ + void saveCommunityAbility(String customerId, String dateId); + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/IndexCollDistrictDepartmentService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/IndexCollDistrictDepartmentService.java new file mode 100644 index 0000000000..8416ac208c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/IndexCollDistrictDepartmentService.java @@ -0,0 +1,10 @@ +package com.epmet.service.evaluationindex.indexcoll; + +/** + * 区直部门相关统计 + * + * @author zhaoqifeng + * @date 2020/9/18 10:43 + */ +public interface IndexCollDistrictDepartmentService { +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/IndexCollDistrictService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/IndexCollDistrictService.java new file mode 100644 index 0000000000..d6863f651e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/IndexCollDistrictService.java @@ -0,0 +1,10 @@ +package com.epmet.service.evaluationindex.indexcoll; + +/** + * 全区相关统计 + * + * @author zhaoqifeng + * @date 2020/9/18 10:44 + */ +public interface IndexCollDistrictService { +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/IndexCollStreetService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/IndexCollStreetService.java new file mode 100644 index 0000000000..a38bff296d --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/IndexCollStreetService.java @@ -0,0 +1,20 @@ +package com.epmet.service.evaluationindex.indexcoll; + +/** + * 街道相关统计 + * + * @author zhaoqifeng + * @date 2020/9/18 10:35 + */ +public interface IndexCollStreetService { + /** + * 街道治理能力统计 + * + * @author zhaoqifeng + * @date 2020/9/18 13:52 + * @param customerId + * @param dateId + * @return void + */ + void saveStreetAbility(String customerId, String dateId); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexGovrnAblityOrgMonthlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexGovrnAblityOrgMonthlyServiceImpl.java new file mode 100644 index 0000000000..a1665b836c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexGovrnAblityOrgMonthlyServiceImpl.java @@ -0,0 +1,23 @@ +package com.epmet.service.evaluationindex.indexcoll.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.evaluationindex.indexcoll.FactIndexGovrnAblityOrgMonthlyDao; +import com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityOrgMonthlyEntity; +import com.epmet.service.evaluationindex.indexcoll.FactIndexGovrnAblityOrgMonthlyService; +import org.springframework.stereotype.Service; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/9/20 20:29 + */ +@Service +@DataSource(DataSourceConstant.EVALUATION_INDEX) +public class FactIndexGovrnAblityOrgMonthlyServiceImpl extends BaseServiceImpl implements FactIndexGovrnAblityOrgMonthlyService { + @Override + public void deleteByCustomer(String customerId, String monthId, String type) { + baseDao.deleteByCustomer(customerId, monthId, type); + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexPartyAblityOrgMonthlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexPartyAblityOrgMonthlyServiceImpl.java new file mode 100644 index 0000000000..7964b2788b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexPartyAblityOrgMonthlyServiceImpl.java @@ -0,0 +1,23 @@ +package com.epmet.service.evaluationindex.indexcoll.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.evaluationindex.indexcoll.FactIndexPartyAblityOrgMonthlyDao; +import com.epmet.entity.evaluationindex.indexcoll.FactIndexPartyAblityOrgMonthlyEntity; +import com.epmet.service.evaluationindex.indexcoll.FactIndexPartyAblityOrgMonthlyService; +import org.springframework.stereotype.Service; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/9/20 23:01 + */ +@Service +@DataSource(DataSourceConstant.EVALUATION_INDEX) +public class FactIndexPartyAblityOrgMonthlyServiceImpl extends BaseServiceImpl implements FactIndexPartyAblityOrgMonthlyService { + @Override + public void deleteByCustomer(String customerId, String monthId, String type) { + baseDao.deleteByCustomer(customerId, monthId, type); + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/IndexCollCommunityServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/IndexCollCommunityServiceImpl.java new file mode 100644 index 0000000000..ad5ce2728f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/IndexCollCommunityServiceImpl.java @@ -0,0 +1,159 @@ +package com.epmet.service.evaluationindex.indexcoll.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.constant.OrgTypeConstant; +import com.epmet.dao.evaluationindex.extract.FactOriginProjectOrgPeriodDailyDao; +import com.epmet.dto.extract.result.OrgStatisticsResultDTO; +import com.epmet.dto.stats.DimAgencyDTO; +import com.epmet.dto.stats.FactArticlePublishedAgencyDailyDTO; +import com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityOrgMonthlyEntity; +import com.epmet.entity.evaluationindex.indexcoll.FactIndexPartyAblityOrgMonthlyEntity; +import com.epmet.service.evaluationindex.extract.FactOriginProjectLogDailyService; +import com.epmet.service.evaluationindex.extract.FactOriginProjectMainDailyService; +import com.epmet.service.evaluationindex.indexcoll.FactIndexGovrnAblityOrgMonthlyService; +import com.epmet.service.evaluationindex.indexcoll.FactIndexPartyAblityOrgMonthlyService; +import com.epmet.service.evaluationindex.indexcoll.IndexCollCommunityService; +import com.epmet.service.stats.DimAgencyService; +import com.epmet.service.stats.FactArticlePublishedAgencyDailyService; +import com.epmet.util.DimIdGenerator; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.util.Date; +import java.util.List; +import java.util.stream.Collectors; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/9/18 10:34 + */ +@Service +@Slf4j +@DataSource(DataSourceConstant.EVALUATION_INDEX) +public class IndexCollCommunityServiceImpl implements IndexCollCommunityService { + @Autowired + private DimAgencyService dimAgencyService; + @Autowired + private FactIndexGovrnAblityOrgMonthlyService factIndexGovrnAblityOrgMonthlyService; + @Autowired + private FactOriginProjectLogDailyService factOriginProjectLogDailyService; + @Autowired + private FactOriginProjectOrgPeriodDailyDao factOriginProjectOrgPeriodDailyDao; + @Autowired + private FactOriginProjectMainDailyService factOriginProjectMainDailyService; + @Autowired + private FactArticlePublishedAgencyDailyService factArticlePublishedAgencyDailyService; + @Autowired + private FactIndexPartyAblityOrgMonthlyService factIndexPartyAblityOrgMonthlyService; + + @Override + public void saveCommunityAbility(String customerId, String dateId) { + //当前日期前一天 + Date date = DateUtils.getBeforeDay(DateUtils.stringToDate(dateId, DateUtils.DATE_PATTERN_YYYYMMDD)); + //获取日期相关维度 + DimIdGenerator.DimIdBean dimId = DimIdGenerator.getDimIdBean(date); + //获取社区列表 + ListagencyList = dimAgencyService.getAgencyByLevel(customerId, OrgTypeConstant.COMMUNITY); + //社区数据初始化 + List list = agencyList.stream().map(agency ->{ + FactIndexGovrnAblityOrgMonthlyEntity entity = new FactIndexGovrnAblityOrgMonthlyEntity(); + entity.setCustomerId(customerId); + entity.setAgencyId(agency.getId()); + entity.setParentId(agency.getPid()); + entity.setYearId(dimId.getYearId()); + entity.setQuarterId(dimId.getQuarterId()); + entity.setMonthId(dimId.getMonthId()); + entity.setDataType(OrgTypeConstant.COMMUNITY); + entity.setTransferedCount(NumConstant.ZERO); + entity.setRespProjectRatio(new BigDecimal(NumConstant.ZERO)); + entity.setOverdueProjectRatio(new BigDecimal(NumConstant.ZERO)); + entity.setClosedProjectRatio(new BigDecimal(NumConstant.ZERO)); + entity.setSatisfactionRatio(new BigDecimal(NumConstant.ZERO)); + entity.setClosedProjectCount(NumConstant.ZERO); + entity.setHandleProjectRatio(new BigDecimal(NumConstant.ZERO)); + return entity; + }).collect(Collectors.toList()); + //1.治理能力 + //被吹哨次数统计 + List transferCount = factOriginProjectLogDailyService.getAgencyTransferCount(customerId, dimId.getMonthId(), + OrgTypeConstant.COMMUNITY); + if (null != transferCount && !transferCount.isEmpty()) { + list.forEach(entity -> transferCount.stream().filter(dto -> dto.getAgencyId().equals(entity.getAgencyId())).forEach(count -> { + entity.setTransferedCount(count.getCount()); + })); + } + + //社区项目响应度 + List responsiveness = factOriginProjectOrgPeriodDailyDao.selectResponsiveness(customerId, dimId.getMonthId(), + OrgTypeConstant.COMMUNITY, OrgTypeConstant.AGENCY); + if (null != responsiveness && !responsiveness.isEmpty()) { + list.forEach(entity -> responsiveness.stream().filter(dto -> dto.getAgencyId().equals(entity.getAgencyId())).forEach(response -> { + if (response.getCount() != NumConstant.ZERO) { + BigDecimal count = new BigDecimal(response.getCount()); + BigDecimal sum = new BigDecimal(response.getSum()); + entity.setRespProjectRatio(sum.divide(count, NumConstant.SIX, RoundingMode.HALF_UP)); + } + })); + } + + //社区超期项目率 + List overdueCount = factOriginProjectMainDailyService.getOverdueCount(customerId, dimId.getMonthId()); + if (null != overdueCount && !overdueCount.isEmpty()) { + list.forEach(entity -> overdueCount.stream().filter(dto -> dto.getAgencyId().equals(entity.getAgencyId())).forEach(overdue -> { + if (overdue.getSum() != NumConstant.ZERO) { + BigDecimal count = new BigDecimal(overdue.getCount()); + BigDecimal sum = new BigDecimal(overdue.getSum()); + entity.setOverdueProjectRatio(count.divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + } + })); + } + + //社区办结项目满意度 + List satisfaction = factOriginProjectLogDailyService.getSatisfaction(customerId, dimId.getMonthId(), OrgTypeConstant.COMMUNITY); + if (null != satisfaction && !satisfaction.isEmpty()) { + list.forEach(entity -> satisfaction.stream().filter(dto -> dto.getAgencyId().equals(entity.getAgencyId())).forEach(sa -> { + if (sa.getCount() != NumConstant.ZERO) { + BigDecimal count = new BigDecimal(sa.getCount()); + BigDecimal sum = new BigDecimal(sa.getSum()); + entity.setOverdueProjectRatio(sum.divide(count, NumConstant.SIX, RoundingMode.HALF_UP)); + } + })); + } + + factIndexGovrnAblityOrgMonthlyService.deleteByCustomer(customerId, dimId.getMonthId(), OrgTypeConstant.COMMUNITY); + factIndexGovrnAblityOrgMonthlyService.insertBatch(list); + + //2.党建能力 + //获取社区发文数量 + List articles = factArticlePublishedAgencyDailyService.getArticleCount(customerId, dimId.getMonthId(), + OrgTypeConstant.COMMUNITY); + + List partyList = agencyList.stream().map(agency ->{ + FactIndexPartyAblityOrgMonthlyEntity entity = new FactIndexPartyAblityOrgMonthlyEntity(); + entity.setCustomerId(customerId); + entity.setAgencyId(agency.getId()); + entity.setParentId(agency.getPid()); + entity.setYearId(dimId.getYearId()); + entity.setQuarterId(dimId.getQuarterId()); + entity.setMonthId(dimId.getMonthId()); + entity.setDataType(OrgTypeConstant.COMMUNITY); + entity.setPublishArticleCount(NumConstant.ZERO); + return entity; + }).collect(Collectors.toList()); + if (null != articles && !articles.isEmpty()) { + partyList.forEach(entity -> articles.stream().filter(article -> entity.getAgencyId().equals(article.getAgencyId())).forEach(dto -> { + entity.setPublishArticleCount(dto.getArticleTotalCount()); + })); + } + factIndexPartyAblityOrgMonthlyService.deleteByCustomer(customerId, dimId.getMonthId(), OrgTypeConstant.COMMUNITY); + factIndexPartyAblityOrgMonthlyService.insertBatch(partyList); + } + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/IndexCollDistrictDepartmentServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/IndexCollDistrictDepartmentServiceImpl.java new file mode 100644 index 0000000000..c5f62d4072 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/IndexCollDistrictDepartmentServiceImpl.java @@ -0,0 +1,18 @@ +package com.epmet.service.evaluationindex.indexcoll.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.constant.DataSourceConstant; +import com.epmet.service.evaluationindex.indexcoll.IndexCollDistrictDepartmentService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/9/18 10:43 + */ +@Service +@Slf4j +@DataSource(DataSourceConstant.EVALUATION_INDEX) +public class IndexCollDistrictDepartmentServiceImpl implements IndexCollDistrictDepartmentService { +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/IndexCollDistrictServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/IndexCollDistrictServiceImpl.java new file mode 100644 index 0000000000..64d47690b6 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/IndexCollDistrictServiceImpl.java @@ -0,0 +1,18 @@ +package com.epmet.service.evaluationindex.indexcoll.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.constant.DataSourceConstant; +import com.epmet.service.evaluationindex.indexcoll.IndexCollDistrictService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/9/18 10:45 + */ +@Service +@Slf4j +@DataSource(DataSourceConstant.EVALUATION_INDEX) +public class IndexCollDistrictServiceImpl implements IndexCollDistrictService { +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/IndexCollStreetServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/IndexCollStreetServiceImpl.java new file mode 100644 index 0000000000..00f4d71ce6 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/IndexCollStreetServiceImpl.java @@ -0,0 +1,164 @@ +package com.epmet.service.evaluationindex.indexcoll.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.constant.OrgTypeConstant; +import com.epmet.dao.evaluationindex.extract.FactOriginProjectOrgPeriodDailyDao; +import com.epmet.dto.extract.result.OrgStatisticsResultDTO; +import com.epmet.dto.stats.DimAgencyDTO; +import com.epmet.dto.stats.FactArticlePublishedAgencyDailyDTO; +import com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityOrgMonthlyEntity; +import com.epmet.entity.evaluationindex.indexcoll.FactIndexPartyAblityOrgMonthlyEntity; +import com.epmet.service.evaluationindex.extract.FactOriginProjectLogDailyService; +import com.epmet.service.evaluationindex.extract.FactOriginProjectMainDailyService; +import com.epmet.service.evaluationindex.indexcoll.FactIndexGovrnAblityOrgMonthlyService; +import com.epmet.service.evaluationindex.indexcoll.FactIndexPartyAblityOrgMonthlyService; +import com.epmet.service.evaluationindex.indexcoll.IndexCollStreetService; +import com.epmet.service.stats.DimAgencyService; +import com.epmet.service.stats.FactArticlePublishedAgencyDailyService; +import com.epmet.util.DimIdGenerator; +import io.swagger.models.auth.In; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.util.Date; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/9/18 10:35 + */ +@Service +@Slf4j +@DataSource(DataSourceConstant.EVALUATION_INDEX) +public class IndexCollStreetServiceImpl implements IndexCollStreetService { + @Autowired + private DimAgencyService dimAgencyService; + @Autowired + private FactIndexGovrnAblityOrgMonthlyService factIndexGovrnAblityOrgMonthlyService; + @Autowired + private FactOriginProjectLogDailyService factOriginProjectLogDailyService; + @Autowired + private FactOriginProjectOrgPeriodDailyDao factOriginProjectOrgPeriodDailyDao; + @Autowired + private FactOriginProjectMainDailyService factOriginProjectMainDailyService; + @Autowired + private FactArticlePublishedAgencyDailyService factArticlePublishedAgencyDailyService; + @Autowired + private FactIndexPartyAblityOrgMonthlyService factIndexPartyAblityOrgMonthlyService; + + @Override + public void saveStreetAbility(String customerId, String dateId) { + //当前日期前一天 + Date date = DateUtils.getBeforeDay(DateUtils.stringToDate(dateId, DateUtils.DATE_PATTERN_YYYYMMDD)); + //获取日期相关维度 + DimIdGenerator.DimIdBean dimId = DimIdGenerator.getDimIdBean(date); + //获取社区列表 + ListagencyList = dimAgencyService.getAgencyByLevel(customerId, OrgTypeConstant.STREET); + //社区数据初始化 + List list = agencyList.stream().map(agency ->{ + FactIndexGovrnAblityOrgMonthlyEntity entity = new FactIndexGovrnAblityOrgMonthlyEntity(); + entity.setCustomerId(customerId); + entity.setAgencyId(agency.getId()); + entity.setParentId(agency.getPid()); + entity.setYearId(dimId.getYearId()); + entity.setQuarterId(dimId.getQuarterId()); + entity.setMonthId(dimId.getMonthId()); + entity.setDataType(OrgTypeConstant.STREET); + entity.setTransferedCount(NumConstant.ZERO); + //办结项目数 + entity.setClosedProjectCount(NumConstant.ZERO); + //项目响应度 + entity.setRespProjectRatio(new BigDecimal(NumConstant.ZERO)); + entity.setOverdueProjectRatio(new BigDecimal(NumConstant.ZERO)); + //办结项目率 + entity.setClosedProjectRatio(new BigDecimal(NumConstant.ZERO)); + entity.setSatisfactionRatio(new BigDecimal(NumConstant.ZERO)); + entity.setHandleProjectRatio(new BigDecimal(NumConstant.ZERO)); + return entity; + }).collect(Collectors.toList()); + + //被吹哨次数统计 + List transferCount = factOriginProjectLogDailyService.getAgencyTransferCount(customerId, dimId.getMonthId(), + OrgTypeConstant.STREET); + if (null != transferCount && !transferCount.isEmpty()) { + list.forEach(entity -> transferCount.stream().filter(dto -> dto.getAgencyId().equals(entity.getAgencyId())).forEach(count -> { + entity.setTransferedCount(count.getCount()); + })); + } + + //社区项目响应度 + List responsiveness = factOriginProjectOrgPeriodDailyDao.selectResponsiveness(customerId, dimId.getMonthId(), + OrgTypeConstant.STREET, OrgTypeConstant.AGENCY); + if (null != responsiveness && !responsiveness.isEmpty()) { + list.forEach(entity -> responsiveness.stream().filter(dto -> dto.getAgencyId().equals(entity.getAgencyId())).forEach(response -> { + if (response.getCount() != NumConstant.ZERO) { + BigDecimal count = new BigDecimal(response.getCount()); + BigDecimal sum = new BigDecimal(response.getSum()); + entity.setRespProjectRatio(sum.divide(count, NumConstant.SIX, RoundingMode.HALF_UP)); + } + })); + } + + //社区办结项目满意度 + List satisfaction = factOriginProjectLogDailyService.getSatisfaction(customerId, dimId.getMonthId(), OrgTypeConstant.STREET); + if (null != satisfaction && !satisfaction.isEmpty()) { + list.forEach(entity -> satisfaction.stream().filter(dto -> dto.getAgencyId().equals(entity.getAgencyId())).forEach(sa -> { + if (sa.getCount() != NumConstant.ZERO) { + BigDecimal count = new BigDecimal(sa.getCount()); + BigDecimal sum = new BigDecimal(sa.getSum()); + entity.setOverdueProjectRatio(sum.divide(count, NumConstant.SIX, RoundingMode.HALF_UP)); + } + })); + } + //办结数 + Map agencyHandleCount = factOriginProjectLogDailyService.getProjectHandledAgency(customerId,dimId.getMonthId(),"month"); + Map responseMap = factOriginProjectLogDailyService.getAgencyResponseRatio(customerId,dimId.getMonthId(),"month"); + list.forEach(entity ->{ + entity.setClosedProjectCount(agencyHandleCount.get(entity.getAgencyId())); + BigDecimal element = entity.getClosedProjectRatio(); + //办结率 + entity.setClosedProjectRatio( + element.divide(new BigDecimal(entity.getTransferedCount()), NumConstant.SIX, RoundingMode.HALF_UP) + ); + //响应度 + entity.setRespProjectRatio(responseMap.get(entity.getAgencyId())); + }); + + factIndexGovrnAblityOrgMonthlyService.deleteByCustomer(customerId, dimId.getMonthId(), OrgTypeConstant.STREET); + factIndexGovrnAblityOrgMonthlyService.insertBatch(list); + + + //2.党建能力 + //获取社区发文数量 + List articles = factArticlePublishedAgencyDailyService.getArticleCount(customerId, dimId.getMonthId(), + OrgTypeConstant.STREET); + List partyList = agencyList.stream().map(agency ->{ + FactIndexPartyAblityOrgMonthlyEntity entity = new FactIndexPartyAblityOrgMonthlyEntity(); + entity.setCustomerId(customerId); + entity.setAgencyId(agency.getId()); + entity.setParentId(agency.getPid()); + entity.setYearId(dimId.getYearId()); + entity.setQuarterId(dimId.getQuarterId()); + entity.setMonthId(dimId.getMonthId()); + entity.setDataType(OrgTypeConstant.COMMUNITY); + entity.setPublishArticleCount(NumConstant.ZERO); + return entity; + }).collect(Collectors.toList()); + if (null != articles && !articles.isEmpty()) { + partyList.forEach(entity -> articles.stream().filter(article -> entity.getAgencyId().equals(article.getAgencyId())).forEach(dto -> { + entity.setPublishArticleCount(dto.getArticleTotalCount()); + })); + } + factIndexPartyAblityOrgMonthlyService.deleteByCustomer(customerId, dimId.getMonthId(), OrgTypeConstant.STREET); + factIndexPartyAblityOrgMonthlyService.insertBatch(partyList); + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/GroupDataService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/GroupDataService.java index 82588801a7..38e291d420 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/GroupDataService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/GroupDataService.java @@ -1,5 +1,6 @@ package com.epmet.service.group; +import com.epmet.dto.extract.FactOriginGroupMainDailyDTO; import com.epmet.dto.group.result.*; import com.epmet.util.DimIdGenerator; import org.apache.ibatis.annotations.Param; @@ -55,4 +56,14 @@ public interface GroupDataService { */ List getAgencyGrid(@Param("gridIds") List gridIds); + /** + * @Description 业务抽取 - 小组数据 + * @param isFirst + * @param customerId + * @return + * @author wangc + * @date 2020.09.18 22:52 + **/ + List extractGroupData(Boolean isFirst,String customerId,String dateId); + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/impl/GroupDataServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/impl/GroupDataServiceImpl.java index 2b37f81ed6..b7875982d5 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/impl/GroupDataServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/impl/GroupDataServiceImpl.java @@ -4,6 +4,7 @@ import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.constant.DataSourceConstant; import com.epmet.dao.group.GroupDataDao; +import com.epmet.dto.extract.FactOriginGroupMainDailyDTO; import com.epmet.dto.group.form.GridGroupPeopleFormDTO; import com.epmet.dto.group.form.GridGroupPeopleTotalFormDTO; import com.epmet.dto.group.form.GridGroupTotalFormDTO; @@ -12,9 +13,12 @@ import com.epmet.dto.group.result.*; import com.epmet.entity.stats.DimGridEntity; import com.epmet.service.group.GroupDataService; import com.epmet.util.DimIdGenerator; +import org.apache.commons.lang3.StringUtils; +import org.apache.poi.util.StringUtil; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; import java.util.*; import java.util.stream.Collectors; @@ -193,4 +197,18 @@ public class GroupDataServiceImpl implements GroupDataService { } + /** + * @Description 业务抽取 - 小组数据 + * * @param isFirst + * @param customerId + * @return + * @author wangc + * @date 2020.09.18 22:52 + **/ + @Override + public List extractGroupData(Boolean isFirst ,String customerId,String dateId) { + return groupDataDao.groupExtracting(customerId,isFirst?null:dateId); + } + + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectProcessService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectProcessService.java index c60ff6c8cc..b6b0f70269 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectProcessService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectProcessService.java @@ -18,7 +18,9 @@ package com.epmet.service.project; import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.dto.project.FinishOrgDTO; import com.epmet.dto.project.ProcessInfoDTO; +import com.epmet.dto.project.result.ProjectOrgPeriodResultDTO; import com.epmet.entity.project.ProjectEntity; import com.epmet.entity.project.ProjectProcessEntity; @@ -78,4 +80,25 @@ public interface ProjectProcessService extends BaseService * @return java.util.List */ List getClosedProjectList(String customerId, String date); + + /** + * @Description 查询各机关项目节点历时 + * @param isFirst 是否首次 + * @param customerId + * @param date + * @return + * @author wangc + * @date 2020.09.18 13:38 + **/ + List getProjectPeriod(Boolean isFirst,String customerId,String date); + + /** + * 获取办结组织 + * @author zhaoqifeng + * @date 2020/9/20 21:11 + * @param customerId + * @param date + * @return java.util.List + */ + List getFinishOrg(String customerId, String date); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectProcessServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectProcessServiceImpl.java index 8bfa1c998c..c29bf789a5 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectProcessServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectProcessServiceImpl.java @@ -19,15 +19,24 @@ package com.epmet.service.project.impl; 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.constant.DataSourceConstant; import com.epmet.dao.project.ProjectProcessDao; +import com.epmet.dto.form.CommonStaffIdFormDTO; +import com.epmet.dto.project.FinishOrgDTO; import com.epmet.dto.project.ProcessInfoDTO; +import com.epmet.dto.project.result.ProjectOrgPeriodResultDTO; +import com.epmet.dto.project.result.ProjectOrgRelationWhenResponseResultDTO; import com.epmet.entity.project.ProjectEntity; import com.epmet.entity.project.ProjectProcessEntity; import com.epmet.service.project.ProjectProcessService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; -import java.util.List; +import java.util.*; +import java.util.stream.Collectors; /** * 项目处理进展表 @@ -35,6 +44,7 @@ import java.util.List; * @author generator generator@elink-cn.com * @since v1.0.0 2020-05-11 */ +@Slf4j @Service @DataSource(DataSourceConstant.GOV_PROJECT) public class ProjectProcessServiceImpl extends BaseServiceImpl implements ProjectProcessService { @@ -68,4 +78,109 @@ public class ProjectProcessServiceImpl extends BaseServiceImpl getClosedProjectList(String customerId, String date) { return baseDao.selectClosedProjectList(customerId, date); } + + /** + * @Description 查询各机关项目节点历时 + * @param isFirst 是否首次 + * @param customerId + * @param date + * @return + * @author wangc + * @date 2020.09.18 13:38 + **/ + @Override + public List getProjectPeriod(Boolean isFirst,String customerId, String date) { + List projectNodePeriodPerOrgList; + if(isFirst){ + projectNodePeriodPerOrgList = baseDao.selectProjectOrgPeriod(customerId,null,null); + }else{ + projectNodePeriodPerOrgList = baseDao.selectProjectOrgPeriod(customerId,null,date); + } + + if(!CollectionUtils.isEmpty(projectNodePeriodPerOrgList)){ + + Map> processMap + = projectNodePeriodPerOrgList.stream().collect(Collectors.groupingBy(ProjectOrgPeriodResultDTO :: getProcessId)); + + List projects = + projectNodePeriodPerOrgList.stream().map(ProjectOrgPeriodResultDTO::getProjectId).distinct().collect(Collectors.toList()); + if(!projects.isEmpty()){ + List responseList = baseDao.selectResponseTrace(projects); + Map> sorted = + responseList.stream().collect(Collectors.groupingBy(ProjectOrgRelationWhenResponseResultDTO::getProjectId)); + skipLevelGrouping(processMap,sorted); + List result = new LinkedList<>(); + processMap.values().forEach(list -> {list.forEach(obj -> {result.add(obj);});}); + return result; + } + } + + return new ArrayList<>(); + } + + @Override + public List getFinishOrg(String customerId, String date) { + return baseDao.selectFinishOrg(customerId, date); + } + + /** + * @Description 跨级分组 eg -> transfer ; response response transfer ; return ; response close. + * @param dest - Map> 需要填充的数据 + * @param fillFactor - Map> 填充因子 + * @return + * @author wangc + * @date 2020.09.18 15:27 + **/ + private void skipLevelGrouping(Map> dest,Map> fillFactor){ + for(String projectId : fillFactor.keySet()){ + List projectTraceUnit = fillFactor.get(projectId); + if(!projectTraceUnit.isEmpty()){ + Map> staffResponseTrace = + projectTraceUnit.stream().collect(Collectors.groupingBy(ProjectOrgRelationWhenResponseResultDTO::getStaffId)); + if(!CollectionUtils.isEmpty(staffResponseTrace)){ + staffResponseTrace.keySet().forEach( staffId -> { + + if(!CollectionUtils.isEmpty(staffResponseTrace.get(staffId))){ + List staffResponseTraceUnit + = staffResponseTrace.get(staffId); + int lastEndCount = NumConstant.ONE_NEG; + for(int index = NumConstant.ZERO; index < staffResponseTraceUnit.size(); index ++){ + + if(StringUtils.equalsAny(staffResponseTraceUnit.get(index).getOperation(), + "transfer","return","close")){ + + replaceFirstResponseDate(dest,index,staffResponseTraceUnit,true); + + lastEndCount = index; + }else{ + if(lastEndCount == NumConstant.ONE_NEG) continue; + + if(index - NumConstant.ONE == lastEndCount){ + replaceFirstResponseDate(dest,index,staffResponseTraceUnit,false); + }else{continue;} + } + } + } + }); + } + + } + } + } + + private void replaceFirstResponseDate(Map> dest, int index, List staffResponseTraceUnit, boolean ifResponsed){ + List processSingleList = + dest.get(staffResponseTraceUnit.get(index).getProcessId()); + if(!CollectionUtils.isEmpty(processSingleList)){ + //ProjectOrgPeriodResultDTO element = processSingleList.get(NumConstant.ZERO); + ProjectOrgPeriodResultDTO element = processSingleList.stream().filter(node -> + StringUtils.equals(node.getStaffId(),staffResponseTraceUnit.get(index).getStaffId())).findFirst().get(); + if(!ifResponsed && null == element.getHandledDate()){ + log.warn("com.epmet.service.project.impl.ProjectProcessServiceImpl.skipLevelGrouping::已流出节点没有办结日期,节点ID{}",element.getProcessId() ); + } + element.setPeriodTillReplyFirstly(ifResponsed ? staffResponseTraceUnit.get(index).getCreatedTime() :element.getHandledDate()); + } + } + + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimAgencyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimAgencyService.java index aad2cae314..e22b42c609 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimAgencyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimAgencyService.java @@ -25,6 +25,7 @@ import com.epmet.dto.stats.DimAgencyDTO; import com.epmet.entity.org.CustomerAgencyEntity; import com.epmet.entity.stats.DimAgencyEntity; +import javax.xml.soap.SAAJResult; import java.util.Date; import java.util.List; import java.util.Map; @@ -176,4 +177,14 @@ public interface DimAgencyService extends BaseService { DimAgencyEntity getLatestCreatedAgencyDimEntity(); DimAgencyEntity getLatestUpdatedAgencyDimEntity(); + + /** + * 根据级别获取组织信息 + * @author zhaoqifeng + * @date 2020/9/20 17:29 + * @param customerId + * @param level + * @return java.util.List + */ + List getAgencyByLevel(String customerId, String level); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimCustomerPartymemberService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimCustomerPartymemberService.java index 267eca8c73..137aebedbe 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimCustomerPartymemberService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimCustomerPartymemberService.java @@ -21,6 +21,7 @@ import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; import com.epmet.dto.stats.DimCustomerPartymemberDTO; import com.epmet.dto.stats.form.CustomerIdAndDateIdFormDTO; +import com.epmet.entity.evaluationindex.indexcoll.FactIndexPartyAblityCpcMonthlyEntity; import com.epmet.entity.stats.DimCustomerPartymemberEntity; import java.util.List; @@ -101,4 +102,13 @@ public interface DimCustomerPartymemberService extends BaseService + * @param customerId 客户id + * @author yinzuomei + * @description 查询客户下所有的党员, 构造好党员相关-党建能力初始值 + * @Date 2020/9/18 9:03 + **/ + List selectPartyMemberList(String customerId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimGridService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimGridService.java index 399781d3d3..f98f0dd75a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimGridService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimGridService.java @@ -23,6 +23,7 @@ import com.epmet.dto.group.AgencyDTO; import com.epmet.dto.group.result.AgencyGridInfoResultDTO; import com.epmet.dto.group.result.SubAgencyIdResultDTO; import com.epmet.dto.stats.DimGridDTO; +import com.epmet.dto.stats.result.GridAttributesResultDTO; import com.epmet.dto.stats.result.GridBelongAgencyResultDTO; import com.epmet.entity.stats.DimGridEntity; import com.epmet.entity.stats.LastExecRecordEntity; @@ -138,4 +139,13 @@ public interface DimGridService extends BaseService { * @date 2020/9/17 2:34 下午 */ List selectGridBelongAgencyInfo(List gridIds); + + /** + * @Description 查询网格的所有所属上级属性 + * @param gridIds + * @return + * @author wangc + * @date 2020.09.20 13:01 + **/ + List getGridAttributes(String customerId,List gridIds); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactArticlePublishedAgencyDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactArticlePublishedAgencyDailyService.java index dc9d7e3d63..5838685418 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactArticlePublishedAgencyDailyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactArticlePublishedAgencyDailyService.java @@ -18,9 +18,11 @@ package com.epmet.service.stats; import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.dto.stats.FactArticlePublishedAgencyDailyDTO; import com.epmet.entity.stats.FactArticlePublishedAgencyDailyEntity; import java.util.Collection; +import java.util.List; /** * 文章发布数量【机关】日统计表 @@ -42,4 +44,15 @@ public interface FactArticlePublishedAgencyDailyService extends BaseService values); + /** + * 获取组织文章数量 + * @author zhaoqifeng + * @date 2020/9/20 22:49 + * @param customerId + * @param monthId + * @param level + * @return java.util.List + */ + List getArticleCount(String customerId, String monthId, String level); + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactArticlePublishedGridDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactArticlePublishedGridDailyService.java index d19038fa4e..f0b212f125 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactArticlePublishedGridDailyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactArticlePublishedGridDailyService.java @@ -18,6 +18,7 @@ package com.epmet.service.stats; import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.dto.extract.result.PublishCountResultDTO; import com.epmet.entity.stats.FactArticlePublishedAgencyDailyEntity; import com.epmet.entity.stats.FactArticlePublishedGridDailyEntity; @@ -55,5 +56,12 @@ public interface FactArticlePublishedGridDailyService extends BaseService values); - + /** + * @Description 查询网格下的文章发文数量 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/9/19 2:44 下午 + */ + List selectArticlePublishCount(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/stats/impl/DimAgencyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimAgencyServiceImpl.java index ee4c56db29..f0f530fa4f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimAgencyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimAgencyServiceImpl.java @@ -276,4 +276,9 @@ public class DimAgencyServiceImpl extends BaseServiceImpl getAgencyByLevel(String customerId, String level) { + return baseDao.selectDimAgencyByLevel(customerId, level); + } + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimCustomerPartymemberServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimCustomerPartymemberServiceImpl.java index e04247c46d..689592e636 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimCustomerPartymemberServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimCustomerPartymemberServiceImpl.java @@ -19,6 +19,7 @@ package com.epmet.service.stats.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.dto.form.TimeListResultDTO; import com.epmet.commons.tools.exception.RenException; @@ -26,12 +27,14 @@ import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.constant.DataSourceConstant; import com.epmet.constant.StatsConstant; import com.epmet.dao.stats.DimCustomerPartymemberDao; import com.epmet.dto.stats.DimCustomerPartymemberDTO; import com.epmet.dto.stats.form.CustomerIdAndDateIdFormDTO; import com.epmet.dto.stats.form.DimCustomerPartyMemberFormDTO; import com.epmet.dto.stats.result.GridBelongAgencyResultDTO; +import com.epmet.entity.evaluationindex.indexcoll.FactIndexPartyAblityCpcMonthlyEntity; import com.epmet.entity.stats.DimCustomerPartymemberEntity; import com.epmet.service.partymember.PartyMemberService; import com.epmet.service.stats.DimCustomerPartymemberService; @@ -138,7 +141,7 @@ public class DimCustomerPartymemberServiceImpl extends BaseServiceImpl partyMemberList = partyMemberService.selectPartyMemberInfo(customerId, dateId); if (CollectionUtils.isEmpty(partyMemberList)){ - log.error(String.format(StatsConstant.PARTY_INFO_LIST,customerId)); + log.warn(String.format(StatsConstant.PARTY_INFO_LIST,customerId)); return; } List gridIds = partyMemberList.stream().map(party -> party.getGridId()).distinct().collect(Collectors.toList()); @@ -158,6 +161,19 @@ public class DimCustomerPartymemberServiceImpl extends BaseServiceImpl + * @author yinzuomei + * @description 查询客户下所有的党员, 构造好党员相关-党建能力初始值 + * @Date 2020/9/18 9:03 + **/ + @DataSource(value = DataSourceConstant.STATS) + @Override + public List selectPartyMemberList(String customerId) { + return baseDao.selectPartyMemberList(customerId); + } + /** * @Description 删除旧纪录,插入新纪录 * @param partyMemberList diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimGridServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimGridServiceImpl.java index f7cec14b13..5062b8e94f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimGridServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimGridServiceImpl.java @@ -34,6 +34,7 @@ import com.epmet.dto.group.AgencyDTO; import com.epmet.dto.group.result.AgencyGridInfoResultDTO; import com.epmet.dto.group.result.SubAgencyIdResultDTO; import com.epmet.dto.stats.DimGridDTO; +import com.epmet.dto.stats.result.GridAttributesResultDTO; import com.epmet.dto.stats.result.GridBelongAgencyResultDTO; import com.epmet.entity.stats.DimGridEntity; import com.epmet.service.stats.DimGridService; @@ -41,11 +42,9 @@ 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.Date; -import java.util.List; -import java.util.Map; +import java.util.*; /** * 客户网格维度 @@ -177,4 +176,17 @@ public class DimGridServiceImpl extends BaseServiceImpl selectGridBelongAgencyInfo(List gridIds) { return baseDao.selectGridBelongAgencyInfo(gridIds); } + + /** + * @Description 查询网格的所有所属上级属性 + * @param gridIds + * @return + * @author wangc + * @date 2020.09.20 13:01 + **/ + @Override + public List getGridAttributes(String customerId,List gridIds) { + if(CollectionUtils.isEmpty(gridIds)) return Collections.EMPTY_LIST; + return baseDao.selectGridAttributes(customerId,gridIds); + } } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactArticlePublishedAgencyDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactArticlePublishedAgencyDailyServiceImpl.java index c12d4b176f..a411475a62 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactArticlePublishedAgencyDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactArticlePublishedAgencyDailyServiceImpl.java @@ -22,6 +22,7 @@ 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.stats.FactArticlePublishedAgencyDailyDao; +import com.epmet.dto.stats.FactArticlePublishedAgencyDailyDTO; import com.epmet.entity.stats.FactArticlePublishedAgencyDailyEntity; import com.epmet.service.stats.FactArticlePublishedAgencyDailyService; import lombok.extern.slf4j.Slf4j; @@ -30,6 +31,7 @@ import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; import java.util.Collection; +import java.util.List; /** * 文章发布数量【机关】日统计表 @@ -55,4 +57,11 @@ public class FactArticlePublishedAgencyDailyServiceImpl extends BaseServiceImpl< this.insertBatch(values, 100); return true; } + + @Override + public List getArticleCount(String customerId, String monthId, String level) { + return baseDao.selectArticleCount(customerId, monthId, level); + } + + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactArticlePublishedGridDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactArticlePublishedGridDailyServiceImpl.java index 9ad55d632f..2b2b77edce 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactArticlePublishedGridDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactArticlePublishedGridDailyServiceImpl.java @@ -23,6 +23,7 @@ import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; import com.epmet.constant.DataSourceConstant; import com.epmet.dao.stats.FactArticlePublishedGridDailyDao; +import com.epmet.dto.extract.result.PublishCountResultDTO; import com.epmet.entity.stats.FactArticlePublishedAgencyDailyEntity; import com.epmet.entity.stats.FactArticlePublishedGridDailyEntity; import com.epmet.service.stats.FactArticlePublishedGridDailyService; @@ -67,4 +68,16 @@ public class FactArticlePublishedGridDailyServiceImpl extends BaseServiceImpl selectArticlePublishCount(String customerId, String monthId) { + return baseDao.selectArticlePublishCount(customerId, monthId); + } } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/FactRegUserGridMonthlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/FactRegUserGridMonthlyService.java index 11c7dd2e12..860d383906 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/FactRegUserGridMonthlyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/FactRegUserGridMonthlyService.java @@ -19,6 +19,7 @@ package com.epmet.service.stats.user; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.extract.result.GridUserCountResultDTO; import com.epmet.dto.stats.user.FactRegUserGridMonthlyDTO; import com.epmet.entity.stats.user.FactRegUserGridMonthlyEntity; @@ -93,4 +94,13 @@ public interface FactRegUserGridMonthlyService extends BaseService selectGridUserCount(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/stats/user/impl/FactRegUserGridMonthlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/impl/FactRegUserGridMonthlyServiceImpl.java index 2054ea5909..8016f7f613 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/impl/FactRegUserGridMonthlyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/impl/FactRegUserGridMonthlyServiceImpl.java @@ -24,6 +24,7 @@ import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.dao.stats.user.FactRegUserGridMonthlyDao; +import com.epmet.dto.extract.result.GridUserCountResultDTO; import com.epmet.dto.stats.user.FactRegUserGridMonthlyDTO; import com.epmet.entity.stats.user.FactRegUserGridMonthlyEntity; import com.epmet.service.stats.user.FactRegUserGridMonthlyService; @@ -99,4 +100,16 @@ public class FactRegUserGridMonthlyServiceImpl extends BaseServiceImpl selectGridUserCount(String customerId, String monthId) { + return baseDao.selectGridUserCount(customerId, monthId); + } + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/UserService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/UserService.java index 60934ed2c1..0203780cc8 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/UserService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/UserService.java @@ -1,8 +1,10 @@ package com.epmet.service.user; import com.epmet.dto.AgencySubTreeDto; +import com.epmet.dto.extract.form.GridHeartedFormDTO; import com.epmet.dto.stats.user.result.UserStatisticalData; import com.epmet.util.DimIdGenerator; +import org.apache.ibatis.annotations.Param; import java.util.Date; import java.util.List; @@ -35,4 +37,22 @@ public interface UserService { * @date 2020/9/15 4:23 下午 */ Map selectUserIsParty(List userIds); + + /** + * @Description 查询客户下的党员userId + * @param customerId + * @return + * @author wangc + * @date 2020.09.20 15:01 + **/ + List getPartymembersByCustomerId(String customerId); + + /** + * @Description 查询客户下的热心居民Id以及所在网格Id + * @param customerId + * @return + * @author wangc + * @date 2020.09.20 15:01 + **/ + List getWarmHeartedByCustomerId(String customerId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java index 3d230f476b..5a8aa7b3f2 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java @@ -6,6 +6,7 @@ import com.epmet.constant.DataSourceConstant; import com.epmet.constant.ExtractConstant; import com.epmet.dao.user.UserDao; import com.epmet.dto.AgencySubTreeDto; +import com.epmet.dto.extract.form.GridHeartedFormDTO; import com.epmet.dto.extract.result.UserPartyResultDTO; import com.epmet.dto.stats.user.*; import com.epmet.dto.stats.user.result.UserStatisticalData; @@ -152,6 +153,30 @@ public class UserServiceImpl implements UserService { return result; } + /** + * @Description 查询客户下的党员userId + * @param customerId + * @return + * @author wangc + * @date 2020.09.20 15:01 + **/ + @Override + public List getPartymembersByCustomerId(String customerId) { + return userDao.selectPartymembersByCustomerId(customerId); + } + + /** + * @Description 查询客户下的热心居民Id以及所在网格Id + * @param customerId + * @return + * @author wangc + * @date 2020.09.20 15:01 + **/ + @Override + public List getWarmHeartedByCustomerId(String customerId) { + return userDao.selectWarmHeartedByCustomerId(customerId); + } + /** * @Description 初始化机关-所有下级网格Map diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginGroupMainDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginGroupMainDailyDao.xml new file mode 100644 index 0000000000..d07e74fae7 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginGroupMainDailyDao.xml @@ -0,0 +1,225 @@ + + + + + + + + + + + + + + + DELETE FROM + fact_origin_group_main_daily + WHERE + CUSTOMER_ID = #{customerId} + + + + + + DELETE FROM + fact_origin_group_member_daily + WHERE + CUSTOMER_ID = #{customerId} + + + + DELETE FROM + fact_origin_group_main_daily + + CUSTOMER_ID = #{customerId} + + ID = #{groupId} + + + + + + UPDATE fact_origin_group_main_daily + SET IS_OWNER_PARTY = 1 + + DEL_FLAG = '0' + AND CUSTOMER_ID = #{customerId} + AND + + GROUP_OWNER_ID = #{ownerId} + + + + + + UPDATE fact_origin_group_main_daily + SET IS_OWNER_HEARTED = 1 + + DEL_FLAG = '0' + AND CUSTOMER_ID = #{customerId} + AND + + (GROUP_OWNER_ID = #{item.userId} AND GRID_ID = #{item.gridId}) + + + + + + INSERT INTO fact_origin_group_main_daily + ( + + id, + customer_id, + group_state, + grid_id, + agency_id, + parent_id, + pids, + date_id, + week_id, + month_id, + quarter_id, + year_id, + resi_member_count, + member_total, + group_owner_id, + is_owner_hearted, + is_owner_party, + del_flag, + revision, + created_by, + created_time, + updated_by, + updated_time + )VALUES + + ( + #{item.id}, + #{item.customerId}, + #{item.groupState}, + #{item.gridId}, + #{item.agencyId}, + #{item.parentId}, + #{item.pids}, + #{item.dateId}, + #{item.weekId}, + #{item.monthId}, + #{item.quarterId}, + #{item.yearId}, + 0, + #{item.memberTotal}, + #{item.groupOwnerId}, + + + 0, + + + #{item.isOwnerHearted}, + + + + + + 0, + + + #{item.isOwnerParty}, + + + + '0', + 0, + 'CRAWLER_ROBOT', + now(), + 'CRAWLER_ROBOT', + now() + + ) + + + + + + INSERT INTO fact_origin_group_member_daily + ( + id, + group_id, + member_id, + customer_id, + leader_flag, + date_id, + week_id, + month_id, + quarter_id, + year_id, + action_code, + revision, + del_flag, + created_by, + created_time, + updated_by, + updated_time + )VALUES + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{item.groupId}, + #{item.memberId}, + #{item.customerId}, + #{item.leaderFlag}, + #{item.dateId}, + #{item.weekId}, + #{item.monthId}, + #{item.quarterId}, + #{item.yearId}, + #{item.actionCode}, + '0', + 0, + 'CRAWLER_ROBOT', + now(), + 'CRAWLER_ROBOT', + now() + ) + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueLogDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueLogDailyDao.xml index ab19b88e80..1f62f10256 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueLogDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueLogDailyDao.xml @@ -62,4 +62,33 @@ CUSTOMER_ID = #{customerId} AND DATE_ID = #{dateId} + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueMainDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueMainDailyDao.xml index 9d3ad44198..de03f24dc5 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueMainDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueMainDailyDao.xml @@ -66,4 +66,91 @@ CUSTOMER_ID = #{customerId} AND DATE_ID = #{dateId} + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectLogDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectLogDailyDao.xml index 71f24fc66c..d6825a5eb1 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectLogDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectLogDailyDao.xml @@ -2,27 +2,189 @@ + + DELETE FROM + fact_origin_project_log_daily + WHERE + CUSTOMER_ID = #{customerId} + + DATE_ID = #{date} + + - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + \ 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 58bdebeea2..99a6ac97a4 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 @@ -44,6 +44,103 @@ WHERE CUSTOMER_ID = #{customerId} AND PROJECT_STATUS = 'pending' + + + + + + DELETE FROM + fact_origin_project_main_daily + WHERE + CUSTOMER_ID = #{customerId} + + DATE_ID = #{date} + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectOrgPeriodDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectOrgPeriodDailyDao.xml new file mode 100644 index 0000000000..bf502d1af2 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectOrgPeriodDailyDao.xml @@ -0,0 +1,182 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + DELETE FROM + fact_origin_project_org_period_daily + WHERE + DEL_FLAG = '0' + + PROJECT_ID = #{item} + + + + + + + + insert into fact_origin_project_org_period_daily + ( + id, + customer_id, + project_id, + org_id, + org_type, + pid, + pids, + informed_date, + handled_date, + total_period, + period_till_reply_firstly, + is_resolved, + operation, + del_flag, + revision, + created_time, + created_by, + updated_time, + updated_by + )values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{item.customerId}, + #{item.projectId}, + #{item.orgId}, + #{item.orgType}, + + 0, + #{item.pid}, + + #{item.pids}, + #{item.informedDate}, + #{item.handledDate}, + #{item.totalPeriod}, + #{item.periodTillReplyFirstly}, + #{item.isResolved}, + #{item.operation}, + '0', + 0, + now(), + 'CRAWLER_ROBOT', + now(), + 'CRAWLER_ROBOT' + ) + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginTopicLogDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginTopicLogDailyDao.xml index 3efebcd69f..bbb25ff3ae 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginTopicLogDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginTopicLogDailyDao.xml @@ -65,4 +65,80 @@ ) + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginTopicMainDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginTopicMainDailyDao.xml index 377f09bd45..ef87296be2 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginTopicMainDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginTopicMainDailyDao.xml @@ -62,4 +62,35 @@ ) + + + + + + \ No newline at end of file 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 a84dff6a5c..2343295520 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 @@ -161,4 +161,90 @@ AND m.CUSTOMER_ID =#{customerId} AND m.MONTH_ID =#{monthId} + + + + + + + + + + INSERT INTO fact_index_govrn_ablity_grid_monthly ( + ID, + CUSTOMER_ID, + AGENCY_ID, + GRID_ID, + MONTH_ID, + QUARTER_ID, + YEAR_ID, + ISSUE_TOTAL, + AVG_ISSUE_COUNT, + ISSUE_TO_PROJECT_RATIO, + PROJECT_TOTAL, + SELF_SOLVE_PROJECT_COUNT, + RESOLVE_PROJECT_COUNT, + TRANSFER_RIGHT_RATIO, + SATISFACTION_RATIO, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME + ) + VALUES + + ( + REPLACE ( UUID(), '-', '' ), + #{item.customerId}, + #{item.agencyId}, + #{item.gridId}, + #{item.monthId}, + #{item.quarterId}, + #{item.yearId}, + #{item.issueTotal}, + #{item.avgIssueCount}, + #{item.issueToProjectRatio}, + #{item.projectTotal}, + #{item.selfSolveProjectCount}, + #{item.resolveProjectCount}, + #{item.transferRightRatio}, + #{item.satisfactionRatio}, + #{item.delFlag}, + #{item.revision}, + #{item.createdBy}, + NOW(), + #{item.updatedBy}, + NOW() + ) + + + + + + DELETE FROM fact_index_govrn_ablity_grid_monthly + WHERE CUSTOMER_ID = #{customerId} + AND MONTH_ID = #{monthId} + 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 eb9a582759..4644c01b11 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 @@ -33,6 +33,12 @@ AND MONTH_ID = #{monthId} limit 1000; + + delete from fact_index_govrn_ablity_org_monthly + where CUSTOMER_ID = #{customerId} + AND MONTH_ID = #{monthId} + AND DATA_TYPE = #{type} + insert into fact_index_govrn_ablity_org_monthly 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 443d22edfa..788af38336 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 @@ -125,5 +125,63 @@ LIMIT #{offset},#{pageSize} - + + + insert into fact_index_party_ablity_cpc_monthly + ( + ID, + CUSTOMER_ID, + AGENCY_ID, + PARENT_ID, + GRID_ID, + MONTH_ID, + QUARTER_ID, + YEAR_ID, + CREATE_TOPIC_COUNT, + JOIN_TOPIC_COUNT, + SHIFT_ISSUE_COUNT, + SHIFT_PROJECT_COUNT, + JOIN_THREE_MEETS_COUNT, + GROUP_USER_COUNT, + GROUP_TOPIC_COUNT, + TOPIC_TO_ISSUE_RATIO, + GROUP_ACTIVE_USER_COUNT, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME, + USER_ID + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{item.customerId}, + #{item.agencyId}, + #{item.parentId}, + #{item.gridId}, + #{item.monthId}, + #{item.quarterId}, + #{item.yearId}, + #{item.createTopicCount}, + #{item.joinTopicCount}, + #{item.shiftIssueCount}, + #{item.shiftProjectCount}, + #{item.joinThreeMeetsCount}, + #{item.groupUserCount}, + #{item.groupTopicCount}, + #{item.topicToIssueRatio}, + #{item.groupActiveUserCount}, + 0, + 0, + 'APP_USER', + now(), + 'APP_USER', + now(), + #{item.userId} + ) + + + 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 5f94b54fba..500f67dcc8 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 @@ -193,4 +193,77 @@ AND m.CUSTOMER_ID =#{customerId} AND m.MONTH_ID =#{monthId} + + + + INSERT INTO fact_index_party_ablity_grid_monthly ( + ID, + CUSTOMER_ID, + AGENCY_ID, + GRID_ID, + MONTH_ID, + QUARTER_ID, + YEAR_ID, + USER_COUNT, + PARTY_COUNT, + ACTIVE_USER_COUNT, + ACTIVE_PARTY_COUNT, + PARTY_AVG_TOPIC_COUNT, + USER_AVG_TOPIC_COUNT, + PARTY_AVG_SHIFT_PROJECT_COUNT, + USER_AVG_SHIFT_PROJECT_COUNT, + CREATE_GROUP_PARTY_COUNT, + PUBLISH_ARTICLE_COUNT, + ISSUE_TO_PROJECT_RATIO, + CREATE_THREE_MEETS_COUNT, + JOIN_THREE_MEETS_COUNT, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME + ) + VALUES + + ( + REPLACE ( UUID(), '-', '' ), + #{item.customerId}, + #{item.agencyId}, + #{item.gridId}, + #{item.monthId}, + #{item.quarterId}, + #{item.yearId}, + #{item.userCount}, + #{item.partyCount}, + #{item.activeUserCount}, + #{item.activePartyCount}, + #{item.partyAvgTopicCount}, + #{item.userAvgTopicCount}, + #{item.partyAvgShiftProjectCount}, + #{item.userAvgShiftProjectCount}, + #{item.createGroupPartyCount}, + #{item.publishArticleCount}, + #{item.issueToProjectRatio}, + #{item.createThreeMeetsCount}, + #{item.joinThreeMeetsCount}, + #{item.delFlag}, + #{item.revision}, + #{item.createdBy}, + NOW(), + #{item.updatedBy}, + NOW() + ) + + + + + + DELETE + FROM + fact_index_party_ablity_grid_monthly + WHERE + CUSTOMER_ID = #{customerId} + AND MONTH_ID = #{monthId} + 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 4aacf64da8..cf9146cc1f 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 @@ -27,6 +27,12 @@ AND MONTH_ID = #{monthId} limit 1000; + + delete from fact_index_party_ablity_org_monthly + where CUSTOMER_ID = #{customerId} + AND MONTH_ID = #{monthId} + AND DATA_TYPE = #{type} + insert into fact_index_party_ablity_org_monthly diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/group/GroupDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/group/GroupDataDao.xml index 0ed8f428fe..61e4057e22 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/group/GroupDataDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/group/GroupDataDao.xml @@ -155,5 +155,61 @@ rgm.resi_group_id - + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectDao.xml index c44315b3e6..e1a5401797 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectDao.xml @@ -93,7 +93,7 @@ AND ORIGIN = 'issue' AND CUSTOMER_ID = #{customerId} - AND DATE_FORMAT(CREATED_TIME, '%Y-%m-%d') = #{date} + AND DATE_FORMAT(CREATED_TIME, '%Y%m%d') = #{date} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectProcessDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectProcessDao.xml index 680a923090..48bf09f1c2 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectProcessDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectProcessDao.xml @@ -30,12 +30,14 @@ INNER JOIN project p ON pp.PROJECT_ID = p.ID WHERE p.CUSTOMER_ID = #{customerId} - AND DATE_FORMAT(pp.CREATED_TIME, '%Y-%m-%d') = #{date} + AND DATE_FORMAT(pp.CREATED_TIME, '%Y%m%d') = #{date} + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimAgencyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimAgencyDao.xml index 357265ee82..58dbc205d9 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimAgencyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimAgencyDao.xml @@ -315,5 +315,20 @@ ) + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimCustomerPartymemberDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimCustomerPartymemberDao.xml index 8dbc158531..b8465ad316 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimCustomerPartymemberDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimCustomerPartymemberDao.xml @@ -59,4 +59,32 @@ CUSTOMER_ID = #{customerId} AND DATE_ID = #{dateId} + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimGridDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimGridDao.xml index d3f6c044a3..bbc7e463e1 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimGridDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimGridDao.xml @@ -89,4 +89,24 @@ ) + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactArticlePublishedAgencyDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactArticlePublishedAgencyDailyDao.xml index ea4debe1dc..5050847753 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactArticlePublishedAgencyDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactArticlePublishedAgencyDailyDao.xml @@ -25,6 +25,18 @@ DELETE FROM fact_article_published_agency_daily WHERE CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} AND DATE_ID = #{dateId,jdbcType=VARCHAR} + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactArticlePublishedGridDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactArticlePublishedGridDailyDao.xml index b265d0b0c9..01af6f789d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactArticlePublishedGridDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactArticlePublishedGridDailyDao.xml @@ -41,5 +41,17 @@ DELETE FROM fact_article_published_grid_daily WHERE CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} AND DATE_ID = #{dateId,jdbcType=VARCHAR} + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactRegUserGridMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactRegUserGridMonthlyDao.xml index f5f66265fe..42e736c90c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactRegUserGridMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactRegUserGridMonthlyDao.xml @@ -106,5 +106,19 @@ + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/UserDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/UserDao.xml index 67e2ab9442..22061e3e70 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/UserDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/UserDao.xml @@ -424,4 +424,37 @@ ) + + + + diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/FactOriginExtractTaskService.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/FactOriginExtractTaskService.java new file mode 100644 index 0000000000..59ce874166 --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/FactOriginExtractTaskService.java @@ -0,0 +1,23 @@ +package com.epmet.service; + + +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.extract.form.ExtractFormDTO; + +/** + * desc: 业务数据抽取到统计库服务类 + * + * @return: + * @date: 2020/6/22 10:24 + * @author: jianjun liu + */ +public interface FactOriginExtractTaskService { + + /** + * desc: 【日】抽取 小组 话题 议题 项目数据到统计库 + * + * @date: 2020/6/22 9:09 + * @author: jianjun liu + */ + Result factOriginExtractJob(ExtractFormDTO formDTO); +} diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/IndexOriginExtractTaskService.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/IndexOriginExtractTaskService.java new file mode 100644 index 0000000000..5416375c13 --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/IndexOriginExtractTaskService.java @@ -0,0 +1,24 @@ +package com.epmet.service; + + +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.extract.form.ExtractIndexFormDTO; + +/** + * desc: 统计库数据抽取到指标库服务类 + * + * @return: + * @date: 2020/6/22 10:24 + * @author: jianjun liu + */ +public interface IndexOriginExtractTaskService { + + /** + * desc: 【月】抽取 数据到指标库 + * + * @param formDTO + * @date: 2020/6/22 9:09 + * @author: jianjun liu + */ + Result indexOriginExtractJob(ExtractIndexFormDTO formDTO); +} diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/FactOriginExtractTaskServiceImpl.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/FactOriginExtractTaskServiceImpl.java new file mode 100644 index 0000000000..9dfed79a57 --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/FactOriginExtractTaskServiceImpl.java @@ -0,0 +1,30 @@ +package com.epmet.service.impl; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.extract.form.ExtractFormDTO; +import com.epmet.feign.DataStatisticalOpenFeignClient; +import com.epmet.service.FactOriginExtractTaskService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +/** + * desc:数据统计 任务服务类 + */ +@Service +public class FactOriginExtractTaskServiceImpl implements FactOriginExtractTaskService { + @Autowired + private DataStatisticalOpenFeignClient dataStatisticalOpenFeignClient; + + + /** + * desc: 【日】抽取 小组 话题 议题 项目数据到统计库 + * + * @param formDTO + * @date: 2020/6/22 9:09 + * @author: jianjun liu + */ + @Override + public Result factOriginExtractJob(ExtractFormDTO formDTO) { + return dataStatisticalOpenFeignClient.factOriginExtractAll(formDTO); + } +} diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/IndexOriginExtractTaskServiceImpl.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/IndexOriginExtractTaskServiceImpl.java new file mode 100644 index 0000000000..e734004bd7 --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/IndexOriginExtractTaskServiceImpl.java @@ -0,0 +1,30 @@ +package com.epmet.service.impl; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.extract.form.ExtractIndexFormDTO; +import com.epmet.feign.DataStatisticalOpenFeignClient; +import com.epmet.service.IndexOriginExtractTaskService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +/** + * desc:指标原始数据统计 任务服务类 + */ +@Service +public class IndexOriginExtractTaskServiceImpl implements IndexOriginExtractTaskService { + @Autowired + private DataStatisticalOpenFeignClient dataStatisticalOpenFeignClient; + + + /** + * desc: 【月】抽取 统计库对象数据到统计库 + * + * @param formDTO + * @date: 2020/6/22 9:09 + * @author: jianjun liu + */ + @Override + public Result indexOriginExtractJob(ExtractIndexFormDTO formDTO) { + return dataStatisticalOpenFeignClient.indexOriginExtractAll(formDTO); + } +} diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/FactOriginExtractTask.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/FactOriginExtractTask.java new file mode 100644 index 0000000000..51d4a847bc --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/FactOriginExtractTask.java @@ -0,0 +1,48 @@ +package com.epmet.task; + +import com.alibaba.fastjson.JSON; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.StatsFormDTO; +import com.epmet.dto.extract.form.ExtractFormDTO; +import com.epmet.service.FactOriginExtractTaskService; +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * desc:数据抽取定时任务 定时任务 + */ +@Component("factOriginExtractTask") +public class FactOriginExtractTask implements ITask { + private Logger logger = LoggerFactory.getLogger(getClass()); + + @Autowired + private FactOriginExtractTaskService factOriginExtractTaskService; + + + @Override + public void run(String params) { + logger.info("FactOriginExtractTask定时任务正在执行,参数为:{}", params); + ExtractFormDTO formDTO = new ExtractFormDTO(); + if (StringUtils.isNotBlank(params)) { + formDTO = JSON.parseObject(params, ExtractFormDTO.class); + } + Result result = factOriginExtractTaskService.factOriginExtractJob(formDTO); + if (result.success()) { + logger.info("FactOriginExtractTask定时任务执行成功"); + } else { + logger.error("FactOriginExtractTask定时任务执行失败:" + result.getMsg()); + } + } + + public static void main(String[] args) { + StatsFormDTO formDTO = new StatsFormDTO(); + String params = "{'date':'\"2020-06-20','customerId':'123'}"; + if (StringUtils.isNotBlank(params)) { + formDTO = JSON.parseObject(params, StatsFormDTO.class); + } + System.out.println(JSON.toJSONString(formDTO)); + } +} diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/IndexOriginExtractTask.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/IndexOriginExtractTask.java new file mode 100644 index 0000000000..f8f405587a --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/IndexOriginExtractTask.java @@ -0,0 +1,38 @@ +package com.epmet.task; + +import com.alibaba.fastjson.JSON; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.extract.form.ExtractFormDTO; +import com.epmet.service.FactOriginExtractTaskService; +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * desc:数据抽取定时任务 定时任务 + */ +@Component("indexOriginExtractTask") +public class IndexOriginExtractTask implements ITask { + private Logger logger = LoggerFactory.getLogger(getClass()); + + @Autowired + private FactOriginExtractTaskService factOriginExtractTaskService; + + + @Override + public void run(String params) { + logger.info("indexOriginExtractTask定时任务正在执行,参数为:{}", params); + ExtractFormDTO formDTO = new ExtractFormDTO(); + if (StringUtils.isNotBlank(params)) { + formDTO = JSON.parseObject(params, ExtractFormDTO.class); + } + Result result = factOriginExtractTaskService.factOriginExtractJob(formDTO); + if (result.success()) { + logger.info("indexOriginExtractTask定时任务执行成功"); + } else { + logger.error("indexOriginExtractTask定时任务执行失败:" + result.getMsg()); + } + } +}