From c4c4f1eeb8898d562cc443a882bdb47dc73f5e7e Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Tue, 11 May 2021 16:46:57 +0800 Subject: [PATCH 001/128] =?UTF-8?q?=E5=B0=8F=E7=BB=84=E5=9F=BA=E7=A1=80?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E7=BB=9F=E8=AE=A1=E5=8F=8Afact=5Forigin=5Fgr?= =?UTF-8?q?oup=5Fmain=5Fdaily=E8=A1=A8=E6=96=B0=E5=A2=9EgroupType=E5=AD=97?= =?UTF-8?q?=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/commons/tools/utils/DateUtils.java | 19 ++ .../extract/FactOriginGroupMainDailyDTO.java | 5 + .../dto/group/form/GroupTotalFormDTO.java | 24 ++ .../stats/FactGroupTotalAgencyDailyDTO.java | 126 +++++++++ .../dto/stats/FactGroupTotalGridDailyDTO.java | 126 +++++++++ .../controller/StatsGroupController.java | 28 +- .../com/epmet/dao/group/GroupDataDao.java | 7 + .../stats/FactGroupTotalAgencyDailyDao.java | 38 +++ .../dao/stats/FactGroupTotalGridDailyDao.java | 39 +++ .../epmet/entity/group/ResiGroupEntity.java | 95 +++++++ .../FactGroupTotalAgencyDailyEntity.java | 96 +++++++ .../stats/FactGroupTotalGridDailyEntity.java | 96 +++++++ .../com/epmet/service/StatsGroupService.java | 12 + .../epmet/service/group/GroupDataService.java | 6 + .../group/impl/GroupDataServiceImpl.java | 11 + .../service/impl/StatsGroupServiceImpl.java | 250 ++++++++++++++++++ .../FactGroupTotalAgencyDailyService.java | 101 +++++++ .../stats/FactGroupTotalGridDailyService.java | 101 +++++++ .../FactGroupTotalAgencyDailyServiceImpl.java | 108 ++++++++ .../FactGroupTotalGridDailyServiceImpl.java | 108 ++++++++ ...12__alter_fact_origin_group_main_daily.sql | 3 + .../extract/FactOriginGroupMainDailyDao.xml | 2 + .../resources/mapper/group/GroupDataDao.xml | 13 +- .../stats/FactGroupTotalAgencyDailyDao.xml | 15 ++ .../stats/FactGroupTotalGridDailyDao.xml | 16 ++ 25 files changed, 1443 insertions(+), 2 deletions(-) create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/form/GroupTotalFormDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactGroupTotalAgencyDailyDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactGroupTotalGridDailyDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGroupTotalAgencyDailyDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGroupTotalGridDailyDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/group/ResiGroupEntity.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactGroupTotalAgencyDailyEntity.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactGroupTotalGridDailyEntity.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactGroupTotalAgencyDailyService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactGroupTotalGridDailyService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGroupTotalAgencyDailyServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGroupTotalGridDailyServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.12__alter_fact_origin_group_main_daily.sql create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupTotalAgencyDailyDao.xml create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupTotalGridDailyDao.xml diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java index 1886bd8300..c79f891d7c 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java @@ -17,6 +17,7 @@ import org.joda.time.LocalDate; import org.joda.time.format.DateTimeFormat; import org.joda.time.format.DateTimeFormatter; +import java.text.DateFormat; import java.text.ParseException; import java.text.SimpleDateFormat; import java.time.ZoneId; @@ -781,4 +782,22 @@ public class DateUtils { Date nowDate = c.getTime(); return com.epmet.commons.tools.utils.DateUtils.format(nowDate, com.epmet.commons.tools.utils.DateUtils.DATE_PATTERN_YYYYMM); } + + /** + * @Author sun + * @Description 获取当前日期的前一天日期(yyyy-mm-dd) + **/ + public static Date yesterDay() { + Date date = new Date(); + try { + DateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + Calendar calendar = Calendar.getInstance(); + calendar.set(Calendar.HOUR_OF_DAY, -24); + String str = sdf.format(calendar.getTime()); + date = sdf.parse(str); + } catch (Exception e) { + e.printStackTrace(); + } + return date; + } } 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 index 8292361039..818d5a399c 100644 --- 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 @@ -150,6 +150,11 @@ Ps: 如果一个小组被拒绝,当前小组的状态将永久停留在“审 */ private Date updatedTime; + /** + * 小组类型(ordinary:楼院小组 branch:支部小组) + */ + private String groupType; + 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/group/form/GroupTotalFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/form/GroupTotalFormDTO.java new file mode 100644 index 0000000000..ce3c23761d --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/form/GroupTotalFormDTO.java @@ -0,0 +1,24 @@ +package com.epmet.dto.group.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author sun + * 小组总数-网格日统计-接口入参 + */ +@Data +public class GroupTotalFormDTO implements Serializable { + + private static final long serialVersionUID = -4527492073390715391L; + + /** + * 客户Id + */ + private String customerId = ""; + /** + * 需要执行的日期(格式:yyyy-MM-dd)2020-01-01 + */ + private String date = ""; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactGroupTotalAgencyDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactGroupTotalAgencyDailyDTO.java new file mode 100644 index 0000000000..d840d0510f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactGroupTotalAgencyDailyDTO.java @@ -0,0 +1,126 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 小组总数-机关日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-10 + */ +@Data +public class FactGroupTotalAgencyDailyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 机构ID 关联机关dim表 + */ + private String agencyId; + + /** + * 父级机关ID + */ + private String pid; + + /** + * 统计日期 关联日期dim表 + */ + private String dateId; + + /** + * 周ID + */ + private String weekId; + + /** + * 月份ID + */ + private String monthId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 年ID + */ + private String yearId; + + /** + * 当前组织及下级小组总数 + */ + private Integer groupTotal; + + /** + * 当前组织及下级楼院小组总数 + */ + private Integer ordinaryTotal; + + /** + * 当前组织及下级支部小组总数 + */ + private Integer branchTotal; + + /** + * 删除标识 未删除:0,已删除:1 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactGroupTotalGridDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactGroupTotalGridDailyDTO.java new file mode 100644 index 0000000000..942888e0cb --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactGroupTotalGridDailyDTO.java @@ -0,0 +1,126 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 小组总数-网格日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-10 + */ +@Data +public class FactGroupTotalGridDailyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 机构ID 关联机关dim表 + */ + private String agencyId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 统计日期 关联日期dim表 + */ + private String dateId; + + /** + * 周ID + */ + private String weekId; + + /** + * 月份ID + */ + private String monthId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 年ID + */ + private String yearId; + + /** + * 网格下小组总数 + */ + private Integer groupTotal; + + /** + * 网格下楼院小组总数 + */ + private Integer ordinaryTotal; + + /** + * 网格下支部小组总数 + */ + private Integer branchTotal; + + /** + * 删除标识 未删除:0,已删除:1 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsGroupController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsGroupController.java index e3e70ba31c..9896ae6290 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsGroupController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsGroupController.java @@ -1,10 +1,15 @@ package com.epmet.controller; import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.StatsFormDTO; import com.epmet.dto.group.form.GroupStatsFormDTO; +import com.epmet.dto.group.form.GroupTotalFormDTO; import com.epmet.service.StatsGroupService; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; +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 zxc @@ -56,4 +61,25 @@ public class StatsGroupController { return new Result(); } + /** + * @Author sun + * @Description 小组总数-网格日统计 + **/ + @PostMapping("gridgrouptotal") + public Result gridGroupTotal(@RequestBody(required = false) GroupTotalFormDTO formDTO) { + statsGroupService.gridGroupTotal(formDTO); + return new Result(); + } + + /** + * @Author sun + * @Description 小组总数-机关日统计 + **/ + @PostMapping("agencygrouptotal") + public Result agencyGroupTotal(@RequestBody(required = false) GroupTotalFormDTO formDTO) { + statsGroupService.agencyGroupTotal(formDTO); + return new Result(); + } + + } 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 32059b58b3..0e29f1530a 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 @@ -6,6 +6,7 @@ import com.epmet.dto.group.form.GridGroupPeopleTotalFormDTO; import com.epmet.dto.group.form.GridGroupTotalFormDTO; import com.epmet.dto.group.form.GroupIncrFormDTO; import com.epmet.dto.group.result.*; +import com.epmet.entity.group.ResiGroupEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -90,4 +91,10 @@ public interface GroupDataDao { * @date 2020.09.18 22:45 **/ List groupExtracting(@Param("customerId")String customerId,@Param("dateId") String dateId); + + /** + * @Author sun + * @Description 查询客户下有效群组列表 + **/ + List selectCustomerGroupList(@Param("customerId")String customerId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGroupTotalAgencyDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGroupTotalAgencyDailyDao.java new file mode 100644 index 0000000000..a38c1d00b5 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGroupTotalAgencyDailyDao.java @@ -0,0 +1,38 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.stats; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.stats.FactGroupTotalAgencyDailyEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 小组总数-机关日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-10 + */ +@Mapper +public interface FactGroupTotalAgencyDailyDao extends BaseDao { + + /** + * @Author sun + * @Description 根据客户Id、日维度Id批量物理删除一下可能存在的历史数据 + **/ + void delDateGroupTotal(FactGroupTotalAgencyDailyEntity delEntity); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGroupTotalGridDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGroupTotalGridDailyDao.java new file mode 100644 index 0000000000..cf88536956 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGroupTotalGridDailyDao.java @@ -0,0 +1,39 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.stats; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.stats.FactGroupTotalGridDailyEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 小组总数-网格日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-10 + */ +@Mapper +public interface FactGroupTotalGridDailyDao extends BaseDao { + + /** + * @Author sun + * @Description 根据客户Id、日维度Id批量物理删除一下可能存在的历史数据 + **/ + void delDateGroupTotal(FactGroupTotalGridDailyEntity delEntity); + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/group/ResiGroupEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/group/ResiGroupEntity.java new file mode 100644 index 0000000000..138bfba563 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/group/ResiGroupEntity.java @@ -0,0 +1,95 @@ +/** + * 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.group; + +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-03-28 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("resi_group") +public class ResiGroupEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 群头像(htt://地址) + */ + private String groupHeadPhoto; + + /** + * 小组名称 + */ + private String groupName; + + /** + * 群介绍 + */ + private String groupIntroduction; + + /** + * 客户id + */ + private String customerId; + + /** + * 网格id + */ + private String gridId; + + /** + * 状态:(审核通过 - approved 、 审核中 - under_auditting、 审核未通过 - rejected 、 已屏蔽 - hidden、 已关闭 - closed) +Ps: 如果一个小组被拒绝,当前小组的状态将永久停留在“审核未通过” + */ + private String state; + + /** + * 最新话题时间 + */ + private Date latestTopicPublishDate; + + /** + * 进组审核open开启;close关闭 + */ + private String auditSwitch; + + /** + * VISIT_SWITCH 小组是否允许参观:允许:open;不允许:closed + */ + private String visitSwitch; + + /** + * 小组类型(ordinary:楼院小组 branch:支部小组) + */ + private String groupType; + + /** + * 小组等级 + */ + private Integer level; +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactGroupTotalAgencyDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactGroupTotalAgencyDailyEntity.java new file mode 100644 index 0000000000..814c9abd6a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactGroupTotalAgencyDailyEntity.java @@ -0,0 +1,96 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.stats; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 小组总数-机关日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-10 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_group_total_agency_daily") +public class FactGroupTotalAgencyDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 机构ID 关联机关dim表 + */ + private String agencyId; + + /** + * 父级机关ID + */ + private String pid; + + /** + * 统计日期 关联日期dim表 + */ + private String dateId; + + /** + * 周ID + */ + private String weekId; + + /** + * 月份ID + */ + private String monthId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 年ID + */ + private String yearId; + + /** + * 当前组织及下级小组总数 + */ + private Integer groupTotal; + + /** + * 当前组织及下级楼院小组总数 + */ + private Integer ordinaryTotal; + + /** + * 当前组织及下级支部小组总数 + */ + private Integer branchTotal; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactGroupTotalGridDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactGroupTotalGridDailyEntity.java new file mode 100644 index 0000000000..995fe3fbb5 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactGroupTotalGridDailyEntity.java @@ -0,0 +1,96 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.stats; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 小组总数-网格日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-10 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_group_total_grid_daily") +public class FactGroupTotalGridDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 机构ID 关联机关dim表 + */ + private String agencyId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 统计日期 关联日期dim表 + */ + private String dateId; + + /** + * 周ID + */ + private String weekId; + + /** + * 月份ID + */ + private String monthId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 年ID + */ + private String yearId; + + /** + * 网格下小组总数 + */ + private Integer groupTotal; + + /** + * 网格下楼院小组总数 + */ + private Integer ordinaryTotal; + + /** + * 网格下支部小组总数 + */ + private Integer branchTotal; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsGroupService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsGroupService.java index 10bb4f3a46..1fcb3da75b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsGroupService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsGroupService.java @@ -1,6 +1,7 @@ package com.epmet.service; import com.epmet.dto.group.form.GroupStatsFormDTO; +import com.epmet.dto.group.form.GroupTotalFormDTO; /** * @Author zxc @@ -26,4 +27,15 @@ public interface StatsGroupService { */ void groupAgencyMonthly(GroupStatsFormDTO formDTO); + /** + * @Author sun + * @Description 小组总数-网格日统计 + **/ + void gridGroupTotal(GroupTotalFormDTO formDTO); + + /** + * @Author sun + * @Description 小组总数-机关日统计 + **/ + void agencyGroupTotal(GroupTotalFormDTO formDTO); } 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 38e291d420..e971566233 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 @@ -2,6 +2,7 @@ package com.epmet.service.group; import com.epmet.dto.extract.FactOriginGroupMainDailyDTO; import com.epmet.dto.group.result.*; +import com.epmet.entity.group.ResiGroupEntity; import com.epmet.util.DimIdGenerator; import org.apache.ibatis.annotations.Param; @@ -66,4 +67,9 @@ public interface GroupDataService { **/ List extractGroupData(Boolean isFirst,String customerId,String dateId); + /** + * @Author sun + * @Description 查询客户下有效群组列表 + **/ + List getGroupListByCustomerId(String customerId); } 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 b7875982d5..ca2c54b87d 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 @@ -10,6 +10,7 @@ import com.epmet.dto.group.form.GridGroupPeopleTotalFormDTO; import com.epmet.dto.group.form.GridGroupTotalFormDTO; import com.epmet.dto.group.form.GroupIncrFormDTO; import com.epmet.dto.group.result.*; +import com.epmet.entity.group.ResiGroupEntity; import com.epmet.entity.stats.DimGridEntity; import com.epmet.service.group.GroupDataService; import com.epmet.util.DimIdGenerator; @@ -211,4 +212,14 @@ public class GroupDataServiceImpl implements GroupDataService { } + /** + * @Author sun + * @Description 查询客户下有效群组列表 + **/ + @Override + public List getGroupListByCustomerId(String customerId) { + return groupDataDao.selectCustomerGroupList(customerId); + } + + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java index 5e4fde3280..4be803a4a6 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java @@ -6,9 +6,14 @@ import com.epmet.constant.GroupConstant; import com.epmet.dto.AgencySubTreeDto; import com.epmet.dto.group.form.AgencyMonthlyFormDTO; import com.epmet.dto.group.form.GroupStatsFormDTO; +import com.epmet.dto.group.form.GroupTotalFormDTO; import com.epmet.dto.group.result.*; import com.epmet.dto.stats.DimAgencyDTO; +import com.epmet.entity.group.ResiGroupEntity; import com.epmet.entity.stats.DimAgencyEntity; +import com.epmet.entity.stats.DimGridEntity; +import com.epmet.entity.stats.FactGroupTotalAgencyDailyEntity; +import com.epmet.entity.stats.FactGroupTotalGridDailyEntity; import com.epmet.service.StatsGroupService; import com.epmet.service.group.GroupDataService; import com.epmet.service.org.CustomerGridService; @@ -20,11 +25,13 @@ import org.apache.commons.lang3.StringUtils; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; import java.time.LocalDate; import java.time.ZoneId; import java.time.ZonedDateTime; import java.util.*; +import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicReference; import java.util.stream.Collectors; @@ -50,6 +57,12 @@ public class StatsGroupServiceImpl implements StatsGroupService { private DimCustomerService dimCustomerService; @Autowired private CustomerGridService customerGridService; + @Autowired + private DimGridService dimGridService; + @Autowired + private FactGroupTotalGridDailyService factGroupTotalGridDailyService; + @Autowired + private FactGroupTotalAgencyDailyService factGroupTotalAgencyDailyService; /** * @param @@ -333,4 +346,241 @@ public class StatsGroupServiceImpl implements StatsGroupService { return DimIdGenerator.getDimIdBean(result); } + /** + * @Author sun + * @Description 小组总数-网格日统计 + **/ + @Override + public void gridGroupTotal(GroupTotalFormDTO formDTO) { + Date date = DateUtils.yesterDay(); + //入参有日期的则按具体时间执行,没有的则按当前时间前一天执行 + if (null != formDTO && StringUtils.isNotBlank(formDTO.getDate())) { + date = DateUtils.parse(formDTO.getDate(), DateUtils.DATE_PATTERN); + } + //入参有客户Id的则按客户Id执行,没有的则全部客户都执行 + if (null != formDTO && StringUtils.isNotBlank(formDTO.getCustomerId())) { + log.info("单独统计客户网格-小组总数日统计数据,当前统计的客户Id:" + formDTO.getCustomerId()); + gridGroupStats(formDTO.getCustomerId(), date); + } else { + int pageNo = 1; + int pageSize = 100; + List customerIdList = null; + do { + //获取有效客户列表 + customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize); + if (!CollectionUtils.isEmpty(customerIdList)) { + for (String customerId : customerIdList) { + try { + log.info("for循环统计网格-小组总数日统计数据,当前统计的客户Id:" + customerId); + //遍历统计每一个客户数据 + gridGroupStats(customerId, date); + } catch (Exception e) { + log.error("小组总数-网格日统计-程序错误,对应客户Id:" + customerId, e); + log.error("Error creating model JSON", e); + } + } + } + } while (!CollectionUtils.isEmpty(customerIdList) && customerIdList.size() == pageSize); + } + + } + + /** + * @Author sun + * @Description 小组总数-网格日统计数据 + **/ + private void gridGroupStats(String customerId, Date date) { + //1:查询各维度表Id,方便使用 + DimIdGenerator.DimIdBean dimId = DimIdGenerator.getDimIdBean(date); + + //2:根据客户Id查询网格维度表数据 + log.info("StatsGroupServiceImpl.customerGridStats-根据客户Id查询网格维度数据,对应客户Id:" + customerId); + List dimGridList = dimGridService.getGridListByCustomerId(customerId); + + //3.根据客户Id查询客户下有效的群组列表数据 + log.info("StatsGroupServiceImpl.customerGridStats-根据客户Id查询客户下有效的群组列表数据,对应客户Id:" + customerId); + List groupList = groupDataService.getGroupListByCustomerId(customerId); + + //4.分别计算每个网格下审核通过的小组数据 + List list = new ArrayList<>(); + dimGridList.forEach(grid -> { + FactGroupTotalGridDailyEntity entity = new FactGroupTotalGridDailyEntity(); + AtomicInteger total = new AtomicInteger(0); + AtomicInteger ordinary = new AtomicInteger(0); + AtomicInteger branch = new AtomicInteger(0); + groupList.forEach(group -> { + if (grid.getId().equals(group.getGridId()) && "approved".equals(group.getState())) { + + total.addAndGet(1); + if ("ordinary".equals(group.getGroupType())) { + ordinary.addAndGet(1); + } + if ("branch".equals(group.getGroupType())) { + branch.addAndGet(1); + } + } + }); + //封装数据 + entity.setCustomerId(grid.getCustomerId()); + entity.setAgencyId(grid.getAgencyId()); + entity.setGridId(grid.getId()); + entity.setDateId(dimId.getDateId()); + entity.setWeekId(dimId.getWeekId()); + entity.setMonthId(dimId.getMonthId()); + entity.setQuarterId(dimId.getQuarterId()); + entity.setYearId(dimId.getYearId()); + entity.setGroupTotal(total.get()); + entity.setOrdinaryTotal(ordinary.get()); + entity.setBranchTotal(branch.get()); + list.add(entity); + }); + + //5.批量插入数据库,先删后增的逻辑 + if (!CollectionUtils.isEmpty(list)) { + //5.1:根据客户Id、日维度Id批量物理删除一下可能存在的历史数据 + FactGroupTotalGridDailyEntity delEntity = new FactGroupTotalGridDailyEntity(); + delEntity.setCustomerId(customerId); + delEntity.setDateId(dimId.getDateId()); + log.info("StatsGroupServiceImpl.customerGridStats-根据客户Id、日维度Id批量删除小组总数网格日统计表数据,对应客户Id:" + customerId + ",日维度Id:" + dimId.getDateId()); + factGroupTotalGridDailyService.delDateGroupTotal(delEntity); + + //5.2:批量保存网格日统计数据 + log.info("StatsGroupServiceImpl.customerGridStats-批量新增小组总数网格日统计表数据,对应客户Id:" + customerId + ",日维度Id:" + dimId.getDateId()); + factGroupTotalGridDailyService.insertBatch(list); + } + + } + + /** + * @Author sun + * @Description 小组总数-机关日统计 + **/ + @Override + public void agencyGroupTotal(GroupTotalFormDTO formDTO) { + Date date = DateUtils.yesterDay(); + //入参有时间的则按具体时间执行,没有的则按当前时间前一天执行 + if (null != formDTO && StringUtils.isNotBlank(formDTO.getDate())) { + date = DateUtils.parse(formDTO.getDate(), DateUtils.DATE_PATTERN); + } + //入参有客户Id的则按客户Id执行,没有的则全部客户都执行 + if (null != formDTO && StringUtils.isNotBlank(formDTO.getCustomerId())) { + log.info("单独统计客户组织下-小组总数日统计数据,当前统计的客户Id:" + formDTO.getCustomerId()); + agencyGroupStats(formDTO.getCustomerId(), date); + } else { + int pageNo = 1; + int pageSize = 100; + List customerIdList = null; + do { + customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize); + if (!CollectionUtils.isEmpty(customerIdList)) { + for (String customerId : customerIdList) { + try { + log.info("for循环统计机关-小组总数日统计数据,当前统计的客户Id:" + customerId); + //遍历统计每一个客户数据 + agencyGroupStats(customerId, date); + } catch (Exception e) { + log.error("小组总数-机关日统计程序错误,对应客户Id:" + customerId, e); + log.error("Error creating model JSON", e); + } + } + } + } while (!CollectionUtils.isEmpty(customerIdList) && customerIdList.size() == pageSize); + } + + } + + /** + * @Author sun + * @Description 小组总数-机关日统计数据 + **/ + private void agencyGroupStats(String customerId, Date date) { + //1:查询各维度表Id,方便使用 + DimIdGenerator.DimIdBean dimId = DimIdGenerator.getDimIdBean(date); + + //2:根据客户Id查询机关维度表数据 + log.info("StatsGroupServiceImpl.agencyGroupStats-根据客户Id查询机关维度数据,对应客户Id:" + customerId); + DimAgencyDTO dimAgencyDTO = new DimAgencyDTO(); + dimAgencyDTO.setCustomerId(customerId); + List agencyList = dimAgencyService.getDimAgencyList(dimAgencyDTO); + + //3.根据客户Id查询网格维度表数据 + List gridList = dimGridService.getGridListByCustomerId(customerId); + + //4.根据客户Id查询客户下有效的群组列表数据 + log.info("StatsGroupServiceImpl.agencyGroupStats-根据客户Id查询客户下有效的群组列表数据,对应客户Id:" + customerId); + List groupList = groupDataService.getGroupListByCustomerId(customerId); + + List list = new ArrayList<>(); + //5.遍历组织维度数据分别计算每个组织下群组数据 + agencyList.forEach(agency->{ + FactGroupTotalAgencyDailyEntity entity = new FactGroupTotalAgencyDailyEntity(); + //5-1.汇总组织及所有下级组织列表 + Map map = new HashMap<>(); + map.put(agency.getId(), agency.getId()); + String subPids = ((null == agency.getPids() || "".equals(agency.getPids())) ? agency.getId() : agency.getPids() + ":" + agency.getId()); + agencyList.forEach(sub -> { + if (sub.getPids().contains(subPids)) { + map.put(sub.getId(), sub.getId()); + } + }); + + //5-2.汇总组织及下级所有的网格列表 + List agencyGridList = new ArrayList<>(); + gridList.forEach(grid->{ + if (map.containsKey(grid.getAgencyId())) { + agencyGridList.add(grid.getId()); + } + }); + + AtomicInteger total = new AtomicInteger(0); + AtomicInteger ordinary = new AtomicInteger(0); + AtomicInteger branch = new AtomicInteger(0); + //5-3.根据汇总的网格列表统计对应的群组数据 + agencyGridList.forEach(gridId -> { + groupList.forEach(group -> { + if (gridId.equals(group.getGridId()) && "approved".equals(group.getState())) { + total.addAndGet(1); + if ("ordinary".equals(group.getGroupType())) { + ordinary.addAndGet(1); + } + if ("branch".equals(group.getGroupType())) { + branch.addAndGet(1); + } + } + }); + }); + //封装数据 + entity.setCustomerId(agency.getCustomerId()); + entity.setAgencyId(agency.getId()); + entity.setPid(agency.getPid()); + entity.setDateId(dimId.getDateId()); + entity.setWeekId(dimId.getWeekId()); + entity.setMonthId(dimId.getMonthId()); + entity.setQuarterId(dimId.getQuarterId()); + entity.setYearId(dimId.getYearId()); + entity.setGroupTotal(total.get()); + entity.setOrdinaryTotal(ordinary.get()); + entity.setBranchTotal(branch.get()); + list.add(entity); + }); + + //6.批量插入数据库,先删后增的逻辑 + if (!CollectionUtils.isEmpty(list)) { + //5.1:根据客户Id、日维度Id批量物理删除一下可能存在的历史数据 + FactGroupTotalAgencyDailyEntity delEntity = new FactGroupTotalAgencyDailyEntity(); + delEntity.setCustomerId(customerId); + delEntity.setDateId(dimId.getDateId()); + log.info("StatsGroupServiceImpl.agencyGroupStats-根据客户Id、日维度Id批量删除小组总数网格日统计表数据,对应客户Id:" + customerId + ",日维度Id:" + dimId.getDateId()); + factGroupTotalAgencyDailyService.delDateGroupTotal(delEntity); + + //5.2:批量保存网格日统计数据 + log.info("StatsGroupServiceImpl.agencyGroupStats-批量新增小组总数网格日统计表数据,对应客户Id:" + customerId + ",日维度Id:" + dimId.getDateId()); + factGroupTotalAgencyDailyService.insertBatch(list); + } + + + } + + + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactGroupTotalAgencyDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactGroupTotalAgencyDailyService.java new file mode 100644 index 0000000000..602b0092f6 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactGroupTotalAgencyDailyService.java @@ -0,0 +1,101 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.FactGroupTotalAgencyDailyDTO; +import com.epmet.entity.stats.FactGroupTotalAgencyDailyEntity; + +import java.util.List; +import java.util.Map; + +/** + * 小组总数-机关日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-10 + */ +public interface FactGroupTotalAgencyDailyService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-05-10 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-05-10 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return FactGroupTotalAgencyDailyDTO + * @author generator + * @date 2021-05-10 + */ + FactGroupTotalAgencyDailyDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-05-10 + */ + void save(FactGroupTotalAgencyDailyDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-05-10 + */ + void update(FactGroupTotalAgencyDailyDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-05-10 + */ + void delete(String[] ids); + + /** + * @Author sun + * @Description 根据客户Id、日维度Id批量物理删除一下可能存在的历史数据 + **/ + void delDateGroupTotal(FactGroupTotalAgencyDailyEntity delEntity); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactGroupTotalGridDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactGroupTotalGridDailyService.java new file mode 100644 index 0000000000..fef3b0328c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactGroupTotalGridDailyService.java @@ -0,0 +1,101 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.FactGroupTotalGridDailyDTO; +import com.epmet.entity.stats.FactGroupTotalGridDailyEntity; + +import java.util.List; +import java.util.Map; + +/** + * 小组总数-网格日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-10 + */ +public interface FactGroupTotalGridDailyService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-05-10 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-05-10 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return FactGroupTotalGridDailyDTO + * @author generator + * @date 2021-05-10 + */ + FactGroupTotalGridDailyDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-05-10 + */ + void save(FactGroupTotalGridDailyDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-05-10 + */ + void update(FactGroupTotalGridDailyDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-05-10 + */ + void delete(String[] ids); + + /** + * @Author sun + * @Description 根据客户Id、日维度Id批量物理删除一下可能存在的历史数据 + **/ + void delDateGroupTotal(FactGroupTotalGridDailyEntity delEntity); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGroupTotalAgencyDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGroupTotalAgencyDailyServiceImpl.java new file mode 100644 index 0000000000..d10940fcc3 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGroupTotalAgencyDailyServiceImpl.java @@ -0,0 +1,108 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.stats.impl; + +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.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.dao.stats.FactGroupTotalAgencyDailyDao; +import com.epmet.dto.FactGroupTotalAgencyDailyDTO; +import com.epmet.entity.stats.FactGroupTotalAgencyDailyEntity; +import com.epmet.service.stats.FactGroupTotalAgencyDailyService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 小组总数-机关日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-10 + */ +@Service +public class FactGroupTotalAgencyDailyServiceImpl extends BaseServiceImpl implements FactGroupTotalAgencyDailyService { + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, FactGroupTotalAgencyDailyDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, FactGroupTotalAgencyDailyDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public FactGroupTotalAgencyDailyDTO get(String id) { + FactGroupTotalAgencyDailyEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, FactGroupTotalAgencyDailyDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(FactGroupTotalAgencyDailyDTO dto) { + FactGroupTotalAgencyDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactGroupTotalAgencyDailyEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(FactGroupTotalAgencyDailyDTO dto) { + FactGroupTotalAgencyDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactGroupTotalAgencyDailyEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * @Author sun + * @Description 根据客户Id、日维度Id批量物理删除一下可能存在的历史数据 + **/ + @Override + public void delDateGroupTotal(FactGroupTotalAgencyDailyEntity delEntity) { + baseDao.delDateGroupTotal(delEntity); + } + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGroupTotalGridDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGroupTotalGridDailyServiceImpl.java new file mode 100644 index 0000000000..f8aa5d5afe --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGroupTotalGridDailyServiceImpl.java @@ -0,0 +1,108 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.stats.impl; + +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.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.dao.stats.FactGroupTotalGridDailyDao; +import com.epmet.dto.FactGroupTotalGridDailyDTO; +import com.epmet.entity.stats.FactGroupTotalGridDailyEntity; +import com.epmet.service.stats.FactGroupTotalGridDailyService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 小组总数-网格日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-10 + */ +@Service +public class FactGroupTotalGridDailyServiceImpl extends BaseServiceImpl implements FactGroupTotalGridDailyService { + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, FactGroupTotalGridDailyDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, FactGroupTotalGridDailyDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public FactGroupTotalGridDailyDTO get(String id) { + FactGroupTotalGridDailyEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, FactGroupTotalGridDailyDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(FactGroupTotalGridDailyDTO dto) { + FactGroupTotalGridDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactGroupTotalGridDailyEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(FactGroupTotalGridDailyDTO dto) { + FactGroupTotalGridDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactGroupTotalGridDailyEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * @Author sun + * @Description 根据客户Id、日维度Id批量物理删除一下可能存在的历史数据 + **/ + @Override + public void delDateGroupTotal(FactGroupTotalGridDailyEntity delEntity) { + baseDao.delDateGroupTotal(delEntity); + } + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.12__alter_fact_origin_group_main_daily.sql b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.12__alter_fact_origin_group_main_daily.sql new file mode 100644 index 0000000000..a4e1300cdb --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.12__alter_fact_origin_group_main_daily.sql @@ -0,0 +1,3 @@ +ALTER TABLE `fact_origin_group_main_daily` +ADD COLUMN `GROUP_TYPE` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '小组类型(ordinary:楼院小组 branch:支部小组)' AFTER `GROUP_STATE`; + 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 index db5dc8b583..3107a108d9 100644 --- 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 @@ -139,6 +139,7 @@ id, customer_id, group_state, + group_type, grid_id, agency_id, parent_id, @@ -165,6 +166,7 @@ #{item.id}, #{item.customerId}, #{item.groupState}, + #{item.groupType}, #{item.gridId}, #{item.agencyId}, #{item.parentId}, 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 9b6da626dc..8ecfd3b72a 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 @@ -186,7 +186,8 @@ oper.UPDATED_TIME AS joinDate, IF(groupp.CREATED_BY = oper.CUSTOMER_USER_ID,'leader','member') AS leaderFlag, groupp.CREATED_BY AS groupOwnerId, - IF(groupp.CREATED_BY = oper.CUSTOMER_USER_ID,'join','create') AS actionCode + IF(groupp.CREATED_BY = oper.CUSTOMER_USER_ID,'join','create') AS actionCode, + groupp.group_type AS groupType FROM RESI_GROUP groupp @@ -226,4 +227,14 @@ + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupTotalAgencyDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupTotalAgencyDailyDao.xml new file mode 100644 index 0000000000..618a957a95 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupTotalAgencyDailyDao.xml @@ -0,0 +1,15 @@ + + + + + + + DELETE + FROM + fact_group_total_agency_daily + WHERE + 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/FactGroupTotalGridDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupTotalGridDailyDao.xml new file mode 100644 index 0000000000..743f3af322 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupTotalGridDailyDao.xml @@ -0,0 +1,16 @@ + + + + + + + + DELETE + FROM + fact_group_total_grid_daily + WHERE + customer_id = #{customerId} + AND date_id = #{dateId} + + + \ No newline at end of file From 3d4560c155243d546b2ffced3461b2b4851f9216 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Tue, 11 May 2021 17:07:54 +0800 Subject: [PATCH 002/128] bug --- .../main/resources/mapper/stats/FactGroupTotalGridDailyDao.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupTotalGridDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupTotalGridDailyDao.xml index 743f3af322..689f3f5820 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupTotalGridDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupTotalGridDailyDao.xml @@ -1,4 +1,3 @@ - From fd18dc33c74adaaefb0addadac2dde40669a8eea Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Tue, 11 May 2021 18:00:37 +0800 Subject: [PATCH 003/128] =?UTF-8?q?=E7=A8=8B=E5=BA=8F=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/group/GroupDataDao.xml | 1 + 1 file changed, 1 insertion(+) 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 8ecfd3b72a..1bf3357347 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 @@ -162,6 +162,7 @@ + From 1d0f29b3fafe48814fa666ec728c4b2ac39b2ac3 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Wed, 12 May 2021 11:05:01 +0800 Subject: [PATCH 004/128] =?UTF-8?q?=E7=BE=A4=E7=BB=84=E6=95=B0=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1=E4=BB=A3=E7=A0=81=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/commons/tools/utils/DateUtils.java | 18 +++++ .../dto/group/form/GroupTotalFormDTO.java | 4 +- .../extract/FactOriginGroupMainDailyDao.java | 6 ++ .../com/epmet/dao/group/GroupDataDao.java | 5 -- .../FactOriginGroupMainDailyEntity.java | 5 ++ .../com/epmet/service/StatsGroupService.java | 2 + .../FactOriginGroupMainDailyService.java | 6 ++ .../FactOriginGroupMainDailyServiceImpl.java | 9 +++ .../epmet/service/group/GroupDataService.java | 5 -- .../group/impl/GroupDataServiceImpl.java | 11 --- .../service/impl/StatsGroupServiceImpl.java | 69 +++++++++++-------- .../extract/FactOriginGroupMainDailyDao.xml | 11 +++ .../resources/mapper/group/GroupDataDao.xml | 10 --- 13 files changed, 100 insertions(+), 61 deletions(-) diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java index c79f891d7c..a2f88e4133 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java @@ -800,4 +800,22 @@ public class DateUtils { } return date; } + + /** + * 格式化日期 + * @param dateStr String 字符型日期 + * @param format String 格式 + * @return Date 日期 + */ + public static Date parseDate(String dateStr, String format) { + Date date = null; + try { + DateFormat dateFormat = new SimpleDateFormat(format); + date = dateFormat.parse(dateStr); + } catch (Exception e) { + e.printStackTrace(); + } + return date; + } + } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/form/GroupTotalFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/form/GroupTotalFormDTO.java index ce3c23761d..7d91c9c3fc 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/form/GroupTotalFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/form/GroupTotalFormDTO.java @@ -18,7 +18,7 @@ public class GroupTotalFormDTO implements Serializable { */ private String customerId = ""; /** - * 需要执行的日期(格式:yyyy-MM-dd)2020-01-01 + * 需要执行的日期(格式:yyyyMMdd) */ - private String date = ""; + private String dateId = ""; } 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 index 911d8b7993..7ffdf0c1f3 100644 --- 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 @@ -199,4 +199,10 @@ public interface FactOriginGroupMainDailyDao extends BaseDao selectOrgGroupCount(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("level") String level); + + /** + * @Author sun + * @Description 查询客户小组维度下有效群组列表 + **/ + List selectCustomerGroupList(@Param("customerId") String customerId, @Param("dateId") String dateId); } 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 0e29f1530a..bf35e1fe88 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 @@ -92,9 +92,4 @@ public interface GroupDataDao { **/ List groupExtracting(@Param("customerId")String customerId,@Param("dateId") String dateId); - /** - * @Author sun - * @Description 查询客户下有效群组列表 - **/ - List selectCustomerGroupList(@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 index 8bb0ba12a1..34b01407d6 100644 --- 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 @@ -116,4 +116,9 @@ Ps: 如果一个小组被拒绝,当前小组的状态将永久停留在“审 */ private Integer isOwnerParty; + /** + * 小组类型(ordinary:楼院小组 branch:支部小组) + */ + private String groupType; + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsGroupService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsGroupService.java index 1fcb3da75b..c6019d1490 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsGroupService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsGroupService.java @@ -3,6 +3,8 @@ package com.epmet.service; import com.epmet.dto.group.form.GroupStatsFormDTO; import com.epmet.dto.group.form.GroupTotalFormDTO; +import java.text.ParseException; + /** * @Author zxc * @CreateTime 2020/6/16 14:14 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginGroupMainDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginGroupMainDailyService.java index 730acde2c8..9b4350b1fb 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginGroupMainDailyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginGroupMainDailyService.java @@ -105,4 +105,10 @@ public interface FactOriginGroupMainDailyService extends BaseService */ List getOrgGroupCount(String customerId, String monthId, String level); + + /** + * @Author sun + * @Description 查询客户小组维度下有效群组列表 + **/ + List getGroupListByCustomerId(String customerId, String dateId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginGroupMainDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginGroupMainDailyServiceImpl.java index 94fadea5fe..718a045131 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginGroupMainDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginGroupMainDailyServiceImpl.java @@ -136,4 +136,13 @@ public class FactOriginGroupMainDailyServiceImpl extends BaseServiceImpl getGroupListByCustomerId(String customerId, String dateId) { + return baseDao.selectCustomerGroupList(customerId, dateId); + } + } 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 e971566233..76865ba242 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 @@ -67,9 +67,4 @@ public interface GroupDataService { **/ List extractGroupData(Boolean isFirst,String customerId,String dateId); - /** - * @Author sun - * @Description 查询客户下有效群组列表 - **/ - List getGroupListByCustomerId(String customerId); } 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 ca2c54b87d..93d6b4a7db 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 @@ -211,15 +211,4 @@ public class GroupDataServiceImpl implements GroupDataService { return groupDataDao.groupExtracting(customerId,isFirst?null:dateId); } - - /** - * @Author sun - * @Description 查询客户下有效群组列表 - **/ - @Override - public List getGroupListByCustomerId(String customerId) { - return groupDataDao.selectCustomerGroupList(customerId); - } - - } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java index 4be803a4a6..f222a9ee8e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java @@ -1,6 +1,7 @@ package com.epmet.service.impl; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.convert.DateConverter; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.constant.GroupConstant; import com.epmet.dto.AgencySubTreeDto; @@ -9,24 +10,29 @@ import com.epmet.dto.group.form.GroupStatsFormDTO; import com.epmet.dto.group.form.GroupTotalFormDTO; import com.epmet.dto.group.result.*; import com.epmet.dto.stats.DimAgencyDTO; +import com.epmet.entity.evaluationindex.extract.FactOriginGroupMainDailyEntity; import com.epmet.entity.group.ResiGroupEntity; import com.epmet.entity.stats.DimAgencyEntity; import com.epmet.entity.stats.DimGridEntity; import com.epmet.entity.stats.FactGroupTotalAgencyDailyEntity; import com.epmet.entity.stats.FactGroupTotalGridDailyEntity; import com.epmet.service.StatsGroupService; +import com.epmet.service.evaluationindex.extract.todata.FactOriginGroupMainDailyService; import com.epmet.service.group.GroupDataService; import com.epmet.service.org.CustomerGridService; import com.epmet.service.stats.*; import com.epmet.util.DimIdGenerator; import com.epmet.util.ModuleConstant; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.configuration.ConfigurationException; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; +import java.text.ParseException; +import java.text.SimpleDateFormat; import java.time.LocalDate; import java.time.ZoneId; import java.time.ZonedDateTime; @@ -63,6 +69,8 @@ public class StatsGroupServiceImpl implements StatsGroupService { private FactGroupTotalGridDailyService factGroupTotalGridDailyService; @Autowired private FactGroupTotalAgencyDailyService factGroupTotalAgencyDailyService; + @Autowired + private FactOriginGroupMainDailyService factOriginGroupMainDailyService; /** * @param @@ -352,15 +360,16 @@ public class StatsGroupServiceImpl implements StatsGroupService { **/ @Override public void gridGroupTotal(GroupTotalFormDTO formDTO) { - Date date = DateUtils.yesterDay(); //入参有日期的则按具体时间执行,没有的则按当前时间前一天执行 - if (null != formDTO && StringUtils.isNotBlank(formDTO.getDate())) { - date = DateUtils.parse(formDTO.getDate(), DateUtils.DATE_PATTERN); + if (StringUtils.isBlank(formDTO.getDateId())) { + Date yesterday = DateUtils.addDateDays(new Date(), -1); + SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); + formDTO.setDateId(format.format(yesterday)); } //入参有客户Id的则按客户Id执行,没有的则全部客户都执行 if (null != formDTO && StringUtils.isNotBlank(formDTO.getCustomerId())) { log.info("单独统计客户网格-小组总数日统计数据,当前统计的客户Id:" + formDTO.getCustomerId()); - gridGroupStats(formDTO.getCustomerId(), date); + gridGroupStats(formDTO.getCustomerId(), formDTO.getDateId()); } else { int pageNo = 1; int pageSize = 100; @@ -373,7 +382,7 @@ public class StatsGroupServiceImpl implements StatsGroupService { try { log.info("for循环统计网格-小组总数日统计数据,当前统计的客户Id:" + customerId); //遍历统计每一个客户数据 - gridGroupStats(customerId, date); + gridGroupStats(customerId, formDTO.getDateId()); } catch (Exception e) { log.error("小组总数-网格日统计-程序错误,对应客户Id:" + customerId, e); log.error("Error creating model JSON", e); @@ -389,8 +398,9 @@ public class StatsGroupServiceImpl implements StatsGroupService { * @Author sun * @Description 小组总数-网格日统计数据 **/ - private void gridGroupStats(String customerId, Date date) { + private void gridGroupStats(String customerId, String dateId) { //1:查询各维度表Id,方便使用 + Date date = DateUtils.parseDate(dateId,DateUtils.DATE_PATTERN_YYYYMMDD); DimIdGenerator.DimIdBean dimId = DimIdGenerator.getDimIdBean(date); //2:根据客户Id查询网格维度表数据 @@ -399,18 +409,18 @@ public class StatsGroupServiceImpl implements StatsGroupService { //3.根据客户Id查询客户下有效的群组列表数据 log.info("StatsGroupServiceImpl.customerGridStats-根据客户Id查询客户下有效的群组列表数据,对应客户Id:" + customerId); - List groupList = groupDataService.getGroupListByCustomerId(customerId); + List groupList = factOriginGroupMainDailyService.getGroupListByCustomerId(customerId, dateId); //4.分别计算每个网格下审核通过的小组数据 List list = new ArrayList<>(); + DimIdGenerator.DimIdBean finalDimId = dimId; dimGridList.forEach(grid -> { FactGroupTotalGridDailyEntity entity = new FactGroupTotalGridDailyEntity(); AtomicInteger total = new AtomicInteger(0); AtomicInteger ordinary = new AtomicInteger(0); AtomicInteger branch = new AtomicInteger(0); groupList.forEach(group -> { - if (grid.getId().equals(group.getGridId()) && "approved".equals(group.getState())) { - + if (grid.getId().equals(group.getGridId()) && "approved".equals(group.getGroupState())) { total.addAndGet(1); if ("ordinary".equals(group.getGroupType())) { ordinary.addAndGet(1); @@ -424,11 +434,11 @@ public class StatsGroupServiceImpl implements StatsGroupService { entity.setCustomerId(grid.getCustomerId()); entity.setAgencyId(grid.getAgencyId()); entity.setGridId(grid.getId()); - entity.setDateId(dimId.getDateId()); - entity.setWeekId(dimId.getWeekId()); - entity.setMonthId(dimId.getMonthId()); - entity.setQuarterId(dimId.getQuarterId()); - entity.setYearId(dimId.getYearId()); + entity.setDateId(finalDimId.getDateId()); + entity.setWeekId(finalDimId.getWeekId()); + entity.setMonthId(finalDimId.getMonthId()); + entity.setQuarterId(finalDimId.getQuarterId()); + entity.setYearId(finalDimId.getYearId()); entity.setGroupTotal(total.get()); entity.setOrdinaryTotal(ordinary.get()); entity.setBranchTotal(branch.get()); @@ -457,15 +467,16 @@ public class StatsGroupServiceImpl implements StatsGroupService { **/ @Override public void agencyGroupTotal(GroupTotalFormDTO formDTO) { - Date date = DateUtils.yesterDay(); - //入参有时间的则按具体时间执行,没有的则按当前时间前一天执行 - if (null != formDTO && StringUtils.isNotBlank(formDTO.getDate())) { - date = DateUtils.parse(formDTO.getDate(), DateUtils.DATE_PATTERN); + //入参有日期的则按具体时间执行,没有的则按当前时间前一天执行 + if (StringUtils.isBlank(formDTO.getDateId())) { + Date yesterday = DateUtils.addDateDays(new Date(), -1); + SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); + formDTO.setDateId(format.format(yesterday)); } //入参有客户Id的则按客户Id执行,没有的则全部客户都执行 if (null != formDTO && StringUtils.isNotBlank(formDTO.getCustomerId())) { log.info("单独统计客户组织下-小组总数日统计数据,当前统计的客户Id:" + formDTO.getCustomerId()); - agencyGroupStats(formDTO.getCustomerId(), date); + agencyGroupStats(formDTO.getCustomerId(), formDTO.getDateId()); } else { int pageNo = 1; int pageSize = 100; @@ -477,7 +488,7 @@ public class StatsGroupServiceImpl implements StatsGroupService { try { log.info("for循环统计机关-小组总数日统计数据,当前统计的客户Id:" + customerId); //遍历统计每一个客户数据 - agencyGroupStats(customerId, date); + agencyGroupStats(customerId, formDTO.getDateId()); } catch (Exception e) { log.error("小组总数-机关日统计程序错误,对应客户Id:" + customerId, e); log.error("Error creating model JSON", e); @@ -493,8 +504,9 @@ public class StatsGroupServiceImpl implements StatsGroupService { * @Author sun * @Description 小组总数-机关日统计数据 **/ - private void agencyGroupStats(String customerId, Date date) { + private void agencyGroupStats(String customerId, String dateId) { //1:查询各维度表Id,方便使用 + Date date = DateUtils.parseDate(dateId,DateUtils.DATE_PATTERN_YYYYMMDD); DimIdGenerator.DimIdBean dimId = DimIdGenerator.getDimIdBean(date); //2:根据客户Id查询机关维度表数据 @@ -508,10 +520,11 @@ public class StatsGroupServiceImpl implements StatsGroupService { //4.根据客户Id查询客户下有效的群组列表数据 log.info("StatsGroupServiceImpl.agencyGroupStats-根据客户Id查询客户下有效的群组列表数据,对应客户Id:" + customerId); - List groupList = groupDataService.getGroupListByCustomerId(customerId); + List groupList = factOriginGroupMainDailyService.getGroupListByCustomerId(customerId, dateId); List list = new ArrayList<>(); //5.遍历组织维度数据分别计算每个组织下群组数据 + DimIdGenerator.DimIdBean finalDimId = dimId; agencyList.forEach(agency->{ FactGroupTotalAgencyDailyEntity entity = new FactGroupTotalAgencyDailyEntity(); //5-1.汇总组织及所有下级组织列表 @@ -538,7 +551,7 @@ public class StatsGroupServiceImpl implements StatsGroupService { //5-3.根据汇总的网格列表统计对应的群组数据 agencyGridList.forEach(gridId -> { groupList.forEach(group -> { - if (gridId.equals(group.getGridId()) && "approved".equals(group.getState())) { + if (gridId.equals(group.getGridId()) && "approved".equals(group.getGroupState())) { total.addAndGet(1); if ("ordinary".equals(group.getGroupType())) { ordinary.addAndGet(1); @@ -553,11 +566,11 @@ public class StatsGroupServiceImpl implements StatsGroupService { entity.setCustomerId(agency.getCustomerId()); entity.setAgencyId(agency.getId()); entity.setPid(agency.getPid()); - entity.setDateId(dimId.getDateId()); - entity.setWeekId(dimId.getWeekId()); - entity.setMonthId(dimId.getMonthId()); - entity.setQuarterId(dimId.getQuarterId()); - entity.setYearId(dimId.getYearId()); + entity.setDateId(finalDimId.getDateId()); + entity.setWeekId(finalDimId.getWeekId()); + entity.setMonthId(finalDimId.getMonthId()); + entity.setQuarterId(finalDimId.getQuarterId()); + entity.setYearId(finalDimId.getYearId()); entity.setGroupTotal(total.get()); entity.setOrdinaryTotal(ordinary.get()); entity.setBranchTotal(branch.get()); 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 index 3107a108d9..2f40e1de70 100644 --- 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 @@ -340,4 +340,15 @@ AND f.GROUP_STATE = 'approved' GROUP BY f.AGENCY_ID + + + 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 1bf3357347..a1b2b223ab 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 @@ -228,14 +228,4 @@ - - \ No newline at end of file From 9108b5ef31596db5cdc3054b439605b8be1f5c5c Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 12 May 2021 14:10:18 +0800 Subject: [PATCH 005/128] =?UTF-8?q?=E5=85=9A=E5=91=98=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=EF=BC=9A=E5=8F=82=E5=8A=A0=E4=B8=89=E4=B8=80=E4=BC=9A=E4=B8=80?= =?UTF-8?q?=E8=AF=BE=E6=AC=A1=E6=95=B0joinThreeMeetsCount=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=E8=B5=8B=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/dao/group/GroupDataDao.java | 10 +++++- .../impl/CalCpcIndexServiceImpl.java | 31 +++++++++++++++++-- .../epmet/service/group/GroupDataService.java | 10 +++++- .../group/impl/GroupDataServiceImpl.java | 22 ++++++++++--- .../resources/mapper/group/GroupDataDao.xml | 24 +++++++------- 5 files changed, 75 insertions(+), 22 deletions(-) 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 bf35e1fe88..8d4fb6f16a 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 @@ -6,7 +6,7 @@ import com.epmet.dto.group.form.GridGroupPeopleTotalFormDTO; import com.epmet.dto.group.form.GridGroupTotalFormDTO; import com.epmet.dto.group.form.GroupIncrFormDTO; import com.epmet.dto.group.result.*; -import com.epmet.entity.group.ResiGroupEntity; +import com.epmet.dto.indexcollect.result.CpcIndexCommonDTO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -92,4 +92,12 @@ public interface GroupDataDao { **/ List groupExtracting(@Param("customerId")String customerId,@Param("dateId") String dateId); + /** + * 查询小组活动签到表,计算用户在本月内签到的活动次数 + * + * @param customerId + * @param monthId + * @return com.epmet.dto.indexcollect.result.CpcIndexCommonDTO + */ + List selectUserSignedCount(@Param("customerId")String customerId, @Param("monthId")String monthId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalCpcIndexServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalCpcIndexServiceImpl.java index 6c7fad11c7..5a30c84911 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalCpcIndexServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalCpcIndexServiceImpl.java @@ -7,6 +7,7 @@ import com.epmet.entity.evaluationindex.indexcoll.FactIndexPartyAblityCpcMonthly import com.epmet.service.evaluationindex.extract.dataToIndex.CalCpcIndexService; import com.epmet.service.evaluationindex.extract.todata.*; import com.epmet.service.evaluationindex.indexcoll.FactIndexPartyAblityCpcMonthlyService; +import com.epmet.service.group.GroupDataService; import com.epmet.service.stats.DimCustomerPartymemberService; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; @@ -43,6 +44,8 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService { private FactIndexPartyAblityCpcMonthlyService factIndexPartyAblityCpcMonthlyService; @Autowired private FactOriginGroupMainDailyService factOriginGroupMainDailyService; + @Autowired + private GroupDataService groupDataService; /** * @param customerId 客户id @@ -54,7 +57,7 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService { **/ @Override public void calCpcPartyAbility(String customerId, String monthId) { - //1、构造初始值 + //1、构造初始值 当前客户下所有的党员 List indexPartyAblityCpcList = dimCustomerPartymemberService.selectPartyMemberList(customerId); if (CollectionUtils.isEmpty(indexPartyAblityCpcList)) { log.info("dim_customer_partymember do not any records customerId="+customerId); @@ -71,7 +74,8 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService { Map shiftIssueCountMap = calShiftIssueCount(customerId, monthId); //4、党员提出的议题转项目数 Map shiftProjectCountMap = calShiftProjectCount(customerId, monthId); - //5、参加“三会一课”次数 默认0 + //5、参加“三会一课”次数 默认0 :当前用户在本月内活动签到次数 + Map joinThreeMeetsCountMap=calJoinThreeMeetsCount(customerId,monthId); //可以先查询出每个党员的 自建群 Map> userCreatedGroups = queryUserCreatedGroups(customerId, indexPartyAblityCpcList); @@ -105,7 +109,10 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService { if (shiftProjectCountMap.containsKey(indexPartyAblityCpcEntity.getUserId())) { indexPartyAblityCpcEntity.setShiftProjectCount(shiftProjectCountMap.get(indexPartyAblityCpcEntity.getUserId())); } - //5、参加“三会一课”次数 目前没有此业务,默认0 + //5、参加“三会一课”次数 目前没有此业务,默认0 : 当前用户在本月内活动签到次数 + if(joinThreeMeetsCountMap.containsKey(indexPartyAblityCpcEntity.getUserId())){ + indexPartyAblityCpcEntity.setJoinThreeMeetsCount(joinThreeMeetsCountMap.get(indexPartyAblityCpcEntity.getUserId())); + } //6、党员自建群群众人数 if (groupUserCountMap.containsKey(indexPartyAblityCpcEntity.getUserId())) { indexPartyAblityCpcEntity.setGroupUserCount(groupUserCountMap.get(indexPartyAblityCpcEntity.getUserId())); @@ -220,6 +227,24 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService { return resultMap; } + /** + * @return java.util.Map + * @param customerId + * @param monthId + * @author yinzuomei + * @description 5:参加“三会一课”次数 : 当前用户在本月内活动签到次数 + * @Date 2021/5/12 13:38 + **/ + private Map calJoinThreeMeetsCount(String customerId, String monthId) { + //查询小组活动签到表,计算用户在本月内签到的活动次数 + List list=groupDataService.selectJoinThreeMeetsCount(customerId,monthId); + Map resultMap = new HashMap<>(); + for (CpcIndexCommonDTO cpcIndexCommonDTO : list) { + resultMap.put(cpcIndexCommonDTO.getUserId(), cpcIndexCommonDTO.getIndexValue()); + } + return resultMap; + } + /** * @param customerId * @param monthId 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 76865ba242..6be5b22324 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 @@ -2,7 +2,7 @@ package com.epmet.service.group; import com.epmet.dto.extract.FactOriginGroupMainDailyDTO; import com.epmet.dto.group.result.*; -import com.epmet.entity.group.ResiGroupEntity; +import com.epmet.dto.indexcollect.result.CpcIndexCommonDTO; import com.epmet.util.DimIdGenerator; import org.apache.ibatis.annotations.Param; @@ -67,4 +67,12 @@ public interface GroupDataService { **/ List extractGroupData(Boolean isFirst,String customerId,String dateId); + /** + * 查询小组活动签到表,计算用户在本月内签到的活动次数 + * + * @param customerId + * @param monthId + * @return com.epmet.dto.indexcollect.result.CpcIndexCommonDTO + */ + List selectJoinThreeMeetsCount(String customerId, String monthId); } 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 93d6b4a7db..20927df80a 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 @@ -10,16 +10,12 @@ import com.epmet.dto.group.form.GridGroupPeopleTotalFormDTO; import com.epmet.dto.group.form.GridGroupTotalFormDTO; import com.epmet.dto.group.form.GroupIncrFormDTO; import com.epmet.dto.group.result.*; -import com.epmet.entity.group.ResiGroupEntity; -import com.epmet.entity.stats.DimGridEntity; +import com.epmet.dto.indexcollect.result.CpcIndexCommonDTO; 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; @@ -139,6 +135,7 @@ public class GroupDataServiceImpl implements GroupDataService { * @param * @author zxc */ + @Override public List getAgencyGroupTotalCount(String customerId,String dateId){ /*if (allGrid.size() == NumConstant.ZERO){ return new ArrayList<>(); @@ -164,6 +161,7 @@ public class GroupDataServiceImpl implements GroupDataService { * @param * @author zxc */ + @Override public List selectAgencyEveryGroupPeopleCount(String customerId,String dateId){ /*if (allGrid.size() == NumConstant.ZERO){ return new ArrayList<>(); @@ -177,6 +175,7 @@ public class GroupDataServiceImpl implements GroupDataService { * @param dateId * @author zxc */ + @Override public List selectAgencyGroupIncr(String customerId,String dateId){ /*if (allGrid.size() == NumConstant.ZERO){ return new ArrayList<>(); @@ -211,4 +210,17 @@ public class GroupDataServiceImpl implements GroupDataService { return groupDataDao.groupExtracting(customerId,isFirst?null:dateId); } + /** + * 查询小组活动签到表,计算用户在本月内签到的活动次数 + * + * @param customerId + * @param monthId + * @return com.epmet.dto.indexcollect.result.CpcIndexCommonDTO + */ + @Override + public List selectJoinThreeMeetsCount(String customerId, String monthId) { + return groupDataDao.selectUserSignedCount(customerId,monthId); + } + + } 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 a1b2b223ab..08b32f97fe 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 @@ -214,18 +214,18 @@ - - SELECT - - ATTACHMENT_URL AS eventImgUrl, - SORT - - FROM - resi_topic_attachment - WHERE - DEL_FLAG = '0' - + m.SIGN_USER_ID AS userId, + count( DISTINCT m.GROUP_ACT_ID ) AS indexValue + FROM + act_sign_in_record m + WHERE + m.DEL_FLAG = '0' + AND m.CUSTOMER_ID = #{customerId} + AND DATE_FORMAT( m.CREATED_TIME, '%Y%m')= #{monthId} + GROUP BY + m.SIGN_USER_ID - \ No newline at end of file From 3640f3740b5306c652d0000dbd49a9c47103f28d Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 12 May 2021 14:18:22 +0800 Subject: [PATCH 006/128] =?UTF-8?q?=E5=85=9A=E5=91=98=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=EF=BC=9A=E5=8F=82=E5=8A=A0=E4=B8=89=E4=B8=80=E4=BC=9A=E4=B8=80?= =?UTF-8?q?=E8=AF=BE=E6=AC=A1=E6=95=B0joinThreeMeetsCount=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=E8=B5=8B=E5=80=BC=20sql=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/dao/group/GroupDataDao.java | 2 +- .../dataToIndex/impl/CalCpcIndexServiceImpl.java | 6 +++--- .../epmet/service/group/impl/GroupDataServiceImpl.java | 2 +- .../src/main/resources/mapper/group/GroupDataDao.xml | 10 ++++++++-- 4 files changed, 13 insertions(+), 7 deletions(-) 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 8d4fb6f16a..fae2cfd223 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 @@ -93,7 +93,7 @@ public interface GroupDataDao { List groupExtracting(@Param("customerId")String customerId,@Param("dateId") String dateId); /** - * 查询小组活动签到表,计算用户在本月内签到的活动次数 + * 查询小组活动签到表,计算用户在本月内签到的活动次数 限制活动分类编码100001 三会一课 * * @param customerId * @param monthId diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalCpcIndexServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalCpcIndexServiceImpl.java index 5a30c84911..353c3ad882 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalCpcIndexServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalCpcIndexServiceImpl.java @@ -74,7 +74,7 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService { Map shiftIssueCountMap = calShiftIssueCount(customerId, monthId); //4、党员提出的议题转项目数 Map shiftProjectCountMap = calShiftProjectCount(customerId, monthId); - //5、参加“三会一课”次数 默认0 :当前用户在本月内活动签到次数 + //5、参加“三会一课”次数 默认0 :当前用户在本月内活动签到次数 限制活动分类编码100001 三会一课 Map joinThreeMeetsCountMap=calJoinThreeMeetsCount(customerId,monthId); //可以先查询出每个党员的 自建群 @@ -109,7 +109,7 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService { if (shiftProjectCountMap.containsKey(indexPartyAblityCpcEntity.getUserId())) { indexPartyAblityCpcEntity.setShiftProjectCount(shiftProjectCountMap.get(indexPartyAblityCpcEntity.getUserId())); } - //5、参加“三会一课”次数 目前没有此业务,默认0 : 当前用户在本月内活动签到次数 + //5、参加“三会一课”次数 目前没有此业务,默认0 : 当前用户在本月内活动签到次数 限制活动分类编码100001 三会一课 if(joinThreeMeetsCountMap.containsKey(indexPartyAblityCpcEntity.getUserId())){ indexPartyAblityCpcEntity.setJoinThreeMeetsCount(joinThreeMeetsCountMap.get(indexPartyAblityCpcEntity.getUserId())); } @@ -232,7 +232,7 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService { * @param customerId * @param monthId * @author yinzuomei - * @description 5:参加“三会一课”次数 : 当前用户在本月内活动签到次数 + * @description 5:参加“三会一课”次数 : 当前用户在本月内活动签到次数 限制活动分类编码100001 三会一课 * @Date 2021/5/12 13:38 **/ private Map calJoinThreeMeetsCount(String customerId, String monthId) { 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 20927df80a..550c0d73e8 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 @@ -211,7 +211,7 @@ public class GroupDataServiceImpl implements GroupDataService { } /** - * 查询小组活动签到表,计算用户在本月内签到的活动次数 + * 查询小组活动签到表,计算用户在本月内签到的活动次数 限制活动分类编码100001 三会一课 * * @param customerId * @param monthId 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 08b32f97fe..a5de0e01ab 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 @@ -214,17 +214,23 @@ - + From 6cf0f40b6df066572bd1d91583bd94c541f7cc2b Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Wed, 12 May 2021 15:49:01 +0800 Subject: [PATCH 007/128] =?UTF-8?q?dada=5Faggregator=E5=BC=95=E5=85=A5data?= =?UTF-8?q?=5Fstatistical=E6=95=B0=E6=8D=AE=E6=BA=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../constant/DataSourceConstant.java | 2 ++ .../data-aggregator-server/pom.xml | 28 ++++++++++++++++++ .../controller/DataStatsController.java | 20 +++++++++++++ .../dataaggre/dao/datastats/DataStatsDao.java | 29 +++++++++++++++++++ .../service/datastats/DataStatsService.java | 9 ++++++ .../datastats/impl/DataStatsServiceImpl.java | 22 ++++++++++++++ .../src/main/resources/bootstrap.yml | 5 ++++ .../mapper/datastats/DatsStatsDao.xml | 7 +++++ 8 files changed, 122 insertions(+) create mode 100644 epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/DataStatsController.java create mode 100644 epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/datastats/DataStatsDao.java create mode 100644 epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/DataStatsService.java create mode 100644 epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java create mode 100644 epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/constant/DataSourceConstant.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/constant/DataSourceConstant.java index 07604c401d..b5395e65b6 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/constant/DataSourceConstant.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/constant/DataSourceConstant.java @@ -26,4 +26,6 @@ public interface DataSourceConstant { String EPMET_COMMON_SERVICE="commonservice"; String OPER_CRM="opercrm"; + + String DATA_STATISTICAL="datastatistical"; } diff --git a/epmet-module/data-aggregator/data-aggregator-server/pom.xml b/epmet-module/data-aggregator/data-aggregator-server/pom.xml index 7b74f08a23..604d182cb8 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/pom.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/pom.xml @@ -157,6 +157,13 @@ epmet_oper_crm_user EpmEt-db-UsEr + + + + + epmet_data_statistical_user + EpmEt-db-UsEr + 0 192.168.1.130 @@ -238,6 +245,13 @@ epmet_oper_crm_user EpmEt-db-UsEr + + + + + epmet_data_statistical_user + EpmEt-db-UsEr + 0 192.168.1.130 @@ -319,6 +333,13 @@ epmet elink@833066 + + + + + epmet_data_statistical_user + EpmEt-db-UsEr + 0 r-m5eoz5b6tkx09y6bpz.redis.rds.aliyuncs.com @@ -400,6 +421,13 @@ epmet_oper_crm_user EpmEt-db-UsEr + + + + + epmet_data_statistical_user + EpmEt-db-UsEr + 0 r-m5ez3n1j0qc3ykq2ut.redis.rds.aliyuncs.com diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/DataStatsController.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/DataStatsController.java new file mode 100644 index 0000000000..2b2abc3b51 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/DataStatsController.java @@ -0,0 +1,20 @@ +package com.epmet.dataaggre.controller; + +import com.epmet.dataaggre.service.datastats.DataStatsService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * @Author sun + * @Description 数据统计服务 + */ +@RestController +@RequestMapping("datastats") +public class DataStatsController { + + @Autowired + private DataStatsService dataStatsService; + + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/datastats/DataStatsDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/datastats/DataStatsDao.java new file mode 100644 index 0000000000..475f62cdea --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/datastats/DataStatsDao.java @@ -0,0 +1,29 @@ +/** + * 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.dataaggre.dao.datastats; + +import org.apache.ibatis.annotations.Mapper; + +/** + * @Author sun + * @Description 数据统计服务 + */ +@Mapper +public interface DataStatsDao { + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/DataStatsService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/DataStatsService.java new file mode 100644 index 0000000000..fca91d972e --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/DataStatsService.java @@ -0,0 +1,9 @@ +package com.epmet.dataaggre.service.datastats; + +/** + * @Author sun + * @Description 数据统计服务 + */ +public interface DataStatsService { + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java new file mode 100644 index 0000000000..d83e73545e --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java @@ -0,0 +1,22 @@ +package com.epmet.dataaggre.service.datastats.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.dataaggre.constant.DataSourceConstant; +import com.epmet.dataaggre.dao.datastats.DataStatsDao; +import com.epmet.dataaggre.service.datastats.DataStatsService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +/** + * @Author sun + * @Description 数据统计服务 + */ +@Service +@DataSource(DataSourceConstant.DATA_STATISTICAL) +@Slf4j +public class DataStatsServiceImpl implements DataStatsService { + @Autowired + private DataStatsDao dataStatsDao; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/bootstrap.yml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/bootstrap.yml index 6e27140e97..cd8b7b8ef1 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/bootstrap.yml +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/bootstrap.yml @@ -129,6 +129,11 @@ dynamic: url: @datasource.druid.opercrm.url@ username: @datasource.druid.opercrm.username@ password: @datasource.druid.opercrm.password@ + datastatistical: + driver-class-name: com.mysql.cj.jdbc.Driver + url: @datasource.druid.opercrm.url@ + username: @datasource.druid.opercrm.username@ + password: @datasource.druid.opercrm.password@ feign: hystrix: enabled: true diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml new file mode 100644 index 0000000000..8360ef814e --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file From bb2b3eede94da2570d885a42aabd6b83a3f42ce4 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 13 May 2021 09:11:35 +0800 Subject: [PATCH 008/128] zancun --- .../impl/CalGridIndexServiceImpl.java | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalGridIndexServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalGridIndexServiceImpl.java index fc3c7532d1..474456ec41 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalGridIndexServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalGridIndexServiceImpl.java @@ -130,6 +130,11 @@ public class CalGridIndexServiceImpl implements CalGridIndexService { }); } + // 组织“三会一课”次数 前网格下 满足【未取消的活动 and 签到记录>1 and 活动开始时间在当前时间维度内】 +1 + // 党员参加“三会一课”人次 :本网格内注册的党员,在本月内活动签到次数 + Map createThreeMeetsCountMap=getCreateThreeMeetsCountMap(customerId,monthId); + Map joinThreeMeetsCountMap=getJoinThreeMeetsCountMap(customerId,monthId); + String quarterId = DateUtils.getQuarterId(monthId); String yearId = DateUtils.getYearId(monthId); result.forEach(r -> { @@ -217,6 +222,14 @@ public class CalGridIndexServiceImpl implements CalGridIndexService { } }); } + // 组织“三会一课”次数 前网格下 满足【未取消的活动 and 签到记录>1 and 活动开始时间在当前时间维度内】 +1 + if (createThreeMeetsCountMap.containsKey(r.getGridId())) { + r.setCreateThreeMeetsCount(createThreeMeetsCountMap.get(r.getGridId())); + } + // 党员参加“三会一课”人次 :本网格内注册的党员,在本月内活动签到次数 + if (joinThreeMeetsCountMap.containsKey(r.getGridId())) { + r.setJoinThreeMeetsCount(joinThreeMeetsCountMap.get(r.getGridId())); + } }); delPartyAbility(customerId, monthId); List> partition = ListUtils.partition(result, NumConstant.ONE_HUNDRED); @@ -226,6 +239,19 @@ public class CalGridIndexServiceImpl implements CalGridIndexService { return true; } + + private Map getJoinThreeMeetsCountMap(String customerId, String monthId) { + // 组织“三会一课”次数 前网格下 满足【未取消的活动 and 签到记录>1 and 活动开始时间在当前时间维度内】 +1 + // todo + return null; + } + + private Map getCreateThreeMeetsCountMap(String customerId, String monthId) { + // 党员参加“三会一课”人次 :本网格内注册的党员,在本月内活动签到次数 + // todo + return null; + } + /** * @Description 计算网格指标治理能力 * @param customerId From 3b9ca27d03a19872e8ee4851f60feed93c2e8f2c Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 13 May 2021 10:11:06 +0800 Subject: [PATCH 009/128] =?UTF-8?q?=E7=BD=91=E6=A0=BC=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=EF=BC=9A=E7=BB=84=E7=BB=87=E2=80=9D=E4=B8=89=E4=BC=9A=E4=B8=80?= =?UTF-8?q?=E8=AF=BE=E2=80=9C=E6=AC=A1=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/dao/group/GroupDataDao.java | 10 +++++++ .../impl/CalGridIndexServiceImpl.java | 26 ++++++++++++++----- .../epmet/service/group/GroupDataService.java | 10 +++++++ .../group/impl/GroupDataServiceImpl.java | 13 ++++++++++ .../resources/mapper/group/GroupDataDao.xml | 18 +++++++++++++ 5 files changed, 70 insertions(+), 7 deletions(-) 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 fae2cfd223..80776d8798 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 @@ -7,6 +7,7 @@ import com.epmet.dto.group.form.GridGroupTotalFormDTO; import com.epmet.dto.group.form.GroupIncrFormDTO; import com.epmet.dto.group.result.*; import com.epmet.dto.indexcollect.result.CpcIndexCommonDTO; +import com.epmet.dto.indexcollect.result.GridIndexCommonDTO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -100,4 +101,13 @@ public interface GroupDataDao { * @return com.epmet.dto.indexcollect.result.CpcIndexCommonDTO */ List selectUserSignedCount(@Param("customerId")String customerId, @Param("monthId")String monthId); + + /** + * 网格相关:组织“三会一课”次数: 当前网格下 满足【未取消的活动 and 签到记录>1 and 活动开始时间在当前时间维度内】 +1 + * + * @param customerId + * @param monthId + * @return com.epmet.dto.indexcollect.result.CpcIndexCommonDTO + */ + List selectCountGridCreateThreeMeets(@Param("customerId")String customerId, @Param("monthId")String monthId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalGridIndexServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalGridIndexServiceImpl.java index 474456ec41..ef869f7941 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalGridIndexServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalGridIndexServiceImpl.java @@ -8,6 +8,7 @@ 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.dto.indexcollect.result.GridIndexCommonDTO; import com.epmet.entity.evaluationindex.indexcoll.FactIndexServiceAblityGridMonthlyEntity; import com.epmet.service.evaluationindex.extract.dataToIndex.CalGridIndexService; import com.epmet.service.evaluationindex.extract.todata.*; @@ -15,6 +16,7 @@ import com.epmet.service.evaluationindex.indexcoll.FactIndexGovrnAblityOrgMonthl import com.epmet.service.evaluationindex.indexcoll.FactIndexPartyAblityOrgMonthlyService; import com.epmet.service.evaluationindex.indexcoll.FactIndexServiceAblityGridMonthlyService; import com.epmet.service.evaluationindex.screen.ScreenCustomerGridService; +import com.epmet.service.group.GroupDataService; import com.epmet.service.heart.ActInfoService; import com.epmet.service.partymember.PartyMemberService; import com.epmet.service.stats.FactArticlePublishedGridDailyService; @@ -29,7 +31,10 @@ import org.springframework.util.CollectionUtils; import java.math.BigDecimal; import java.text.NumberFormat; -import java.util.*; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; import java.util.concurrent.atomic.AtomicReference; import java.util.stream.Collectors; @@ -71,6 +76,8 @@ public class CalGridIndexServiceImpl implements CalGridIndexService { private PartyMemberService partyMemberService; @Autowired private ScreenCustomerGridService gridService; + @Autowired + private GroupDataService groupDataService; /** * @Description 计算网格指标党建能力 @@ -131,8 +138,8 @@ public class CalGridIndexServiceImpl implements CalGridIndexService { } // 组织“三会一课”次数 前网格下 满足【未取消的活动 and 签到记录>1 and 活动开始时间在当前时间维度内】 +1 - // 党员参加“三会一课”人次 :本网格内注册的党员,在本月内活动签到次数 Map createThreeMeetsCountMap=getCreateThreeMeetsCountMap(customerId,monthId); + // 党员参加“三会一课”人次 :本网格内注册的党员,在本月内活动签到次数 Map joinThreeMeetsCountMap=getJoinThreeMeetsCountMap(customerId,monthId); String quarterId = DateUtils.getQuarterId(monthId); @@ -239,19 +246,24 @@ public class CalGridIndexServiceImpl implements CalGridIndexService { return true; } - - private Map getJoinThreeMeetsCountMap(String customerId, String monthId) { + private Map getCreateThreeMeetsCountMap(String customerId, String monthId) { // 组织“三会一课”次数 前网格下 满足【未取消的活动 and 签到记录>1 and 活动开始时间在当前时间维度内】 +1 - // todo - return null; + //查询小组活动签到表,计算用户在本月内签到的活动次数 + List list=groupDataService.selectCountGridCreateThreeMeets(customerId,monthId); + Map resultMap = new HashMap<>(); + for (GridIndexCommonDTO gridIndexCommonDTO : list) { + resultMap.put(gridIndexCommonDTO.getGridId(), gridIndexCommonDTO.getIndexValue()); + } + return resultMap; } - private Map getCreateThreeMeetsCountMap(String customerId, String monthId) { + private Map getJoinThreeMeetsCountMap(String customerId, String monthId) { // 党员参加“三会一课”人次 :本网格内注册的党员,在本月内活动签到次数 // todo return null; } + /** * @Description 计算网格指标治理能力 * @param customerId 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 6be5b22324..b1a07d9941 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 @@ -3,6 +3,7 @@ package com.epmet.service.group; import com.epmet.dto.extract.FactOriginGroupMainDailyDTO; import com.epmet.dto.group.result.*; import com.epmet.dto.indexcollect.result.CpcIndexCommonDTO; +import com.epmet.dto.indexcollect.result.GridIndexCommonDTO; import com.epmet.util.DimIdGenerator; import org.apache.ibatis.annotations.Param; @@ -75,4 +76,13 @@ public interface GroupDataService { * @return com.epmet.dto.indexcollect.result.CpcIndexCommonDTO */ List selectJoinThreeMeetsCount(String customerId, String monthId); + + /** + * 网格相关:组织“三会一课”次数: 当前网格下 满足【未取消的活动 and 签到记录>1 and 活动开始时间在当前时间维度内】 +1 + * + * @param customerId + * @param monthId + * @return com.epmet.dto.indexcollect.result.CpcIndexCommonDTO + */ + List selectCountGridCreateThreeMeets(String customerId, String monthId); } 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 550c0d73e8..d0a87ed295 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 @@ -11,6 +11,7 @@ import com.epmet.dto.group.form.GridGroupTotalFormDTO; import com.epmet.dto.group.form.GroupIncrFormDTO; import com.epmet.dto.group.result.*; import com.epmet.dto.indexcollect.result.CpcIndexCommonDTO; +import com.epmet.dto.indexcollect.result.GridIndexCommonDTO; import com.epmet.service.group.GroupDataService; import com.epmet.util.DimIdGenerator; import org.springframework.beans.BeanUtils; @@ -222,5 +223,17 @@ public class GroupDataServiceImpl implements GroupDataService { return groupDataDao.selectUserSignedCount(customerId,monthId); } + /** + * 网格相关:组织“三会一课”次数: 当前网格下 满足【未取消的活动 and 签到记录>1 and 活动开始时间在当前时间维度内】 +1 + * + * @param customerId + * @param monthId + * @return com.epmet.dto.indexcollect.result.CpcIndexCommonDTO + */ + @Override + public List selectCountGridCreateThreeMeets(String customerId, String monthId) { + return groupDataDao.selectCountGridCreateThreeMeets(customerId,monthId); + } + } 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 a5de0e01ab..d8ed5a56df 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 @@ -234,4 +234,22 @@ GROUP BY m.SIGN_USER_ID + + + \ No newline at end of file From 827b66b4cc7353af00361e04e1e7a90f3b46b6d4 Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Thu, 13 May 2021 10:47:02 +0800 Subject: [PATCH 010/128] =?UTF-8?q?=E5=B0=8F=E7=BB=84=E6=88=90=E5=91=98?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=98=AF=E5=90=A6=E5=85=9A=E5=91=98=E8=BA=AB?= =?UTF-8?q?=E4=BB=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../FactOriginGroupMemberDailyDTO.java | 146 ++++++++++++++ .../FactAgencyOriginProjectDailyDTO.java | 187 ++++++++++++++++++ .../FactAgencyOriginProjectMonthlyDTO.java | 172 ++++++++++++++++ .../FactOriginExtractController.java | 4 +- .../FactOriginGroupMemberDailyDao.java | 33 ++++ .../FactAgencyOriginProjectDailyDao.java | 33 ++++ .../FactAgencyOriginProjectMonthlyDao.java | 33 ++++ .../FactOriginGroupMemberDailyEntity.java | 116 +++++++++++ .../FactAgencyOriginProjectDailyEntity.java | 157 +++++++++++++++ .../FactAgencyOriginProjectMonthlyEntity.java | 142 +++++++++++++ .../FactOriginGroupMainDailyService.java | 3 +- .../FactOriginGroupMemberDailyService.java | 95 +++++++++ .../FactOriginGroupMainDailyServiceImpl.java | 18 +- ...FactOriginGroupMemberDailyServiceImpl.java | 101 ++++++++++ .../todata/impl/GroupExtractServiceImpl.java | 7 +- .../FactAgencyOriginProjectDailyService.java | 95 +++++++++ ...FactAgencyOriginProjectMonthlyService.java | 95 +++++++++ ...ctAgencyOriginProjectDailyServiceImpl.java | 101 ++++++++++ ...AgencyOriginProjectMonthlyServiceImpl.java | 101 ++++++++++ .../extract/FactOriginGroupMemberDailyDao.xml | 32 +++ .../stats/FactAgencyOriginProjectDailyDao.xml | 40 ++++ .../FactAgencyOriginProjectMonthlyDao.xml | 37 ++++ 22 files changed, 1740 insertions(+), 8 deletions(-) create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactOriginGroupMemberDailyDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactAgencyOriginProjectDailyDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactAgencyOriginProjectMonthlyDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginGroupMemberDailyDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactAgencyOriginProjectDailyDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactAgencyOriginProjectMonthlyDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginGroupMemberDailyEntity.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactAgencyOriginProjectDailyEntity.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactAgencyOriginProjectMonthlyEntity.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginGroupMemberDailyService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginGroupMemberDailyServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactAgencyOriginProjectDailyService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactAgencyOriginProjectMonthlyService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactAgencyOriginProjectDailyServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactAgencyOriginProjectMonthlyServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginGroupMemberDailyDao.xml create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactAgencyOriginProjectDailyDao.xml create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactAgencyOriginProjectMonthlyDao.xml diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactOriginGroupMemberDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactOriginGroupMemberDailyDTO.java new file mode 100644 index 0000000000..42ec5cd2b7 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactOriginGroupMemberDailyDTO.java @@ -0,0 +1,146 @@ +/** + * 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 2021-05-12 + */ +@Data +public class FactOriginGroupMemberDailyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 组Id + */ + private String groupId; + + /** + * 小组所在的网格id + */ + private String gridId; + + /** + * 小组所在的社区id + */ + private String agencyId; + + /** + * 小组所在的街道id + */ + private String parentId; + + /** + * 所有上级组织ID,英文:隔开 + */ + private String pids; + + /** + * 成员Id(userId) + */ + private String memberId; + + /** + * 客户Id + */ + private String customerId; + + /** + * leader(群主) member(成员) + */ + private String leaderFlag; + + /** + * 入群审核通过或自动加入群的日期 yyyyMMdd + */ + private String dateId; + + /** + * 入群周 2020W15 + */ + private String weekId; + + /** + * 入群月 202004 + */ + private String monthId; + + /** + * 入群季 2020Q2 + */ + private String quarterId; + + /** + * 入群年 2020 + */ + private String yearId; + + /** + * join(入群),群主建群自己入群也是join + */ + private String actionCode; + + /** + * 是否是党员 + */ + private Integer isParty; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 删除标识 + */ + private String delFlag; + + /** + * + */ + private String createdBy; + + /** + * + */ + private Date createdTime; + + /** + * + */ + private String updatedBy; + + /** + * + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactAgencyOriginProjectDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactAgencyOriginProjectDailyDTO.java new file mode 100644 index 0000000000..89809107e2 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactAgencyOriginProjectDailyDTO.java @@ -0,0 +1,187 @@ +/** + * 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.stats; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 机关下日项目数据统计 存放机关下截止到当前日期的各项总数据以及昨日新增各项数据,每日定时执行,先删后增 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-12 + */ +@Data +public class FactAgencyOriginProjectDailyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 客户Id 【dim_customer.id】 + */ + private String customerId; + + /** + * 机关Id 【dim_agency.id】 + */ + private String agencyId; + + /** + * 上级组织Id【dim_agency.pid】 + */ + private String parentId; + + /** + * 日维度Id 【dim_date.id】 + */ + private String dateId; + + /** + * 周维度Id 【dim_week.id】 + */ + private String weekId; + + /** + * 月维度Id 【dim_month.id】 + */ + private String monthId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 年维度Id 【dim_year.id】 + */ + private String yearId; + + /** + * 项目来源 来源:议题issue 组织agency + */ + private String origin; + + /** + * 截止当日项目总数 【当前组织及下级项目总数】 + */ + private Integer projectTotal; + + /** + * 截止当日处理中项目数 【当前组织及下级所有未结案项目总数】 + */ + private Integer pendingTotal; + + /** + * 截止当日处理中项目占比 【当前组织及下级未结案项目百分比(存百分比数,小数点后两位)】 + */ + private BigDecimal pendingRatio; + + /** + * 截止当日已结案项目数 【当前组织及下级已结案项目总数】 + */ + private Integer closedTotal; + + /** + * 截止当日已结案项目占比 【当前组织及下级已结案项目百分比(存百分比数,小数点后两位)】 + */ + private BigDecimal closedRatio; + + /** + * 截止当日已结案中已解决项目数 【当前组织及下级已结案项目中已解决总数】 + */ + private Integer resolvedTotal; + + /** + * 截止当日已结案中已解决项目占比 【当前组织及下级已结案项目中已解决占比】 + */ + private BigDecimal resolvedRatio; + + /** + * 截止当日已结案中未解决项目数 【当前组织及下级已结案项目中未解决总数】 + */ + private Integer unresolvedTotal; + + /** + * 截止当日已结案中未解决项目占比 【当前组织及下级已结案项目中未解决占比】 + */ + private BigDecimal unresolvedRatio; + + /** + * 当日项目总数 【当前组织及下级项目总数】 + */ + private Integer projectIncr; + + /** + * 当日处理中项目数 【当前组织及下级前一日新增处理中项目数】 + */ + private Integer pendingIncr; + + /** + * 当日已结案项目数 【当前组织及下级前一日新增结案项目数】 + */ + private Integer closedIncr; + + /** + * 当日已结案项目中已解决数 【当前组织及下级前一日新增结案中已解决项目数】 + */ + private Integer resolvedIncr; + + /** + * 当日已结案项目组未解决数 【当前组织及下级前一日新增结案中未解决项目数】 + */ + private Integer unresolvedIncr; + + /** + * 删除标识 【0.未删除 1.已删除】 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactAgencyOriginProjectMonthlyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactAgencyOriginProjectMonthlyDTO.java new file mode 100644 index 0000000000..b35d5f30dc --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactAgencyOriginProjectMonthlyDTO.java @@ -0,0 +1,172 @@ +/** + * 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.stats; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 机关下月项目数据统计 存放机关下截止到当前月份的各项总数据以及上月新增各项数据,每月月初定时执行,先删后增 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-12 + */ +@Data +public class FactAgencyOriginProjectMonthlyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 客户Id 【dim_customer.id】 + */ + private String customerId; + + /** + * 机关Id 【dim_agency.id】 + */ + private String agencyId; + + /** + * 上级组织Id【dim_agency.pid】 + */ + private String parentId; + + /** + * 月维度Id 【dim_month.id】 + */ + private String monthId; + + /** + * 季维度Id 【dim_quarter.id】 + */ + private String quarterId; + + /** + * 年维度Id 【dim_year.id】 + */ + private String yearId; + + /** + * 截止当月项目总数 【当前组织及下级项目总数】 + */ + private Integer projectTotal; + + /** + * 截止当月处理中项目数 【当前组织及下级所有未结案项目总数】 + */ + private Integer pendingTotal; + + /** + * 截止当月处理中项目占比 【当前组织及下级未结案项目百分比(存百分比数,小数点后两位)】 + */ + private BigDecimal pendingRatio; + + /** + * 截止当月已结案项目数 【当前组织及下级已结案项目总数】 + */ + private Integer closedTotal; + + /** + * 截止当月已结案项目占比 【当前组织及下级已结案项目百分比(存百分比数,小数点后两位)】 + */ + private BigDecimal closedRatio; + + /** + * 截止当月已结案中已解决项目数 【当前组织及下级已结案项目中已解决总数】 + */ + private Integer resolvedTotal; + + /** + * 截止当月已结案中已解决项目占比 【当前组织及下级已结案项目中已解决占比】 + */ + private BigDecimal resolvedRatio; + + /** + * 截止当月已结案中未解决项目数 【当前组织及下级已结案项目中未解决总数】 + */ + private Integer unresolvedTotal; + + /** + * 截止当月已结案中未解决项目占比 【当前组织及下级已结案项目中未解决占比】 + */ + private BigDecimal unresolvedRatio; + + /** + * 当月项目总数 【当前组织及下级前一月新增项目数】 + */ + private Integer projectIncr; + + /** + * 当月处理中项目数 【当前组织及下级前一月新增处理中项目数】 + */ + private Integer pendingIncr; + + /** + * 当月已结案项目数 【当前组织及下级前一月新增结案项目数】 + */ + private Integer closedIncr; + + /** + * 当月已结案项目中已解决数 【当前组织及下级前一日新增结案中已解决项目数】 + */ + private Integer resolvedIncr; + + /** + * 当月已结案项目组未解决数 【当前组织及下级前一日新增结案中未解决项目数】 + */ + private Integer unresolvedIncr; + + /** + * 删除标识 【0.未删除 1.已删除】 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactOriginExtractController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactOriginExtractController.java index 9542bdc580..2cce1d4a19 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactOriginExtractController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactOriginExtractController.java @@ -126,7 +126,9 @@ public class FactOriginExtractController { paramNew.setDateId(dateDimId); groupExtractService.extractGroupData(paramNew); } - }else groupExtractService.extractGroupData(param); + }else { + groupExtractService.extractGroupData(param); + } return new Result(); } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginGroupMemberDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginGroupMemberDailyDao.java new file mode 100644 index 0000000000..662f2a14c5 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginGroupMemberDailyDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.evaluationindex.extract; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.evaluationindex.extract.FactOriginGroupMemberDailyEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-12 + */ +@Mapper +public interface FactOriginGroupMemberDailyDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactAgencyOriginProjectDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactAgencyOriginProjectDailyDao.java new file mode 100644 index 0000000000..6428ba8104 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactAgencyOriginProjectDailyDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.stats; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.stats.FactAgencyOriginProjectDailyEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 机关下日项目数据统计 存放机关下截止到当前日期的各项总数据以及昨日新增各项数据,每日定时执行,先删后增 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-12 + */ +@Mapper +public interface FactAgencyOriginProjectDailyDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactAgencyOriginProjectMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactAgencyOriginProjectMonthlyDao.java new file mode 100644 index 0000000000..2848f6e90b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactAgencyOriginProjectMonthlyDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.stats; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.stats.FactAgencyOriginProjectMonthlyEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 机关下月项目数据统计 存放机关下截止到当前月份的各项总数据以及上月新增各项数据,每月月初定时执行,先删后增 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-12 + */ +@Mapper +public interface FactAgencyOriginProjectMonthlyDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginGroupMemberDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginGroupMemberDailyEntity.java new file mode 100644 index 0000000000..97317f5868 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginGroupMemberDailyEntity.java @@ -0,0 +1,116 @@ +/** + * 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 2021-05-12 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_origin_group_member_daily") +public class FactOriginGroupMemberDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 组Id + */ + private String groupId; + + /** + * 小组所在的网格id + */ + private String gridId; + + /** + * 小组所在的社区id + */ + private String agencyId; + + /** + * 小组所在的街道id + */ + private String parentId; + + /** + * 所有上级组织ID,英文:隔开 + */ + private String pids; + + /** + * 成员Id(userId) + */ + private String memberId; + + /** + * 客户Id + */ + private String customerId; + + /** + * leader(群主) member(成员) + */ + private String leaderFlag; + + /** + * 入群审核通过或自动加入群的日期 yyyyMMdd + */ + private String dateId; + + /** + * 入群周 2020W15 + */ + private String weekId; + + /** + * 入群月 202004 + */ + private String monthId; + + /** + * 入群季 2020Q2 + */ + private String quarterId; + + /** + * 入群年 2020 + */ + private String yearId; + + /** + * join(入群),群主建群自己入群也是join + */ + private String actionCode; + + /** + * 是否是党员 + */ + private Integer isParty; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactAgencyOriginProjectDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactAgencyOriginProjectDailyEntity.java new file mode 100644 index 0000000000..cb239df727 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactAgencyOriginProjectDailyEntity.java @@ -0,0 +1,157 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.stats; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 机关下日项目数据统计 存放机关下截止到当前日期的各项总数据以及昨日新增各项数据,每日定时执行,先删后增 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-12 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_agency_origin_project_daily") +public class FactAgencyOriginProjectDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id 【dim_customer.id】 + */ + private String customerId; + + /** + * 机关Id 【dim_agency.id】 + */ + private String agencyId; + + /** + * 上级组织Id【dim_agency.pid】 + */ + private String parentId; + + /** + * 日维度Id 【dim_date.id】 + */ + private String dateId; + + /** + * 周维度Id 【dim_week.id】 + */ + private String weekId; + + /** + * 月维度Id 【dim_month.id】 + */ + private String monthId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 年维度Id 【dim_year.id】 + */ + private String yearId; + + /** + * 项目来源 来源:议题issue 组织agency + */ + private String origin; + + /** + * 截止当日项目总数 【当前组织及下级项目总数】 + */ + private Integer projectTotal; + + /** + * 截止当日处理中项目数 【当前组织及下级所有未结案项目总数】 + */ + private Integer pendingTotal; + + /** + * 截止当日处理中项目占比 【当前组织及下级未结案项目百分比(存百分比数,小数点后两位)】 + */ + private BigDecimal pendingRatio; + + /** + * 截止当日已结案项目数 【当前组织及下级已结案项目总数】 + */ + private Integer closedTotal; + + /** + * 截止当日已结案项目占比 【当前组织及下级已结案项目百分比(存百分比数,小数点后两位)】 + */ + private BigDecimal closedRatio; + + /** + * 截止当日已结案中已解决项目数 【当前组织及下级已结案项目中已解决总数】 + */ + private Integer resolvedTotal; + + /** + * 截止当日已结案中已解决项目占比 【当前组织及下级已结案项目中已解决占比】 + */ + private BigDecimal resolvedRatio; + + /** + * 截止当日已结案中未解决项目数 【当前组织及下级已结案项目中未解决总数】 + */ + private Integer unresolvedTotal; + + /** + * 截止当日已结案中未解决项目占比 【当前组织及下级已结案项目中未解决占比】 + */ + private BigDecimal unresolvedRatio; + + /** + * 当日项目总数 【当前组织及下级项目总数】 + */ + private Integer projectIncr; + + /** + * 当日处理中项目数 【当前组织及下级前一日新增处理中项目数】 + */ + private Integer pendingIncr; + + /** + * 当日已结案项目数 【当前组织及下级前一日新增结案项目数】 + */ + private Integer closedIncr; + + /** + * 当日已结案项目中已解决数 【当前组织及下级前一日新增结案中已解决项目数】 + */ + private Integer resolvedIncr; + + /** + * 当日已结案项目组未解决数 【当前组织及下级前一日新增结案中未解决项目数】 + */ + private Integer unresolvedIncr; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactAgencyOriginProjectMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactAgencyOriginProjectMonthlyEntity.java new file mode 100644 index 0000000000..2acda24617 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactAgencyOriginProjectMonthlyEntity.java @@ -0,0 +1,142 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.stats; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 机关下月项目数据统计 存放机关下截止到当前月份的各项总数据以及上月新增各项数据,每月月初定时执行,先删后增 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-12 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_agency_origin_project_monthly") +public class FactAgencyOriginProjectMonthlyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id 【dim_customer.id】 + */ + private String customerId; + + /** + * 机关Id 【dim_agency.id】 + */ + private String agencyId; + + /** + * 上级组织Id【dim_agency.pid】 + */ + private String parentId; + + /** + * 月维度Id 【dim_month.id】 + */ + private String monthId; + + /** + * 季维度Id 【dim_quarter.id】 + */ + private String quarterId; + + /** + * 年维度Id 【dim_year.id】 + */ + private String yearId; + + /** + * 截止当月项目总数 【当前组织及下级项目总数】 + */ + private Integer projectTotal; + + /** + * 截止当月处理中项目数 【当前组织及下级所有未结案项目总数】 + */ + private Integer pendingTotal; + + /** + * 截止当月处理中项目占比 【当前组织及下级未结案项目百分比(存百分比数,小数点后两位)】 + */ + private BigDecimal pendingRatio; + + /** + * 截止当月已结案项目数 【当前组织及下级已结案项目总数】 + */ + private Integer closedTotal; + + /** + * 截止当月已结案项目占比 【当前组织及下级已结案项目百分比(存百分比数,小数点后两位)】 + */ + private BigDecimal closedRatio; + + /** + * 截止当月已结案中已解决项目数 【当前组织及下级已结案项目中已解决总数】 + */ + private Integer resolvedTotal; + + /** + * 截止当月已结案中已解决项目占比 【当前组织及下级已结案项目中已解决占比】 + */ + private BigDecimal resolvedRatio; + + /** + * 截止当月已结案中未解决项目数 【当前组织及下级已结案项目中未解决总数】 + */ + private Integer unresolvedTotal; + + /** + * 截止当月已结案中未解决项目占比 【当前组织及下级已结案项目中未解决占比】 + */ + private BigDecimal unresolvedRatio; + + /** + * 当月项目总数 【当前组织及下级前一月新增项目数】 + */ + private Integer projectIncr; + + /** + * 当月处理中项目数 【当前组织及下级前一月新增处理中项目数】 + */ + private Integer pendingIncr; + + /** + * 当月已结案项目数 【当前组织及下级前一月新增结案项目数】 + */ + private Integer closedIncr; + + /** + * 当月已结案项目中已解决数 【当前组织及下级前一日新增结案中已解决项目数】 + */ + private Integer resolvedIncr; + + /** + * 当月已结案项目组未解决数 【当前组织及下级前一日新增结案中未解决项目数】 + */ + private Integer unresolvedIncr; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginGroupMainDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginGroupMainDailyService.java index 9b4350b1fb..21d55ac87e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginGroupMainDailyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginGroupMainDailyService.java @@ -64,7 +64,8 @@ public interface FactOriginGroupMainDailyService extends BaseService originGroupData, List memberList, List missing); + boolean insertExtractedData(boolean isFirst, String customerId, String dateId, List originGroupData, + List memberList, List missing, List partyIds); /** * @param customerId diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginGroupMemberDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginGroupMemberDailyService.java new file mode 100644 index 0000000000..618c340d66 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginGroupMemberDailyService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.evaluationindex.extract.todata; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.extract.FactOriginGroupMemberDailyDTO; +import com.epmet.entity.evaluationindex.extract.FactOriginGroupMemberDailyEntity; + +import java.util.List; +import java.util.Map; + +/** + * + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-12 + */ +public interface FactOriginGroupMemberDailyService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-05-12 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-05-12 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return FactOriginGroupMemberDailyDTO + * @author generator + * @date 2021-05-12 + */ + FactOriginGroupMemberDailyDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-05-12 + */ + void save(FactOriginGroupMemberDailyDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-05-12 + */ + void update(FactOriginGroupMemberDailyDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-05-12 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginGroupMainDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginGroupMainDailyServiceImpl.java index 718a045131..d7819f31b1 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginGroupMainDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginGroupMainDailyServiceImpl.java @@ -18,15 +18,21 @@ package com.epmet.service.evaluationindex.extract.todata.impl; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.dao.evaluationindex.extract.FactOriginGroupMainDailyDao; +import com.epmet.dao.evaluationindex.extract.FactOriginGroupMemberDailyDao; import com.epmet.dto.extract.FactOriginGroupMainDailyDTO; import com.epmet.dto.extract.form.ScreenPartyLinkMassesDataFormDTO; import com.epmet.dto.extract.result.GridGroupUserCountResultDTO; import com.epmet.dto.extract.result.OrgStatisticsResultDTO; import com.epmet.dto.group.result.ExtractGroupMemberActionRecordResultDTO; import com.epmet.entity.evaluationindex.extract.FactOriginGroupMainDailyEntity; +import com.epmet.entity.evaluationindex.extract.FactOriginGroupMemberDailyEntity; import com.epmet.service.evaluationindex.extract.todata.FactOriginGroupMainDailyService; +import com.epmet.service.evaluationindex.extract.todata.FactOriginGroupMemberDailyService; 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; @@ -45,6 +51,8 @@ import java.util.stream.Collectors; @Service public class FactOriginGroupMainDailyServiceImpl extends BaseServiceImpl implements FactOriginGroupMainDailyService { + @Autowired + private FactOriginGroupMemberDailyService factOriginGroupMemberDailyService; /** * @return java.util.List @@ -84,7 +92,7 @@ public class FactOriginGroupMainDailyServiceImpl extends BaseServiceImpl originGroupData, List memberList,List missing) { + public boolean insertExtractedData(boolean isFirst, String customerId, String dateId,List originGroupData, List memberList,List missing, List partyIds) { if(!CollectionUtils.isEmpty(originGroupData)) { if (isFirst) { //isFirst @@ -96,9 +104,15 @@ public class FactOriginGroupMainDailyServiceImpl extends BaseServiceImpl members = ConvertUtils.sourceToTarget(memberList, FactOriginGroupMemberDailyEntity.class); + members.forEach(item -> { + if (partyIds.contains(item.getMemberId())) { + item.setIsParty(NumConstant.ONE); + } + }); baseDao.insertBatchMain(originGroupData); - baseDao.insertBatchMembers(memberList); + factOriginGroupMemberDailyService.insertBatch(members); } if(!CollectionUtils.isEmpty(missing)){ baseDao.deleteBatchByGroupId(customerId,missing); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginGroupMemberDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginGroupMemberDailyServiceImpl.java new file mode 100644 index 0000000000..aea9baa4bc --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginGroupMemberDailyServiceImpl.java @@ -0,0 +1,101 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.evaluationindex.extract.todata.impl; + +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.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.evaluationindex.extract.FactOriginGroupMemberDailyDao; +import com.epmet.dto.extract.FactOriginGroupMemberDailyDTO; +import com.epmet.entity.evaluationindex.extract.FactOriginGroupMemberDailyEntity; +import com.epmet.service.evaluationindex.extract.todata.FactOriginGroupMemberDailyService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-12 + */ +@Service +public class FactOriginGroupMemberDailyServiceImpl extends BaseServiceImpl implements FactOriginGroupMemberDailyService { + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, FactOriginGroupMemberDailyDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, FactOriginGroupMemberDailyDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public FactOriginGroupMemberDailyDTO get(String id) { + FactOriginGroupMemberDailyEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, FactOriginGroupMemberDailyDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(FactOriginGroupMemberDailyDTO dto) { + FactOriginGroupMemberDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactOriginGroupMemberDailyEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(FactOriginGroupMemberDailyDTO dto) { + FactOriginGroupMemberDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactOriginGroupMemberDailyEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/GroupExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/GroupExtractServiceImpl.java index 6f6451114d..209588d464 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/GroupExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/GroupExtractServiceImpl.java @@ -89,7 +89,7 @@ public class GroupExtractServiceImpl implements GroupExtractService { List memberList = new LinkedList<>(); if (!CollectionUtils.isEmpty(originGroupData)) { List gridList = dimGridService.getGridAttributes(param.getCustomerId(),null); - + List partyIds = userService.getPartymembersByCustomerId(param.getCustomerId()); if (!CollectionUtils.isEmpty(gridList)) { Map gridMap = gridList.stream().collect(Collectors.toMap(GridAttributesResultDTO::getGridId, Function.identity(), (key1, key2) -> key2)); @@ -166,14 +166,13 @@ public class GroupExtractServiceImpl implements GroupExtractService { param.getDateId(), originGroupData, memberList, - missingGroups + missingGroups, + partyIds ); } - - List partyIds = userService.getPartymembersByCustomerId(param.getCustomerId()); List heartedIds = userService.getWarmHeartedByCustomerId(param.getCustomerId()); if(!partyIds.isEmpty()) { factOriginGroupMainDailyDao.updatePartyFlag(partyIds, param.getCustomerId()); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactAgencyOriginProjectDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactAgencyOriginProjectDailyService.java new file mode 100644 index 0000000000..6a3e24b5f6 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactAgencyOriginProjectDailyService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.stats.FactAgencyOriginProjectDailyDTO; +import com.epmet.entity.stats.FactAgencyOriginProjectDailyEntity; + +import java.util.List; +import java.util.Map; + +/** + * 机关下日项目数据统计 存放机关下截止到当前日期的各项总数据以及昨日新增各项数据,每日定时执行,先删后增 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-12 + */ +public interface FactAgencyOriginProjectDailyService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-05-12 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-05-12 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return FactAgencyOriginProjectDailyDTO + * @author generator + * @date 2021-05-12 + */ + FactAgencyOriginProjectDailyDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-05-12 + */ + void save(FactAgencyOriginProjectDailyDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-05-12 + */ + void update(FactAgencyOriginProjectDailyDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-05-12 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactAgencyOriginProjectMonthlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactAgencyOriginProjectMonthlyService.java new file mode 100644 index 0000000000..5d3a4fdb19 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactAgencyOriginProjectMonthlyService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.stats.FactAgencyOriginProjectMonthlyDTO; +import com.epmet.entity.stats.FactAgencyOriginProjectMonthlyEntity; + +import java.util.List; +import java.util.Map; + +/** + * 机关下月项目数据统计 存放机关下截止到当前月份的各项总数据以及上月新增各项数据,每月月初定时执行,先删后增 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-12 + */ +public interface FactAgencyOriginProjectMonthlyService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-05-12 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-05-12 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return FactAgencyOriginProjectMonthlyDTO + * @author generator + * @date 2021-05-12 + */ + FactAgencyOriginProjectMonthlyDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-05-12 + */ + void save(FactAgencyOriginProjectMonthlyDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-05-12 + */ + void update(FactAgencyOriginProjectMonthlyDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-05-12 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactAgencyOriginProjectDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactAgencyOriginProjectDailyServiceImpl.java new file mode 100644 index 0000000000..ef08dc5cbf --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactAgencyOriginProjectDailyServiceImpl.java @@ -0,0 +1,101 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.stats.impl; + +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.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.stats.FactAgencyOriginProjectDailyDao; +import com.epmet.dto.stats.FactAgencyOriginProjectDailyDTO; +import com.epmet.entity.stats.FactAgencyOriginProjectDailyEntity; +import com.epmet.service.stats.FactAgencyOriginProjectDailyService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 机关下日项目数据统计 存放机关下截止到当前日期的各项总数据以及昨日新增各项数据,每日定时执行,先删后增 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-12 + */ +@Service +public class FactAgencyOriginProjectDailyServiceImpl extends BaseServiceImpl implements FactAgencyOriginProjectDailyService { + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, FactAgencyOriginProjectDailyDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, FactAgencyOriginProjectDailyDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public FactAgencyOriginProjectDailyDTO get(String id) { + FactAgencyOriginProjectDailyEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, FactAgencyOriginProjectDailyDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(FactAgencyOriginProjectDailyDTO dto) { + FactAgencyOriginProjectDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactAgencyOriginProjectDailyEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(FactAgencyOriginProjectDailyDTO dto) { + FactAgencyOriginProjectDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactAgencyOriginProjectDailyEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactAgencyOriginProjectMonthlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactAgencyOriginProjectMonthlyServiceImpl.java new file mode 100644 index 0000000000..55a965b5d3 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactAgencyOriginProjectMonthlyServiceImpl.java @@ -0,0 +1,101 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.stats.impl; + +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.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.stats.FactAgencyOriginProjectMonthlyDao; +import com.epmet.dto.stats.FactAgencyOriginProjectMonthlyDTO; +import com.epmet.entity.stats.FactAgencyOriginProjectMonthlyEntity; +import com.epmet.service.stats.FactAgencyOriginProjectMonthlyService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 机关下月项目数据统计 存放机关下截止到当前月份的各项总数据以及上月新增各项数据,每月月初定时执行,先删后增 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-12 + */ +@Service +public class FactAgencyOriginProjectMonthlyServiceImpl extends BaseServiceImpl implements FactAgencyOriginProjectMonthlyService { + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, FactAgencyOriginProjectMonthlyDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, FactAgencyOriginProjectMonthlyDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public FactAgencyOriginProjectMonthlyDTO get(String id) { + FactAgencyOriginProjectMonthlyEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, FactAgencyOriginProjectMonthlyDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(FactAgencyOriginProjectMonthlyDTO dto) { + FactAgencyOriginProjectMonthlyEntity entity = ConvertUtils.sourceToTarget(dto, FactAgencyOriginProjectMonthlyEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(FactAgencyOriginProjectMonthlyDTO dto) { + FactAgencyOriginProjectMonthlyEntity entity = ConvertUtils.sourceToTarget(dto, FactAgencyOriginProjectMonthlyEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginGroupMemberDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginGroupMemberDailyDao.xml new file mode 100644 index 0000000000..1c0a1d4edb --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginGroupMemberDailyDao.xml @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactAgencyOriginProjectDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactAgencyOriginProjectDailyDao.xml new file mode 100644 index 0000000000..bcc0f98ef5 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactAgencyOriginProjectDailyDao.xml @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactAgencyOriginProjectMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactAgencyOriginProjectMonthlyDao.xml new file mode 100644 index 0000000000..8fd44cba67 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactAgencyOriginProjectMonthlyDao.xml @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From df72dae3658534416016361b34503d824082c419 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Thu, 13 May 2021 11:07:23 +0800 Subject: [PATCH 011/128] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E8=AF=84=E4=BB=B7?= =?UTF-8?q?=E5=88=86=E6=95=B0DTO?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/form/ProjectEvaluateScoreFormDTO.java | 22 +++++++++++++++++++ .../result/ProjectEvaluateScoreResultDTO.java | 21 ++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ProjectEvaluateScoreFormDTO.java create mode 100644 epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectEvaluateScoreResultDTO.java diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ProjectEvaluateScoreFormDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ProjectEvaluateScoreFormDTO.java new file mode 100644 index 0000000000..df4c02015d --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ProjectEvaluateScoreFormDTO.java @@ -0,0 +1,22 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/5/13 11:05 上午 + * @DESC + */ +@Data +public class ProjectEvaluateScoreFormDTO implements Serializable { + + private static final long serialVersionUID = -8126781510521211570L; + + public interface ProjectEvaluateScoreForm{} + + @NotBlank(message = "projectId不能为空",groups = ProjectEvaluateScoreForm.class) + private String projectId; +} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectEvaluateScoreResultDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectEvaluateScoreResultDTO.java new file mode 100644 index 0000000000..6d92acd594 --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectEvaluateScoreResultDTO.java @@ -0,0 +1,21 @@ +package com.epmet.dto.result; + +import com.epmet.commons.tools.constant.NumConstant; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/5/13 10:57 上午 + * @DESC + */ +public class ProjectEvaluateScoreResultDTO implements Serializable { + + private static final long serialVersionUID = 3317308221138082162L; + + /** + * 项目评价分数 + */ + private Integer score = NumConstant.ZERO; + +} From ca96a3f34874ff134c2257018150c723598dd9d0 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 13 May 2021 11:18:48 +0800 Subject: [PATCH 012/128] =?UTF-8?q?=E7=BD=91=E6=A0=BC=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=EF=BC=9A=E5=85=9A=E5=91=98=E5=8F=82=E5=8A=A0=E2=80=9C=E4=B8=89?= =?UTF-8?q?=E4=BC=9A=E4=B8=80=E8=AF=BE=E2=80=9D=E4=BA=BA=E6=AC=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../result/PartyMemberInfoResultDTO.java | 5 +++ .../result/PartyJoinThreeMeetDTO.java | 20 +++++++++ .../dao/stats/DimCustomerPartymemberDao.java | 8 ++++ .../impl/CalGridIndexServiceImpl.java | 41 +++++++++++++++---- .../stats/DimCustomerPartymemberService.java | 8 ++++ .../DimCustomerPartymemberServiceImpl.java | 11 +++++ .../stats/DimCustomerPartymemberDao.xml | 12 ++++++ 7 files changed, 98 insertions(+), 7 deletions(-) create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/result/PartyJoinThreeMeetDTO.java diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/PartyMemberInfoResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/PartyMemberInfoResultDTO.java index 24e5ec021a..d0f56ff909 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/PartyMemberInfoResultDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/PartyMemberInfoResultDTO.java @@ -48,4 +48,9 @@ public class PartyMemberInfoResultDTO implements Serializable { * 机关名称 */ private String agencyName; + + /** + * 党员的用户id + */ + private String userId; } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/result/PartyJoinThreeMeetDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/result/PartyJoinThreeMeetDTO.java new file mode 100644 index 0000000000..b59fd8a969 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/result/PartyJoinThreeMeetDTO.java @@ -0,0 +1,20 @@ +package com.epmet.dto.indexcollect.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 网格相关:党员参加“三会一课”人次 用 + * + * @author yinzuomei@elink-cn.com + * @date 2021/5/13 10:50 + */ +@Data +public class PartyJoinThreeMeetDTO implements Serializable { + private static final long serialVersionUID = 3027535602832948917L; + private String gridId; + private String userId; + private Integer joinThreeMeetsCount; + +} 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 0d614b2e4a..3e69bc2837 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 @@ -100,4 +100,12 @@ public interface DimCustomerPartymemberDao extends BaseDao selectPartyMemberUserIdsByPids(@Param("customerId") String customerId, @Param("pids")String pids); + + /** + * 查询当前客户下所有注册的党员 + * + * @param customerId + * @return 返回网格id、用户id + */ + List selectPartyMemberInfoByCustomerId(@Param("customerId")String customerId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalGridIndexServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalGridIndexServiceImpl.java index ef869f7941..f0c009064f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalGridIndexServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalGridIndexServiceImpl.java @@ -1,6 +1,7 @@ package com.epmet.service.evaluationindex.extract.dataToIndex.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.constant.ExtractConstant; import com.epmet.constant.ProjectEvaluateConstant; @@ -8,7 +9,9 @@ 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.dto.indexcollect.result.CpcIndexCommonDTO; import com.epmet.dto.indexcollect.result.GridIndexCommonDTO; +import com.epmet.dto.indexcollect.result.PartyJoinThreeMeetDTO; import com.epmet.entity.evaluationindex.indexcoll.FactIndexServiceAblityGridMonthlyEntity; import com.epmet.service.evaluationindex.extract.dataToIndex.CalGridIndexService; import com.epmet.service.evaluationindex.extract.todata.*; @@ -19,6 +22,7 @@ import com.epmet.service.evaluationindex.screen.ScreenCustomerGridService; import com.epmet.service.group.GroupDataService; import com.epmet.service.heart.ActInfoService; import com.epmet.service.partymember.PartyMemberService; +import com.epmet.service.stats.DimCustomerPartymemberService; import com.epmet.service.stats.FactArticlePublishedGridDailyService; import com.epmet.service.stats.user.FactRegUserGridMonthlyService; import com.epmet.service.user.UserService; @@ -78,6 +82,8 @@ public class CalGridIndexServiceImpl implements CalGridIndexService { private ScreenCustomerGridService gridService; @Autowired private GroupDataService groupDataService; + @Autowired + private DimCustomerPartymemberService dimCustomerPartymemberService; /** * @Description 计算网格指标党建能力 @@ -140,7 +146,7 @@ public class CalGridIndexServiceImpl implements CalGridIndexService { // 组织“三会一课”次数 前网格下 满足【未取消的活动 and 签到记录>1 and 活动开始时间在当前时间维度内】 +1 Map createThreeMeetsCountMap=getCreateThreeMeetsCountMap(customerId,monthId); // 党员参加“三会一课”人次 :本网格内注册的党员,在本月内活动签到次数 - Map joinThreeMeetsCountMap=getJoinThreeMeetsCountMap(customerId,monthId); + List joinThreeMeetsCountList=getJoinThreeMeetsCountMap(customerId,monthId); String quarterId = DateUtils.getQuarterId(monthId); String yearId = DateUtils.getYearId(monthId); @@ -234,8 +240,14 @@ public class CalGridIndexServiceImpl implements CalGridIndexService { r.setCreateThreeMeetsCount(createThreeMeetsCountMap.get(r.getGridId())); } // 党员参加“三会一课”人次 :本网格内注册的党员,在本月内活动签到次数 - if (joinThreeMeetsCountMap.containsKey(r.getGridId())) { - r.setJoinThreeMeetsCount(joinThreeMeetsCountMap.get(r.getGridId())); + if (!CollectionUtils.isEmpty(joinThreeMeetsCountList)) { + Integer joinThreeMeetsCount = NumConstant.ZERO; + for (PartyJoinThreeMeetDTO dto : joinThreeMeetsCountList) { + if (dto.getGridId().equals(r.getGridId())) { + joinThreeMeetsCount += dto.getJoinThreeMeetsCount(); + } + } + r.setJoinThreeMeetsCount(joinThreeMeetsCount); } }); delPartyAbility(customerId, monthId); @@ -257,13 +269,28 @@ public class CalGridIndexServiceImpl implements CalGridIndexService { return resultMap; } - private Map getJoinThreeMeetsCountMap(String customerId, String monthId) { + private List getJoinThreeMeetsCountMap(String customerId, String monthId) { + List partyJoinThreeMeetDTOList = new ArrayList<>(); // 党员参加“三会一课”人次 :本网格内注册的党员,在本月内活动签到次数 - // todo - return null; + //1、查询出当前客户下注册的党员 + List list = dimCustomerPartymemberService.selectPartyMemberInfoByCustomerId(customerId); + if (!CollectionUtils.isEmpty(list)) { + partyJoinThreeMeetDTOList = ConvertUtils.sourceToTarget(list, PartyJoinThreeMeetDTO.class); + //2、查询出所有用户本月签到次数 + List userList = groupDataService.selectJoinThreeMeetsCount(customerId, monthId); + for (PartyJoinThreeMeetDTO partyJoinThreeMeetDTO : partyJoinThreeMeetDTOList) { + partyJoinThreeMeetDTO.setJoinThreeMeetsCount(NumConstant.ZERO); + for (CpcIndexCommonDTO cpcIndexCommonDTO : userList) { + if (partyJoinThreeMeetDTO.getUserId().equals(cpcIndexCommonDTO.getUserId())) { + partyJoinThreeMeetDTO.setJoinThreeMeetsCount(cpcIndexCommonDTO.getIndexValue()); + break; + } + } + } + } + return partyJoinThreeMeetDTOList; } - /** * @Description 计算网格指标治理能力 * @param customerId 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 d231065d66..d93248f4f5 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 @@ -131,4 +131,12 @@ public interface DimCustomerPartymemberService extends BaseService getPartyMemberUserIds(String customerId, String type,String orgId); + + /** + * 查询当前客户下所有注册的党员 + * + * @param customerId + * @return 返回网格id、用户id + */ + List selectPartyMemberInfoByCustomerId(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/impl/DimCustomerPartymemberServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimCustomerPartymemberServiceImpl.java index 5aa8fb1d26..cec5da65e6 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 @@ -246,4 +246,15 @@ public class DimCustomerPartymemberServiceImpl extends BaseServiceImpl selectPartyMemberInfoByCustomerId(String customerId) { + return baseDao.selectPartyMemberInfoByCustomerId(customerId); + } } \ 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 2d92d5d61b..564aca5628 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 @@ -140,4 +140,16 @@ AND dcp.CUSTOMER_ID =#{customerId} and dcp.PIDS LIKE CONCAT(#{pids},'%') + + + + \ No newline at end of file From 3b36db48a350237c17bf0118d8f784887f24456a Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Thu, 13 May 2021 13:40:05 +0800 Subject: [PATCH 013/128] =?UTF-8?q?=E5=9F=BA=E7=A1=80=E6=95=B0=E6=8D=AE-?= =?UTF-8?q?=E7=BB=84=E7=BB=87=E4=B8=8B=E4=BA=94=E9=A1=B9=E5=9F=BA=E7=A1=80?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=B1=87=E6=80=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../form/AgenctBasicDataFormDTO.java | 29 ++++++ .../result/AgencyBasicDataResultDTO.java | 96 +++++++++++++++++++ .../controller/DataStatsController.java | 21 +++- .../dataaggre/dao/datastats/DataStatsDao.java | 40 ++++++++ .../service/datastats/DataStatsService.java | 10 ++ .../datastats/impl/DataStatsServiceImpl.java | 94 +++++++++++++++++- .../mapper/datastats/DatsStatsDao.xml | 89 +++++++++++++++++ 7 files changed, 377 insertions(+), 2 deletions(-) create mode 100644 epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/AgenctBasicDataFormDTO.java create mode 100644 epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/AgencyBasicDataResultDTO.java diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/AgenctBasicDataFormDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/AgenctBasicDataFormDTO.java new file mode 100644 index 0000000000..0b79c2da2c --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/AgenctBasicDataFormDTO.java @@ -0,0 +1,29 @@ +package com.epmet.dataaggre.dto.datastats.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import com.epmet.dataaggre.dto.resigroup.form.CandidateListFormDTO; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Description 基础数据-组织各种数据汇总-接口入参 + * @Auth sun + */ +@Data +public class AgenctBasicDataFormDTO implements Serializable { + + private static final long serialVersionUID = -3381286960911634231L; + /** + * 组织Id + */ + @NotBlank(message = "组织ID不能为空",groups = AgenctBasicDataFormDTO.Agency.class) + private String agencyId; + /** + * 客户Id + */ + private String customerId; + public interface Agency extends CustomerClientShowGroup{} + +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/AgencyBasicDataResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/AgencyBasicDataResultDTO.java new file mode 100644 index 0000000000..25509719c4 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/AgencyBasicDataResultDTO.java @@ -0,0 +1,96 @@ +package com.epmet.dataaggre.dto.datastats.result; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * @Description 基础数据-组织各种数据汇总-接口返参 + * @Auth sun + */ +@Data +public class AgencyBasicDataResultDTO implements Serializable { + private static final long serialVersionUID = 466974582608407121L; + BigDecimal bi = new BigDecimal(0); + /** + * 客户Id + */ + private String customerId; + /** + * 组织Id + */ + private String agencyId; + //用户总数 + private Integer userTotal = 0; + //党员总数 + private Integer partyMemberTotal = 0; + //党员总数占比 + private BigDecimal partyMemberRatio = bi; + //居民总数 + private Integer resiTotal = 0; + //居民总数占比 + private BigDecimal resiRatio = bi; + //党群小组总数 + private Integer groupTotal = 0; + //楼院小组总数 + private Integer ordinaryTotal = 0; + //楼院小组总数占比 + private BigDecimal ordinaryRatio = bi; + //支部小组总数 + private Integer branchTotal = 0; + //支部小组总数占比 + private BigDecimal branchRatio = bi; + //话题总数 + private Integer topicTotal = 0; + //热议中总数 + private Integer discussingTotal = 0; + //热议中总数占比 + private BigDecimal discussingRatio = bi; + //已处理总数 + private Integer closedTopicTotal = 0; + //已处理总数占比 + private BigDecimal closedTopicRatio = bi; + //转议题总数 + private Integer shiftIssueTotal = 0; + //转议题总数占比 + private BigDecimal shiftIssueRatio = bi; + //议题总数 + private Integer issueTotal = 0; + //表决中总数 + private Integer votingTotal = 0; + //表决中总数占比 + private BigDecimal votingRatio = bi; + //已处理总数 + private Integer closedIssueTotal = 0; + //已处理总数占比 + private BigDecimal closedIssueRatio = bi; + //已转项目总数 + private Integer shiftProjectTotal = 0; + //已转项目总数占比 + private BigDecimal shiftProjectRatio = bi; + //项目总数 + private Integer projectTotal = 0; + //处理中总数 + private Integer pendingTotal = 0; + //处理中总数占比 + private BigDecimal pendingRatio = bi; + //已结案总数 + private Integer closedProjectTotal = 0; + //已结案总数占比 + private BigDecimal closedProjectRatio = bi; + + + @Data + public static class Topic implements Serializable { + //话题数量 + private Integer topicCount; + //话题状态 已关闭:closed、已屏蔽:hidden、 讨论中:discussing + private String topicStatus; + //话题已转议题数量 + private Integer shiftedIssueTotal; + //数据更新至 时间 + private String deadline; + } + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/DataStatsController.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/DataStatsController.java index 2b2abc3b51..f5919caac5 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/DataStatsController.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/DataStatsController.java @@ -1,13 +1,21 @@ package com.epmet.dataaggre.controller; +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.dataaggre.dto.datastats.form.AgenctBasicDataFormDTO; +import com.epmet.dataaggre.dto.datastats.result.AgencyBasicDataResultDTO; import com.epmet.dataaggre.service.datastats.DataStatsService; 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 sun - * @Description 数据统计服务 + * @Description 数据统计服务 */ @RestController @RequestMapping("datastats") @@ -16,5 +24,16 @@ public class DataStatsController { @Autowired private DataStatsService dataStatsService; + /** + * @Param formDTO + * @Description 组织下五项基础数据汇总 + * @author sun + */ + @PostMapping("agencybasicdata") + public Result agencyBasicData(@LoginUser TokenDto tokenDto, @RequestBody AgenctBasicDataFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, AgenctBasicDataFormDTO.Agency.class); + formDTO.setCustomerId(tokenDto.getCustomerId()); + return new Result().ok(dataStatsService.agencyBasicData(formDTO)); + } } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/datastats/DataStatsDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/datastats/DataStatsDao.java index 475f62cdea..7918222a52 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/datastats/DataStatsDao.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/datastats/DataStatsDao.java @@ -17,7 +17,11 @@ package com.epmet.dataaggre.dao.datastats; +import com.epmet.dataaggre.dto.datastats.result.AgencyBasicDataResultDTO; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * @Author sun @@ -26,4 +30,40 @@ import org.apache.ibatis.annotations.Mapper; @Mapper public interface DataStatsDao { + /** + * @Description 查询组织下注册用户最新日统计数据 + * @author sun + */ + AgencyBasicDataResultDTO getAgnecyRegUser(@Param("agencyId") String agencyId); + + /** + * @Description 查询组织下最新群组日统计数据 + * @author sun + */ + AgencyBasicDataResultDTO getAgnecyGroup(@Param("agencyId") String agencyId); + + /** + * @Description 查询组织下最新状态话题-机关日统计数据表 + * @author sun + */ + List getAgencyTopic(@Param("agencyId") String agencyId); + + /** + * @Description 查询组织下最新转议题话题-机关日统计数据表 + * @author sun + */ + AgencyBasicDataResultDTO.Topic getAgencyTopicShiftIssue(@Param("agencyId") String agencyId); + + /** + * @Description 查询组织下最新议题日统计数据 + * @author sun + */ + AgencyBasicDataResultDTO getAgencyIssue(@Param("agencyId") String agencyId); + + /** + * @Description 查询组织下最新项目日统计数据 + * @author sun + */ + AgencyBasicDataResultDTO getAgencyProject(@Param("agencyId") String agencyId); + } \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/DataStatsService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/DataStatsService.java index fca91d972e..566d849255 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/DataStatsService.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/DataStatsService.java @@ -1,9 +1,19 @@ package com.epmet.dataaggre.service.datastats; +import com.epmet.dataaggre.dto.datastats.form.AgenctBasicDataFormDTO; +import com.epmet.dataaggre.dto.datastats.result.AgencyBasicDataResultDTO; + /** * @Author sun * @Description 数据统计服务 */ public interface DataStatsService { + /** + * @Param formDTO + * @Description 组织下五项基础数据汇总 + * @author sun + */ + AgencyBasicDataResultDTO agencyBasicData(AgenctBasicDataFormDTO formDTO); + } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java index d83e73545e..688a2d6a91 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java @@ -1,16 +1,25 @@ package com.epmet.dataaggre.service.datastats.impl; import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.tools.constant.NumConstant; import com.epmet.dataaggre.constant.DataSourceConstant; import com.epmet.dataaggre.dao.datastats.DataStatsDao; +import com.epmet.dataaggre.dto.datastats.form.AgenctBasicDataFormDTO; +import com.epmet.dataaggre.dto.datastats.result.AgencyBasicDataResultDTO; import com.epmet.dataaggre.service.datastats.DataStatsService; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.math.BigDecimal; +import java.text.NumberFormat; +import java.util.List; +import java.util.concurrent.atomic.AtomicReference; +import java.util.stream.Collectors; + /** * @Author sun - * @Description 数据统计服务 + * @Description 数据统计服务 */ @Service @DataSource(DataSourceConstant.DATA_STATISTICAL) @@ -19,4 +28,87 @@ public class DataStatsServiceImpl implements DataStatsService { @Autowired private DataStatsDao dataStatsDao; + + /** + * @Param formDTO + * @Description 组织下五项基础数据汇总 + * @author sun + */ + @Override + public AgencyBasicDataResultDTO agencyBasicData(AgenctBasicDataFormDTO formDTO) { + AgencyBasicDataResultDTO resultDTO = new AgencyBasicDataResultDTO(); + resultDTO.setCustomerId(formDTO.getCustomerId()); + resultDTO.setAgencyId(formDTO.getAgencyId()); + NumberFormat numberFormat = NumberFormat.getInstance(); + numberFormat.setMaximumFractionDigits(NumConstant.SIX); + + //1.查询组织下注册用户最新日统计数据【只查询注册用户的统计数据,不涉及参与用户的】 + AgencyBasicDataResultDTO user = dataStatsDao.getAgnecyRegUser(formDTO.getAgencyId()); + if (null != user) { + resultDTO.setUserTotal(user.getUserTotal()); + resultDTO.setResiTotal(user.getResiTotal()); + resultDTO.setResiRatio(user.getResiTotal() == 0 || user.getUserTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) user.getResiTotal() / (float) user.getUserTotal()))); + resultDTO.setPartyMemberTotal(user.getPartyMemberTotal()); + resultDTO.setPartyMemberRatio(user.getPartyMemberTotal() == 0 || user.getUserTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) user.getPartyMemberTotal() / (float) user.getUserTotal()))); + } + + //2.查询组织下最新群组日统计数据 + AgencyBasicDataResultDTO group = dataStatsDao.getAgnecyGroup(formDTO.getAgencyId()); + if (null != user) { + resultDTO.setGroupTotal(group.getGroupTotal()); + resultDTO.setOrdinaryTotal(group.getOrdinaryTotal()); + resultDTO.setOrdinaryRatio(group.getOrdinaryTotal() == 0 || group.getGroupTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) group.getOrdinaryTotal() / (float) group.getGroupTotal()))); + resultDTO.setBranchTotal(group.getBranchTotal()); + resultDTO.setBranchRatio(group.getBranchTotal() == 0 || group.getGroupTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) group.getBranchTotal() / (float) group.getGroupTotal()))); + } + + //3.查询组织下最新话题日统计数据 + //状态话题-机关日统计数据表最新日期三种状态数据 + //机关日表里三种类型数据之和就是话题总量,讨论中数量与热议中不是一个概念,热议中=总量-关闭数-屏蔽数-转议题数 + List topic = dataStatsDao.getAgencyTopic(formDTO.getAgencyId()); + //转议题话题-机关日统计数据表 + AgencyBasicDataResultDTO.Topic topicSHiftIssue = dataStatsDao.getAgencyTopicShiftIssue(formDTO.getAgencyId()); + AtomicReference closedTotal = new AtomicReference<>(0); + AtomicReference hiddenTotal = new AtomicReference<>(0); + if (topic.size()>NumConstant.ZERO) { + resultDTO.setTopicTotal(topic.stream().collect(Collectors.summingInt(AgencyBasicDataResultDTO.Topic::getTopicCount))); + topic.forEach(t -> { + if (t.getTopicStatus().equals("closed")){ closedTotal.set(t.getTopicCount()); } + if (t.getTopicStatus().equals("hidden")){ hiddenTotal.set(t.getTopicCount()); } + }); + } + if (null != topicSHiftIssue) { + resultDTO.setShiftIssueTotal(topicSHiftIssue.getShiftedIssueTotal()); + resultDTO.setShiftIssueRatio(resultDTO.getShiftIssueTotal() == 0 || resultDTO.getTopicTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getShiftIssueTotal() / (float) resultDTO.getTopicTotal()))); + } + resultDTO.setDiscussingTotal(resultDTO.getTopicTotal()-closedTotal.get()-hiddenTotal.get()-resultDTO.getShiftIssueTotal()); + resultDTO.setDiscussingRatio(resultDTO.getDiscussingTotal() == 0 || resultDTO.getTopicTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getDiscussingTotal() / (float) resultDTO.getTopicTotal()))); + resultDTO.setClosedTopicTotal(closedTotal.get()); + resultDTO.setClosedTopicRatio(resultDTO.getClosedTopicTotal() == 0 || resultDTO.getTopicTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getClosedTopicTotal() / (float) resultDTO.getTopicTotal()))); + + //4.查询组织下最新议题日统计数据 + AgencyBasicDataResultDTO issue = dataStatsDao.getAgencyIssue(formDTO.getAgencyId()); + if (null != issue) { + resultDTO.setIssueTotal(issue.getIssueTotal()); + resultDTO.setVotingTotal(issue.getVotingTotal()); + resultDTO.setVotingRatio(resultDTO.getVotingTotal() == 0 || resultDTO.getIssueTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getVotingTotal() / (float) resultDTO.getIssueTotal()))); + resultDTO.setClosedIssueTotal(issue.getClosedIssueTotal()); + resultDTO.setClosedIssueRatio(resultDTO.getClosedIssueTotal() == 0 || resultDTO.getIssueTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getClosedIssueTotal() / (float) resultDTO.getIssueTotal()))); + resultDTO.setShiftProjectTotal(issue.getShiftProjectTotal()); + resultDTO.setShiftProjectRatio(resultDTO.getShiftProjectTotal() == 0 || resultDTO.getIssueTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getShiftProjectTotal() / (float) resultDTO.getIssueTotal()))); + } + + //5.查询组织下最新项目日统计数据 + AgencyBasicDataResultDTO project = dataStatsDao.getAgencyProject(formDTO.getAgencyId()); + if (null != project) { + resultDTO.setProjectTotal(project.getProjectTotal()); + resultDTO.setPendingTotal(project.getPendingTotal()); + resultDTO.setPendingRatio(resultDTO.getPendingTotal() == 0 || resultDTO.getProjectTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getPendingTotal() / (float) resultDTO.getProjectTotal()))); + resultDTO.setClosedProjectTotal(project.getClosedProjectTotal()); + resultDTO.setClosedProjectRatio(resultDTO.getClosedProjectTotal() == 0 || resultDTO.getProjectTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getClosedProjectTotal() / (float) resultDTO.getProjectTotal()))); + } + + return resultDTO; + } + } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml index 8360ef814e..07f4f4b448 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml @@ -3,5 +3,94 @@ + + + + + + + + + + + \ No newline at end of file From 356451982ccaf4ca040ec28fa2b02edc188098bf Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Thu, 13 May 2021 15:59:50 +0800 Subject: [PATCH 014/128] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=EF=BC=8C=E6=9F=A5=E8=AF=A2=E9=A1=B9=E7=9B=AE=E8=AF=84=E4=BB=B7?= =?UTF-8?q?=E5=BE=97=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../result/ProjectEvaluateScoreResultDTO.java | 6 +++++ ...ojectSatisfactionStatisticsController.java | 14 +++++++++++ .../dao/ProjectSatisfactionStatisticsDao.java | 11 ++++++++- .../ProjectSatisfactionStatisticsEntity.java | 13 ++++++++++ .../ProjectSatisfactionStatisticsService.java | 10 ++++++++ ...jectSatisfactionStatisticsServiceImpl.java | 24 +++++++++++++++++++ .../ProjectSatisfactionStatisticsDao.xml | 17 ++++--------- 7 files changed, 81 insertions(+), 14 deletions(-) diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectEvaluateScoreResultDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectEvaluateScoreResultDTO.java index 6d92acd594..06bf349809 100644 --- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectEvaluateScoreResultDTO.java +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectEvaluateScoreResultDTO.java @@ -1,6 +1,9 @@ package com.epmet.dto.result; import com.epmet.commons.tools.constant.NumConstant; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; import java.io.Serializable; @@ -9,6 +12,9 @@ import java.io.Serializable; * @DateTime 2021/5/13 10:57 上午 * @DESC */ +@Data +@AllArgsConstructor +@NoArgsConstructor public class ProjectEvaluateScoreResultDTO implements Serializable { private static final long serialVersionUID = 3317308221138082162L; diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectSatisfactionStatisticsController.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectSatisfactionStatisticsController.java index 8857e92695..78fed6b459 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectSatisfactionStatisticsController.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectSatisfactionStatisticsController.java @@ -26,6 +26,8 @@ import com.epmet.commons.tools.validator.group.AddGroup; import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.commons.tools.validator.group.DefaultGroup; import com.epmet.dto.ProjectSatisfactionStatisticsDTO; +import com.epmet.dto.form.ProjectEvaluateScoreFormDTO; +import com.epmet.dto.result.ProjectEvaluateScoreResultDTO; import com.epmet.excel.ProjectSatisfactionStatisticsExcel; import com.epmet.service.ProjectSatisfactionStatisticsService; import org.springframework.beans.factory.annotation.Autowired; @@ -91,4 +93,16 @@ public class ProjectSatisfactionStatisticsController { ExcelUtils.exportExcelToTarget(response, null, list, ProjectSatisfactionStatisticsExcel.class); } + /** + * @Description 项目评价分数 + * @Param formDTO + * @author zxc + * @date 2021/5/13 11:18 上午 + */ + @PostMapping("projectevaluatescore") + public Result projectEvaluateScore(@RequestBody ProjectEvaluateScoreFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, ProjectEvaluateScoreFormDTO.ProjectEvaluateScoreForm.class); + return new Result().ok(projectSatisfactionStatisticsService.projectEvaluateScore(formDTO)); + } + } \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectSatisfactionStatisticsDao.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectSatisfactionStatisticsDao.java index 1b05ef5788..60a2852e8f 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectSatisfactionStatisticsDao.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectSatisfactionStatisticsDao.java @@ -20,6 +20,7 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.entity.ProjectSatisfactionStatisticsEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; /** * 项目满意度调查统计表 @@ -29,5 +30,13 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface ProjectSatisfactionStatisticsDao extends BaseDao { - + + /** + * @Description 根据项目ID查询此项目评价信息 + * @Param projectId + * @author zxc + * @date 2021/5/13 1:28 下午 + */ + ProjectSatisfactionStatisticsEntity selectInfoByProjectId(@Param("projectId")String projectId); + } \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/ProjectSatisfactionStatisticsEntity.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/ProjectSatisfactionStatisticsEntity.java index 5474b38c88..d943a4a6cf 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/ProjectSatisfactionStatisticsEntity.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/ProjectSatisfactionStatisticsEntity.java @@ -22,6 +22,7 @@ import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableName; import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import com.epmet.commons.tools.constant.NumConstant; import lombok.Data; import lombok.EqualsAndHashCode; @@ -60,9 +61,21 @@ public class ProjectSatisfactionStatisticsEntity extends BaseEpmetEntity { */ private Integer badCount; + /** + * 应评价人数【等于实际表决人数】 + */ + private Integer shouldEvaluateCount; + /** * 客户ID */ @TableField(fill = FieldFill.INSERT) private String customerId; + + public ProjectSatisfactionStatisticsEntity() { + this.goodCount = NumConstant.ZERO; + this.perfectCount = NumConstant.ZERO; + this.badCount = NumConstant.ZERO; + this.shouldEvaluateCount = NumConstant.ZERO; + } } diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectSatisfactionStatisticsService.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectSatisfactionStatisticsService.java index 770a98d174..fa035d53f6 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectSatisfactionStatisticsService.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectSatisfactionStatisticsService.java @@ -20,6 +20,8 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; import com.epmet.dto.ProjectSatisfactionStatisticsDTO; +import com.epmet.dto.form.ProjectEvaluateScoreFormDTO; +import com.epmet.dto.result.ProjectEvaluateScoreResultDTO; import com.epmet.entity.ProjectSatisfactionStatisticsEntity; import java.util.List; @@ -92,4 +94,12 @@ public interface ProjectSatisfactionStatisticsService extends BaseService - - - - - - - - - - - - - + + \ No newline at end of file From 4ca51fec88d79b51d6bdd4953b24a9396ff19580 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Thu, 13 May 2021 17:27:58 +0800 Subject: [PATCH 015/128] =?UTF-8?q?=E7=BB=84=E7=BB=87=E3=80=81=E7=BD=91?= =?UTF-8?q?=E6=A0=BC=E5=B1=82=E7=BA=A7=E7=94=A8=E6=88=B7=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../form/AgenctBasicDataFormDTO.java | 4 - .../dto/datastats/form/SubAgencyFormDTO.java | 28 ++++++ .../dto/datastats/form/SubGridFormDTO.java | 28 ++++++ .../result/AgencyBasicDataResultDTO.java | 6 +- .../result/SubAgencyUserResultDTO.java | 33 +++++++ .../result/SubGridUserResultDTO.java | 33 +++++++ .../controller/DataStatsController.java | 33 ++++++- .../dataaggre/dao/datastats/DataStatsDao.java | 27 ++++++ .../entity/datastats/DimAgencyEntity.java | 78 +++++++++++++++ .../entity/datastats/DimCustomerEntity.java | 49 ++++++++++ .../entity/datastats/DimGridEntity.java | 59 +++++++++++ .../service/datastats/DataStatsService.java | 19 ++++ .../datastats/impl/DataStatsServiceImpl.java | 97 ++++++++++++++++++- .../mapper/datastats/DatsStatsDao.xml | 57 +++++++++++ 14 files changed, 538 insertions(+), 13 deletions(-) create mode 100644 epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/SubAgencyFormDTO.java create mode 100644 epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/SubGridFormDTO.java create mode 100644 epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubAgencyUserResultDTO.java create mode 100644 epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubGridUserResultDTO.java create mode 100644 epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/datastats/DimAgencyEntity.java create mode 100644 epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/datastats/DimCustomerEntity.java create mode 100644 epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/datastats/DimGridEntity.java diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/AgenctBasicDataFormDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/AgenctBasicDataFormDTO.java index 0b79c2da2c..609cf1729a 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/AgenctBasicDataFormDTO.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/AgenctBasicDataFormDTO.java @@ -20,10 +20,6 @@ public class AgenctBasicDataFormDTO implements Serializable { */ @NotBlank(message = "组织ID不能为空",groups = AgenctBasicDataFormDTO.Agency.class) private String agencyId; - /** - * 客户Id - */ - private String customerId; public interface Agency extends CustomerClientShowGroup{} } diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/SubAgencyFormDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/SubAgencyFormDTO.java new file mode 100644 index 0000000000..c70db44b6e --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/SubAgencyFormDTO.java @@ -0,0 +1,28 @@ +package com.epmet.dataaggre.dto.datastats.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Description 基础数据-组织直属下级数据汇总-接口入参 + * @Auth sun + */ +@Data +public class SubAgencyFormDTO implements Serializable { + + private static final long serialVersionUID = -3381286960911634231L; + /** + * 组织Id + */ + @NotBlank(message = "组织ID不能为空",groups = SubAgencyFormDTO.Agency.class) + private String agencyId; + /** + * 日维度Id + */ + private String dateId; + public interface Agency extends CustomerClientShowGroup{} + +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/SubGridFormDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/SubGridFormDTO.java new file mode 100644 index 0000000000..e21141e22a --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/SubGridFormDTO.java @@ -0,0 +1,28 @@ +package com.epmet.dataaggre.dto.datastats.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Description 基础数据-组织直属网格数据汇总-接口入参 + * @Auth sun + */ +@Data +public class SubGridFormDTO implements Serializable { + + private static final long serialVersionUID = -3381286960911634231L; + /** + * 组织Id + */ + @NotBlank(message = "组织ID不能为空",groups = SubGridFormDTO.Agency.class) + private String agencyId; + /** + * 日维度Id + */ + private String dateId; + public interface Agency extends CustomerClientShowGroup{} + +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/AgencyBasicDataResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/AgencyBasicDataResultDTO.java index 25509719c4..ad7869fd0b 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/AgencyBasicDataResultDTO.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/AgencyBasicDataResultDTO.java @@ -1,5 +1,6 @@ package com.epmet.dataaggre.dto.datastats.result; +import com.fasterxml.jackson.annotation.JsonIgnore; import lombok.Data; import java.io.Serializable; @@ -12,11 +13,8 @@ import java.math.BigDecimal; @Data public class AgencyBasicDataResultDTO implements Serializable { private static final long serialVersionUID = 466974582608407121L; + @JsonIgnore BigDecimal bi = new BigDecimal(0); - /** - * 客户Id - */ - private String customerId; /** * 组织Id */ diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubAgencyUserResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubAgencyUserResultDTO.java new file mode 100644 index 0000000000..a60c3ad76b --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubAgencyUserResultDTO.java @@ -0,0 +1,33 @@ +package com.epmet.dataaggre.dto.datastats.result; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * @Description 基础数据-查询当前组织的直属下级组织用户数据-接口返参 + * @Auth sun + */ +@Data +public class SubAgencyUserResultDTO implements Serializable { + private static final long serialVersionUID = 466974582608407121L; + @JsonIgnore + BigDecimal bi = new BigDecimal(0); + //组织Id + private String agencyId; + //组织名称 + private String agencyName; + //用户总数 + private Integer userTotal = 0; + //党员总数 + private Integer partyMemberTotal = 0; + //党员总数占比 + private BigDecimal partyMemberRatio = bi; + //居民总数 + private Integer resiTotal = 0; + //居民总数占比 + private BigDecimal resiRatio = bi; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubGridUserResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubGridUserResultDTO.java new file mode 100644 index 0000000000..243ae23961 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubGridUserResultDTO.java @@ -0,0 +1,33 @@ +package com.epmet.dataaggre.dto.datastats.result; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * @Description 基础数据-查询当前组织下直属网格列表用户数据-接口返参 + * @Auth sun + */ +@Data +public class SubGridUserResultDTO implements Serializable { + private static final long serialVersionUID = 466974582608407121L; + @JsonIgnore + BigDecimal bi = new BigDecimal(0); + //网格Id + private String gridId; + //网格名称 + private String gridName; + //用户总数 + private Integer userTotal = 0; + //党员总数 + private Integer partyMemberTotal = 0; + //党员总数占比 + private BigDecimal partyMemberRatio = bi; + //居民总数 + private Integer resiTotal = 0; + //居民总数占比 + private BigDecimal resiRatio = bi; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/DataStatsController.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/DataStatsController.java index f5919caac5..81188aee40 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/DataStatsController.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/DataStatsController.java @@ -1,11 +1,13 @@ package com.epmet.dataaggre.controller; -import com.epmet.commons.tools.annotation.LoginUser; -import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dataaggre.dto.datastats.form.AgenctBasicDataFormDTO; +import com.epmet.dataaggre.dto.datastats.form.SubAgencyFormDTO; +import com.epmet.dataaggre.dto.datastats.form.SubGridFormDTO; import com.epmet.dataaggre.dto.datastats.result.AgencyBasicDataResultDTO; +import com.epmet.dataaggre.dto.datastats.result.SubAgencyUserResultDTO; +import com.epmet.dataaggre.dto.datastats.result.SubGridUserResultDTO; import com.epmet.dataaggre.service.datastats.DataStatsService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; @@ -13,6 +15,8 @@ import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; +import java.util.List; + /** * @Author sun * @Description 数据统计服务 @@ -30,10 +34,31 @@ public class DataStatsController { * @author sun */ @PostMapping("agencybasicdata") - public Result agencyBasicData(@LoginUser TokenDto tokenDto, @RequestBody AgenctBasicDataFormDTO formDTO) { + public Result agencyBasicData(@RequestBody AgenctBasicDataFormDTO formDTO) { ValidatorUtils.validateEntity(formDTO, AgenctBasicDataFormDTO.Agency.class); - formDTO.setCustomerId(tokenDto.getCustomerId()); return new Result().ok(dataStatsService.agencyBasicData(formDTO)); } + /** + * @Param formDTO + * @Description 查询当前组织的直属下级组织用户数据 + * @author sun + */ + @PostMapping("subagencyuser") + public Result> subAgencyUser(@RequestBody SubAgencyFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, SubAgencyFormDTO.Agency.class); + return new Result>().ok(dataStatsService.subAgencyUser(formDTO)); + } + + /** + * @Param formDTO + * @Description 查询当前组织下直属网格列表用户数据 + * @author sun + */ + @PostMapping("subgriduser") + public Result> subGridUser(@RequestBody SubGridFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, SubGridFormDTO.Agency.class); + return new Result>().ok(dataStatsService.subGridUser(formDTO)); + } + } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/datastats/DataStatsDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/datastats/DataStatsDao.java index 7918222a52..cfc28bc839 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/datastats/DataStatsDao.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/datastats/DataStatsDao.java @@ -18,6 +18,10 @@ package com.epmet.dataaggre.dao.datastats; import com.epmet.dataaggre.dto.datastats.result.AgencyBasicDataResultDTO; +import com.epmet.dataaggre.dto.datastats.result.SubAgencyUserResultDTO; +import com.epmet.dataaggre.dto.datastats.result.SubGridUserResultDTO; +import com.epmet.dataaggre.entity.datastats.DimAgencyEntity; +import com.epmet.dataaggre.entity.datastats.DimGridEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -66,4 +70,27 @@ public interface DataStatsDao { */ AgencyBasicDataResultDTO getAgencyProject(@Param("agencyId") String agencyId); + /** + * @Description 查询当前组织的直属下级组织信息 + * @author sun + */ + List getSubAgencyList(@Param("pid") String pid); + + /** + * @Description 查询当前组织的直属下级组织信息 + * @author sun + */ + List getSubAgencyUser(@Param("agencyIds") List agencyIds, @Param("dateId") String dateId); + + /** + * @Description 查询组织下网格列表 + * @author sun + */ + List getSubGridList(@Param("agencyId") String agencyId); + + /** + * @Description 查询网格层级注册用户日统计数据 + * @author sun + */ + List getSubGridUser(@Param("gridIds") List gridIds, @Param("dateId") String dateId); } \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/datastats/DimAgencyEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/datastats/DimAgencyEntity.java new file mode 100644 index 0000000000..efec2115db --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/datastats/DimAgencyEntity.java @@ -0,0 +1,78 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dataaggre.entity.datastats; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + + +/** + * 机关维度 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("dim_agency") +public class DimAgencyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 组织名称 + */ + private String agencyName; + + /** + * 客户ID + */ + private String customerId; + + /** + * 上级组织机构ID,根组织为0 + */ + private String pid; + + /** + * 所有上级组织机构ID(以英文:隔开) + */ + private String pids; + + /** + * 机关维度类型。self:机关本身自己,all:机关自己+下级+网格+部门等 + */ + private String agencyDimType; + + /** + * 所有上级名称,以-连接 + */ + private String allParentName; + + /** + * 机关级别(社区级:community, + * 乡(镇、街道)级:street, + * 区县级: district, + * 市级: city + * 省级:province) + */ + private String level; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/datastats/DimCustomerEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/datastats/DimCustomerEntity.java new file mode 100644 index 0000000000..7037fe122a --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/datastats/DimCustomerEntity.java @@ -0,0 +1,49 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dataaggre.entity.datastats; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + + +/** + * 客户维度 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("dim_customer") +public class DimCustomerEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户名称 + */ + private String customerName; + + /** + * 客户所属行政地区编码,取值来自客户根组织的area_code(01.14 add) + */ + private String areaCode; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/datastats/DimGridEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/datastats/DimGridEntity.java new file mode 100644 index 0000000000..fcb170a9e2 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/datastats/DimGridEntity.java @@ -0,0 +1,59 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dataaggre.entity.datastats; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + + +/** + * 客户网格维度 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("dim_grid") +public class DimGridEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 网格名称 + */ + private String gridName; + + /** + * 客户ID + */ + private String customerId; + + /** + * 所属组织机构ID(customer_agency.id) + */ + private String agencyId; + + /** + * 所属地区码(所属组织地区码) + */ + private String areaCode; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/DataStatsService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/DataStatsService.java index 566d849255..a69361e18a 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/DataStatsService.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/DataStatsService.java @@ -1,7 +1,13 @@ package com.epmet.dataaggre.service.datastats; import com.epmet.dataaggre.dto.datastats.form.AgenctBasicDataFormDTO; +import com.epmet.dataaggre.dto.datastats.form.SubAgencyFormDTO; +import com.epmet.dataaggre.dto.datastats.form.SubGridFormDTO; import com.epmet.dataaggre.dto.datastats.result.AgencyBasicDataResultDTO; +import com.epmet.dataaggre.dto.datastats.result.SubAgencyUserResultDTO; +import com.epmet.dataaggre.dto.datastats.result.SubGridUserResultDTO; + +import java.util.List; /** * @Author sun @@ -16,4 +22,17 @@ public interface DataStatsService { */ AgencyBasicDataResultDTO agencyBasicData(AgenctBasicDataFormDTO formDTO); + /** + * @Param formDTO + * @Description 查询当前组织的直属下级组织用户数据 + * @author sun + */ + List subAgencyUser(SubAgencyFormDTO formDTO); + + /** + * @Param formDTO + * @Description 查询当前组织下直属网格列表用户数据 + * @author sun + */ + List subGridUser(SubGridFormDTO formDTO); } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java index 688a2d6a91..1587588412 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java @@ -1,18 +1,30 @@ package com.epmet.dataaggre.service.datastats.impl; import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.utils.DateUtils; import com.epmet.dataaggre.constant.DataSourceConstant; import com.epmet.dataaggre.dao.datastats.DataStatsDao; import com.epmet.dataaggre.dto.datastats.form.AgenctBasicDataFormDTO; +import com.epmet.dataaggre.dto.datastats.form.SubAgencyFormDTO; +import com.epmet.dataaggre.dto.datastats.form.SubGridFormDTO; import com.epmet.dataaggre.dto.datastats.result.AgencyBasicDataResultDTO; +import com.epmet.dataaggre.dto.datastats.result.SubAgencyUserResultDTO; +import com.epmet.dataaggre.dto.datastats.result.SubGridUserResultDTO; +import com.epmet.dataaggre.entity.datastats.DimAgencyEntity; +import com.epmet.dataaggre.entity.datastats.DimGridEntity; import com.epmet.dataaggre.service.datastats.DataStatsService; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.math.BigDecimal; import java.text.NumberFormat; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Date; import java.util.List; import java.util.concurrent.atomic.AtomicReference; import java.util.stream.Collectors; @@ -37,7 +49,6 @@ public class DataStatsServiceImpl implements DataStatsService { @Override public AgencyBasicDataResultDTO agencyBasicData(AgenctBasicDataFormDTO formDTO) { AgencyBasicDataResultDTO resultDTO = new AgencyBasicDataResultDTO(); - resultDTO.setCustomerId(formDTO.getCustomerId()); resultDTO.setAgencyId(formDTO.getAgencyId()); NumberFormat numberFormat = NumberFormat.getInstance(); numberFormat.setMaximumFractionDigits(NumConstant.SIX); @@ -111,4 +122,88 @@ public class DataStatsServiceImpl implements DataStatsService { return resultDTO; } + /** + * @Param formDTO + * @Description 查询当前组织的直属下级组织用户数据 + * @author sun + */ + @Override + public List subAgencyUser(SubAgencyFormDTO formDTO) { + List resultList = new ArrayList<>(); + NumberFormat numberFormat = NumberFormat.getInstance(); + numberFormat.setMaximumFractionDigits(NumConstant.SIX); + + //入参有日期的则按具体时间执行,没有的则按当前时间前一天执行 + if (StringUtils.isBlank(formDTO.getDateId())) { + Date yesterday = DateUtils.addDateDays(new Date(), -1); + SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); + formDTO.setDateId(format.format(yesterday)); + } + + //1.查询当前组织的直属下级组织信息【机关维度】 + List subAgencyList = dataStatsDao.getSubAgencyList(formDTO.getAgencyId()); + if(subAgencyList.size() agencyIds = subAgencyList.stream().map(DimAgencyEntity::getId).collect(Collectors.toList()); + + //2.查询直属下级组织注册用户日统计数据,默认按用户总数降序 + resultList = dataStatsDao.getSubAgencyUser(agencyIds, formDTO.getDateId()); + + //3.封装数据并返回 + resultList.forEach(re->{ + re.setPartyMemberRatio(re.getPartyMemberTotal() == 0 || re.getUserTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getPartyMemberTotal() / (float) re.getUserTotal()))); + re.setResiRatio(re.getResiTotal() == 0 || re.getUserTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getResiTotal() / (float) re.getUserTotal()))); + subAgencyList.forEach(sub->{ + if(re.getAgencyId().equals(sub.getId())){ + re.setAgencyName(sub.getAgencyName()); + } + }); + }); + + return resultList; + } + + /** + * @Param formDTO + * @Description 查询当前组织下直属网格列表用户数据 + * @author sun + */ + @Override + public List subGridUser(SubGridFormDTO formDTO) { + List resultList = new ArrayList<>(); + NumberFormat numberFormat = NumberFormat.getInstance(); + numberFormat.setMaximumFractionDigits(NumConstant.SIX); + + //入参有日期的则按具体时间执行,没有的则按当前时间前一天执行 + if (StringUtils.isBlank(formDTO.getDateId())) { + Date yesterday = DateUtils.addDateDays(new Date(), -1); + SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); + formDTO.setDateId(format.format(yesterday)); + } + + //1.查询组织直属网格列表【网格维度】 + List gridList = dataStatsDao.getSubGridList(formDTO.getAgencyId()); + if(gridList.size() gridIds = gridList.stream().map(DimGridEntity::getId).collect(Collectors.toList()); + + //2.查询网格层级注册用户日统计数据,默认按用户总数降序 + resultList = dataStatsDao.getSubGridUser(gridIds, formDTO.getDateId()); + + //3.封装数据并返回 + resultList.forEach(re->{ + re.setPartyMemberRatio(re.getPartyMemberTotal() == 0 || re.getUserTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getPartyMemberTotal() / (float) re.getUserTotal()))); + re.setResiRatio(re.getResiTotal() == 0 || re.getUserTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getResiTotal() / (float) re.getUserTotal()))); + gridList.forEach(sub->{ + if(re.getGridId().equals(sub.getId())){ + re.setGridName(sub.getGridName()); + } + }); + }); + + return resultList; + } + } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml index 07f4f4b448..b07c649371 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml @@ -93,4 +93,61 @@ LIMIT 1 + + + + + + + + \ No newline at end of file From 183977481f50b760c5b746fde6cd5232bd8ca15b Mon Sep 17 00:00:00 2001 From: jianjun Date: Thu, 13 May 2021 18:10:08 +0800 Subject: [PATCH 016/128] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=9A=82=E5=AD=98=20?= =?UTF-8?q?=E6=80=95=E4=B8=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/io/renren/GeneratorApplication.java | 1 + .../index/dto/IndexExplainDTO.java | 122 ++++++++++++ .../index/dto/IndexExplainTreeDTO.java | 97 ++++++++++ .../index/form/IndexExplainFormDTO.java | 52 +++++ .../index/result/IndexExplainChildResult.java | 25 +++ .../index/result/IndexExplainResult.java | 48 +++++ .../index/result/IndexGroupDetailResult.java | 92 +++++++++ .../index/result/IndexScoreDetailResult.java | 44 +++++ .../datareport/constant/IndexConstant.java | 74 +++++++ .../index/IndexExplainController.java | 62 ++++++ .../java/com/epmet/datareport/dao/.gitignore | 0 .../index/IndexExplainDao.java | 36 ++++ .../evaluationindex/index/IndexGroupDao.java | 33 ++++ .../index/IndexGroupDetailDao.java | 45 +++++ .../IndexGroupDetailEntity.java | 90 +++++++++ .../evaluationindex/IndexGroupEntity.java | 68 +++++++ .../index/IndexExplainService.java | 42 ++++ .../index/impl/IndexExplainServiceImpl.java | 181 ++++++++++++++++++ .../mapper/{fact => index}/IndexDictDao.xml | 0 .../mapper/index/IndexExplainDao.xml | 41 ++++ .../resources/mapper/index/IndexGroupDao.xml | 23 +++ .../mapper/index/IndexGroupDetailDao.xml | 36 ++++ 22 files changed, 1212 insertions(+) create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/dto/IndexExplainDTO.java create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/dto/IndexExplainTreeDTO.java create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/form/IndexExplainFormDTO.java create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/result/IndexExplainChildResult.java create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/result/IndexExplainResult.java create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/result/IndexGroupDetailResult.java create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/result/IndexScoreDetailResult.java create mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/constant/IndexConstant.java create mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/index/IndexExplainController.java delete mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/.gitignore create mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/index/IndexExplainDao.java create mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/index/IndexGroupDao.java create mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/index/IndexGroupDetailDao.java create mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/entity/evaluationindex/IndexGroupDetailEntity.java create mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/entity/evaluationindex/IndexGroupEntity.java create mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/index/IndexExplainService.java create mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/index/impl/IndexExplainServiceImpl.java rename epmet-module/data-report/data-report-server/src/main/resources/mapper/{fact => index}/IndexDictDao.xml (100%) create mode 100644 epmet-module/data-report/data-report-server/src/main/resources/mapper/index/IndexExplainDao.xml create mode 100644 epmet-module/data-report/data-report-server/src/main/resources/mapper/index/IndexGroupDao.xml create mode 100644 epmet-module/data-report/data-report-server/src/main/resources/mapper/index/IndexGroupDetailDao.xml diff --git a/epmet-cloud-generator/src/main/java/io/renren/GeneratorApplication.java b/epmet-cloud-generator/src/main/java/io/renren/GeneratorApplication.java index 143c4bda3a..caad8b0869 100644 --- a/epmet-cloud-generator/src/main/java/io/renren/GeneratorApplication.java +++ b/epmet-cloud-generator/src/main/java/io/renren/GeneratorApplication.java @@ -8,5 +8,6 @@ public class GeneratorApplication { public static void main(String[] args) { SpringApplication.run(GeneratorApplication.class, args); + System.out.println("http://localhost:8070/epmet-cloud-generator/#generator.html"); } } diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/dto/IndexExplainDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/dto/IndexExplainDTO.java new file mode 100644 index 0000000000..9980f5500d --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/dto/IndexExplainDTO.java @@ -0,0 +1,122 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.evaluationindex.index.dto; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 指标说明文案 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-12 + */ +@Data +public class IndexExplainDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户id + */ + private String customerId; + + /** + * 标题 + */ + private String title; + + /** + * 指标code + */ + private String indexCode; + + /** + * 含义 + */ + private String meaning; + + /** + * 组织级别(网格级:grid;社区级:community;乡(镇、街道)级:street;区县级: district;市级: city;省级:province) + */ + private String orgLevel; + + /** + * 父ID + */ + private String pid; + + /** + * 排序 + */ + private Integer sort; + + /** + * 是否需要查询;1有;0:无; + */ + private Integer isSearch; + + /** + * 数据类型:none;本级:self;下级:sub + */ + private String type; + + /** + * 是否下钻:1 是;0否;eg:网格的下级分数 下钻到党员 + */ + private Integer goDown; + + /** + * 删除标记 0:未删除,1:已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/dto/IndexExplainTreeDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/dto/IndexExplainTreeDTO.java new file mode 100644 index 0000000000..e50b466e9d --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/dto/IndexExplainTreeDTO.java @@ -0,0 +1,97 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.evaluationindex.index.dto; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + + +/** + * 指标说明文案 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-12 + */ +@Data +public class IndexExplainTreeDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户id + */ + private String customerId; + + /** + * 标题 + */ + private String title; + + /** + * 含义 + */ + private String meaning; + + /** + * 指标code + */ + private String indexCode; + + /** + * 组织级别(网格级:grid;社区级:community;乡(镇、街道)级:street;区县级: district;市级: city;省级:province) + */ + private String orgLevel; + + /** + * 父ID + */ + private String pid; + + /** + * 排序 + */ + private Integer sort; + + /** + * 是否需要查询;1有;0:无; + */ + private Integer isSearch; + + /** + * 数据类型:none;本级:self;下级:sub + */ + private String type; + + /** + * 是否下钻:1 是;0否;eg:网格的下级分数 下钻到党员 + */ + private Integer goDown; + + /** + * 子节点 + */ + List children; + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/form/IndexExplainFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/form/IndexExplainFormDTO.java new file mode 100644 index 0000000000..7d17b128d1 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/form/IndexExplainFormDTO.java @@ -0,0 +1,52 @@ +/** + * 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.evaluationindex.index.form; + +import lombok.Data; + +import java.io.Serializable; + + +/** + * 指标说明文案查询参数 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-12 + */ +@Data +public class IndexExplainFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + + /** + * 客户id + */ + private String customerId; + + /** + * 组织级别(网格级:grid;社区级:community;乡(镇、街道)级:street;区县级: district;市级: city;省级:province) + */ + private String orgLevel; + + /** + * 组织id + */ + private String orgId; + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/result/IndexExplainChildResult.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/result/IndexExplainChildResult.java new file mode 100644 index 0000000000..261c8b775d --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/result/IndexExplainChildResult.java @@ -0,0 +1,25 @@ +package com.epmet.evaluationindex.index.result; + +import com.epmet.evaluationindex.index.dto.IndexExplainDTO; +import lombok.Data; + +import java.util.List; + +/** + * desc:得分明细说明结果类 + * + * @author: LiuJanJun + * @date: 2021/5/12 4:19 下午 + * @version: 1.0 + */ +@Data +public class IndexExplainChildResult extends IndexExplainDTO { + + private static final long serialVersionUID = -3997821113617472317L; + + + + + + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/result/IndexExplainResult.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/result/IndexExplainResult.java new file mode 100644 index 0000000000..5e37adf827 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/result/IndexExplainResult.java @@ -0,0 +1,48 @@ +package com.epmet.evaluationindex.index.result; + +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + +/** + * desc:得分明细说明结果类 + * + * @author: LiuJanJun + * @date: 2021/5/12 4:19 下午 + * @version: 1.0 + */ +@Data +public class IndexExplainResult { + + /** + * 标题 + */ + private String title; + + /** + * 含义 + */ + private String meaning; + + /** + * 子节点 list + */ + private List children = new ArrayList<>(); + + /** + * 子节点data list + */ + private List tableDataList = new ArrayList<>(); + /** + * 子节点标题 list + */ + private List tableTileList = new ArrayList<>(); + + /** + * 阈值说明列表 + */ + private List thresholdList = new ArrayList<>(); + + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/result/IndexGroupDetailResult.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/result/IndexGroupDetailResult.java new file mode 100644 index 0000000000..170aed8ec9 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/result/IndexGroupDetailResult.java @@ -0,0 +1,92 @@ +/** + * 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.evaluationindex.index.result; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * 客户指标详情 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-12 + */ +@Data + +public class IndexGroupDetailResult implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * index_group.id + */ + private String indexGroupId; + + /** + * 指标id + */ + private String indexId; + + /** + * 指标code + */ + private String indexCode; + + /** + * 指标名称 + */ + private String indexName; + + /** + * 所有有权重的指标code拼接的字符串 冒号隔开 + */ + private String allParentIndexCode; + + /** + * 所有指标code拼接的字符串 冒号隔开 + */ + private String allIndexCodePath; + + /** + * 权重(同一组权重总和=1) + */ + private BigDecimal weight; + + /** + * 计算阈值,-1:没有阈值;如果是百分数则 为0.00几;如果为数据则直接填数值 + */ + private BigDecimal threshold; + + /** + * 是否启用:启用:enable 禁用:disabled + */ + private String status; + + /** + * 正相关:positive;负相关:negative + */ + private String correlation; + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/result/IndexScoreDetailResult.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/result/IndexScoreDetailResult.java new file mode 100644 index 0000000000..8eb5fb8ecb --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/result/IndexScoreDetailResult.java @@ -0,0 +1,44 @@ +package com.epmet.evaluationindex.index.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * desc:得分明细说明结果类 + * + * @author: LiuJanJun + * @date: 2021/5/12 4:19 下午 + * @version: 1.0 + */ +@Data +public class IndexScoreDetailResult implements Serializable { + + private static final long serialVersionUID = -3997821113617472317L; + /** + * 指标code + */ + private String indexCode; + /** + * 指标名称 + */ + private String indexName; + + /** + * 原始值(如果是平均分的话 则为 参与平均的个数) + */ + private String originValue; + + /** + * 分值 + */ + private String score; + + /** + * 分值 + */ + private String weight; + + + +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/constant/IndexConstant.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/constant/IndexConstant.java new file mode 100644 index 0000000000..df3239962b --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/constant/IndexConstant.java @@ -0,0 +1,74 @@ +package com.epmet.datareport.constant; + +import org.apache.commons.lang3.StringUtils; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +/** + * @author sun + * @dscription 数据 + */ +public class IndexConstant { + + /** + * 评价指标类型-百分比 + */ + public static final List ScoreLastHeader = Arrays.asList("指标值", "得分", "权重"); + public static final List QuantityLastHeader = Arrays.asList("数量", "平均值", "权重"); + + private static final String DJZS_CN = "党建指数"; + private static final String FWZS_CN = "服务指数"; + private static final String ZLZS_CN = "治理指数"; + private static final String ZB_CN = "指标"; + private static final String BEN_JI = "本级"; + private static final String XIA_JI = "下级"; + + + /** + * desc: 根据indexCode 获取表格表头 + * + * @param allIndexCode + * @return java.util.List + * @author LiuJanJun + * @date 2021/5/13 11:06 上午 + */ + public static List getStandardSelfHeaders(String allIndexCode) { + List result = new ArrayList<>(8); + if (StringUtils.isBlank(allIndexCode)) { + return null; + } + + if (allIndexCode.contains(FactConstant.DJNL)) { + result.add(BEN_JI + DJZS_CN + ZB_CN); + } else if (allIndexCode.contains(FactConstant.FWNL)) { + result.add(BEN_JI + FWZS_CN + ZB_CN); + } else if (allIndexCode.contains(FactConstant.ZLNL)) { + result.add(BEN_JI + ZLZS_CN + ZB_CN); + } + result.addAll(ScoreLastHeader); + return result; + } + + /** + * desc: 根据indexCode 获取表格表头 + * + * @param allIndexCode + * @return java.util.List + * @author LiuJanJun + * @date 2021/5/13 11:06 上午 + */ + public static List getStandardSubHeaders(String allIndexCode) { + List result = new ArrayList<>(8); + if (allIndexCode.contains(FactConstant.DJNL)) { + result.add(XIA_JI + DJZS_CN + ZB_CN); + } else if (allIndexCode.contains(FactConstant.FWNL)) { + result.add(XIA_JI + FWZS_CN + ZB_CN); + } else if (allIndexCode.contains(FactConstant.ZLNL)) { + result.add(XIA_JI + ZLZS_CN + ZB_CN); + } + result.addAll(QuantityLastHeader); + return result; + } +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/index/IndexExplainController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/index/IndexExplainController.java new file mode 100644 index 0000000000..14ab225481 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/index/IndexExplainController.java @@ -0,0 +1,62 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.datareport.controller.index; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.datareport.service.evaluationindex.index.IndexExplainService; +import com.epmet.evaluationindex.index.form.IndexExplainFormDTO; +import com.epmet.evaluationindex.index.result.IndexExplainResult; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + + +/** + * 指标说明文案 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-12 + */ +@RestController +@RequestMapping("indexexplain") +public class IndexExplainController { + + @Autowired + private IndexExplainService indexExplainService; + + + /** + * desc: 获取得分说明明细 + * + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @author LiuJanJun + * @date 2021/5/12 4:12 下午 + */ + @PostMapping("detail") + public Result> getScoreDetail(@RequestBody IndexExplainFormDTO formDTO){ + Result> ok = new Result>().ok(indexExplainService.getScoreDetail(formDTO)); + return ok; + } + + +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/.gitignore b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/.gitignore deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/index/IndexExplainDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/index/IndexExplainDao.java new file mode 100644 index 0000000000..64fc30bac1 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/index/IndexExplainDao.java @@ -0,0 +1,36 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.datareport.dao.evaluationindex.index; + +import com.epmet.evaluationindex.index.dto.IndexExplainTreeDTO; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 指标说明文案 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-12 + */ +@Mapper +public interface IndexExplainDao { + + List getIndexExplainTreeByOrgType(@Param("orgLevel") String orgLevel); +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/index/IndexGroupDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/index/IndexGroupDao.java new file mode 100644 index 0000000000..31a4dd6030 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/index/IndexGroupDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.datareport.dao.evaluationindex.index; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.datareport.entity.evaluationindex.IndexGroupEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 客户指标分组 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-12 + */ +@Mapper +public interface IndexGroupDao extends BaseDao { + +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/index/IndexGroupDetailDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/index/IndexGroupDetailDao.java new file mode 100644 index 0000000000..06cfac4493 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/index/IndexGroupDetailDao.java @@ -0,0 +1,45 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.datareport.dao.evaluationindex.index; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.datareport.entity.evaluationindex.IndexGroupDetailEntity; +import com.epmet.evaluationindex.index.result.IndexGroupDetailResult; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * 客户指标详情 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-12 + */ +@Mapper +public interface IndexGroupDetailDao extends BaseDao { + + /** + * desc: 根据客户Id获取客户所有指标数据 + * + * @param customerId + * @return java.util.List + * @author LiuJanJun + * @date 2021/5/13 2:41 下午 + */ + List getAllIndexByCId(String customerId); +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/entity/evaluationindex/IndexGroupDetailEntity.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/entity/evaluationindex/IndexGroupDetailEntity.java new file mode 100644 index 0000000000..9e73f700a7 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/entity/evaluationindex/IndexGroupDetailEntity.java @@ -0,0 +1,90 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.datareport.entity.evaluationindex; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; + +/** + * 客户指标详情 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-12 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("index_group_detail") +public class IndexGroupDetailEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * index_group.id + */ + private String indexGroupId; + + /** + * 指标id + */ + private String indexId; + + /** + * 指标code + */ + private String indexCode; + + /** + * 所有有权重的指标code拼接的字符串 冒号隔开 + */ + private String allParentIndexCode; + + /** + * 所有指标code拼接的字符串 冒号隔开 + */ + private String allIndexCodePath; + + /** + * 权重(同一组权重总和=1) + */ + private BigDecimal weight; + + /** + * 计算阈值,-1:没有阈值;如果是百分数则 为0.00几;如果为数据则直接填数值 + */ + private BigDecimal threshold; + + /** + * 是否启用:启用:enable 禁用:disabled + */ + private String status; + + /** + * 正相关:positive;负相关:negative + */ + private String correlation; + +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/entity/evaluationindex/IndexGroupEntity.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/entity/evaluationindex/IndexGroupEntity.java new file mode 100644 index 0000000000..31716ee9ec --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/entity/evaluationindex/IndexGroupEntity.java @@ -0,0 +1,68 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.datareport.entity.evaluationindex; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 客户指标分组 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-12 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("index_group") +public class IndexGroupEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 指标id + */ + private String indexId; + + /** + * 指标code + */ + private String indexCode; + + /** + * 是否启用:启用:enable 禁用:disabled + */ + private String status; + + /** + * 当前指标关联的上一级指标分组,如果没有上一级,则为0 + */ + private String parentIndexGroupId; + + /** + * 所有指标code拼接的字符串 冒号隔开 + */ + private String allIndexCodePath; + +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/index/IndexExplainService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/index/IndexExplainService.java new file mode 100644 index 0000000000..54c12aed09 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/index/IndexExplainService.java @@ -0,0 +1,42 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.datareport.service.evaluationindex.index; + +import com.epmet.evaluationindex.index.form.IndexExplainFormDTO; +import com.epmet.evaluationindex.index.result.IndexExplainResult; + +import java.util.List; + +/** + * 指标说明文案 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-12 + */ +public interface IndexExplainService { + + /** + * desc: 获取指标得分说明 + * + * @param formDTO + * @return java.util.List + * @author LiuJanJun + * @date 2021/5/12 4:38 下午 + */ + List getScoreDetail(IndexExplainFormDTO formDTO); +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/index/impl/IndexExplainServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/index/impl/IndexExplainServiceImpl.java new file mode 100644 index 0000000000..b21d3f0ec4 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/index/impl/IndexExplainServiceImpl.java @@ -0,0 +1,181 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.datareport.service.evaluationindex.index.impl; + +import com.alibaba.fastjson.JSON; +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.constant.DataSourceConstant; +import com.epmet.datareport.constant.IndexConstant; +import com.epmet.datareport.dao.evaluationindex.index.IndexExplainDao; +import com.epmet.datareport.dao.evaluationindex.index.IndexGroupDetailDao; +import com.epmet.datareport.dao.fact.FactIndexGridSubScoreDao; +import com.epmet.datareport.service.evaluationindex.index.IndexExplainService; +import com.epmet.evaluationindex.index.dto.IndexExplainTreeDTO; +import com.epmet.evaluationindex.index.form.IndexExplainFormDTO; +import com.epmet.evaluationindex.index.result.IndexExplainResult; +import com.epmet.evaluationindex.index.result.IndexGroupDetailResult; +import com.epmet.evaluationindex.index.result.IndexScoreDetailResult; +import com.epmet.evaluationindex.screen.dto.form.AblityListFormDTO; +import com.epmet.evaluationindex.screen.dto.result.AblityListResultDTO; +import org.apache.commons.collections4.CollectionUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * 指标说明文案 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-12 + */ +@Service +@DataSource(DataSourceConstant.EVALUATION_INDEX) +public class IndexExplainServiceImpl implements IndexExplainService { + + @Autowired + private IndexExplainDao indexExplainDao; + @Autowired + private IndexGroupDetailDao indexGroupDetailDao; + @Autowired + private FactIndexGridSubScoreDao gridSubScoreDao; + + + @Override + public List getScoreDetail(IndexExplainFormDTO formDTO) { + List results = new ArrayList<>(); + List explainDTOList = indexExplainDao.getIndexExplainTreeByOrgType(formDTO.getOrgLevel()); + if (CollectionUtils.isEmpty(explainDTOList)) { + return null; + } + List groupDetailEntities = indexGroupDetailDao.getAllIndexByCId(formDTO.getCustomerId()); + if (CollectionUtils.isEmpty(groupDetailEntities)) { + return null; + } + Map> detailEntityMap = groupDetailEntities.stream().collect(Collectors.groupingBy(IndexGroupDetailResult::getAllParentIndexCode)); + + + for (IndexExplainTreeDTO explainDTO : explainDTOList) { + //根节点 + IndexExplainResult result = new IndexExplainResult(); + results.add(result); + result.setTitle(explainDTO.getTitle()); + result.setMeaning(explainDTO.getMeaning()); + + setTableData(formDTO, detailEntityMap, explainDTO, result); + + + setChildren(formDTO, detailEntityMap, result, explainDTO, explainDTO.getChildren()); + System.out.println(JSON.toJSONString(result)); + } + + + return results; + } + + private void setTableData(IndexExplainFormDTO formDTO, Map> detailEntityMap, IndexExplainTreeDTO explainDTO, IndexExplainResult result) { + Integer goDown = explainDTO.getGoDown(); + if (NumConstant.ONE == explainDTO.getIsSearch()) { + List tableHeaders = getTableHeaders(explainDTO); + result.setTableTileList(tableHeaders); + switch (explainDTO.getOrgLevel()) { + case "grid": + String type = explainDTO.getType(); + String allIndexCodePath = explainDTO.getIndexCode(); + List indexGroupDetailEntities = detailEntityMap.get(allIndexCodePath); + List tableList = new ArrayList<>(); + indexGroupDetailEntities.forEach(index -> { + //设置默认值 + if (!index.getAllIndexCodePath().contains(type)) { + return; + } + IndexScoreDetailResult table = new IndexScoreDetailResult(); + table.setIndexCode(index.getIndexCode()); + table.setIndexName(index.getIndexName()); + table.setOriginValue(NumConstant.ZERO_STR); + table.setScore(NumConstant.ZERO_STR); + table.setWeight(index.getWeight().multiply(new BigDecimal(100)).setScale(NumConstant.TWO, BigDecimal.ROUND_HALF_UP) + "%"); + tableList.add(table); + + + }); + result.setTableDataList(tableList); + //set Target value + if (goDown == 1) { + AblityListFormDTO ablityListFormDTO = new AblityListFormDTO(); + ablityListFormDTO.setCustomerId(formDTO.getCustomerId()); + ablityListFormDTO.setOrgId(formDTO.getOrgId()); + ablityListFormDTO.setOrgType(formDTO.getOrgLevel()); + ablityListFormDTO.setMonthId(DateUtils.getCurrentTimeBeforeMonthId()); + ablityListFormDTO.setAllParentIndexCode(allIndexCodePath); + + List scoreList = gridSubScoreDao.selectGridAblityList(ablityListFormDTO); + scoreList.forEach(score -> { + for (IndexScoreDetailResult tb : tableList) { + if (tb.getIndexCode().equals(score.getKey())) { + tb.setOriginValue(score.getValue()); + tb.setScore(String.valueOf(score.getScore())); + tb.setWeight(score.getWeight().multiply(new BigDecimal(100)).setScale(NumConstant.TWO, BigDecimal.ROUND_HALF_UP) + "%"); + } + } + }); + } + break; + default: + + } + } + } + + private void setChildren(IndexExplainFormDTO formDTO, Map> detailEntityMap, IndexExplainResult result, IndexExplainTreeDTO parentNode, List children) { + List childrenList = new ArrayList<>(); + children.forEach(child -> { + IndexExplainResult ch = new IndexExplainResult(); + ch.setTitle(child.getTitle()); + ch.setMeaning(child.getMeaning()); + if (CollectionUtils.isNotEmpty(child.getChildren())) { + setChildren(formDTO, detailEntityMap, ch, child, child.getChildren()); + } + setTableData(formDTO, detailEntityMap, child, ch); + childrenList.add(ch); + }); + result.setChildren(childrenList); + } + + public static void main(String[] args) { + + } + + private List getTableHeaders(IndexExplainTreeDTO explain) { + String type = explain.getType(); + List headers = new ArrayList<>(); + if ("zishen".equals(type)) { + headers = IndexConstant.getStandardSelfHeaders(explain.getIndexCode()); + + } else if ("xiaji".equals(type)) { + headers = IndexConstant.getStandardSubHeaders(explain.getIndexCode()); + } + return headers; + } +} diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/IndexDictDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/index/IndexDictDao.xml similarity index 100% rename from epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/IndexDictDao.xml rename to epmet-module/data-report/data-report-server/src/main/resources/mapper/index/IndexDictDao.xml diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/index/IndexExplainDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/index/IndexExplainDao.xml new file mode 100644 index 0000000000..392ba21ddd --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/index/IndexExplainDao.xml @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/index/IndexGroupDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/index/IndexGroupDao.xml new file mode 100644 index 0000000000..e91cf12796 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/index/IndexGroupDao.xml @@ -0,0 +1,23 @@ + + + + + + + + + diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/index/IndexGroupDetailDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/index/IndexGroupDetailDao.xml new file mode 100644 index 0000000000..741df34cfb --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/index/IndexGroupDetailDao.xml @@ -0,0 +1,36 @@ + + + + + + + + + + From 443a1a26a4261af7b3f401c96a9645f0509dda0c Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Fri, 14 May 2021 10:01:59 +0800 Subject: [PATCH 017/128] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../form/AgenctBasicDataFormDTO.java | 4 ++++ .../dataaggre/dao/datastats/DataStatsDao.java | 12 ++++++------ .../datastats/impl/DataStatsServiceImpl.java | 19 +++++++++++++------ .../mapper/datastats/DatsStatsDao.xml | 18 ++++++------------ 4 files changed, 29 insertions(+), 24 deletions(-) diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/AgenctBasicDataFormDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/AgenctBasicDataFormDTO.java index 609cf1729a..9f8c5fd1b1 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/AgenctBasicDataFormDTO.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/AgenctBasicDataFormDTO.java @@ -20,6 +20,10 @@ public class AgenctBasicDataFormDTO implements Serializable { */ @NotBlank(message = "组织ID不能为空",groups = AgenctBasicDataFormDTO.Agency.class) private String agencyId; + /** + * 日维度Id + */ + private String dateId; public interface Agency extends CustomerClientShowGroup{} } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/datastats/DataStatsDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/datastats/DataStatsDao.java index cfc28bc839..c0ef0d6e14 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/datastats/DataStatsDao.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/datastats/DataStatsDao.java @@ -38,37 +38,37 @@ public interface DataStatsDao { * @Description 查询组织下注册用户最新日统计数据 * @author sun */ - AgencyBasicDataResultDTO getAgnecyRegUser(@Param("agencyId") String agencyId); + AgencyBasicDataResultDTO getAgnecyRegUser(@Param("agencyId") String agencyId, @Param("dateId") String dateId); /** * @Description 查询组织下最新群组日统计数据 * @author sun */ - AgencyBasicDataResultDTO getAgnecyGroup(@Param("agencyId") String agencyId); + AgencyBasicDataResultDTO getAgnecyGroup(@Param("agencyId") String agencyId, @Param("dateId") String dateId); /** * @Description 查询组织下最新状态话题-机关日统计数据表 * @author sun */ - List getAgencyTopic(@Param("agencyId") String agencyId); + List getAgencyTopic(@Param("agencyId") String agencyId, @Param("dateId") String dateId); /** * @Description 查询组织下最新转议题话题-机关日统计数据表 * @author sun */ - AgencyBasicDataResultDTO.Topic getAgencyTopicShiftIssue(@Param("agencyId") String agencyId); + AgencyBasicDataResultDTO.Topic getAgencyTopicShiftIssue(@Param("agencyId") String agencyId, @Param("dateId") String dateId); /** * @Description 查询组织下最新议题日统计数据 * @author sun */ - AgencyBasicDataResultDTO getAgencyIssue(@Param("agencyId") String agencyId); + AgencyBasicDataResultDTO getAgencyIssue(@Param("agencyId") String agencyId, @Param("dateId") String dateId); /** * @Description 查询组织下最新项目日统计数据 * @author sun */ - AgencyBasicDataResultDTO getAgencyProject(@Param("agencyId") String agencyId); + AgencyBasicDataResultDTO getAgencyProject(@Param("agencyId") String agencyId, @Param("dateId") String dateId); /** * @Description 查询当前组织的直属下级组织信息 diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java index 1587588412..0c4465b7fe 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java @@ -53,8 +53,15 @@ public class DataStatsServiceImpl implements DataStatsService { NumberFormat numberFormat = NumberFormat.getInstance(); numberFormat.setMaximumFractionDigits(NumConstant.SIX); + //入参有日期的则按具体时间执行,没有的则按当前时间前一天执行 + if (StringUtils.isBlank(formDTO.getDateId())) { + Date yesterday = DateUtils.addDateDays(new Date(), -1); + SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); + formDTO.setDateId(format.format(yesterday)); + } + //1.查询组织下注册用户最新日统计数据【只查询注册用户的统计数据,不涉及参与用户的】 - AgencyBasicDataResultDTO user = dataStatsDao.getAgnecyRegUser(formDTO.getAgencyId()); + AgencyBasicDataResultDTO user = dataStatsDao.getAgnecyRegUser(formDTO.getAgencyId(), formDTO.getDateId()); if (null != user) { resultDTO.setUserTotal(user.getUserTotal()); resultDTO.setResiTotal(user.getResiTotal()); @@ -64,7 +71,7 @@ public class DataStatsServiceImpl implements DataStatsService { } //2.查询组织下最新群组日统计数据 - AgencyBasicDataResultDTO group = dataStatsDao.getAgnecyGroup(formDTO.getAgencyId()); + AgencyBasicDataResultDTO group = dataStatsDao.getAgnecyGroup(formDTO.getAgencyId(), formDTO.getDateId()); if (null != user) { resultDTO.setGroupTotal(group.getGroupTotal()); resultDTO.setOrdinaryTotal(group.getOrdinaryTotal()); @@ -76,9 +83,9 @@ public class DataStatsServiceImpl implements DataStatsService { //3.查询组织下最新话题日统计数据 //状态话题-机关日统计数据表最新日期三种状态数据 //机关日表里三种类型数据之和就是话题总量,讨论中数量与热议中不是一个概念,热议中=总量-关闭数-屏蔽数-转议题数 - List topic = dataStatsDao.getAgencyTopic(formDTO.getAgencyId()); + List topic = dataStatsDao.getAgencyTopic(formDTO.getAgencyId(), formDTO.getDateId()); //转议题话题-机关日统计数据表 - AgencyBasicDataResultDTO.Topic topicSHiftIssue = dataStatsDao.getAgencyTopicShiftIssue(formDTO.getAgencyId()); + AgencyBasicDataResultDTO.Topic topicSHiftIssue = dataStatsDao.getAgencyTopicShiftIssue(formDTO.getAgencyId(), formDTO.getDateId()); AtomicReference closedTotal = new AtomicReference<>(0); AtomicReference hiddenTotal = new AtomicReference<>(0); if (topic.size()>NumConstant.ZERO) { @@ -98,7 +105,7 @@ public class DataStatsServiceImpl implements DataStatsService { resultDTO.setClosedTopicRatio(resultDTO.getClosedTopicTotal() == 0 || resultDTO.getTopicTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getClosedTopicTotal() / (float) resultDTO.getTopicTotal()))); //4.查询组织下最新议题日统计数据 - AgencyBasicDataResultDTO issue = dataStatsDao.getAgencyIssue(formDTO.getAgencyId()); + AgencyBasicDataResultDTO issue = dataStatsDao.getAgencyIssue(formDTO.getAgencyId(), formDTO.getDateId()); if (null != issue) { resultDTO.setIssueTotal(issue.getIssueTotal()); resultDTO.setVotingTotal(issue.getVotingTotal()); @@ -110,7 +117,7 @@ public class DataStatsServiceImpl implements DataStatsService { } //5.查询组织下最新项目日统计数据 - AgencyBasicDataResultDTO project = dataStatsDao.getAgencyProject(formDTO.getAgencyId()); + AgencyBasicDataResultDTO project = dataStatsDao.getAgencyProject(formDTO.getAgencyId(), formDTO.getDateId()); if (null != project) { resultDTO.setProjectTotal(project.getProjectTotal()); resultDTO.setPendingTotal(project.getPendingTotal()); diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml index b07c649371..43ea7b7e85 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml @@ -13,8 +13,7 @@ WHERE del_flag = '0' AND agency_id = #{agencyId} - ORDER BY - date_id DESC + AND date_id = #{dateId} LIMIT 1 @@ -28,8 +27,7 @@ WHERE del_flag = '0' AND agency_id = #{agencyId} - ORDER BY - date_id DESC + AND date_id = #{dateId} LIMIT 1 @@ -43,8 +41,7 @@ del_flag = '0' AND topic_status_id in('discussing','closed','hidden') AND agency_id = #{agencyId} - ORDER BY - date_id DESC + AND date_id = #{dateId} LIMIT 3 @@ -57,8 +54,7 @@ WHERE del_flag = '0' AND agency_id = #{agencyId} - ORDER BY - date_id DESC + AND date_id = #{dateId} LIMIT 1 @@ -73,8 +69,7 @@ WHERE del_flag = '0' AND agency_id = #{agencyId} - ORDER BY - date_id DESC + AND date_id = #{dateId} LIMIT 1 @@ -88,8 +83,7 @@ WHERE del_flag = '0' AND agency_id = '8631fa4b22e88fdc259b3f51b5de2be2' - ORDER BY - date_id DESC + AND date_id = #{dateId} LIMIT 1 From 5cd2ff433fea9563f7c5146ca443b5281f9f5152 Mon Sep 17 00:00:00 2001 From: jianjun Date: Fri, 14 May 2021 14:48:21 +0800 Subject: [PATCH 018/128] =?UTF-8?q?=E7=BD=91=E6=A0=BC=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E6=8C=87=E6=A0=87=E6=98=8E=E7=BB=86=20=E6=9A=82=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../index/form/IndexScoreFormDTO.java | 40 ++++++++ .../index/result/IndexScoreDetailResult.java | 5 + .../index/result/IndexScoreResult.java | 40 ++++++++ .../dao/fact/FactIndexCpcScoreDao.java | 33 +++++++ .../dao/fact/FactIndexCpcSubScoreDao.java | 38 +++++++ .../dao/fact/FactIndexGridSubScoreDao.java | 12 +++ .../FactIndexCpcScoreEntity.java | 98 +++++++++++++++++++ .../FactIndexCpcSubScoreEntity.java | 98 +++++++++++++++++++ .../index/impl/IndexExplainServiceImpl.java | 96 ++++++++++-------- .../mapper/fact/FactIndexCpcScoreDao.xml | 28 ++++++ .../mapper/fact/FactIndexCpcSubScoreDao.xml | 43 ++++++++ .../mapper/fact/FactIndexGridSubScoreDao.xml | 32 ++++++ 12 files changed, 520 insertions(+), 43 deletions(-) create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/form/IndexScoreFormDTO.java create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/result/IndexScoreResult.java create mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexCpcScoreDao.java create mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexCpcSubScoreDao.java create mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/entity/evaluationindex/FactIndexCpcScoreEntity.java create mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/entity/evaluationindex/FactIndexCpcSubScoreEntity.java create mode 100644 epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCpcScoreDao.xml create mode 100644 epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCpcSubScoreDao.xml diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/form/IndexScoreFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/form/IndexScoreFormDTO.java new file mode 100644 index 0000000000..0ee464a9b5 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/form/IndexScoreFormDTO.java @@ -0,0 +1,40 @@ +package com.epmet.evaluationindex.index.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 指标分数 返回结果 + * @Author sun + */ +@Data +public class IndexScoreFormDTO implements Serializable { + + + private static final long serialVersionUID = 6225580299239889980L; + + private String customerId; + /** + * 组织或网格Id + */ + private String orgId; + /** + * 组织或网格类型 + */ + private String orgType; + + /** + * 月份Id(格式:202009) + */ + private String monthId; + /** + * 类型(党建能力:dangjiannengli;治理能力:zhilinengli;服务能力:fuwunengli;) + */ + private String indexCode; + /** + * 所有有权重的指标code拼接的字符串 冒号隔开 + */ + private String allParentIndexCode; + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/result/IndexScoreDetailResult.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/result/IndexScoreDetailResult.java index 8eb5fb8ecb..8b30af940f 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/result/IndexScoreDetailResult.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/result/IndexScoreDetailResult.java @@ -39,6 +39,11 @@ public class IndexScoreDetailResult implements Serializable { */ private String weight; + /** + * 数量 + */ + private String quantity; + } diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/result/IndexScoreResult.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/result/IndexScoreResult.java new file mode 100644 index 0000000000..c817b5de55 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/result/IndexScoreResult.java @@ -0,0 +1,40 @@ +package com.epmet.evaluationindex.index.result; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * 指标分数 返回结果 + * @Author sun + */ +@Data +public class IndexScoreResult implements Serializable { + + + private static final long serialVersionUID = -8458272574625683349L; + /** + * 指标code + */ + private String indexCode; + /** + * 指标对应值(数值或百分比)原始值 + */ + private BigDecimal score; + + /** + * 指标对应的权重 + */ + private BigDecimal weight; + + /** + * 原始值 + */ + private String originValue; + /** + * 数量 + */ + private String quantity; + +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexCpcScoreDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexCpcScoreDao.java new file mode 100644 index 0000000000..1bd10bd84c --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexCpcScoreDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.datareport.dao.fact; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.datareport.entity.evaluationindex.FactIndexCpcScoreEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 党员相关分值 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-14 + */ +@Mapper +public interface FactIndexCpcScoreDao extends BaseDao { + +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexCpcSubScoreDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexCpcSubScoreDao.java new file mode 100644 index 0000000000..cc59f410ba --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexCpcSubScoreDao.java @@ -0,0 +1,38 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.datareport.dao.fact; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.datareport.entity.evaluationindex.FactIndexCpcSubScoreEntity; +import com.epmet.evaluationindex.index.form.IndexScoreFormDTO; +import com.epmet.evaluationindex.index.result.IndexScoreResult; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * 党员相关分值 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-14 + */ +@Mapper +public interface FactIndexCpcSubScoreDao extends BaseDao { + + List selecCpcAvgScore(IndexScoreFormDTO ablityListFormDTO); +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexGridSubScoreDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexGridSubScoreDao.java index 8900171322..b71adcdd4e 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexGridSubScoreDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexGridSubScoreDao.java @@ -17,6 +17,8 @@ package com.epmet.datareport.dao.fact; +import com.epmet.evaluationindex.index.form.IndexScoreFormDTO; +import com.epmet.evaluationindex.index.result.IndexScoreResult; import com.epmet.evaluationindex.screen.dto.form.AblityListFormDTO; import com.epmet.evaluationindex.screen.dto.form.MonthAblityListFormDTO; import com.epmet.evaluationindex.screen.dto.result.AblityListResultDTO; @@ -48,4 +50,14 @@ public interface FactIndexGridSubScoreDao { * @author sun */ LinkedList selectGridMonthAblityList(MonthAblityListFormDTO formDTO); + + /** + * desc: 查询分数 + * + * @param ablityListFormDTO + * @return java.util.List + * @author LiuJanJun + * @date 2021/5/14 2:07 下午 + */ + List selectGridSubScore(IndexScoreFormDTO ablityListFormDTO); } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/entity/evaluationindex/FactIndexCpcScoreEntity.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/entity/evaluationindex/FactIndexCpcScoreEntity.java new file mode 100644 index 0000000000..5a4455b069 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/entity/evaluationindex/FactIndexCpcScoreEntity.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.datareport.entity.evaluationindex; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; + +/** + * 党员相关分值 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-14 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_index_cpc_score") +public class FactIndexCpcScoreEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 网格所属的机关Id + */ + private String agencyId; + + /** + * 网格Id + */ + private String gridId; + + /** + * 年度ID: yyyy + */ + private String yearId; + + /** + * 月维度Id: yyyyMM + */ + private String monthId; + + /** + * 用户id + */ + private String userId; + + /** + * 1:总分;0不是 默认0 + */ + private String isTotal; + + /** + * 分值 + */ + private BigDecimal score; + + /** + * 参与议事分值:canyuyishi; +党务活动分值:dangwuhuodong; +联系群众分值:lianxiqunzhong; +党建能力分值:dangjiannengli + */ + private String indexCode; + + /** + * 所有指标code拼接的字符串 冒号隔开 + */ + private String allParentIndexCode; + + /** + * 权重(同一组权重总和=1) + */ + private BigDecimal weight; + +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/entity/evaluationindex/FactIndexCpcSubScoreEntity.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/entity/evaluationindex/FactIndexCpcSubScoreEntity.java new file mode 100644 index 0000000000..737633648c --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/entity/evaluationindex/FactIndexCpcSubScoreEntity.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.datareport.entity.evaluationindex; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; + +/** + * 党员相关分值 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-14 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_index_cpc_sub_score") +public class FactIndexCpcSubScoreEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 网格所属的机关Id + */ + private String agencyId; + + /** + * 网格Id + */ + private String gridId; + + /** + * 年度ID: yyyy + */ + private String yearId; + + /** + * 月维度Id: yyyyMM + */ + private String monthId; + + /** + * 用户id + */ + private String userId; + + /** + * 计算指标时的原始值 字符串类型 + */ + private String originValue; + + /** + * 分值 + */ + private BigDecimal score; + + /** + * 参与议事分值:canyuyishi; +党务活动分值:dangwuhuodong; +联系群众分值:lianxiqunzhong; +党建能力分值:dangjiannengli + */ + private String indexCode; + + /** + * 所有指标code拼接的字符串 冒号隔开 + */ + private String allParentIndexCode; + + /** + * 权重(同一组权重总和=1) + */ + private BigDecimal weight; + +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/index/impl/IndexExplainServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/index/impl/IndexExplainServiceImpl.java index b21d3f0ec4..ac2e998e2e 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/index/impl/IndexExplainServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/index/impl/IndexExplainServiceImpl.java @@ -17,7 +17,6 @@ package com.epmet.datareport.service.evaluationindex.index.impl; -import com.alibaba.fastjson.JSON; import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.utils.DateUtils; @@ -25,15 +24,16 @@ import com.epmet.constant.DataSourceConstant; import com.epmet.datareport.constant.IndexConstant; import com.epmet.datareport.dao.evaluationindex.index.IndexExplainDao; import com.epmet.datareport.dao.evaluationindex.index.IndexGroupDetailDao; +import com.epmet.datareport.dao.fact.FactIndexCpcSubScoreDao; import com.epmet.datareport.dao.fact.FactIndexGridSubScoreDao; import com.epmet.datareport.service.evaluationindex.index.IndexExplainService; import com.epmet.evaluationindex.index.dto.IndexExplainTreeDTO; import com.epmet.evaluationindex.index.form.IndexExplainFormDTO; +import com.epmet.evaluationindex.index.form.IndexScoreFormDTO; import com.epmet.evaluationindex.index.result.IndexExplainResult; import com.epmet.evaluationindex.index.result.IndexGroupDetailResult; import com.epmet.evaluationindex.index.result.IndexScoreDetailResult; -import com.epmet.evaluationindex.screen.dto.form.AblityListFormDTO; -import com.epmet.evaluationindex.screen.dto.result.AblityListResultDTO; +import com.epmet.evaluationindex.index.result.IndexScoreResult; import org.apache.commons.collections4.CollectionUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -60,6 +60,8 @@ public class IndexExplainServiceImpl implements IndexExplainService { private IndexGroupDetailDao indexGroupDetailDao; @Autowired private FactIndexGridSubScoreDao gridSubScoreDao; + @Autowired + private FactIndexCpcSubScoreDao factIndexCpcSubScoreDao; @Override @@ -82,15 +84,12 @@ public class IndexExplainServiceImpl implements IndexExplainService { results.add(result); result.setTitle(explainDTO.getTitle()); result.setMeaning(explainDTO.getMeaning()); - + //设置表格数据 setTableData(formDTO, detailEntityMap, explainDTO, result); - - + //子节点 setChildren(formDTO, detailEntityMap, result, explainDTO, explainDTO.getChildren()); - System.out.println(JSON.toJSONString(result)); } - return results; } @@ -102,44 +101,40 @@ public class IndexExplainServiceImpl implements IndexExplainService { switch (explainDTO.getOrgLevel()) { case "grid": String type = explainDTO.getType(); - String allIndexCodePath = explainDTO.getIndexCode(); - List indexGroupDetailEntities = detailEntityMap.get(allIndexCodePath); - List tableList = new ArrayList<>(); - indexGroupDetailEntities.forEach(index -> { - //设置默认值 - if (!index.getAllIndexCodePath().contains(type)) { - return; - } - IndexScoreDetailResult table = new IndexScoreDetailResult(); - table.setIndexCode(index.getIndexCode()); - table.setIndexName(index.getIndexName()); - table.setOriginValue(NumConstant.ZERO_STR); - table.setScore(NumConstant.ZERO_STR); - table.setWeight(index.getWeight().multiply(new BigDecimal(100)).setScale(NumConstant.TWO, BigDecimal.ROUND_HALF_UP) + "%"); - tableList.add(table); - - - }); - result.setTableDataList(tableList); + String allIndexCodePath = null; + List tableList = null; + if ("zishen".equals(type)) { + allIndexCodePath = "wanggexiangguan:dangjiannengli"; + tableList = setDefaultTableData(detailEntityMap, type, allIndexCodePath); + result.setTableDataList(tableList); + } else if ("xiaji".equals(type)) { + allIndexCodePath = "dangyuanxiangguan:lianxiqunzhong"; + tableList = setDefaultTableData(detailEntityMap, type, allIndexCodePath); + result.setTableDataList(tableList); + } //set Target value + IndexScoreFormDTO ablityListFormDTO = new IndexScoreFormDTO(); + ablityListFormDTO.setCustomerId(formDTO.getCustomerId()); + ablityListFormDTO.setOrgId(formDTO.getOrgId()); + ablityListFormDTO.setMonthId(DateUtils.getCurrentTimeBeforeMonthId()); + ablityListFormDTO.setAllParentIndexCode(allIndexCodePath); + //下钻到党员 + List scoreList = null; if (goDown == 1) { - AblityListFormDTO ablityListFormDTO = new AblityListFormDTO(); - ablityListFormDTO.setCustomerId(formDTO.getCustomerId()); - ablityListFormDTO.setOrgId(formDTO.getOrgId()); - ablityListFormDTO.setOrgType(formDTO.getOrgLevel()); - ablityListFormDTO.setMonthId(DateUtils.getCurrentTimeBeforeMonthId()); - ablityListFormDTO.setAllParentIndexCode(allIndexCodePath); - - List scoreList = gridSubScoreDao.selectGridAblityList(ablityListFormDTO); - scoreList.forEach(score -> { - for (IndexScoreDetailResult tb : tableList) { - if (tb.getIndexCode().equals(score.getKey())) { - tb.setOriginValue(score.getValue()); - tb.setScore(String.valueOf(score.getScore())); - tb.setWeight(score.getWeight().multiply(new BigDecimal(100)).setScale(NumConstant.TWO, BigDecimal.ROUND_HALF_UP) + "%"); - } + scoreList = factIndexCpcSubScoreDao.selecCpcAvgScore(ablityListFormDTO); + } else { + //不下钻 + scoreList = gridSubScoreDao.selectGridSubScore(ablityListFormDTO); + } + for (IndexScoreResult score : scoreList) { + for (IndexScoreDetailResult tb : tableList) { + if (tb.getIndexCode().equals(score.getIndexCode())) { + tb.setOriginValue(score.getOriginValue()); + tb.setScore(String.valueOf(score.getScore())); + tb.setQuantity(score.getQuantity()); + tb.setWeight(score.getWeight().multiply(new BigDecimal(100)).setScale(NumConstant.TWO, BigDecimal.ROUND_HALF_UP) + "%"); } - }); + } } break; default: @@ -148,6 +143,21 @@ public class IndexExplainServiceImpl implements IndexExplainService { } } + private List setDefaultTableData(Map> detailEntityMap, String type, String allIndexCodePath) { + List indexGroupDetailEntities = detailEntityMap.get(allIndexCodePath); + List tableList = new ArrayList<>(); + indexGroupDetailEntities.forEach(index -> { + IndexScoreDetailResult table = new IndexScoreDetailResult(); + table.setIndexCode(index.getIndexCode()); + table.setIndexName(index.getIndexName()); + table.setOriginValue(NumConstant.ZERO_STR); + table.setScore(NumConstant.ZERO_STR); + table.setWeight(index.getWeight().multiply(new BigDecimal(100)).setScale(NumConstant.TWO, BigDecimal.ROUND_HALF_UP) + "%"); + tableList.add(table); + }); + return tableList; + } + private void setChildren(IndexExplainFormDTO formDTO, Map> detailEntityMap, IndexExplainResult result, IndexExplainTreeDTO parentNode, List children) { List childrenList = new ArrayList<>(); children.forEach(child -> { diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCpcScoreDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCpcScoreDao.xml new file mode 100644 index 0000000000..316e2f60e3 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCpcScoreDao.xml @@ -0,0 +1,28 @@ + + + + + + + + + diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCpcSubScoreDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCpcSubScoreDao.xml new file mode 100644 index 0000000000..acf9b5a874 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCpcSubScoreDao.xml @@ -0,0 +1,43 @@ + + + + + + + + + + + + diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexGridSubScoreDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexGridSubScoreDao.xml index eda1991759..eb2312455a 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexGridSubScoreDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexGridSubScoreDao.xml @@ -40,5 +40,37 @@ ORDER BY fact.month_id ASC + From b666def7083ba7e47677567951bc9e76767652fa Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Fri, 14 May 2021 15:44:54 +0800 Subject: [PATCH 019/128] =?UTF-8?q?=E5=B0=8F=E7=BB=84=E7=BB=84=E7=BB=87?= =?UTF-8?q?=E6=B4=BB=E5=8A=A8=E6=8C=89=E5=A4=A9=E7=B4=AF=E8=AE=A1=E5=80=BC?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../commons/tools/constant/Constant.java | 3 + .../epmet/dto/group/ActCategoryDictDTO.java | 70 ++++++++ .../com/epmet/controller/DemoController.java | 9 + .../extract/FactGroupActDailyDao.java | 38 ++++ .../extract/FactGroupActMonthlyDao.java | 33 ++++ .../com/epmet/dao/group/GroupDataDao.java | 28 +++ .../epmet/dao/org/StatsCustomerAgencyDao.java | 2 + .../extract/FactGroupActDailyEntity.java | 100 +++++++++++ .../extract/FactGroupActMonthlyEntity.java | 100 +++++++++++ .../todata/FactGroupActDailyService.java | 48 +++++ .../todata/FactGroupActMonthlyService.java | 31 ++++ .../impl/FactGroupActDailyServiceImpl.java | 165 ++++++++++++++++++ .../impl/FactGroupActMonthlyServiceImpl.java | 41 +++++ .../impl/FactOriginExtractServiceImpl.java | 42 +++++ .../epmet/service/group/GroupDataService.java | 30 ++++ .../group/impl/GroupDataServiceImpl.java | 53 ++++++ .../service/org/CustomerAgencyService.java | 3 + .../org/impl/CustomerAgencyServiceImpl.java | 5 + .../extract/FactGroupActDailyDao.xml | 15 ++ .../extract/FactGroupActMonthlyDao.xml | 8 + .../resources/mapper/group/GroupDataDao.xml | 61 +++++++ .../mapper/org/StatsCustomerAgencyDao.xml | 7 + 22 files changed, 892 insertions(+) create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/ActCategoryDictDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactGroupActDailyDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactGroupActMonthlyDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactGroupActDailyEntity.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactGroupActMonthlyEntity.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactGroupActDailyService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactGroupActMonthlyService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactGroupActDailyServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactGroupActMonthlyServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactGroupActDailyDao.xml create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactGroupActMonthlyDao.xml diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/Constant.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/Constant.java index 3636e2942d..9ff138efe7 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/Constant.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/Constant.java @@ -8,6 +8,7 @@ package com.epmet.commons.tools.constant; + /** * 常量 * @@ -133,4 +134,6 @@ public interface Constant { * 创建时间字段名 */ String CREATED_TIME = "created_time"; + + String DEFAULT_CUSTOMER = "default"; } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/ActCategoryDictDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/ActCategoryDictDTO.java new file mode 100644 index 0000000000..f75e5dc1b7 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/ActCategoryDictDTO.java @@ -0,0 +1,70 @@ +/** + * 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.group; + +import lombok.Data; + +import java.io.Serializable; + + +/** + * 活动类别字典 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-04-16 + */ +@Data +public class ActCategoryDictDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户id + */ + private String customerId; + + /** + * 类别编码 + */ + private String categoryCode; + + /** + * 活动类别名称;eg:支部建设、联建共建 + */ + private String categoryName; + + /** + * 等级1,2...... + */ + private Integer level; + + /** + * 排序 + */ + private Integer sort; + + /** + * 上级类别编码 + */ + private String parentCode; +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java index b47d3cc8ef..1037de6af4 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 @@ -35,6 +35,7 @@ import com.epmet.entity.stats.DimDateEntity; import com.epmet.entity.stats.DimMonthEntity; import com.epmet.service.StatsDemoService; import com.epmet.service.evaluationindex.extract.dataToIndex.*; +import com.epmet.service.evaluationindex.extract.todata.FactGroupActDailyService; import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectCategoryDailyService; import com.epmet.service.evaluationindex.extract.todata.FactOriginTopicMainDailyService; import com.epmet.service.evaluationindex.extract.toscreen.*; @@ -109,6 +110,8 @@ public class DemoController { private ScreenProjectCategoryGridDailyService projectCategoryGridDailyService; @Autowired private FactOriginProjectCategoryDailyService originProjectCategoryDailyService; + @Autowired + private FactGroupActDailyService factGroupActDailyService; @GetMapping("testAlarm") public void testAlarm() { @@ -870,4 +873,10 @@ public class DemoController { return new Result().ok(ndddYhjfService.difficultyDataExtract(param)); } + @PostMapping("extractgroupact") + public Result extractGroupAct(@RequestParam("customerId") String customerId,@RequestParam("dateId")String dateId){ + factGroupActDailyService.extractGridGroupActDaily(customerId,dateId); + factGroupActDailyService.extractAgencyGroupActDaily(customerId,dateId); + return new Result(); + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactGroupActDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactGroupActDailyDao.java new file mode 100644 index 0000000000..37d3d4e144 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactGroupActDailyDao.java @@ -0,0 +1,38 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.evaluationindex.extract; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.evaluationindex.extract.FactGroupActDailyEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + * 组织活动(参加人数、组织次数、平均参加人数)按天累计值分析 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-13 + */ +@Mapper +public interface FactGroupActDailyDao extends BaseDao { + + int deleteBatch(@Param("customerId") String customerId, + @Param("dateId") String dateId, + @Param("limit") Integer limit, + @Param("orgType")String orgType); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactGroupActMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactGroupActMonthlyDao.java new file mode 100644 index 0000000000..e7b179ef70 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactGroupActMonthlyDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.evaluationindex.extract; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.evaluationindex.extract.FactGroupActMonthlyEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 专项组活动(参加人数、组织次数、平均参加人数)按月增量分析 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-13 + */ +@Mapper +public interface FactGroupActMonthlyDao extends BaseDao { + +} \ No newline at end of file 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 80776d8798..2cbd65788c 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,6 +1,7 @@ package com.epmet.dao.group; import com.epmet.dto.extract.FactOriginGroupMainDailyDTO; +import com.epmet.dto.group.ActCategoryDictDTO; import com.epmet.dto.group.form.GridGroupPeopleFormDTO; import com.epmet.dto.group.form.GridGroupPeopleTotalFormDTO; import com.epmet.dto.group.form.GridGroupTotalFormDTO; @@ -8,6 +9,7 @@ import com.epmet.dto.group.form.GroupIncrFormDTO; import com.epmet.dto.group.result.*; import com.epmet.dto.indexcollect.result.CpcIndexCommonDTO; import com.epmet.dto.indexcollect.result.GridIndexCommonDTO; +import com.epmet.entity.evaluationindex.extract.FactGroupActDailyEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -110,4 +112,30 @@ public interface GroupDataDao { * @return com.epmet.dto.indexcollect.result.CpcIndexCommonDTO */ List selectCountGridCreateThreeMeets(@Param("customerId")String customerId, @Param("monthId")String monthId); + + /** + * 网格相关:组织“三会一课”次数: 当前网格下 满足【未取消的活动 and 签到记录>1 and 活动开始时间在当前时间维度内】 +1 + * + * @param customerId + * @return com.epmet.dto.group.ActCategoryDictDTO + */ + List queryCustomerActCategoryDict(String customerId); + + /** + * 查询某个分类截止到dateId,组织次数、参与人数、平均参与人数 + * + * @param customerId + * @param dateId + * @param categoryCode + * @return com.epmet.entity.evaluationindex.extract.FactGroupActDailyEntity + */ + List selectCountGridGroupActDaily(@Param("customerId") String customerId, + @Param("dateId") String dateId, + @Param("categoryCode") String categoryCode, + @Param("gridId")String gridId); + + List selectCountAgencyGroupActDaily(@Param("customerId") String customerId, + @Param("agencyId")String agencyId, + @Param("dateId") String dateId, + @Param("categoryCode") String categoryCode); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/StatsCustomerAgencyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/StatsCustomerAgencyDao.java index 05a85d3d7c..aa0f78f087 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/StatsCustomerAgencyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/StatsCustomerAgencyDao.java @@ -33,4 +33,6 @@ public interface StatsCustomerAgencyDao extends BaseDao { List selectCustomerAreaCodeById(@Param("customerIds") List customerIds); CustomerAgencyEntity getRootAgencyInfo(String customerId); + + List queryAgencyListByCustomerId(String customerId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactGroupActDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactGroupActDailyEntity.java new file mode 100644 index 0000000000..f128f25d3c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactGroupActDailyEntity.java @@ -0,0 +1,100 @@ +/** + * 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; + +/** + * 组织活动(参加人数、组织次数、平均参加人数)按天累计值分析 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-13 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_group_act_daily") +public class FactGroupActDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 数据更新至日期Id:yyyyMMdd + */ + private String dateId; + + /** + * 网格id + */ + private String orgId; + + /** + * 网格:grid;组织:agency + */ + private String orgType; + + /** + * 1)orgType=grid: pid=网格所属组织id; +2)orgType=agency: pid=当前组织的上级组织 + */ + private String pid; + + /** + * 1)orgType=grid: pids=网格所有上级组织,包括pid; +2)orgType=agency: pids=当前组织的所有上级组织,包括pid. + */ + private String pids; + + /** + * 活动分类编码 + */ + private String categoryCode; + + /** + * 上级分类编码 + */ + private String parentCode; + + /** + * 分类等级 + */ + private Integer level; + + /** + * 截止到dateId: 组织次数;包含dateId这一天的数据 + */ + private Integer organizeTotal; + + /** + * 截止到dateId: 参加人数;包含dateId这一天的数据 + */ + private Integer participateUserTotal; + + /** + * 截止到dateId: 平均参加人数;包含dateId这一天的数据 + */ + private Integer avgParticipateUserTotal; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactGroupActMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactGroupActMonthlyEntity.java new file mode 100644 index 0000000000..d90918a643 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactGroupActMonthlyEntity.java @@ -0,0 +1,100 @@ +/** + * 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; + +/** + * 专项组活动(参加人数、组织次数、平均参加人数)按月增量分析 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-13 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_group_act_monthly") +public class FactGroupActMonthlyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 数据维度:yyyyMM + */ + private String monthId; + + /** + * 网格id + */ + private String orgId; + + /** + * 网格:grid;组织:agency + */ + private String orgType; + + /** + * 1)orgType=grid: pid=网格所属组织id; +2)orgType=agency: pid=当前组织的上级组织 + */ + private String pid; + + /** + * 1)orgType=grid: pids=网格所有上级组织,包括pid; +2)orgType=agency: pids=当前组织的所有上级组织,包括pid. + */ + private String pids; + + /** + * 活动分类编码 + */ + private String categoryCode; + + /** + * 上级分类编码 + */ + private String parentCode; + + /** + * 分类等级 + */ + private Integer level; + + /** + * 本月内:活动组织次数 + */ + private Integer organizeIncr; + + /** + * 本月内:活动签到人数参加人数 + */ + private Integer participateUserIncr; + + /** + * 本月内:平均参加人数 + */ + private Integer avgParticipateUserIncr; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactGroupActDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactGroupActDailyService.java new file mode 100644 index 0000000000..6c8ee23cd7 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactGroupActDailyService.java @@ -0,0 +1,48 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.evaluationindex.extract.todata; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.evaluationindex.extract.FactGroupActDailyEntity; + +/** + * 组织活动(参加人数、组织次数、平均参加人数)按天累计值分析 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-13 + */ +public interface FactGroupActDailyService extends BaseService { + + /** + * 当前客户截止到dateId,网格下 各个分类的 参加人数,组织次数,平均参加人数 + * + * @param customerId + * @param dateId + * @return + */ + void extractGridGroupActDaily(String customerId, String dateId); + + /** + * 当前客户截止到dateId,组织下 各个分类的 参加人数,组织次数,平均参加人数 + * + * @param customerId + * @param dateId + * @return + */ + void extractAgencyGroupActDaily(String customerId, String dateId); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactGroupActMonthlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactGroupActMonthlyService.java new file mode 100644 index 0000000000..1d7391b8b4 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactGroupActMonthlyService.java @@ -0,0 +1,31 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.evaluationindex.extract.todata; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.evaluationindex.extract.FactGroupActMonthlyEntity; + +/** + * 专项组活动(参加人数、组织次数、平均参加人数)按月增量分析 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-13 + */ +public interface FactGroupActMonthlyService extends BaseService { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactGroupActDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactGroupActDailyServiceImpl.java new file mode 100644 index 0000000000..3212ad6dc0 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactGroupActDailyServiceImpl.java @@ -0,0 +1,165 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.evaluationindex.extract.todata.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.evaluationindex.extract.FactGroupActDailyDao; +import com.epmet.dto.group.ActCategoryDictDTO; +import com.epmet.dto.org.GridInfoDTO; +import com.epmet.entity.evaluationindex.extract.FactGroupActDailyEntity; +import com.epmet.entity.org.CustomerAgencyEntity; +import com.epmet.service.evaluationindex.extract.todata.FactGroupActDailyService; +import com.epmet.service.group.GroupDataService; +import com.epmet.service.org.CustomerAgencyService; +import com.epmet.service.org.CustomerGridService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +/** + * 组织活动(参加人数、组织次数、平均参加人数)按天累计值分析 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-13 + */ +@Slf4j +@DataSource(DataSourceConstant.STATS) +@Service +public class FactGroupActDailyServiceImpl extends BaseServiceImpl implements FactGroupActDailyService { + + @Autowired + private GroupDataService groupDataService; + @Autowired + private CustomerAgencyService customerAgencyService; + @Autowired + private CustomerGridService customerGridService; + + /** + * 当前客户截止到dateId,网格下 各个分类的 参加人数,组织次数,平均参加人数 + * + * @param customerId + * @param dateId + * @return + */ + @Override + public void extractGridGroupActDaily(String customerId, String dateId) { + if(StringUtils.isBlank(customerId)||StringUtils.isBlank(dateId)){ + return; + } + // 1、查询出当前客户的组织分类;如果没有直接返回 + List actCategoryDictDTOList = groupDataService.queryCustomerActCategoryDict(customerId); + if (CollectionUtils.isEmpty(actCategoryDictDTOList)) { + return; + } + + // 2、当前客户下所有的网格 + List gridInfoDTOList=customerGridService.queryGridInfoList(customerId); + // 2、遍历每个分类,查询组织次数、参与人数、平均参与人数 + List insertList = new ArrayList<>(); + for(GridInfoDTO gridInfoDTO:gridInfoDTOList){ + + for (ActCategoryDictDTO actCategoryDictDTO : actCategoryDictDTOList) { + List list = groupDataService.selectCountGridGroupActDaily(customerId, dateId, actCategoryDictDTO.getCategoryCode(),gridInfoDTO.getGridId()); + if (CollectionUtils.isNotEmpty(list)) { + list.forEach(dto->{ + dto.setCategoryCode(actCategoryDictDTO.getCategoryCode()); + dto.setParentCode(actCategoryDictDTO.getParentCode()); + dto.setLevel(actCategoryDictDTO.getLevel()); + dto.setOrgType("grid"); + dto.setDateId(dateId); + }); + insertList.addAll(list); + } + } + } + + // 3、批量删除 + int deleteNum; + do { + deleteNum = baseDao.deleteBatch(customerId, dateId, NumConstant.TWO_HUNDRED,"grid"); + } while (deleteNum > NumConstant.ZERO); + + // 4、插入数据 + insertList.forEach(insertEntity -> { + baseDao.insert(insertEntity); + }); + log.info("extractGridGroupActDaily completed"); + } + + /** + * 当前客户截止到dateId,组织下 各个分类的 参加人数,组织次数,平均参加人数 + * + * @param customerId + * @param dateId + * @return + */ + @Override + public void extractAgencyGroupActDaily(String customerId, String dateId) { + // 1、查询出当前客户的组织分类;如果没有直接返回 + List actCategoryDictDTOList = groupDataService.queryCustomerActCategoryDict(customerId); + if (CollectionUtils.isEmpty(actCategoryDictDTOList)) { + return; + } + // 2、当前客户下所有的组织 + List agencyEntityList=customerAgencyService.queryAgencyListByCustomerId(customerId); + List insertList = new ArrayList<>(); + for(CustomerAgencyEntity agencyEntity:agencyEntityList){ + for(ActCategoryDictDTO categoryDict:actCategoryDictDTOList){ + List list = groupDataService.selectCountAgencyGroupActDaily(customerId, + agencyEntity.getId(), + dateId, + categoryDict.getCategoryCode()); + if (CollectionUtils.isNotEmpty(list)) { + list.forEach(dto->{ + dto.setCategoryCode(categoryDict.getCategoryCode()); + dto.setParentCode(categoryDict.getParentCode()); + dto.setLevel(categoryDict.getLevel()); + dto.setOrgId(agencyEntity.getId()); + dto.setOrgType("agency"); + dto.setPid(agencyEntity.getPid()); + dto.setPids(agencyEntity.getPids()); + dto.setDateId(dateId); + }); + insertList.addAll(list); + } + } + } + + // 3、批量删除 + int deleteNum; + do { + deleteNum = baseDao.deleteBatch(customerId, dateId, NumConstant.TWO_HUNDRED,"agency"); + } while (deleteNum > NumConstant.ZERO); + + // 4、插入数据 + insertList.forEach(insertEntity->{ + baseDao.insert(insertEntity); + }); + log.info("extractAgencyGroupActDaily completed"); + } + + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactGroupActMonthlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactGroupActMonthlyServiceImpl.java new file mode 100644 index 0000000000..3cb14a7e31 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactGroupActMonthlyServiceImpl.java @@ -0,0 +1,41 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.evaluationindex.extract.todata.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.FactGroupActMonthlyDao; +import com.epmet.entity.evaluationindex.extract.FactGroupActMonthlyEntity; +import com.epmet.service.evaluationindex.extract.todata.FactGroupActMonthlyService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +/** + * 专项组活动(参加人数、组织次数、平均参加人数)按月增量分析 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-13 + */ +@DataSource(DataSourceConstant.STATS) +@Slf4j +@Service +public class FactGroupActMonthlyServiceImpl extends BaseServiceImpl implements FactGroupActMonthlyService { + + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginExtractServiceImpl.java index 1cd62fd24a..9b8a74548e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginExtractServiceImpl.java @@ -48,6 +48,9 @@ public class FactOriginExtractServiceImpl implements FactOriginExtractService { private DimCustomerPartymemberService dimCustomerPartymemberService; @Autowired private FactOriginProjectCategoryDailyService originProjectCategoryDailyService; + @Autowired + private FactGroupActDailyService factGroupActDailyService; + @Override public void extractAll(ExtractOriginFormDTO extractOriginFormDTO) { @@ -188,6 +191,45 @@ public class FactOriginExtractServiceImpl implements FactOriginExtractService { } } }); + //小组活动 + threadPool.submit(() -> { + ExtractOriginFormDTO extractOriginFormDTO = ConvertUtils.sourceToTarget(param, ExtractOriginFormDTO.class); + if (!isRange) { + //截止到当前dateId + try { + factGroupActDailyService.extractGridGroupActDaily(extractOriginFormDTO.getCustomerId(), extractOriginFormDTO.getDateId()); + } catch (Exception e) { + log.error("抽取【fact_group_act_daily】发生异常,参数:" + JSON.toJSONString(extractOriginFormDTO), e); + } + try { + factGroupActDailyService.extractAgencyGroupActDaily(extractOriginFormDTO.getCustomerId(), extractOriginFormDTO.getDateId()); + } catch (Exception e) { + log.error("抽取【fact_group_act_daily】发生异常,参数:" + JSON.toJSONString(extractOriginFormDTO), e); + } + } else { + //参数指定日期内,比如startDate=20210501,endDate=20210513;依次计算截止到20210501的数据.....截止到20210513的数据 + try { + for (int i = 0; i < finalDaysBetween.size(); i++) { + String dateDimId = finalDaysBetween.get(i); + extractOriginFormDTO.setDateId(dateDimId); + factGroupActDailyService.extractGridGroupActDaily(extractOriginFormDTO.getCustomerId(), extractOriginFormDTO.getDateId()); + } + } catch (Exception e) { + log.error("抽取【fact_group_act_daily】发生异常,参数:" + JSON.toJSONString(extractOriginFormDTO), e); + } + try { + for (int i = 0; i < finalDaysBetween.size(); i++) { + String dateDimId = finalDaysBetween.get(i); + extractOriginFormDTO.setDateId(dateDimId); + factGroupActDailyService.extractAgencyGroupActDaily(extractOriginFormDTO.getCustomerId(), extractOriginFormDTO.getDateId()); + } + } catch (Exception e) { + log.error("抽取【fact_group_act_daily】发生异常,参数:" + JSON.toJSONString(extractOriginFormDTO), e); + } + } + }); + + submitProjectRelationData(param, finalDaysBetween); } 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 b1a07d9941..89cc949ea6 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,9 +1,11 @@ package com.epmet.service.group; import com.epmet.dto.extract.FactOriginGroupMainDailyDTO; +import com.epmet.dto.group.ActCategoryDictDTO; import com.epmet.dto.group.result.*; import com.epmet.dto.indexcollect.result.CpcIndexCommonDTO; import com.epmet.dto.indexcollect.result.GridIndexCommonDTO; +import com.epmet.entity.evaluationindex.extract.FactGroupActDailyEntity; import com.epmet.util.DimIdGenerator; import org.apache.ibatis.annotations.Param; @@ -85,4 +87,32 @@ public interface GroupDataService { * @return com.epmet.dto.indexcollect.result.CpcIndexCommonDTO */ List selectCountGridCreateThreeMeets(String customerId, String monthId); + + /** + * 查询出当前客户的组织分类;如果没有直接返回 + * + * @param customerId + */ + List queryCustomerActCategoryDict(String customerId); + + /** + * 查询某个分类截止到dateId,组织次数、参与人数、平均参与人数 + * 网格按天 + * @param customerId + * @param dateId + * @param categoryCode + * @return com.epmet.entity.evaluationindex.extract.FactGroupActDailyEntity + */ + List selectCountGridGroupActDaily(String customerId, String dateId, String categoryCode,String gridId); + + /** + * 查询某个分类截止到dateId,组织次数、参与人数、平均参与人数 + * 组织按天 + * @param customerId + * @param agencyId + * @param dateId + * @param categoryCode + * @return com.epmet.entity.evaluationindex.extract.FactGroupActDailyEntity + */ + List selectCountAgencyGroupActDaily(String customerId, String agencyId, String dateId, String categoryCode); } 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 d0a87ed295..a7a596ca10 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 @@ -1,10 +1,12 @@ package com.epmet.service.group.impl; import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.tools.constant.Constant; 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.ActCategoryDictDTO; import com.epmet.dto.group.form.GridGroupPeopleFormDTO; import com.epmet.dto.group.form.GridGroupPeopleTotalFormDTO; import com.epmet.dto.group.form.GridGroupTotalFormDTO; @@ -12,8 +14,11 @@ import com.epmet.dto.group.form.GroupIncrFormDTO; import com.epmet.dto.group.result.*; import com.epmet.dto.indexcollect.result.CpcIndexCommonDTO; import com.epmet.dto.indexcollect.result.GridIndexCommonDTO; +import com.epmet.entity.evaluationindex.extract.FactGroupActDailyEntity; import com.epmet.service.group.GroupDataService; import com.epmet.util.DimIdGenerator; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -25,6 +30,7 @@ import java.util.stream.Collectors; * @Author zxc * @CreateTime 2020/6/16 13:23 */ +@Slf4j @Service @DataSource(DataSourceConstant.RESI_GROUP) public class GroupDataServiceImpl implements GroupDataService { @@ -235,5 +241,52 @@ public class GroupDataServiceImpl implements GroupDataService { return groupDataDao.selectCountGridCreateThreeMeets(customerId,monthId); } + /** + * 查询出当前客户的组织分类;如果没有直接返回 + * + * @param customerId + */ + @DataSource(DataSourceConstant.RESI_GROUP) + @Override + public List queryCustomerActCategoryDict(String customerId) { + List resultList=groupDataDao.queryCustomerActCategoryDict(customerId); + if(CollectionUtils.isNotEmpty(resultList)){ + log.info("当前客户下有自己的项目分类"); + return resultList; + } + log.info("----------------------------------------------------"); + return groupDataDao.queryCustomerActCategoryDict(Constant.DEFAULT_CUSTOMER); + } + + /** + * 查询某个分类截止到dateId,组织次数、参与人数、平均参与人数 + * + * @param customerId + * @param dateId + * @param categoryCode + * @return + */ + @DataSource(DataSourceConstant.RESI_GROUP) + @Override + public List selectCountGridGroupActDaily(String customerId, String dateId, String categoryCode,String gridId) { + return groupDataDao.selectCountGridGroupActDaily(customerId,dateId,categoryCode,gridId); + } + + /** + * 查询某个分类截止到dateId,组织次数、参与人数、平均参与人数 + * 组织按天 + * + * @param customerId + * @param agencyId + * @param dateId + * @param categoryCode + * @return com.epmet.entity.evaluationindex.extract.FactGroupActDailyEntity + */ + @DataSource(DataSourceConstant.RESI_GROUP) + @Override + public List selectCountAgencyGroupActDaily(String customerId, String agencyId, String dateId, String categoryCode) { + return groupDataDao.selectCountAgencyGroupActDaily(customerId,agencyId,dateId,categoryCode); + } + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/CustomerAgencyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/CustomerAgencyService.java index b3aa943ada..fd611edf23 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/CustomerAgencyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/CustomerAgencyService.java @@ -20,4 +20,7 @@ public interface CustomerAgencyService { List selectCustomerAreaCodeById(List customerIds); CustomerAgencyEntity getRootAgencyInfo(String customerId); + + + List queryAgencyListByCustomerId(String customerId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerAgencyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerAgencyServiceImpl.java index 8a8fae83b8..5c6b5175b0 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerAgencyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerAgencyServiceImpl.java @@ -50,4 +50,9 @@ public class CustomerAgencyServiceImpl implements CustomerAgencyService { public CustomerAgencyEntity getRootAgencyInfo(String customerId) { return customerAgencyDao.getRootAgencyInfo(customerId); } + + @Override + public List queryAgencyListByCustomerId(String customerId) { + return customerAgencyDao.queryAgencyListByCustomerId(customerId); + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactGroupActDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactGroupActDailyDao.xml new file mode 100644 index 0000000000..91897851f9 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactGroupActDailyDao.xml @@ -0,0 +1,15 @@ + + + + + + + delete from fact_group_act_daily + where CUSTOMER_ID = #{customerId} + AND DATE_ID = #{dateId} + and org_type=#{orgType} + limit #{limit} + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactGroupActMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactGroupActMonthlyDao.xml new file mode 100644 index 0000000000..085c49ab2a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactGroupActMonthlyDao.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file 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 d8ed5a56df..ebd75dc9dd 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 @@ -252,4 +252,65 @@ GROUP BY ga.GRID_ID + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/StatsCustomerAgencyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/StatsCustomerAgencyDao.xml index d5ead92c47..a7b6c09ae2 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/StatsCustomerAgencyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/StatsCustomerAgencyDao.xml @@ -125,4 +125,11 @@ and ca.pid='0' and ca.CUSTOMER_ID=#{customerId} + + \ No newline at end of file From 598828cad6ecc0755aadab06b678551c6dfc4a71 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Fri, 14 May 2021 17:39:19 +0800 Subject: [PATCH 020/128] =?UTF-8?q?=E5=9F=BA=E7=A1=80=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E9=83=A8=E5=88=86=E6=9F=A5=E8=AF=A2=E6=8E=A5=E5=8F=A3=E5=8F=8A?= =?UTF-8?q?=E5=B0=8F=E7=BB=84=E6=80=BB=E6=95=B0=E5=AE=9A=E6=97=B6=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/datastats/form/SubAgencyFormDTO.java | 12 + .../dto/datastats/form/SubGridFormDTO.java | 12 + .../result/SubAgencyGroupResultDTO.java | 33 ++ .../result/SubAgencyIssueResultDTO.java | 37 ++ .../result/SubAgencyProjectResultDTO.java | 33 ++ .../result/SubAgencyTopicResultDTO.java | 37 ++ .../result/SubGridGroupResultDTO.java | 33 ++ .../result/SubGridIssueResultDTO.java | 37 ++ .../result/SubGridProjectResultDTO.java | 33 ++ .../result/SubGridTopicResultDTO.java | 37 ++ .../controller/DataStatsController.java | 92 +++- .../dataaggre/dao/datastats/DataStatsDao.java | 69 ++- .../service/datastats/DataStatsService.java | 62 ++- .../datastats/impl/DataStatsServiceImpl.java | 438 +++++++++++++++++- .../mapper/datastats/DatsStatsDao.xml | 172 ++++++- .../impl/FactOriginExtractServiceImpl.java | 33 ++ 16 files changed, 1148 insertions(+), 22 deletions(-) create mode 100644 epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubAgencyGroupResultDTO.java create mode 100644 epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubAgencyIssueResultDTO.java create mode 100644 epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubAgencyProjectResultDTO.java create mode 100644 epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubAgencyTopicResultDTO.java create mode 100644 epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubGridGroupResultDTO.java create mode 100644 epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubGridIssueResultDTO.java create mode 100644 epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubGridProjectResultDTO.java create mode 100644 epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubGridTopicResultDTO.java diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/SubAgencyFormDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/SubAgencyFormDTO.java index c70db44b6e..a02a39456c 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/SubAgencyFormDTO.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/SubAgencyFormDTO.java @@ -25,4 +25,16 @@ public class SubAgencyFormDTO implements Serializable { private String dateId; public interface Agency extends CustomerClientShowGroup{} + @Data + public static class Topic implements Serializable { + //组织Id + private String agencyId; + //话题数量 + private Integer topicCount; + //话题状态 已关闭:closed、已屏蔽:hidden、 讨论中:discussing + private String topicStatus; + //话题已转议题数量 + private Integer shiftedIssueTotal; + } + } diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/SubGridFormDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/SubGridFormDTO.java index e21141e22a..d7da58385e 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/SubGridFormDTO.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/SubGridFormDTO.java @@ -25,4 +25,16 @@ public class SubGridFormDTO implements Serializable { private String dateId; public interface Agency extends CustomerClientShowGroup{} + @Data + public static class Topic implements Serializable { + //网格Id + private String gridId; + //话题数量 + private Integer topicCount; + //话题状态 已关闭:closed、已屏蔽:hidden、 讨论中:discussing + private String topicStatus; + //话题已转议题数量 + private Integer shiftedIssueTotal; + } + } diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubAgencyGroupResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubAgencyGroupResultDTO.java new file mode 100644 index 0000000000..144368c26e --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubAgencyGroupResultDTO.java @@ -0,0 +1,33 @@ +package com.epmet.dataaggre.dto.datastats.result; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * @Description 基础数据-查询当前组织的直属下级组织群组数据-接口返参 + * @Auth sun + */ +@Data +public class SubAgencyGroupResultDTO implements Serializable { + private static final long serialVersionUID = 466974582608407121L; + @JsonIgnore + BigDecimal bi = new BigDecimal(0); + //组织Id + private String agencyId; + //组织名称 + private String agencyName; + //党群小组总数 + private Integer groupTotal = 0; + //楼院小组总数 + private Integer ordinaryTotal = 0; + //楼院小组总数占比 + private BigDecimal ordinaryRatio = bi; + //支部小组总数 + private Integer branchTotal = 0; + //支部小组总数占比 + private BigDecimal branchRatio = bi; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubAgencyIssueResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubAgencyIssueResultDTO.java new file mode 100644 index 0000000000..5bece9dab4 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubAgencyIssueResultDTO.java @@ -0,0 +1,37 @@ +package com.epmet.dataaggre.dto.datastats.result; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * @Description 基础数据-查询当前组织的直属下级组织议题数据-接口返参 + * @Auth sun + */ +@Data +public class SubAgencyIssueResultDTO implements Serializable { + private static final long serialVersionUID = 466974582608407121L; + @JsonIgnore + BigDecimal bi = new BigDecimal(0); + //组织Id + private String agencyId; + //组织名称 + private String agencyName; + //议题总数 + private Integer issueTotal = 0; + //表决中总数 + private Integer votingTotal = 0; + //表决中总数占比 + private BigDecimal votingRatio = bi; + //已处理总数 + private Integer closedIssueTotal = 0; + //已处理总数占比 + private BigDecimal closedIssueRatio = bi; + //已转项目总数 + private Integer shiftProjectTotal = 0; + //已转项目总数占比 + private BigDecimal shiftProjectRatio = bi; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubAgencyProjectResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubAgencyProjectResultDTO.java new file mode 100644 index 0000000000..33aa889ad4 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubAgencyProjectResultDTO.java @@ -0,0 +1,33 @@ +package com.epmet.dataaggre.dto.datastats.result; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * @Description 基础数据-查询当前组织的直属下级组织项目数据-接口返参 + * @Auth sun + */ +@Data +public class SubAgencyProjectResultDTO implements Serializable { + private static final long serialVersionUID = 466974582608407121L; + @JsonIgnore + BigDecimal bi = new BigDecimal(0); + //组织Id + private String agencyId; + //组织名称 + private String agencyName; + //项目总数 + private Integer projectTotal = 0; + //处理中总数 + private Integer pendingTotal = 0; + //处理中总数占比 + private BigDecimal pendingRatio = bi; + //已结案总数 + private Integer closedProjectTotal = 0; + //已结案总数占比 + private BigDecimal closedProjectRatio = bi; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubAgencyTopicResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubAgencyTopicResultDTO.java new file mode 100644 index 0000000000..bad0896389 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubAgencyTopicResultDTO.java @@ -0,0 +1,37 @@ +package com.epmet.dataaggre.dto.datastats.result; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * @Description 基础数据-查询当前组织的直属下级组织话题数据-接口返参 + * @Auth sun + */ +@Data +public class SubAgencyTopicResultDTO implements Serializable { + private static final long serialVersionUID = 466974582608407121L; + @JsonIgnore + BigDecimal bi = new BigDecimal(0); + //组织Id + private String agencyId; + //组织名称 + private String agencyName; + //话题总数 + private Integer topicTotal = 0; + //热议中总数 + private Integer discussingTotal = 0; + //热议中总数占比 + private BigDecimal discussingRatio = bi; + //已处理总数 + private Integer closedTopicTotal = 0; + //已处理总数占比 + private BigDecimal closedTopicRatio = bi; + //转议题总数 + private Integer shiftIssueTotal = 0; + //转议题总数占比 + private BigDecimal shiftIssueRatio = bi; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubGridGroupResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubGridGroupResultDTO.java new file mode 100644 index 0000000000..eff29276d7 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubGridGroupResultDTO.java @@ -0,0 +1,33 @@ +package com.epmet.dataaggre.dto.datastats.result; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * @Description 基础数据-查询当前组织下直属网格列表群组数据-接口返参 + * @Auth sun + */ +@Data +public class SubGridGroupResultDTO implements Serializable { + private static final long serialVersionUID = 466974582608407121L; + @JsonIgnore + BigDecimal bi = new BigDecimal(0); + //网格Id + private String gridId; + //网格名称 + private String gridName; + //党群小组总数 + private Integer groupTotal = 0; + //楼院小组总数 + private Integer ordinaryTotal = 0; + //楼院小组总数占比 + private BigDecimal ordinaryRatio = bi; + //支部小组总数 + private Integer branchTotal = 0; + //支部小组总数占比 + private BigDecimal branchRatio = bi; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubGridIssueResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubGridIssueResultDTO.java new file mode 100644 index 0000000000..e6131de173 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubGridIssueResultDTO.java @@ -0,0 +1,37 @@ +package com.epmet.dataaggre.dto.datastats.result; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * @Description 基础数据-查询当前组织下直属网格列表议题数据-接口返参 + * @Auth sun + */ +@Data +public class SubGridIssueResultDTO implements Serializable { + private static final long serialVersionUID = 466974582608407121L; + @JsonIgnore + BigDecimal bi = new BigDecimal(0); + //网格Id + private String gridId; + //网格名称 + private String gridName; + //议题总数 + private Integer issueTotal = 0; + //表决中总数 + private Integer votingTotal = 0; + //表决中总数占比 + private BigDecimal votingRatio = bi; + //已处理总数 + private Integer closedIssueTotal = 0; + //已处理总数占比 + private BigDecimal closedIssueRatio = bi; + //已转项目总数 + private Integer shiftProjectTotal = 0; + //已转项目总数占比 + private BigDecimal shiftProjectRatio = bi; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubGridProjectResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubGridProjectResultDTO.java new file mode 100644 index 0000000000..d548cbe0a0 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubGridProjectResultDTO.java @@ -0,0 +1,33 @@ +package com.epmet.dataaggre.dto.datastats.result; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * @Description 基础数据-查询当前组织下直属网格列表项目数据-接口返参 + * @Auth sun + */ +@Data +public class SubGridProjectResultDTO implements Serializable { + private static final long serialVersionUID = 466974582608407121L; + @JsonIgnore + BigDecimal bi = new BigDecimal(0); + //网格Id + private String gridId; + //网格名称 + private String gridName; + //项目总数 + private Integer projectTotal = 0; + //处理中总数 + private Integer pendingTotal = 0; + //处理中总数占比 + private BigDecimal pendingRatio = bi; + //已结案总数 + private Integer closedProjectTotal = 0; + //已结案总数占比 + private BigDecimal closedProjectRatio = bi; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubGridTopicResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubGridTopicResultDTO.java new file mode 100644 index 0000000000..88d4850f13 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubGridTopicResultDTO.java @@ -0,0 +1,37 @@ +package com.epmet.dataaggre.dto.datastats.result; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * @Description 基础数据-查询当前组织下直属网格列表话题数据-接口返参 + * @Auth sun + */ +@Data +public class SubGridTopicResultDTO implements Serializable { + private static final long serialVersionUID = 466974582608407121L; + @JsonIgnore + BigDecimal bi = new BigDecimal(0); + //网格Id + private String gridId; + //网格名称 + private String gridName; + //话题总数 + private Integer topicTotal = 0; + //热议中总数 + private Integer discussingTotal = 0; + //热议中总数占比 + private BigDecimal discussingRatio = bi; + //已处理总数 + private Integer closedTopicTotal = 0; + //已处理总数占比 + private BigDecimal closedTopicRatio = bi; + //转议题总数 + private Integer shiftIssueTotal = 0; + //转议题总数占比 + private BigDecimal shiftIssueRatio = bi; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/DataStatsController.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/DataStatsController.java index 81188aee40..951696b919 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/DataStatsController.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/DataStatsController.java @@ -5,9 +5,7 @@ import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dataaggre.dto.datastats.form.AgenctBasicDataFormDTO; import com.epmet.dataaggre.dto.datastats.form.SubAgencyFormDTO; import com.epmet.dataaggre.dto.datastats.form.SubGridFormDTO; -import com.epmet.dataaggre.dto.datastats.result.AgencyBasicDataResultDTO; -import com.epmet.dataaggre.dto.datastats.result.SubAgencyUserResultDTO; -import com.epmet.dataaggre.dto.datastats.result.SubGridUserResultDTO; +import com.epmet.dataaggre.dto.datastats.result.*; import com.epmet.dataaggre.service.datastats.DataStatsService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; @@ -61,4 +59,92 @@ public class DataStatsController { return new Result>().ok(dataStatsService.subGridUser(formDTO)); } + /** + * @Param formDTO + * @Description 查询当前组织的直属下级组织群组数据 + * @author sun + */ + @PostMapping("subagencygroup") + public Result> subAgencyGroup(@RequestBody SubAgencyFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, SubAgencyFormDTO.Agency.class); + return new Result>().ok(dataStatsService.subAgencyGroup(formDTO)); + } + + /** + * @Param formDTO + * @Description 查询当前组织下直属网格列表群组数据 + * @author sun + */ + @PostMapping("subgridgroup") + public Result> subGridGroup(@RequestBody SubGridFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, SubGridFormDTO.Agency.class); + return new Result>().ok(dataStatsService.subGridGroup(formDTO)); + } + + /** + * @Param formDTO + * @Description 查询当前组织的直属下级组织话题数据 + * @author sun + */ + @PostMapping("subagencytopic") + public Result> subAgencyTopic(@RequestBody SubAgencyFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, SubAgencyFormDTO.Agency.class); + return new Result>().ok(dataStatsService.subAgencyTopic(formDTO)); + } + + /** + * @Param formDTO + * @Description 查询当前组织下直属网格列表话题数据 + * @author sun + */ + @PostMapping("subgridtopic") + public Result> subGridTopic(@RequestBody SubGridFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, SubGridFormDTO.Agency.class); + return new Result>().ok(dataStatsService.subGridTopic(formDTO)); + } + + /** + * @Param formDTO + * @Description 查询当前组织的直属下级组织议题数据 + * @author sun + */ + @PostMapping("subagencyissue") + public Result> subAgencyIssue(@RequestBody SubAgencyFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, SubAgencyFormDTO.Agency.class); + return new Result>().ok(dataStatsService.subAgencyIssue(formDTO)); + } + + /** + * @Param formDTO + * @Description 查询当前组织下直属网格列表议题数据 + * @author sun + */ + @PostMapping("subgridissue") + public Result> subGridIssue(@RequestBody SubGridFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, SubGridFormDTO.Agency.class); + return new Result>().ok(dataStatsService.subGridIssue(formDTO)); + } + + /** + * @Param formDTO + * @Description 查询当前组织的直属下级组织项目数据 + * @author sun + */ + @PostMapping("subagencyproject") + public Result> subAgencyProject(@RequestBody SubAgencyFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, SubAgencyFormDTO.Agency.class); + return new Result>().ok(dataStatsService.subAgencyProject(formDTO)); + } + + /** + * @Param formDTO + * @Description 查询当前组织下直属网格列表项目数据 + * @author sun + */ + @PostMapping("subgridproject") + public Result> subGridProject(@RequestBody SubGridFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, SubGridFormDTO.Agency.class); + return new Result>().ok(dataStatsService.subGridProject(formDTO)); + } + } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/datastats/DataStatsDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/datastats/DataStatsDao.java index c0ef0d6e14..c96b053cba 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/datastats/DataStatsDao.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/datastats/DataStatsDao.java @@ -17,9 +17,9 @@ package com.epmet.dataaggre.dao.datastats; -import com.epmet.dataaggre.dto.datastats.result.AgencyBasicDataResultDTO; -import com.epmet.dataaggre.dto.datastats.result.SubAgencyUserResultDTO; -import com.epmet.dataaggre.dto.datastats.result.SubGridUserResultDTO; +import com.epmet.dataaggre.dto.datastats.form.SubAgencyFormDTO; +import com.epmet.dataaggre.dto.datastats.form.SubGridFormDTO; +import com.epmet.dataaggre.dto.datastats.result.*; import com.epmet.dataaggre.entity.datastats.DimAgencyEntity; import com.epmet.dataaggre.entity.datastats.DimGridEntity; import org.apache.ibatis.annotations.Mapper; @@ -77,7 +77,7 @@ public interface DataStatsDao { List getSubAgencyList(@Param("pid") String pid); /** - * @Description 查询当前组织的直属下级组织信息 + * @Description 查询直属下级组织注册用户日统计数据,默认按用户总数降序 * @author sun */ List getSubAgencyUser(@Param("agencyIds") List agencyIds, @Param("dateId") String dateId); @@ -93,4 +93,65 @@ public interface DataStatsDao { * @author sun */ List getSubGridUser(@Param("gridIds") List gridIds, @Param("dateId") String dateId); + + /** + * @Description 查询直属下级组织小组日统计数据,默认按群组总数降序 + * @author sun + */ + List getSubAgencyGroup(@Param("agencyIds") List agencyIds, @Param("dateId") String dateId); + + /** + * @Description 查询网格层级小组日统计数据,默认按群组总数降序 + * @author sun + */ + List getSubGridGroup(@Param("gridIds") List gridIds, @Param("dateId") String dateId); + + /** + * @Description 查询直属下级组织状态话题-日统计数据 + * @author sun + */ + List getSubAgencyTopic(@Param("agencyIds") List agencyIds, @Param("dateId") String dateId); + + /** + * @Description 查询直属下级组织转议题话题-日统计数据表 + * @author sun + */ + List getSubAgencyTopicShiftIssue(@Param("agencyIds") List agencyIds, @Param("dateId") String dateId); + + /** + * @Description 查询网格层级状态话题-日统计数据 + * @author sun + */ + List getSubGridTopic(@Param("gridIds") List gridIds, @Param("dateId") String dateId); + + /** + * @Description 查询网格层级转议题话题-日统计数据表 + * @author sun + */ + List getSubGridTopicShiftIssue(@Param("gridIds") List gridIds, @Param("dateId") String dateId); + + /** + * @Description 查询直属下级组织议题日统计数据,默认按议题总数降序 + * @author sun + */ + List getSubAgencyIssue(@Param("agencyIds") List agencyIds, @Param("dateId") String dateId); + + /** + * @Description 查询网格层级议题日统计数据,默认按议题总数降序 + * @author sun + */ + List getSubGridIssue(@Param("gridIds") List gridIds, @Param("dateId") String dateId); + + /** + * @Description 查询直属下级组织项目日统计数据,默认按项目总数降序 + * @author sun + */ + List getSubAgencyProject(@Param("agencyIds") List agencyIds, @Param("dateId") String dateId); + + /** + * @Description 查询网格层级项目日统计数据,默认按项目总数降序 + * @author sun + */ + List getSubGridProject(@Param("gridIds") List gridIds, @Param("dateId") String dateId); + } \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/DataStatsService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/DataStatsService.java index a69361e18a..6eb826dc8d 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/DataStatsService.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/DataStatsService.java @@ -3,9 +3,7 @@ package com.epmet.dataaggre.service.datastats; import com.epmet.dataaggre.dto.datastats.form.AgenctBasicDataFormDTO; import com.epmet.dataaggre.dto.datastats.form.SubAgencyFormDTO; import com.epmet.dataaggre.dto.datastats.form.SubGridFormDTO; -import com.epmet.dataaggre.dto.datastats.result.AgencyBasicDataResultDTO; -import com.epmet.dataaggre.dto.datastats.result.SubAgencyUserResultDTO; -import com.epmet.dataaggre.dto.datastats.result.SubGridUserResultDTO; +import com.epmet.dataaggre.dto.datastats.result.*; import java.util.List; @@ -35,4 +33,62 @@ public interface DataStatsService { * @author sun */ List subGridUser(SubGridFormDTO formDTO); + + /** + * @Param formDTO + * @Description 查询当前组织的直属下级组织群组数据 + * @author sun + */ + List subAgencyGroup(SubAgencyFormDTO formDTO); + + /** + * @Param formDTO + * @Description 查询当前组织下直属网格列表群组数据 + * @author sun + */ + List subGridGroup(SubGridFormDTO formDTO); + + /** + * @Param formDTO + * @Description 查询当前组织的直属下级组织话题数据 + * @author sun + * @return + */ + List subAgencyTopic(SubAgencyFormDTO formDTO); + + /** + * @Param formDTO + * @Description 查询当前组织下直属网格列表话题数据 + * @author sun + * @return + */ + List subGridTopic(SubGridFormDTO formDTO); + + /** + * @Param formDTO + * @Description 查询当前组织的直属下级组织议题数据 + * @author sun + */ + List subAgencyIssue(SubAgencyFormDTO formDTO); + + /** + * @Param formDTO + * @Description 查询当前组织下直属网格列表议题数据 + * @author sun + */ + List subGridIssue(SubGridFormDTO formDTO); + + /** + * @Param formDTO + * @Description 查询当前组织的直属下级组织项目数据 + * @author sun + */ + List subAgencyProject(SubAgencyFormDTO formDTO); + + /** + * @Param formDTO + * @Description 查询当前组织下直属网格列表项目数据 + * @author sun + */ + List subGridProject(SubGridFormDTO formDTO); } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java index 0c4465b7fe..f289a4abc9 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java @@ -1,7 +1,6 @@ package com.epmet.dataaggre.service.datastats.impl; import com.epmet.commons.dynamic.datasource.annotation.DataSource; -import com.epmet.commons.mybatis.entity.BaseEpmetEntity; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.dataaggre.constant.DataSourceConstant; @@ -9,9 +8,7 @@ import com.epmet.dataaggre.dao.datastats.DataStatsDao; import com.epmet.dataaggre.dto.datastats.form.AgenctBasicDataFormDTO; import com.epmet.dataaggre.dto.datastats.form.SubAgencyFormDTO; import com.epmet.dataaggre.dto.datastats.form.SubGridFormDTO; -import com.epmet.dataaggre.dto.datastats.result.AgencyBasicDataResultDTO; -import com.epmet.dataaggre.dto.datastats.result.SubAgencyUserResultDTO; -import com.epmet.dataaggre.dto.datastats.result.SubGridUserResultDTO; +import com.epmet.dataaggre.dto.datastats.result.*; import com.epmet.dataaggre.entity.datastats.DimAgencyEntity; import com.epmet.dataaggre.entity.datastats.DimGridEntity; import com.epmet.dataaggre.service.datastats.DataStatsService; @@ -23,9 +20,8 @@ import org.springframework.stereotype.Service; import java.math.BigDecimal; import java.text.NumberFormat; import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; +import java.util.*; +import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicReference; import java.util.stream.Collectors; @@ -51,7 +47,7 @@ public class DataStatsServiceImpl implements DataStatsService { AgencyBasicDataResultDTO resultDTO = new AgencyBasicDataResultDTO(); resultDTO.setAgencyId(formDTO.getAgencyId()); NumberFormat numberFormat = NumberFormat.getInstance(); - numberFormat.setMaximumFractionDigits(NumConstant.SIX); + numberFormat.setMaximumFractionDigits(NumConstant.FOUR); //入参有日期的则按具体时间执行,没有的则按当前时间前一天执行 if (StringUtils.isBlank(formDTO.getDateId())) { @@ -72,7 +68,7 @@ public class DataStatsServiceImpl implements DataStatsService { //2.查询组织下最新群组日统计数据 AgencyBasicDataResultDTO group = dataStatsDao.getAgnecyGroup(formDTO.getAgencyId(), formDTO.getDateId()); - if (null != user) { + if (null != group) { resultDTO.setGroupTotal(group.getGroupTotal()); resultDTO.setOrdinaryTotal(group.getOrdinaryTotal()); resultDTO.setOrdinaryRatio(group.getOrdinaryTotal() == 0 || group.getGroupTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) group.getOrdinaryTotal() / (float) group.getGroupTotal()))); @@ -138,7 +134,7 @@ public class DataStatsServiceImpl implements DataStatsService { public List subAgencyUser(SubAgencyFormDTO formDTO) { List resultList = new ArrayList<>(); NumberFormat numberFormat = NumberFormat.getInstance(); - numberFormat.setMaximumFractionDigits(NumConstant.SIX); + numberFormat.setMaximumFractionDigits(NumConstant.FOUR); //入参有日期的则按具体时间执行,没有的则按当前时间前一天执行 if (StringUtils.isBlank(formDTO.getDateId())) { @@ -180,7 +176,7 @@ public class DataStatsServiceImpl implements DataStatsService { public List subGridUser(SubGridFormDTO formDTO) { List resultList = new ArrayList<>(); NumberFormat numberFormat = NumberFormat.getInstance(); - numberFormat.setMaximumFractionDigits(NumConstant.SIX); + numberFormat.setMaximumFractionDigits(NumConstant.FOUR); //入参有日期的则按具体时间执行,没有的则按当前时间前一天执行 if (StringUtils.isBlank(formDTO.getDateId())) { @@ -213,4 +209,424 @@ public class DataStatsServiceImpl implements DataStatsService { return resultList; } + /** + * @Param formDTO + * @Description 查询当前组织的直属下级组织群组数据 + * @author sun + */ + @Override + public List subAgencyGroup(SubAgencyFormDTO formDTO) { + List resultList = new ArrayList<>(); + NumberFormat numberFormat = NumberFormat.getInstance(); + numberFormat.setMaximumFractionDigits(NumConstant.FOUR); + + //入参有日期的则按具体时间执行,没有的则按当前时间前一天执行 + if (StringUtils.isBlank(formDTO.getDateId())) { + Date yesterday = DateUtils.addDateDays(new Date(), -1); + SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); + formDTO.setDateId(format.format(yesterday)); + } + + //1.查询当前组织的直属下级组织信息【机关维度】 + List subAgencyList = dataStatsDao.getSubAgencyList(formDTO.getAgencyId()); + if(subAgencyList.size() agencyIds = subAgencyList.stream().map(DimAgencyEntity::getId).collect(Collectors.toList()); + + //2.查询直属下级组织小组日统计数据,默认按群组总数降序 + resultList = dataStatsDao.getSubAgencyGroup(agencyIds, formDTO.getDateId()); + + //3.封装数据并返回 + resultList.forEach(re->{ + re.setOrdinaryRatio(re.getOrdinaryTotal() == 0 || re.getGroupTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getOrdinaryTotal() / (float) re.getGroupTotal()))); + re.setBranchRatio(re.getBranchTotal() == 0 || re.getGroupTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getBranchTotal() / (float) re.getGroupTotal()))); + subAgencyList.forEach(sub->{ + if(re.getAgencyId().equals(sub.getId())){ + re.setAgencyName(sub.getAgencyName()); + } + }); + }); + + return resultList; + } + + /** + * @Param formDTO + * @Description 查询当前组织下直属网格列表群组数据 + * @author sun + */ + @Override + public List subGridGroup(SubGridFormDTO formDTO) { + List resultList = new ArrayList<>(); + NumberFormat numberFormat = NumberFormat.getInstance(); + numberFormat.setMaximumFractionDigits(NumConstant.FOUR); + + //入参有日期的则按具体时间执行,没有的则按当前时间前一天执行 + if (StringUtils.isBlank(formDTO.getDateId())) { + Date yesterday = DateUtils.addDateDays(new Date(), -1); + SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); + formDTO.setDateId(format.format(yesterday)); + } + + //1.查询组织直属网格列表【网格维度】 + List gridList = dataStatsDao.getSubGridList(formDTO.getAgencyId()); + if(gridList.size() gridIds = gridList.stream().map(DimGridEntity::getId).collect(Collectors.toList()); + + //2.查询网格层级小组日统计数据,默认按群组总数降序 + resultList = dataStatsDao.getSubGridGroup(gridIds, formDTO.getDateId()); + + //3.封装数据并返回 + resultList.forEach(re->{ + re.setOrdinaryRatio(re.getOrdinaryTotal() == 0 || re.getGroupTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getOrdinaryTotal() / (float) re.getGroupTotal()))); + re.setBranchRatio(re.getBranchTotal() == 0 || re.getGroupTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getBranchTotal() / (float) re.getGroupTotal()))); + gridList.forEach(sub->{ + if(re.getGridId().equals(sub.getId())){ + re.setGridName(sub.getGridName()); + } + }); + }); + + return resultList; + } + + /** + * @Param formDTO + * @Description 查询当前组织的直属下级组织话题数据 + * @author sun + * @return + */ + @Override + public List subAgencyTopic(SubAgencyFormDTO formDTO) { + List resultList = new ArrayList<>(); + NumberFormat numberFormat = NumberFormat.getInstance(); + numberFormat.setMaximumFractionDigits(NumConstant.FOUR); + + //入参有日期的则按具体时间执行,没有的则按当前时间前一天执行 + if (StringUtils.isBlank(formDTO.getDateId())) { + Date yesterday = DateUtils.addDateDays(new Date(), -1); + SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); + formDTO.setDateId(format.format(yesterday)); + } + + //1.查询当前组织的直属下级组织信息【机关维度】 + List subAgencyList = dataStatsDao.getSubAgencyList(formDTO.getAgencyId()); + if(subAgencyList.size() agencyIds = subAgencyList.stream().map(DimAgencyEntity::getId).collect(Collectors.toList()); + + //2.查询直属下级组织状态话题-日统计数据 + //机关日表里三种类型数据之和就是话题总量,讨论中数量与热议中不是一个概念,热议中=总量-关闭数-屏蔽数-转议题数 + List topic = dataStatsDao.getSubAgencyTopic(agencyIds, formDTO.getDateId()); + //查询直属下级组织转议题话题-日统计数据表 + List topicShiftIssue = dataStatsDao.getSubAgencyTopicShiftIssue(agencyIds, formDTO.getDateId()); + agencyIds.forEach(agencyId->{ + SubAgencyTopicResultDTO resultDTO = new SubAgencyTopicResultDTO(); + AtomicInteger topicTotal = new AtomicInteger(0); + AtomicInteger closedTotal = new AtomicInteger(0); + AtomicInteger hiddenTotal = new AtomicInteger(0); + AtomicInteger shiftIssueTotal = new AtomicInteger(0); + AtomicReference agencyName = new AtomicReference<>(""); + topic.forEach(t->{ + if(t.getAgencyId().equals(agencyId)){ + topicTotal.addAndGet(t.getTopicCount()); + if (t.getTopicStatus().equals("closed")){ closedTotal.set(t.getTopicCount()); } + if (t.getTopicStatus().equals("hidden")){ hiddenTotal.set(t.getTopicCount()); } + } + }); + topicShiftIssue.forEach(t->{ + if(t.getAgencyId().equals(agencyId)){ + shiftIssueTotal.addAndGet(t.getShiftedIssueTotal()); + } + }); + subAgencyList.forEach(sub->{ + if(agencyId.equals(sub.getId())){ + agencyName.set(sub.getAgencyName()); + } + }); + + resultDTO.setAgencyId(agencyId); + resultDTO.setAgencyName(agencyName.get()); + resultDTO.setTopicTotal(topicTotal.get()); + resultDTO.setDiscussingTotal(topicTotal.get()-closedTotal.get()-hiddenTotal.get()-shiftIssueTotal.get()); + resultDTO.setDiscussingRatio(resultDTO.getDiscussingTotal() == 0 || resultDTO.getTopicTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getDiscussingTotal() / (float) resultDTO.getTopicTotal()))); + resultDTO.setClosedTopicTotal(closedTotal.get()); + resultDTO.setClosedTopicRatio(resultDTO.getClosedTopicTotal() == 0 || resultDTO.getTopicTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getClosedTopicTotal() / (float) resultDTO.getTopicTotal()))); + resultDTO.setShiftIssueTotal(shiftIssueTotal.get()); + resultDTO.setShiftIssueRatio(resultDTO.getShiftIssueTotal() == 0 || resultDTO.getTopicTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getShiftIssueTotal() / (float) resultDTO.getTopicTotal()))); + + resultList.add(resultDTO); + }); + + //3.默认按话题总数降序 + Collections.sort(resultList, new Comparator() { + @Override + public int compare(SubAgencyTopicResultDTO o1, SubAgencyTopicResultDTO o2) { + //升序 + //return o1.getTopicTotal().compareTo(o2.getTopicTotal()); + //降序 + return o2.getTopicTotal().compareTo(o1.getTopicTotal()); + } + }); + + return resultList; + } + + /** + * @Param formDTO + * @Description 查询当前组织下直属网格列表话题数据 + * @author sun + * @return + */ + @Override + public List subGridTopic(SubGridFormDTO formDTO) { + List resultList = new ArrayList<>(); + NumberFormat numberFormat = NumberFormat.getInstance(); + numberFormat.setMaximumFractionDigits(NumConstant.FOUR); + + //入参有日期的则按具体时间执行,没有的则按当前时间前一天执行 + if (StringUtils.isBlank(formDTO.getDateId())) { + Date yesterday = DateUtils.addDateDays(new Date(), -1); + SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); + formDTO.setDateId(format.format(yesterday)); + } + + //1.查询组织直属网格列表【网格维度】 + List gridList = dataStatsDao.getSubGridList(formDTO.getAgencyId()); + if(gridList.size() gridIds = gridList.stream().map(DimGridEntity::getId).collect(Collectors.toList()); + + //2.查询网格层级话题数据 + //查询网格层级状态话题-日统计数据 机关日表里三种类型数据之和就是话题总量,讨论中数量与热议中不是一个概念,热议中=总量-关闭数-屏蔽数-转议题数 + List topic = dataStatsDao.getSubGridTopic(gridIds, formDTO.getDateId()); + //查询网格层级转议题话题-日统计数据表 + List topicShiftIssue = dataStatsDao.getSubGridTopicShiftIssue(gridIds, formDTO.getDateId()); + gridIds.forEach(gridId->{ + SubGridTopicResultDTO resultDTO = new SubGridTopicResultDTO(); + AtomicInteger topicTotal = new AtomicInteger(0); + AtomicInteger closedTotal = new AtomicInteger(0); + AtomicInteger hiddenTotal = new AtomicInteger(0); + AtomicInteger shiftIssueTotal = new AtomicInteger(0); + AtomicReference gridName = new AtomicReference<>(""); + topic.forEach(t->{ + if(t.getGridId().equals(gridId)){ + topicTotal.addAndGet(t.getTopicCount()); + if (t.getTopicStatus().equals("closed")){ closedTotal.set(t.getTopicCount()); } + if (t.getTopicStatus().equals("hidden")){ hiddenTotal.set(t.getTopicCount()); } + } + }); + topicShiftIssue.forEach(t->{ + if(t.getGridId().equals(gridId)){ + shiftIssueTotal.addAndGet(t.getShiftedIssueTotal()); + } + }); + gridList.forEach(sub->{ + if(gridId.equals(sub.getId())){ + gridName.set(sub.getGridName()); + } + }); + + resultDTO.setGridId(gridId); + resultDTO.setGridName(gridName.get()); + resultDTO.setTopicTotal(topicTotal.get()); + resultDTO.setDiscussingTotal(topicTotal.get()-closedTotal.get()-hiddenTotal.get()-shiftIssueTotal.get()); + resultDTO.setDiscussingRatio(resultDTO.getDiscussingTotal() == 0 || resultDTO.getTopicTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getDiscussingTotal() / (float) resultDTO.getTopicTotal()))); + resultDTO.setClosedTopicTotal(closedTotal.get()); + resultDTO.setClosedTopicRatio(resultDTO.getClosedTopicTotal() == 0 || resultDTO.getTopicTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getClosedTopicTotal() / (float) resultDTO.getTopicTotal()))); + resultDTO.setShiftIssueTotal(shiftIssueTotal.get()); + resultDTO.setShiftIssueRatio(resultDTO.getShiftIssueTotal() == 0 || resultDTO.getTopicTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getShiftIssueTotal() / (float) resultDTO.getTopicTotal()))); + + resultList.add(resultDTO); + }); + + //3.默认按话题总数降序 + Collections.sort(resultList, new Comparator() { + @Override + public int compare(SubGridTopicResultDTO o1, SubGridTopicResultDTO o2) { + //升序 + //return o1.getTopicTotal().compareTo(o2.getTopicTotal()); + //降序 + return o2.getTopicTotal().compareTo(o1.getTopicTotal()); + } + }); + + return resultList; + } + + /** + * @Param formDTO + * @Description 查询当前组织的直属下级组织议题数据 + * @author sun + */ + @Override + public List subAgencyIssue(SubAgencyFormDTO formDTO) { + List resultList = new ArrayList<>(); + NumberFormat numberFormat = NumberFormat.getInstance(); + numberFormat.setMaximumFractionDigits(NumConstant.FOUR); + + //入参有日期的则按具体时间执行,没有的则按当前时间前一天执行 + if (StringUtils.isBlank(formDTO.getDateId())) { + Date yesterday = DateUtils.addDateDays(new Date(), -1); + SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); + formDTO.setDateId(format.format(yesterday)); + } + + //1.查询当前组织的直属下级组织信息【机关维度】 + List subAgencyList = dataStatsDao.getSubAgencyList(formDTO.getAgencyId()); + if(subAgencyList.size() agencyIds = subAgencyList.stream().map(DimAgencyEntity::getId).collect(Collectors.toList()); + + //2.查询直属下级组织议题日统计数据,默认按议题总数降序 + resultList = dataStatsDao.getSubAgencyIssue(agencyIds, formDTO.getDateId()); + + //3.封装数据并返回 + resultList.forEach(re->{ + re.setVotingRatio(re.getVotingTotal() == 0 || re.getIssueTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getVotingTotal() / (float) re.getIssueTotal()))); + re.setClosedIssueRatio(re.getClosedIssueTotal() == 0 || re.getIssueTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getClosedIssueTotal() / (float) re.getIssueTotal()))); + re.setShiftProjectRatio(re.getShiftProjectTotal() == 0 || re.getIssueTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getShiftProjectTotal() / (float) re.getIssueTotal()))); + subAgencyList.forEach(sub->{ + if(re.getAgencyId().equals(sub.getId())){ + re.setAgencyName(sub.getAgencyName()); + } + }); + }); + + return resultList; + } + + /** + * @Param formDTO + * @Description 查询当前组织下直属网格列表议题数据 + * @author sun + */ + @Override + public List subGridIssue(SubGridFormDTO formDTO) { + List resultList = new ArrayList<>(); + NumberFormat numberFormat = NumberFormat.getInstance(); + numberFormat.setMaximumFractionDigits(NumConstant.FOUR); + + //入参有日期的则按具体时间执行,没有的则按当前时间前一天执行 + if (StringUtils.isBlank(formDTO.getDateId())) { + Date yesterday = DateUtils.addDateDays(new Date(), -1); + SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); + formDTO.setDateId(format.format(yesterday)); + } + + //1.查询组织直属网格列表【网格维度】 + List gridList = dataStatsDao.getSubGridList(formDTO.getAgencyId()); + if(gridList.size() gridIds = gridList.stream().map(DimGridEntity::getId).collect(Collectors.toList()); + + //2.查询网格层级议题日统计数据,默认按议题总数降序 + resultList = dataStatsDao.getSubGridIssue(gridIds, formDTO.getDateId()); + + //3.封装数据并返回 + resultList.forEach(re->{ + re.setVotingRatio(re.getVotingTotal() == 0 || re.getIssueTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getVotingTotal() / (float) re.getIssueTotal()))); + re.setClosedIssueRatio(re.getClosedIssueTotal() == 0 || re.getIssueTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getClosedIssueTotal() / (float) re.getIssueTotal()))); + re.setShiftProjectRatio(re.getShiftProjectTotal() == 0 || re.getIssueTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getShiftProjectTotal() / (float) re.getIssueTotal()))); + gridList.forEach(sub->{ + if(re.getGridId().equals(sub.getId())){ + re.setGridName(sub.getGridName()); + } + }); + }); + + return resultList; + } + + /** + * @Param formDTO + * @Description 查询当前组织的直属下级组织项目数据 + * @author sun + */ + @Override + public List subAgencyProject(SubAgencyFormDTO formDTO) { + List resultList = new ArrayList<>(); + NumberFormat numberFormat = NumberFormat.getInstance(); + numberFormat.setMaximumFractionDigits(NumConstant.FOUR); + + //入参有日期的则按具体时间执行,没有的则按当前时间前一天执行 + if (StringUtils.isBlank(formDTO.getDateId())) { + Date yesterday = DateUtils.addDateDays(new Date(), -1); + SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); + formDTO.setDateId(format.format(yesterday)); + } + + //1.查询当前组织的直属下级组织信息【机关维度】 + List subAgencyList = dataStatsDao.getSubAgencyList(formDTO.getAgencyId()); + if(subAgencyList.size() agencyIds = subAgencyList.stream().map(DimAgencyEntity::getId).collect(Collectors.toList()); + + //2.查询直属下级组织项目日统计数据,默认按项目总数降序 + resultList = dataStatsDao.getSubAgencyProject(agencyIds, formDTO.getDateId()); + + //3.封装数据并返回 + resultList.forEach(re->{ + re.setPendingRatio(re.getPendingTotal() == 0 || re.getProjectTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getPendingTotal() / (float) re.getProjectTotal()))); + re.setClosedProjectRatio(re.getClosedProjectTotal() == 0 || re.getProjectTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getClosedProjectTotal() / (float) re.getProjectTotal()))); + subAgencyList.forEach(sub->{ + if(re.getAgencyId().equals(sub.getId())){ + re.setAgencyName(sub.getAgencyName()); + } + }); + }); + + return resultList; + } + + /** + * @Param formDTO + * @Description 查询当前组织下直属网格列表项目数据 + * @author sun + */ + @Override + public List subGridProject(SubGridFormDTO formDTO) { + List resultList = new ArrayList<>(); + NumberFormat numberFormat = NumberFormat.getInstance(); + numberFormat.setMaximumFractionDigits(NumConstant.FOUR); + + //入参有日期的则按具体时间执行,没有的则按当前时间前一天执行 + if (StringUtils.isBlank(formDTO.getDateId())) { + Date yesterday = DateUtils.addDateDays(new Date(), -1); + SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); + formDTO.setDateId(format.format(yesterday)); + } + + //1.查询组织直属网格列表【网格维度】 + List gridList = dataStatsDao.getSubGridList(formDTO.getAgencyId()); + if(gridList.size() gridIds = gridList.stream().map(DimGridEntity::getId).collect(Collectors.toList()); + + //2.查询网格层级项目日统计数据,默认按项目总数降序 + resultList = dataStatsDao.getSubGridProject(gridIds, formDTO.getDateId()); + + //3.封装数据并返回 + resultList.forEach(re->{ + re.setPendingRatio(re.getPendingTotal() == 0 || re.getProjectTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getPendingTotal() / (float) re.getProjectTotal()))); + re.setClosedProjectRatio(re.getClosedProjectTotal() == 0 || re.getProjectTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getClosedProjectTotal() / (float) re.getProjectTotal()))); + gridList.forEach(sub->{ + if(re.getGridId().equals(sub.getId())){ + re.setGridName(sub.getGridName()); + } + }); + }); + + return resultList; + } + } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml index 43ea7b7e85..06967cceab 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml @@ -65,7 +65,7 @@ closed_total AS closedIssueTotal, shift_project_total AS shiftProjectTotal FROM - fact_issue_agency_daily fiad + fact_issue_agency_daily WHERE del_flag = '0' AND agency_id = #{agencyId} @@ -144,4 +144,174 @@ reg_total DESC + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginExtractServiceImpl.java index 9b8a74548e..62a4950f7b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginExtractServiceImpl.java @@ -5,7 +5,9 @@ import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.dto.extract.form.ExtractOriginFormDTO; +import com.epmet.dto.group.form.GroupTotalFormDTO; import com.epmet.dto.stats.form.CustomerIdAndDateIdFormDTO; +import com.epmet.service.StatsGroupService; import com.epmet.service.evaluationindex.extract.todata.*; import com.epmet.service.stats.DimCustomerPartymemberService; import com.epmet.service.stats.DimCustomerService; @@ -50,6 +52,8 @@ public class FactOriginExtractServiceImpl implements FactOriginExtractService { private FactOriginProjectCategoryDailyService originProjectCategoryDailyService; @Autowired private FactGroupActDailyService factGroupActDailyService; + @Autowired + private StatsGroupService statsGroupService; @Override @@ -229,6 +233,35 @@ public class FactOriginExtractServiceImpl implements FactOriginExtractService { } }); + //网格、组织小组总数日统计 + threadPool.submit(() -> { + GroupTotalFormDTO formDTO = new GroupTotalFormDTO(); + formDTO.setCustomerId(param.getCustomerId()); + if (!isRange) { + formDTO.setDateId(param.getDateId()); + try { + statsGroupService.gridGroupTotal(formDTO); + } catch (Exception e) { + log.error("小组总数-网格日统计计算错误,参数:" + JSON.toJSONString(formDTO), e); + } + try { + statsGroupService.agencyGroupTotal(formDTO); + } catch (Exception e) { + log.error("小组总数-机关日统计计算错误,参数:" + JSON.toJSONString(formDTO), e); + } + } else { + try { + statsGroupService.gridGroupTotal(formDTO); + } catch (Exception e) { + log.error("小组总数-网格日统计计算错误,参数:" + JSON.toJSONString(formDTO), e); + } + try { + statsGroupService.agencyGroupTotal(formDTO); + } catch (Exception e) { + log.error("小组总数-机关日统计计算错误,参数:" + JSON.toJSONString(formDTO), e); + } + } + }); submitProjectRelationData(param, finalDaysBetween); } From 2176fdba6fbb2b0e2d6a097c5468cb0269a3b436 Mon Sep 17 00:00:00 2001 From: jianjun Date: Fri, 14 May 2021 17:47:05 +0800 Subject: [PATCH 021/128] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=9A=82=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../index/form/IndexExplainFormDTO.java | 6 ++++++ .../datareport/constant/IndexConstant.java | 19 +++++++++++-------- .../index/impl/IndexExplainServiceImpl.java | 4 ++-- 3 files changed, 19 insertions(+), 10 deletions(-) diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/form/IndexExplainFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/form/IndexExplainFormDTO.java index 7d17b128d1..b97139c8ff 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/form/IndexExplainFormDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/form/IndexExplainFormDTO.java @@ -48,5 +48,11 @@ public class IndexExplainFormDTO implements Serializable { * 组织id */ private String orgId; + /** + * 月份Id + */ + private String monthId; + + } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/constant/IndexConstant.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/constant/IndexConstant.java index df3239962b..4e2c5e01e1 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/constant/IndexConstant.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/constant/IndexConstant.java @@ -22,8 +22,11 @@ public class IndexConstant { private static final String FWZS_CN = "服务指数"; private static final String ZLZS_CN = "治理指数"; private static final String ZB_CN = "指标"; - private static final String BEN_JI = "本级"; - private static final String XIA_JI = "下级"; + private static final String BEN_JI_CN = "本级"; + private static final String XIA_JI_CN = "下级"; + + public static final String ZI_SHEN = "ZISHEN"; + public static final String XIA_JI = "xiaji"; /** @@ -41,11 +44,11 @@ public class IndexConstant { } if (allIndexCode.contains(FactConstant.DJNL)) { - result.add(BEN_JI + DJZS_CN + ZB_CN); + result.add(BEN_JI_CN + DJZS_CN + ZB_CN); } else if (allIndexCode.contains(FactConstant.FWNL)) { - result.add(BEN_JI + FWZS_CN + ZB_CN); + result.add(BEN_JI_CN + FWZS_CN + ZB_CN); } else if (allIndexCode.contains(FactConstant.ZLNL)) { - result.add(BEN_JI + ZLZS_CN + ZB_CN); + result.add(BEN_JI_CN + ZLZS_CN + ZB_CN); } result.addAll(ScoreLastHeader); return result; @@ -62,11 +65,11 @@ public class IndexConstant { public static List getStandardSubHeaders(String allIndexCode) { List result = new ArrayList<>(8); if (allIndexCode.contains(FactConstant.DJNL)) { - result.add(XIA_JI + DJZS_CN + ZB_CN); + result.add(XIA_JI_CN + DJZS_CN + ZB_CN); } else if (allIndexCode.contains(FactConstant.FWNL)) { - result.add(XIA_JI + FWZS_CN + ZB_CN); + result.add(XIA_JI_CN + FWZS_CN + ZB_CN); } else if (allIndexCode.contains(FactConstant.ZLNL)) { - result.add(XIA_JI + ZLZS_CN + ZB_CN); + result.add(XIA_JI_CN + ZLZS_CN + ZB_CN); } result.addAll(QuantityLastHeader); return result; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/index/impl/IndexExplainServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/index/impl/IndexExplainServiceImpl.java index ac2e998e2e..0734fadda1 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/index/impl/IndexExplainServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/index/impl/IndexExplainServiceImpl.java @@ -103,11 +103,11 @@ public class IndexExplainServiceImpl implements IndexExplainService { String type = explainDTO.getType(); String allIndexCodePath = null; List tableList = null; - if ("zishen".equals(type)) { + if (IndexConstant.ZI_SHEN.equals(type)) { allIndexCodePath = "wanggexiangguan:dangjiannengli"; tableList = setDefaultTableData(detailEntityMap, type, allIndexCodePath); result.setTableDataList(tableList); - } else if ("xiaji".equals(type)) { + } else if (IndexConstant.XIA_JI.equals(type)) { allIndexCodePath = "dangyuanxiangguan:lianxiqunzhong"; tableList = setDefaultTableData(detailEntityMap, type, allIndexCodePath); result.setTableDataList(tableList); From fa5303ec97c0887e35dedb2221c243f1760ac265 Mon Sep 17 00:00:00 2001 From: jianjun Date: Fri, 14 May 2021 17:50:39 +0800 Subject: [PATCH 022/128] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=9A=82=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../evaluationindex/index/impl/IndexExplainServiceImpl.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/index/impl/IndexExplainServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/index/impl/IndexExplainServiceImpl.java index 0734fadda1..0f79d225e2 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/index/impl/IndexExplainServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/index/impl/IndexExplainServiceImpl.java @@ -126,6 +126,9 @@ public class IndexExplainServiceImpl implements IndexExplainService { //不下钻 scoreList = gridSubScoreDao.selectGridSubScore(ablityListFormDTO); } + if (scoreList == null || tableList == null) { + return; + } for (IndexScoreResult score : scoreList) { for (IndexScoreDetailResult tb : tableList) { if (tb.getIndexCode().equals(score.getIndexCode())) { @@ -136,6 +139,8 @@ public class IndexExplainServiceImpl implements IndexExplainService { } } } + + break; default: From 054e20801d28fd8ae86dbfdfce21b12a260f5922 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Mon, 17 May 2021 11:04:33 +0800 Subject: [PATCH 023/128] =?UTF-8?q?=E9=83=A8=E5=88=86=E6=96=B9=E6=B3=95?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/datastats/form/SubAgencyFormDTO.java | 9 + .../dto/datastats/form/SubGridFormDTO.java | 9 + .../datastats/impl/DataStatsServiceImpl.java | 336 ++++++++++++++---- 3 files changed, 277 insertions(+), 77 deletions(-) diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/SubAgencyFormDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/SubAgencyFormDTO.java index a02a39456c..d5d3d8a66a 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/SubAgencyFormDTO.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/SubAgencyFormDTO.java @@ -23,6 +23,15 @@ public class SubAgencyFormDTO implements Serializable { * 日维度Id */ private String dateId; + /** + * 排序类型字段 + * 用户【用户:user 党员:party 居民:resi】 + * 党群【党群:group 楼院小组:ordinary 支部小组:branch】 + * 话题【话题:topic 热议中:discussing 已处理:closed 已转议题:shiftIssue】 + * 议题【议题:issue 表决中:voting 已转项目:shiftProject 已处理:closed】 + * 项目【项目:project 处理中:pending 已结案:closed】 + */ + private String type; public interface Agency extends CustomerClientShowGroup{} @Data diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/SubGridFormDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/SubGridFormDTO.java index d7da58385e..d429b47b7c 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/SubGridFormDTO.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/SubGridFormDTO.java @@ -23,6 +23,15 @@ public class SubGridFormDTO implements Serializable { * 日维度Id */ private String dateId; + /** + * 排序类型字段 + * 用户【用户:user 党员:party 居民:resi】 + * 党群【党群:group 楼院小组:ordinary 支部小组:branch】 + * 话题【话题:topic 热议中:discussing 已处理:closed 已转议题:shiftIssue】 + * 议题【议题:issue 表决中:voting 已转项目:shiftProject 已处理:closed】 + * 项目【项目:project 处理中:pending 已结案:closed】 + */ + private String type; public interface Agency extends CustomerClientShowGroup{} @Data diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java index f289a4abc9..900144795e 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java @@ -84,18 +84,22 @@ public class DataStatsServiceImpl implements DataStatsService { AgencyBasicDataResultDTO.Topic topicSHiftIssue = dataStatsDao.getAgencyTopicShiftIssue(formDTO.getAgencyId(), formDTO.getDateId()); AtomicReference closedTotal = new AtomicReference<>(0); AtomicReference hiddenTotal = new AtomicReference<>(0); - if (topic.size()>NumConstant.ZERO) { + if (topic.size() > NumConstant.ZERO) { resultDTO.setTopicTotal(topic.stream().collect(Collectors.summingInt(AgencyBasicDataResultDTO.Topic::getTopicCount))); topic.forEach(t -> { - if (t.getTopicStatus().equals("closed")){ closedTotal.set(t.getTopicCount()); } - if (t.getTopicStatus().equals("hidden")){ hiddenTotal.set(t.getTopicCount()); } + if (t.getTopicStatus().equals("closed")) { + closedTotal.set(t.getTopicCount()); + } + if (t.getTopicStatus().equals("hidden")) { + hiddenTotal.set(t.getTopicCount()); + } }); } if (null != topicSHiftIssue) { resultDTO.setShiftIssueTotal(topicSHiftIssue.getShiftedIssueTotal()); resultDTO.setShiftIssueRatio(resultDTO.getShiftIssueTotal() == 0 || resultDTO.getTopicTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getShiftIssueTotal() / (float) resultDTO.getTopicTotal()))); } - resultDTO.setDiscussingTotal(resultDTO.getTopicTotal()-closedTotal.get()-hiddenTotal.get()-resultDTO.getShiftIssueTotal()); + resultDTO.setDiscussingTotal(resultDTO.getTopicTotal() - closedTotal.get() - hiddenTotal.get() - resultDTO.getShiftIssueTotal()); resultDTO.setDiscussingRatio(resultDTO.getDiscussingTotal() == 0 || resultDTO.getTopicTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getDiscussingTotal() / (float) resultDTO.getTopicTotal()))); resultDTO.setClosedTopicTotal(closedTotal.get()); resultDTO.setClosedTopicRatio(resultDTO.getClosedTopicTotal() == 0 || resultDTO.getTopicTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getClosedTopicTotal() / (float) resultDTO.getTopicTotal()))); @@ -142,10 +146,14 @@ public class DataStatsServiceImpl implements DataStatsService { SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); formDTO.setDateId(format.format(yesterday)); } + //排序类型,默认按用户总数降序 + if (StringUtils.isBlank(formDTO.getDateId())) { + formDTO.setType("user"); + } //1.查询当前组织的直属下级组织信息【机关维度】 List subAgencyList = dataStatsDao.getSubAgencyList(formDTO.getAgencyId()); - if(subAgencyList.size() agencyIds = subAgencyList.stream().map(DimAgencyEntity::getId).collect(Collectors.toList()); @@ -153,17 +161,34 @@ public class DataStatsServiceImpl implements DataStatsService { //2.查询直属下级组织注册用户日统计数据,默认按用户总数降序 resultList = dataStatsDao.getSubAgencyUser(agencyIds, formDTO.getDateId()); - //3.封装数据并返回 - resultList.forEach(re->{ + //3.封装数据 + resultList.forEach(re -> { re.setPartyMemberRatio(re.getPartyMemberTotal() == 0 || re.getUserTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getPartyMemberTotal() / (float) re.getUserTotal()))); re.setResiRatio(re.getResiTotal() == 0 || re.getUserTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getResiTotal() / (float) re.getUserTotal()))); - subAgencyList.forEach(sub->{ - if(re.getAgencyId().equals(sub.getId())){ + subAgencyList.forEach(sub -> { + if (re.getAgencyId().equals(sub.getId())) { re.setAgencyName(sub.getAgencyName()); } }); }); + //4.按要求排序并返回 + Collections.sort(resultList, new Comparator() { + @Override + public int compare(SubAgencyUserResultDTO o1, SubAgencyUserResultDTO o2) { + if ("party".equals(formDTO.getType())) { + //升序 + //return o1.getPartyMemberTotal().compareTo(o2.getPartyMemberTotal()); + //降序 + return o2.getPartyMemberTotal().compareTo(o1.getPartyMemberTotal()); + } else if ("resi".equals(formDTO.getType())) { + return o2.getResiTotal().compareTo(o1.getResiTotal()); + } else { + return o2.getUserTotal().compareTo(o1.getUserTotal()); + } + } + }); + return resultList; } @@ -184,10 +209,14 @@ public class DataStatsServiceImpl implements DataStatsService { SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); formDTO.setDateId(format.format(yesterday)); } + //排序类型,默认按用户总数降序 + if (StringUtils.isBlank(formDTO.getDateId())) { + formDTO.setType("user"); + } //1.查询组织直属网格列表【网格维度】 List gridList = dataStatsDao.getSubGridList(formDTO.getAgencyId()); - if(gridList.size() gridIds = gridList.stream().map(DimGridEntity::getId).collect(Collectors.toList()); @@ -195,17 +224,32 @@ public class DataStatsServiceImpl implements DataStatsService { //2.查询网格层级注册用户日统计数据,默认按用户总数降序 resultList = dataStatsDao.getSubGridUser(gridIds, formDTO.getDateId()); - //3.封装数据并返回 - resultList.forEach(re->{ + //3.封装数据 + resultList.forEach(re -> { re.setPartyMemberRatio(re.getPartyMemberTotal() == 0 || re.getUserTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getPartyMemberTotal() / (float) re.getUserTotal()))); re.setResiRatio(re.getResiTotal() == 0 || re.getUserTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getResiTotal() / (float) re.getUserTotal()))); - gridList.forEach(sub->{ - if(re.getGridId().equals(sub.getId())){ + gridList.forEach(sub -> { + if (re.getGridId().equals(sub.getId())) { re.setGridName(sub.getGridName()); } }); }); + //4.按要求排序并返回 + Collections.sort(resultList, new Comparator() { + @Override + public int compare(SubGridUserResultDTO o1, SubGridUserResultDTO o2) { + if ("party".equals(formDTO.getType())) { + //降序 + return o2.getPartyMemberTotal().compareTo(o1.getPartyMemberTotal()); + } else if ("resi".equals(formDTO.getType())) { + return o2.getResiTotal().compareTo(o1.getResiTotal()); + } else { + return o2.getUserTotal().compareTo(o1.getUserTotal()); + } + } + }); + return resultList; } @@ -226,10 +270,14 @@ public class DataStatsServiceImpl implements DataStatsService { SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); formDTO.setDateId(format.format(yesterday)); } + //排序类型,默认按用户总数降序 + if (StringUtils.isBlank(formDTO.getDateId())) { + formDTO.setType("group"); + } //1.查询当前组织的直属下级组织信息【机关维度】 List subAgencyList = dataStatsDao.getSubAgencyList(formDTO.getAgencyId()); - if(subAgencyList.size() agencyIds = subAgencyList.stream().map(DimAgencyEntity::getId).collect(Collectors.toList()); @@ -237,17 +285,31 @@ public class DataStatsServiceImpl implements DataStatsService { //2.查询直属下级组织小组日统计数据,默认按群组总数降序 resultList = dataStatsDao.getSubAgencyGroup(agencyIds, formDTO.getDateId()); - //3.封装数据并返回 - resultList.forEach(re->{ + //3.封装数据 + resultList.forEach(re -> { re.setOrdinaryRatio(re.getOrdinaryTotal() == 0 || re.getGroupTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getOrdinaryTotal() / (float) re.getGroupTotal()))); re.setBranchRatio(re.getBranchTotal() == 0 || re.getGroupTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getBranchTotal() / (float) re.getGroupTotal()))); - subAgencyList.forEach(sub->{ - if(re.getAgencyId().equals(sub.getId())){ + subAgencyList.forEach(sub -> { + if (re.getAgencyId().equals(sub.getId())) { re.setAgencyName(sub.getAgencyName()); } }); }); + //4.按要求排序并返回 + Collections.sort(resultList, new Comparator() { + @Override + public int compare(SubAgencyGroupResultDTO o1, SubAgencyGroupResultDTO o2) { + if ("ordinary".equals(formDTO.getType())) { + return o2.getOrdinaryTotal().compareTo(o1.getOrdinaryTotal()); + } else if ("branch".equals(formDTO.getType())) { + return o2.getBranchTotal().compareTo(o1.getBranchTotal()); + } else { + return o2.getGroupTotal().compareTo(o1.getGroupTotal()); + } + } + }); + return resultList; } @@ -268,10 +330,14 @@ public class DataStatsServiceImpl implements DataStatsService { SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); formDTO.setDateId(format.format(yesterday)); } + //排序类型,默认按用户总数降序 + if (StringUtils.isBlank(formDTO.getDateId())) { + formDTO.setType("group"); + } //1.查询组织直属网格列表【网格维度】 List gridList = dataStatsDao.getSubGridList(formDTO.getAgencyId()); - if(gridList.size() gridIds = gridList.stream().map(DimGridEntity::getId).collect(Collectors.toList()); @@ -280,24 +346,38 @@ public class DataStatsServiceImpl implements DataStatsService { resultList = dataStatsDao.getSubGridGroup(gridIds, formDTO.getDateId()); //3.封装数据并返回 - resultList.forEach(re->{ + resultList.forEach(re -> { re.setOrdinaryRatio(re.getOrdinaryTotal() == 0 || re.getGroupTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getOrdinaryTotal() / (float) re.getGroupTotal()))); re.setBranchRatio(re.getBranchTotal() == 0 || re.getGroupTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getBranchTotal() / (float) re.getGroupTotal()))); - gridList.forEach(sub->{ - if(re.getGridId().equals(sub.getId())){ + gridList.forEach(sub -> { + if (re.getGridId().equals(sub.getId())) { re.setGridName(sub.getGridName()); } }); }); + //4.按要求排序并返回 + Collections.sort(resultList, new Comparator() { + @Override + public int compare(SubGridGroupResultDTO o1, SubGridGroupResultDTO o2) { + if ("ordinary".equals(formDTO.getType())) { + return o2.getOrdinaryTotal().compareTo(o1.getOrdinaryTotal()); + } else if ("branch".equals(formDTO.getType())) { + return o2.getBranchTotal().compareTo(o1.getBranchTotal()); + } else { + return o2.getGroupTotal().compareTo(o1.getGroupTotal()); + } + } + }); + return resultList; } /** + * @return * @Param formDTO * @Description 查询当前组织的直属下级组织话题数据 * @author sun - * @return */ @Override public List subAgencyTopic(SubAgencyFormDTO formDTO) { @@ -311,10 +391,14 @@ public class DataStatsServiceImpl implements DataStatsService { SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); formDTO.setDateId(format.format(yesterday)); } + //排序类型,默认按用户总数降序 + if (StringUtils.isBlank(formDTO.getDateId())) { + formDTO.setType("topic"); + } //1.查询当前组织的直属下级组织信息【机关维度】 List subAgencyList = dataStatsDao.getSubAgencyList(formDTO.getAgencyId()); - if(subAgencyList.size() agencyIds = subAgencyList.stream().map(DimAgencyEntity::getId).collect(Collectors.toList()); @@ -324,27 +408,31 @@ public class DataStatsServiceImpl implements DataStatsService { List topic = dataStatsDao.getSubAgencyTopic(agencyIds, formDTO.getDateId()); //查询直属下级组织转议题话题-日统计数据表 List topicShiftIssue = dataStatsDao.getSubAgencyTopicShiftIssue(agencyIds, formDTO.getDateId()); - agencyIds.forEach(agencyId->{ + agencyIds.forEach(agencyId -> { SubAgencyTopicResultDTO resultDTO = new SubAgencyTopicResultDTO(); AtomicInteger topicTotal = new AtomicInteger(0); AtomicInteger closedTotal = new AtomicInteger(0); AtomicInteger hiddenTotal = new AtomicInteger(0); AtomicInteger shiftIssueTotal = new AtomicInteger(0); AtomicReference agencyName = new AtomicReference<>(""); - topic.forEach(t->{ - if(t.getAgencyId().equals(agencyId)){ + topic.forEach(t -> { + if (t.getAgencyId().equals(agencyId)) { topicTotal.addAndGet(t.getTopicCount()); - if (t.getTopicStatus().equals("closed")){ closedTotal.set(t.getTopicCount()); } - if (t.getTopicStatus().equals("hidden")){ hiddenTotal.set(t.getTopicCount()); } + if (t.getTopicStatus().equals("closed")) { + closedTotal.set(t.getTopicCount()); + } + if (t.getTopicStatus().equals("hidden")) { + hiddenTotal.set(t.getTopicCount()); + } } }); - topicShiftIssue.forEach(t->{ - if(t.getAgencyId().equals(agencyId)){ + topicShiftIssue.forEach(t -> { + if (t.getAgencyId().equals(agencyId)) { shiftIssueTotal.addAndGet(t.getShiftedIssueTotal()); } }); - subAgencyList.forEach(sub->{ - if(agencyId.equals(sub.getId())){ + subAgencyList.forEach(sub -> { + if (agencyId.equals(sub.getId())) { agencyName.set(sub.getAgencyName()); } }); @@ -352,7 +440,7 @@ public class DataStatsServiceImpl implements DataStatsService { resultDTO.setAgencyId(agencyId); resultDTO.setAgencyName(agencyName.get()); resultDTO.setTopicTotal(topicTotal.get()); - resultDTO.setDiscussingTotal(topicTotal.get()-closedTotal.get()-hiddenTotal.get()-shiftIssueTotal.get()); + resultDTO.setDiscussingTotal(topicTotal.get() - closedTotal.get() - hiddenTotal.get() - shiftIssueTotal.get()); resultDTO.setDiscussingRatio(resultDTO.getDiscussingTotal() == 0 || resultDTO.getTopicTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getDiscussingTotal() / (float) resultDTO.getTopicTotal()))); resultDTO.setClosedTopicTotal(closedTotal.get()); resultDTO.setClosedTopicRatio(resultDTO.getClosedTopicTotal() == 0 || resultDTO.getTopicTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getClosedTopicTotal() / (float) resultDTO.getTopicTotal()))); @@ -362,14 +450,19 @@ public class DataStatsServiceImpl implements DataStatsService { resultList.add(resultDTO); }); - //3.默认按话题总数降序 + //3.按要求排序并返回 Collections.sort(resultList, new Comparator() { @Override public int compare(SubAgencyTopicResultDTO o1, SubAgencyTopicResultDTO o2) { - //升序 - //return o1.getTopicTotal().compareTo(o2.getTopicTotal()); - //降序 - return o2.getTopicTotal().compareTo(o1.getTopicTotal()); + if ("discussing".equals(formDTO.getType())) { + return o2.getDiscussingTotal().compareTo(o1.getDiscussingTotal()); + } else if ("closed".equals(formDTO.getType())) { + return o2.getClosedTopicTotal().compareTo(o1.getClosedTopicTotal()); + } else if ("shiftIssue".equals(formDTO.getType())) { + return o2.getShiftIssueTotal().compareTo(o1.getShiftIssueTotal()); + } else { + return o2.getTopicTotal().compareTo(o1.getTopicTotal()); + } } }); @@ -377,10 +470,10 @@ public class DataStatsServiceImpl implements DataStatsService { } /** + * @return * @Param formDTO * @Description 查询当前组织下直属网格列表话题数据 * @author sun - * @return */ @Override public List subGridTopic(SubGridFormDTO formDTO) { @@ -394,10 +487,14 @@ public class DataStatsServiceImpl implements DataStatsService { SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); formDTO.setDateId(format.format(yesterday)); } + //排序类型,默认按用户总数降序 + if (StringUtils.isBlank(formDTO.getDateId())) { + formDTO.setType("topic"); + } //1.查询组织直属网格列表【网格维度】 List gridList = dataStatsDao.getSubGridList(formDTO.getAgencyId()); - if(gridList.size() gridIds = gridList.stream().map(DimGridEntity::getId).collect(Collectors.toList()); @@ -407,27 +504,31 @@ public class DataStatsServiceImpl implements DataStatsService { List topic = dataStatsDao.getSubGridTopic(gridIds, formDTO.getDateId()); //查询网格层级转议题话题-日统计数据表 List topicShiftIssue = dataStatsDao.getSubGridTopicShiftIssue(gridIds, formDTO.getDateId()); - gridIds.forEach(gridId->{ + gridIds.forEach(gridId -> { SubGridTopicResultDTO resultDTO = new SubGridTopicResultDTO(); AtomicInteger topicTotal = new AtomicInteger(0); AtomicInteger closedTotal = new AtomicInteger(0); AtomicInteger hiddenTotal = new AtomicInteger(0); AtomicInteger shiftIssueTotal = new AtomicInteger(0); AtomicReference gridName = new AtomicReference<>(""); - topic.forEach(t->{ - if(t.getGridId().equals(gridId)){ + topic.forEach(t -> { + if (t.getGridId().equals(gridId)) { topicTotal.addAndGet(t.getTopicCount()); - if (t.getTopicStatus().equals("closed")){ closedTotal.set(t.getTopicCount()); } - if (t.getTopicStatus().equals("hidden")){ hiddenTotal.set(t.getTopicCount()); } + if (t.getTopicStatus().equals("closed")) { + closedTotal.set(t.getTopicCount()); + } + if (t.getTopicStatus().equals("hidden")) { + hiddenTotal.set(t.getTopicCount()); + } } }); - topicShiftIssue.forEach(t->{ - if(t.getGridId().equals(gridId)){ + topicShiftIssue.forEach(t -> { + if (t.getGridId().equals(gridId)) { shiftIssueTotal.addAndGet(t.getShiftedIssueTotal()); } }); - gridList.forEach(sub->{ - if(gridId.equals(sub.getId())){ + gridList.forEach(sub -> { + if (gridId.equals(sub.getId())) { gridName.set(sub.getGridName()); } }); @@ -435,7 +536,7 @@ public class DataStatsServiceImpl implements DataStatsService { resultDTO.setGridId(gridId); resultDTO.setGridName(gridName.get()); resultDTO.setTopicTotal(topicTotal.get()); - resultDTO.setDiscussingTotal(topicTotal.get()-closedTotal.get()-hiddenTotal.get()-shiftIssueTotal.get()); + resultDTO.setDiscussingTotal(topicTotal.get() - closedTotal.get() - hiddenTotal.get() - shiftIssueTotal.get()); resultDTO.setDiscussingRatio(resultDTO.getDiscussingTotal() == 0 || resultDTO.getTopicTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getDiscussingTotal() / (float) resultDTO.getTopicTotal()))); resultDTO.setClosedTopicTotal(closedTotal.get()); resultDTO.setClosedTopicRatio(resultDTO.getClosedTopicTotal() == 0 || resultDTO.getTopicTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getClosedTopicTotal() / (float) resultDTO.getTopicTotal()))); @@ -445,14 +546,19 @@ public class DataStatsServiceImpl implements DataStatsService { resultList.add(resultDTO); }); - //3.默认按话题总数降序 + //3.按要求排序并返回 Collections.sort(resultList, new Comparator() { @Override public int compare(SubGridTopicResultDTO o1, SubGridTopicResultDTO o2) { - //升序 - //return o1.getTopicTotal().compareTo(o2.getTopicTotal()); - //降序 - return o2.getTopicTotal().compareTo(o1.getTopicTotal()); + if ("discussing".equals(formDTO.getType())) { + return o2.getDiscussingTotal().compareTo(o1.getDiscussingTotal()); + } else if ("closed".equals(formDTO.getType())) { + return o2.getClosedTopicTotal().compareTo(o1.getClosedTopicTotal()); + } else if ("shiftIssue".equals(formDTO.getType())) { + return o2.getShiftIssueTotal().compareTo(o1.getShiftIssueTotal()); + } else { + return o2.getTopicTotal().compareTo(o1.getTopicTotal()); + } } }); @@ -476,10 +582,14 @@ public class DataStatsServiceImpl implements DataStatsService { SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); formDTO.setDateId(format.format(yesterday)); } + //排序类型,默认按用户总数降序 + if (StringUtils.isBlank(formDTO.getDateId())) { + formDTO.setType("issue"); + } //1.查询当前组织的直属下级组织信息【机关维度】 List subAgencyList = dataStatsDao.getSubAgencyList(formDTO.getAgencyId()); - if(subAgencyList.size() agencyIds = subAgencyList.stream().map(DimAgencyEntity::getId).collect(Collectors.toList()); @@ -487,18 +597,34 @@ public class DataStatsServiceImpl implements DataStatsService { //2.查询直属下级组织议题日统计数据,默认按议题总数降序 resultList = dataStatsDao.getSubAgencyIssue(agencyIds, formDTO.getDateId()); - //3.封装数据并返回 - resultList.forEach(re->{ + //3.封装数据 + resultList.forEach(re -> { re.setVotingRatio(re.getVotingTotal() == 0 || re.getIssueTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getVotingTotal() / (float) re.getIssueTotal()))); re.setClosedIssueRatio(re.getClosedIssueTotal() == 0 || re.getIssueTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getClosedIssueTotal() / (float) re.getIssueTotal()))); re.setShiftProjectRatio(re.getShiftProjectTotal() == 0 || re.getIssueTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getShiftProjectTotal() / (float) re.getIssueTotal()))); - subAgencyList.forEach(sub->{ - if(re.getAgencyId().equals(sub.getId())){ + subAgencyList.forEach(sub -> { + if (re.getAgencyId().equals(sub.getId())) { re.setAgencyName(sub.getAgencyName()); } }); }); + //4.按要求排序并返回 + Collections.sort(resultList, new Comparator() { + @Override + public int compare(SubAgencyIssueResultDTO o1, SubAgencyIssueResultDTO o2) { + if ("voting".equals(formDTO.getType())) { + return o2.getVotingTotal().compareTo(o1.getVotingTotal()); + } else if ("shiftProject".equals(formDTO.getType())) { + return o2.getShiftProjectTotal().compareTo(o1.getShiftProjectTotal()); + } else if ("closed".equals(formDTO.getType())) { + return o2.getClosedIssueTotal().compareTo(o1.getClosedIssueTotal()); + } else { + return o2.getIssueTotal().compareTo(o1.getIssueTotal()); + } + } + }); + return resultList; } @@ -519,10 +645,14 @@ public class DataStatsServiceImpl implements DataStatsService { SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); formDTO.setDateId(format.format(yesterday)); } + //排序类型,默认按用户总数降序 + if (StringUtils.isBlank(formDTO.getDateId())) { + formDTO.setType("issue"); + } //1.查询组织直属网格列表【网格维度】 List gridList = dataStatsDao.getSubGridList(formDTO.getAgencyId()); - if(gridList.size() gridIds = gridList.stream().map(DimGridEntity::getId).collect(Collectors.toList()); @@ -530,18 +660,34 @@ public class DataStatsServiceImpl implements DataStatsService { //2.查询网格层级议题日统计数据,默认按议题总数降序 resultList = dataStatsDao.getSubGridIssue(gridIds, formDTO.getDateId()); - //3.封装数据并返回 - resultList.forEach(re->{ + //3.封装数据 + resultList.forEach(re -> { re.setVotingRatio(re.getVotingTotal() == 0 || re.getIssueTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getVotingTotal() / (float) re.getIssueTotal()))); re.setClosedIssueRatio(re.getClosedIssueTotal() == 0 || re.getIssueTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getClosedIssueTotal() / (float) re.getIssueTotal()))); re.setShiftProjectRatio(re.getShiftProjectTotal() == 0 || re.getIssueTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getShiftProjectTotal() / (float) re.getIssueTotal()))); - gridList.forEach(sub->{ - if(re.getGridId().equals(sub.getId())){ + gridList.forEach(sub -> { + if (re.getGridId().equals(sub.getId())) { re.setGridName(sub.getGridName()); } }); }); + //4.按要求排序并返回 + Collections.sort(resultList, new Comparator() { + @Override + public int compare(SubGridIssueResultDTO o1, SubGridIssueResultDTO o2) { + if ("voting".equals(formDTO.getType())) { + return o2.getVotingTotal().compareTo(o1.getVotingTotal()); + } else if ("shiftProject".equals(formDTO.getType())) { + return o2.getShiftProjectTotal().compareTo(o1.getShiftProjectTotal()); + } else if ("closed".equals(formDTO.getType())) { + return o2.getClosedIssueTotal().compareTo(o1.getClosedIssueTotal()); + } else { + return o2.getIssueTotal().compareTo(o1.getIssueTotal()); + } + } + }); + return resultList; } @@ -562,10 +708,14 @@ public class DataStatsServiceImpl implements DataStatsService { SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); formDTO.setDateId(format.format(yesterday)); } + //排序类型,默认按用户总数降序 + if (StringUtils.isBlank(formDTO.getDateId())) { + formDTO.setType("project"); + } //1.查询当前组织的直属下级组织信息【机关维度】 List subAgencyList = dataStatsDao.getSubAgencyList(formDTO.getAgencyId()); - if(subAgencyList.size() agencyIds = subAgencyList.stream().map(DimAgencyEntity::getId).collect(Collectors.toList()); @@ -573,17 +723,31 @@ public class DataStatsServiceImpl implements DataStatsService { //2.查询直属下级组织项目日统计数据,默认按项目总数降序 resultList = dataStatsDao.getSubAgencyProject(agencyIds, formDTO.getDateId()); - //3.封装数据并返回 - resultList.forEach(re->{ + //3.封装数据 + resultList.forEach(re -> { re.setPendingRatio(re.getPendingTotal() == 0 || re.getProjectTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getPendingTotal() / (float) re.getProjectTotal()))); re.setClosedProjectRatio(re.getClosedProjectTotal() == 0 || re.getProjectTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getClosedProjectTotal() / (float) re.getProjectTotal()))); - subAgencyList.forEach(sub->{ - if(re.getAgencyId().equals(sub.getId())){ + subAgencyList.forEach(sub -> { + if (re.getAgencyId().equals(sub.getId())) { re.setAgencyName(sub.getAgencyName()); } }); }); + //4.按要求排序并返回 + Collections.sort(resultList, new Comparator() { + @Override + public int compare(SubAgencyProjectResultDTO o1, SubAgencyProjectResultDTO o2) { + if ("pending".equals(formDTO.getType())) { + return o2.getPendingTotal().compareTo(o1.getPendingTotal()); + } else if ("closed".equals(formDTO.getType())) { + return o2.getClosedProjectTotal().compareTo(o1.getClosedProjectTotal()); + } else { + return o2.getProjectTotal().compareTo(o1.getProjectTotal()); + } + } + }); + return resultList; } @@ -604,10 +768,14 @@ public class DataStatsServiceImpl implements DataStatsService { SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); formDTO.setDateId(format.format(yesterday)); } + //排序类型,默认按用户总数降序 + if (StringUtils.isBlank(formDTO.getDateId())) { + formDTO.setType("project"); + } //1.查询组织直属网格列表【网格维度】 List gridList = dataStatsDao.getSubGridList(formDTO.getAgencyId()); - if(gridList.size() gridIds = gridList.stream().map(DimGridEntity::getId).collect(Collectors.toList()); @@ -615,17 +783,31 @@ public class DataStatsServiceImpl implements DataStatsService { //2.查询网格层级项目日统计数据,默认按项目总数降序 resultList = dataStatsDao.getSubGridProject(gridIds, formDTO.getDateId()); - //3.封装数据并返回 - resultList.forEach(re->{ + //3.封装数据 + resultList.forEach(re -> { re.setPendingRatio(re.getPendingTotal() == 0 || re.getProjectTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getPendingTotal() / (float) re.getProjectTotal()))); re.setClosedProjectRatio(re.getClosedProjectTotal() == 0 || re.getProjectTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getClosedProjectTotal() / (float) re.getProjectTotal()))); - gridList.forEach(sub->{ - if(re.getGridId().equals(sub.getId())){ + gridList.forEach(sub -> { + if (re.getGridId().equals(sub.getId())) { re.setGridName(sub.getGridName()); } }); }); + //4.按要求排序并返回 + Collections.sort(resultList, new Comparator() { + @Override + public int compare(SubGridProjectResultDTO o1, SubGridProjectResultDTO o2) { + if ("pending".equals(formDTO.getType())) { + return o2.getPendingTotal().compareTo(o1.getPendingTotal()); + } else if ("closed".equals(formDTO.getType())) { + return o2.getClosedProjectTotal().compareTo(o1.getClosedProjectTotal()); + } else { + return o2.getProjectTotal().compareTo(o1.getProjectTotal()); + } + } + }); + return resultList; } From 77e2146f220b4601b10333e1056cd9a99182e2db Mon Sep 17 00:00:00 2001 From: wxz Date: Mon, 17 May 2021 14:08:20 +0800 Subject: [PATCH 024/128] =?UTF-8?q?=E6=96=B0=E5=A2=9E=EF=BC=9A=E5=85=88?= =?UTF-8?q?=E8=BF=9B=E6=8E=92=E8=A1=8C->=E5=B1=85=E6=B0=91=E7=A7=AF?= =?UTF-8?q?=E5=88=86=E6=8E=92=E8=A1=8C=E5=88=97=E8=A1=A8(=E4=B8=8D?= =?UTF-8?q?=E5=90=AB=E5=85=9A=E5=91=98)=20=E6=96=B0=E5=A2=9E=EF=BC=9A?= =?UTF-8?q?=E5=85=88=E8=BF=9B=E6=8E=92=E8=A1=8C->=E5=85=9A=E5=91=98?= =?UTF-8?q?=E7=A7=AF=E5=88=86=E6=8E=92=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/form/PartyPointRankFormDTO.java | 35 ++++++++++++ .../dto/result/PartyPointRankResultDTO.java | 35 ++++++++++++ .../screen/ScreenUserController.java | 28 +++++++++- .../screen/ScreenPartyUserRankDataDao.java | 20 +++++-- .../screen/ScreenUserService.java | 11 ++++ .../screen/impl/ScreenUserServiceImpl.java | 28 ++++++++++ .../screen/ScreenPartyUserRankDataDao.xml | 56 +++++++++++++++++++ 7 files changed, 207 insertions(+), 6 deletions(-) create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/PartyPointRankFormDTO.java create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PartyPointRankResultDTO.java diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/PartyPointRankFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/PartyPointRankFormDTO.java new file mode 100644 index 0000000000..5e4d3e9cc4 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/PartyPointRankFormDTO.java @@ -0,0 +1,35 @@ +package com.epmet.evaluationindex.screen.dto.form; + + +import lombok.Data; + +import javax.validation.constraints.Min; +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 党员(积分)排行--接口入参 + * @Author sun + */ +@Data +public class PartyPointRankFormDTO implements Serializable { + private static final long serialVersionUID = -2880432640584616651L; + /** + * 组织或网格Id + */ + @NotBlank(message = "组织或网格ID不能为空",groups = {PartyPointRankFormDTO.AddUserInternalGroup.class}) + private String orgId; + /** + * 类型(组织:agency 网格:grid) + */ + @NotBlank(message = "数据类型不能为空",groups = {PartyPointRankFormDTO.AddUserInternalGroup.class}) + private String orgType; + /** + * 默认显示前5名 + */ + @Min(value = 1, message = "查询条数必须大于0", groups = {PartyPointRankFormDTO.AddUserInternalGroup.class }) + private Integer topNum; + public interface AddUserInternalGroup {} + + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PartyPointRankResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PartyPointRankResultDTO.java new file mode 100644 index 0000000000..c6a11b1ea3 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PartyPointRankResultDTO.java @@ -0,0 +1,35 @@ +package com.epmet.evaluationindex.screen.dto.result; + +import lombok.Data; + +@Data +public class PartyPointRankResultDTO { + /** + * 组织ID + */ + private String agencyId; + /** + * 组织名称 + */ + private String agencyName; + /** + * 用户Id + */ + private String userId; + /** + * 用户名称 + */ + private String userName; + /** + * 网格Id + */ + private String gridId; + /** + * 网格名称 + */ + private String gridName; + /** + * 党员积分 + */ + private Double pointTotal; +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/ScreenUserController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/ScreenUserController.java index 84d586306f..9add2dd4d1 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/ScreenUserController.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/ScreenUserController.java @@ -1,13 +1,13 @@ package com.epmet.datareport.controller.screen; -import com.epmet.commons.tools.annotation.LoginUser; -import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.datareport.service.evaluationindex.screen.ScreenUserService; import com.epmet.evaluationindex.screen.dto.form.PartIndexScroeRankFormDTO; +import com.epmet.evaluationindex.screen.dto.form.PartyPointRankFormDTO; import com.epmet.evaluationindex.screen.dto.form.UserPointRankFormDTO; import com.epmet.evaluationindex.screen.dto.result.PartIndexScroeRankResultDTO; +import com.epmet.evaluationindex.screen.dto.result.PartyPointRankResultDTO; import com.epmet.evaluationindex.screen.dto.result.UserPointRankListResultDTO; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; @@ -40,6 +40,18 @@ public class ScreenUserController { return new Result>().ok(screenUserService.userPointRank(formDTO)); } + /** + * 热心市民积分排行列表(不包含党员) + * @param formDTO + * @return + * @author wxz + */ + @PostMapping("userpointrank/withoutpartymember") + public Result> userPointRankWithoutPartyMem(@RequestBody UserPointRankFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, UserPointRankFormDTO.AddUserInternalGroup.class); + return new Result>().ok(screenUserService.userPointRankWithoutPartyMem(formDTO)); + } + /** * @param formDTO * @Description 党员(指标得分)排行 @@ -52,5 +64,17 @@ public class ScreenUserController { } + /** + * @param formDTO + * @Description 党员(积分)排行 + * @author wxz + */ + @PostMapping("partypointrank") + public Result> partyPointRank(@RequestBody PartyPointRankFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, PartIndexScroeRankFormDTO.AddUserInternalGroup.class); + return new Result>().ok(screenUserService.partyPointRank(formDTO)); + } + + } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenPartyUserRankDataDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenPartyUserRankDataDao.java index fe5adc1a77..9dff1c7f68 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenPartyUserRankDataDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenPartyUserRankDataDao.java @@ -19,11 +19,9 @@ package com.epmet.datareport.dao.evaluationindex.screen; import com.epmet.dto.result.user.KcUserPointRankResultDTO; import com.epmet.evaluationindex.screen.dto.form.PartIndexScroeRankFormDTO; +import com.epmet.evaluationindex.screen.dto.form.PartyPointRankFormDTO; import com.epmet.evaluationindex.screen.dto.form.UserPointRankFormDTO; -import com.epmet.evaluationindex.screen.dto.result.PartIndexScroeRankResultDTO; -import com.epmet.evaluationindex.screen.dto.result.PartyUserPointResultDTO; -import com.epmet.evaluationindex.screen.dto.result.UserPointRankListResultDTO; -import com.epmet.evaluationindex.screen.dto.result.UserPointResultDTO; +import com.epmet.evaluationindex.screen.dto.result.*; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -65,6 +63,13 @@ public interface ScreenPartyUserRankDataDao{ */ List selectAgencyUserPointList(UserPointRankFormDTO formDTO); + /** + * 查询组织下居民(不包含党员)积分排行,按积分值降序 + * @param formDTO + * @return + */ + List selectAgencyResiPointListWithoutPartyMem(UserPointRankFormDTO formDTO); + /** * @param formDTO * @Description 查询组织下党员的积分排行,按积分值降序 @@ -75,4 +80,11 @@ public interface ScreenPartyUserRankDataDao{ List selectPartymemberPointOrderByAreaCode(@Param("areaCode") String areaCode); List selectUserPointOrderByAreaCode(@Param("areaCode") String areaCode); + + /** + * 党员积分排行 + * @param formDTO + * @return + */ + List listPartymemberPointRank(PartyPointRankFormDTO formDTO); } \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/ScreenUserService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/ScreenUserService.java index f5e2428f09..85366a3db6 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/ScreenUserService.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/ScreenUserService.java @@ -1,8 +1,10 @@ package com.epmet.datareport.service.evaluationindex.screen; import com.epmet.evaluationindex.screen.dto.form.PartIndexScroeRankFormDTO; +import com.epmet.evaluationindex.screen.dto.form.PartyPointRankFormDTO; import com.epmet.evaluationindex.screen.dto.form.UserPointRankFormDTO; import com.epmet.evaluationindex.screen.dto.result.PartIndexScroeRankResultDTO; +import com.epmet.evaluationindex.screen.dto.result.PartyPointRankResultDTO; import com.epmet.evaluationindex.screen.dto.result.UserPointRankListResultDTO; import java.util.List; @@ -21,10 +23,19 @@ public interface ScreenUserService { */ List userPointRank(UserPointRankFormDTO formDTO); + List userPointRankWithoutPartyMem(UserPointRankFormDTO formDTO); + /** * @param formDTO * @Description 党员(指标得分)排行 * @author sun */ List partIndexScroeRank(PartIndexScroeRankFormDTO formDTO); + + /** + * 党员积分排行 + * @param formDTO + * @return + */ + List partyPointRank(PartyPointRankFormDTO formDTO); } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenUserServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenUserServiceImpl.java index 7721876c58..31f3ee8d3e 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenUserServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenUserServiceImpl.java @@ -7,8 +7,10 @@ import com.epmet.datareport.constant.FactConstant; import com.epmet.datareport.dao.evaluationindex.screen.ScreenPartyUserRankDataDao; import com.epmet.datareport.service.evaluationindex.screen.ScreenUserService; import com.epmet.evaluationindex.screen.dto.form.PartIndexScroeRankFormDTO; +import com.epmet.evaluationindex.screen.dto.form.PartyPointRankFormDTO; import com.epmet.evaluationindex.screen.dto.form.UserPointRankFormDTO; import com.epmet.evaluationindex.screen.dto.result.PartIndexScroeRankResultDTO; +import com.epmet.evaluationindex.screen.dto.result.PartyPointRankResultDTO; import com.epmet.evaluationindex.screen.dto.result.UserPointRankListResultDTO; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -43,6 +45,22 @@ public class ScreenUserServiceImpl implements ScreenUserService { return screenPartyUserRankDataDao.selectAgencyUserPointList(formDTO); } + /** + * @param formDTO + * @Description 热心市民积分排行列表(不包含党员) + * @author sun + */ + @Override + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) + public List userPointRankWithoutPartyMem(UserPointRankFormDTO formDTO) { + //1.参数校验 + if (!FactConstant.AGENCY.equals(formDTO.getOrgType()) && !FactConstant.GRID.equals(formDTO.getOrgType())) { + throw new RenException(String.format("入参格式错误,错误的组织或网格类型:%s", formDTO.getOrgType())); + } + //2.查询组织下居民积分排行,按积分值降序 screen_party_user_rank_data + return screenPartyUserRankDataDao.selectAgencyResiPointListWithoutPartyMem(formDTO); + } + /** * @param formDTO * @Description 党员(指标得分)排行 @@ -59,4 +77,14 @@ public class ScreenUserServiceImpl implements ScreenUserService { return screenPartyUserRankDataDao.selectPartymemberPointList(formDTO); } + @Override + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) + public List partyPointRank(PartyPointRankFormDTO formDTO) { + //1.参数校验 + if (!FactConstant.AGENCY.equals(formDTO.getOrgType()) && !FactConstant.GRID.equals(formDTO.getOrgType())) { + throw new RenException(String.format("入参格式错误,错误的组织或网格类型:%s", formDTO.getOrgType())); + } + return screenPartyUserRankDataDao.listPartymemberPointRank(formDTO); + } + } \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyUserRankDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyUserRankDataDao.xml index 30fb7bd125..aa584adbae 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyUserRankDataDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyUserRankDataDao.xml @@ -131,4 +131,60 @@ m.POINT_TOTAL DESC, m.user_name + + + + + \ No newline at end of file From 985765b0164037265ddf8aab70fb955ec6e2ec02 Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Mon, 17 May 2021 17:58:16 +0800 Subject: [PATCH 025/128] =?UTF-8?q?=E5=85=9A=E5=91=98=E5=85=88=E9=94=8B?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...FactPartyMemberVanguardAgencyDailyDTO.java | 179 ++++++++ .../FactPartyMemberVanguardGridDailyDTO.java | 179 ++++++++ .../com/epmet/controller/DemoController.java | 11 + .../extract/FactOriginGroupMainDailyDao.java | 20 + .../FactOriginGroupMemberDailyDao.java | 24 + .../extract/FactOriginIssueMainDailyDao.java | 20 + .../FactOriginProjectMainDailyDao.java | 41 ++ .../extract/FactOriginTopicMainDailyDao.java | 20 + ...FactPartyMemberVanguardAgencyDailyDao.java | 44 ++ .../FactPartyMemberVanguardGridDailyDao.java | 42 ++ ...tPartyMemberVanguardAgencyDailyEntity.java | 149 +++++++ ...actPartyMemberVanguardGridDailyEntity.java | 149 +++++++ .../StatsPartyMemberVanguardService.java | 31 ++ .../FactOriginGroupMainDailyService.java | 13 + .../FactOriginGroupMemberDailyService.java | 12 + .../FactOriginIssueMainDailyService.java | 12 + .../FactOriginProjectMainDailyService.java | 23 + .../FactOriginTopicMainDailyService.java | 12 + .../FactOriginGroupMainDailyServiceImpl.java | 39 ++ ...FactOriginGroupMemberDailyServiceImpl.java | 44 ++ .../FactOriginIssueMainDailyServiceImpl.java | 42 ++ ...FactOriginProjectMainDailyServiceImpl.java | 75 +++- .../FactOriginTopicMainDailyServiceImpl.java | 42 +- .../StatsPartyMemberVanguardServiceImpl.java | 414 ++++++++++++++++++ ...PartyMemberVanguardAgencyDailyService.java | 105 +++++ ...ctPartyMemberVanguardGridDailyService.java | 105 +++++ ...yMemberVanguardAgencyDailyServiceImpl.java | 118 +++++ ...rtyMemberVanguardGridDailyServiceImpl.java | 118 +++++ .../extract/FactOriginGroupMainDailyDao.xml | 26 ++ .../extract/FactOriginGroupMemberDailyDao.xml | 44 ++ .../extract/FactOriginIssueMainDailyDao.xml | 20 + .../extract/FactOriginProjectMainDailyDao.xml | 42 ++ .../extract/FactOriginTopicMainDailyDao.xml | 20 + .../FactPartyMemberVanguardAgencyDailyDao.xml | 40 ++ .../FactPartyMemberVanguardGridDailyDao.xml | 40 ++ 35 files changed, 2307 insertions(+), 8 deletions(-) create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactPartyMemberVanguardAgencyDailyDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactPartyMemberVanguardGridDailyDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactPartyMemberVanguardAgencyDailyDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactPartyMemberVanguardGridDailyDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactPartyMemberVanguardAgencyDailyEntity.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactPartyMemberVanguardGridDailyEntity.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsPartyMemberVanguardService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsPartyMemberVanguardServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactPartyMemberVanguardAgencyDailyService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactPartyMemberVanguardGridDailyService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactPartyMemberVanguardAgencyDailyServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactPartyMemberVanguardGridDailyServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactPartyMemberVanguardAgencyDailyDao.xml create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactPartyMemberVanguardGridDailyDao.xml diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactPartyMemberVanguardAgencyDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactPartyMemberVanguardAgencyDailyDTO.java new file mode 100644 index 0000000000..434775abd2 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactPartyMemberVanguardAgencyDailyDTO.java @@ -0,0 +1,179 @@ +/** + * 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.stats; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 党员先锋-机关日统计数据 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-13 + */ +@Data +public class FactPartyMemberVanguardAgencyDailyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 机构ID + */ + private String agencyId; + + /** + * 父级机关ID + */ + private String pid; + + /** + * 统计日期 关联日期dim表 + */ + private String dateId; + + /** + * 周ID + */ + private String weekId; + + /** + * 月ID + */ + private String monthId; + + /** + * 季ID + */ + private String quarterId; + + /** + * 年ID + */ + private String yearId; + + /** + * 党员建组数 + */ + private Integer groupCount; + + /** + * 党员建组数占比 + */ + private BigDecimal groupRatio; + + /** + * 组内党员人数 + */ + private Integer groupMemberCount; + + /** + * 组内党员人数占比 + */ + private BigDecimal groupMemberRatio; + + /** + * 党员发布话题数 + */ + private Integer topicCount; + + /** + * 党员发布话题数占比 + */ + private BigDecimal topicRatio; + + /** + * 党员发布话题转议题数 + */ + private Integer issueCount; + + /** + * 党员发布话题转议题数占比 + */ + private BigDecimal issueRatio; + + /** + * 党员发布话题转项目数 + */ + private Integer projectCount; + + /** + * 党员发布话题转项目数占比 + */ + private BigDecimal projectRatio; + + /** + * 党员发布话题转项目结案数 + */ + private Integer projectClosedCount; + + /** + * 党员发布话题转项目结案数占比 + */ + private BigDecimal projectClosedRatio; + + private Integer groupTotal; + private Integer groupMemberTotal; + private Integer topicTotal; + private Integer issueTotal; + private Integer projectTotal; + private Integer projectClosedTotal; + + /** + * 删除标识 未删除:0,已删除:1 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactPartyMemberVanguardGridDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactPartyMemberVanguardGridDailyDTO.java new file mode 100644 index 0000000000..7d28a3e095 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactPartyMemberVanguardGridDailyDTO.java @@ -0,0 +1,179 @@ +/** + * 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.stats; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 党员先锋-网格日统计数据 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-13 + */ +@Data +public class FactPartyMemberVanguardGridDailyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 机构ID + */ + private String agencyId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 统计日期 关联日期dim表 + */ + private String dateId; + + /** + * 周ID + */ + private String weekId; + + /** + * 月ID + */ + private String monthId; + + /** + * 季ID + */ + private String quarterId; + + /** + * 年ID + */ + private String yearId; + + /** + * 党员建组数 + */ + private Integer groupCount; + + /** + * 党员建组数占比 + */ + private BigDecimal groupRatio; + + /** + * 组内党员人数 + */ + private Integer groupMemberCount; + + /** + * 组内党员人数占比 + */ + private BigDecimal groupMemberRatio; + + /** + * 党员发布话题数 + */ + private Integer topicCount; + + /** + * 党员发布话题数占比 + */ + private BigDecimal topicRatio; + + /** + * 党员发布话题转议题数 + */ + private Integer issueCount; + + /** + * 党员发布话题转议题数占比 + */ + private BigDecimal issueRatio; + + /** + * 党员发布话题转项目数 + */ + private Integer projectCount; + + /** + * 党员发布话题转项目数占比 + */ + private BigDecimal projectRatio; + + /** + * 党员发布话题转项目结案数 + */ + private Integer projectClosedCount; + + /** + * 党员发布话题转项目结案数占比 + */ + private BigDecimal projectClosedRatio; + + private Integer groupTotal; + private Integer groupMemberTotal; + private Integer topicTotal; + private Integer issueTotal; + private Integer projectTotal; + private Integer projectClosedTotal; + + /** + * 删除标识 未删除:0,已删除:1 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-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 1037de6af4..018dc35102 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 @@ -18,6 +18,7 @@ import com.epmet.dao.stats.DimCustomerDao; import com.epmet.dao.stats.DimDateDao; import com.epmet.dao.stats.DimMonthDao; import com.epmet.dto.AgencySubTreeDto; +import com.epmet.dto.StatsFormDTO; import com.epmet.dto.extract.form.ExtractOriginFormDTO; import com.epmet.dto.extract.form.ExtractScreenFormDTO; import com.epmet.dto.indexcal.CalculateCommonFormDTO; @@ -34,6 +35,7 @@ import com.epmet.entity.stats.DimCustomerEntity; import com.epmet.entity.stats.DimDateEntity; import com.epmet.entity.stats.DimMonthEntity; import com.epmet.service.StatsDemoService; +import com.epmet.service.StatsPartyMemberVanguardService; import com.epmet.service.evaluationindex.extract.dataToIndex.*; import com.epmet.service.evaluationindex.extract.todata.FactGroupActDailyService; import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectCategoryDailyService; @@ -111,6 +113,8 @@ public class DemoController { @Autowired private FactOriginProjectCategoryDailyService originProjectCategoryDailyService; @Autowired + private StatsPartyMemberVanguardService statsPartyMemberVanguardService; + @Autowired private FactGroupActDailyService factGroupActDailyService; @GetMapping("testAlarm") @@ -873,6 +877,13 @@ public class DemoController { return new Result().ok(ndddYhjfService.difficultyDataExtract(param)); } + @PostMapping("vanguard") + public Result partyMemberVanguard(StatsFormDTO formDTO) { + statsPartyMemberVanguardService.agencyStats(formDTO); + statsPartyMemberVanguardService.gridStats(formDTO); + return new Result(); + } + @PostMapping("extractgroupact") public Result extractGroupAct(@RequestParam("customerId") String customerId,@RequestParam("dateId")String dateId){ factGroupActDailyService.extractGridGroupActDaily(customerId,dateId); 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 index 7ffdf0c1f3..1533d70143 100644 --- 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 @@ -205,4 +205,24 @@ public interface FactOriginGroupMainDailyDao extends BaseDao selectCustomerGroupList(@Param("customerId") String customerId, @Param("dateId") String dateId); + + /** + * 获取组织级别党员建组统计 + * @author zhaoqifeng + * @date 2021/5/13 17:06 + * @param customerId + * @param dateId + * @return java.util.List + */ + List selectPartyMemberGroupStaticByAgency(@Param("customerId") String customerId, @Param("dateId") String dateId); + + /** + * 获取网格级别党员建组统计 + * @author zhaoqifeng + * @date 2021/5/13 17:07 + * @param customerId + * @param dateId + * @return java.util.List + */ + List selectPartyMemberGroupStaticByGrid(@Param("customerId") String customerId, @Param("dateId") String dateId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginGroupMemberDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginGroupMemberDailyDao.java index 662f2a14c5..81a0dd3303 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginGroupMemberDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginGroupMemberDailyDao.java @@ -18,8 +18,12 @@ package com.epmet.dao.evaluationindex.extract; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.extract.result.OrgStatisticsResultDTO; import com.epmet.entity.evaluationindex.extract.FactOriginGroupMemberDailyEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * @@ -29,5 +33,25 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface FactOriginGroupMemberDailyDao extends BaseDao { + + /** + * 获取组织级别党员建组统计 + * @author zhaoqifeng + * @date 2021/5/13 17:06 + * @param customerId + * @param dateId + * @return java.util.List + */ + List selectGroupPartyMemberStaticByAgency(@Param("customerId") String customerId, @Param("dateId") String dateId); + + /** + * 获取网格级别党员建组统计 + * @author zhaoqifeng + * @date 2021/5/13 17:07 + * @param customerId + * @param dateId + * @return java.util.List + */ + List selectGroupPartyMemberStaticByGrid(@Param("customerId") String customerId, @Param("dateId") String dateId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueMainDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueMainDailyDao.java index c8969fea56..280e38213e 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 @@ -205,4 +205,24 @@ public interface FactOriginIssueMainDailyDao extends BaseDao selectOrgIssueCount(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("level") String level); + + /** + * 获取组织级别党员发布话题转议题统计 + * @author zhaoqifeng + * @date 2021/5/17 15:02 + * @param customerId + * @param dateId + * @return java.util.List + */ + List selectPartyMemberIssueStaticByAgency(@Param("customerId") String customerId, @Param("dateId") String dateId); + + /** + * 获取组织级别党员发布话题转议题统计 + * @author zhaoqifeng + * @date 2021/5/17 15:03 + * @param customerId + * @param dateId + * @return java.util.List + */ + List selectPartyMemberIssueStaticByGrid(@Param("customerId") String customerId, @Param("dateId") String dateId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectMainDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectMainDailyDao.java index dbc532b90c..179574ae7a 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 @@ -370,4 +370,45 @@ public interface FactOriginProjectMainDailyDao extends BaseDao getProjectPeriodForDiff(@Param("customerId") String customerId, @Param("dateId") String dateId); List selectResponseCount(@Param("customerId") String customerId); + + + /** + * 获取组织级别党员发布话题转项目统计 + * @author zhaoqifeng + * @date 2021/5/17 15:02 + * @param customerId + * @param dateId + * @return java.util.List + */ + List selectPartyMemberProjectStaticByAgency(@Param("customerId") String customerId, @Param("dateId") String dateId); + + /** + * 获取组织级别党员发布话题转项目统计 + * @author zhaoqifeng + * @date 2021/5/17 15:03 + * @param customerId + * @param dateId + * @return java.util.List + */ + List selectPartyMemberProjectStaticByGrid(@Param("customerId") String customerId, @Param("dateId") String dateId); + + /** + * 获取组织级别党员发布话题结案统计 + * @author zhaoqifeng + * @date 2021/5/17 15:02 + * @param customerId + * @param dateId + * @return java.util.List + */ + List selectPartyMemberClosedProjectStaticByAgency(@Param("customerId") String customerId, @Param("dateId") String dateId); + + /** + * 获取组织级别党员发布话题结案统计 + * @author zhaoqifeng + * @date 2021/5/17 15:03 + * @param customerId + * @param dateId + * @return java.util.List + */ + List selectPartyMemberClosedProjectStaticByGrid(@Param("customerId") String customerId, @Param("dateId") String dateId); } 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 ae3ad01fd5..f34fbf3a4b 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 @@ -139,4 +139,24 @@ public interface FactOriginTopicMainDailyDao extends BaseDao selectOrgTopicCount(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("level") String level); + + /** + * 组织内党员发布话题占比统计 + * @author zhaoqifeng + * @date 2021/5/17 10:29 + * @param customerId + * @param dateId + * @return java.util.List + */ + List selectPartyMemberTopicStaticByAgency(@Param("customerId") String customerId, @Param("dateId") String dateId); + + /** + * 网格内党员发布话题占比统计 + * @author zhaoqifeng + * @date 2021/5/17 10:31 + * @param customerId + * @param dateId + * @return java.util.List + */ + List selectPartyMemberTopicStaticByGrid(@Param("customerId") String customerId, @Param("dateId") String dateId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactPartyMemberVanguardAgencyDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactPartyMemberVanguardAgencyDailyDao.java new file mode 100644 index 0000000000..812935ef6e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactPartyMemberVanguardAgencyDailyDao.java @@ -0,0 +1,44 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.stats; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.stats.FactPartyMemberVanguardAgencyDailyEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + * 党员先锋-机关日统计数据 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-13 + */ +@Mapper +public interface FactPartyMemberVanguardAgencyDailyDao extends BaseDao { + + /** + * 删除日统计数据 + * @author zhaoqifeng + * @date 2021/5/17 17:19 + * @param customerId + * @param dateId + * @return int + */ + int deleteDailyData(@Param("customerId") String customerId, @Param("dateId") String dateId); + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactPartyMemberVanguardGridDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactPartyMemberVanguardGridDailyDao.java new file mode 100644 index 0000000000..310bcabdef --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactPartyMemberVanguardGridDailyDao.java @@ -0,0 +1,42 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.stats; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.stats.FactPartyMemberVanguardGridDailyEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + * 党员先锋-网格日统计数据 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-13 + */ +@Mapper +public interface FactPartyMemberVanguardGridDailyDao extends BaseDao { + /** + * 删除日统计数据 + * @author zhaoqifeng + * @date 2021/5/17 17:19 + * @param customerId + * @param dateId + * @return int + */ + int deleteDailyData(@Param("customerId") String customerId, @Param("dateId") String dateId); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactPartyMemberVanguardAgencyDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactPartyMemberVanguardAgencyDailyEntity.java new file mode 100644 index 0000000000..44666ec1d9 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactPartyMemberVanguardAgencyDailyEntity.java @@ -0,0 +1,149 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.stats; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 党员先锋-机关日统计数据 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-13 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_party_member_vanguard_agency_daily") +public class FactPartyMemberVanguardAgencyDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 机构ID + */ + private String agencyId; + + /** + * 父级机关ID + */ + private String pid; + + /** + * 统计日期 关联日期dim表 + */ + private String dateId; + + /** + * 周ID + */ + private String weekId; + + /** + * 月ID + */ + private String monthId; + + /** + * 季ID + */ + private String quarterId; + + /** + * 年ID + */ + private String yearId; + + /** + * 党员建组数 + */ + private Integer groupCount; + + private Integer groupTotal; + private Integer groupMemberTotal; + private Integer topicTotal; + private Integer issueTotal; + private Integer projectTotal; + private Integer projectClosedTotal; + + /** + * 党员建组数占比 + */ + private BigDecimal groupRatio; + + /** + * 组内党员人数 + */ + private Integer groupMemberCount; + + /** + * 组内党员人数占比 + */ + private BigDecimal groupMemberRatio; + + /** + * 党员发布话题数 + */ + private Integer topicCount; + + /** + * 党员发布话题数占比 + */ + private BigDecimal topicRatio; + + /** + * 党员发布话题转议题数 + */ + private Integer issueCount; + + /** + * 党员发布话题转议题数占比 + */ + private BigDecimal issueRatio; + + /** + * 党员发布话题转项目数 + */ + private Integer projectCount; + + /** + * 党员发布话题转项目数占比 + */ + private BigDecimal projectRatio; + + /** + * 党员发布话题转项目结案数 + */ + private Integer projectClosedCount; + + /** + * 党员发布话题转项目结案数占比 + */ + private BigDecimal projectClosedRatio; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactPartyMemberVanguardGridDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactPartyMemberVanguardGridDailyEntity.java new file mode 100644 index 0000000000..5b591a8e7e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactPartyMemberVanguardGridDailyEntity.java @@ -0,0 +1,149 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.stats; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 党员先锋-网格日统计数据 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-13 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_party_member_vanguard_grid_daily") +public class FactPartyMemberVanguardGridDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 机构ID + */ + private String agencyId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 统计日期 关联日期dim表 + */ + private String dateId; + + /** + * 周ID + */ + private String weekId; + + /** + * 月ID + */ + private String monthId; + + /** + * 季ID + */ + private String quarterId; + + /** + * 年ID + */ + private String yearId; + + /** + * 党员建组数 + */ + private Integer groupCount; + + private Integer groupTotal; + private Integer groupMemberTotal; + private Integer topicTotal; + private Integer issueTotal; + private Integer projectTotal; + private Integer projectClosedTotal; + + /** + * 党员建组数占比 + */ + private BigDecimal groupRatio; + + /** + * 组内党员人数 + */ + private Integer groupMemberCount; + + /** + * 组内党员人数占比 + */ + private BigDecimal groupMemberRatio; + + /** + * 党员发布话题数 + */ + private Integer topicCount; + + /** + * 党员发布话题数占比 + */ + private BigDecimal topicRatio; + + /** + * 党员发布话题转议题数 + */ + private Integer issueCount; + + /** + * 党员发布话题转议题数占比 + */ + private BigDecimal issueRatio; + + /** + * 党员发布话题转项目数 + */ + private Integer projectCount; + + /** + * 党员发布话题转项目数占比 + */ + private BigDecimal projectRatio; + + /** + * 党员发布话题转项目结案数 + */ + private Integer projectClosedCount; + + /** + * 党员发布话题转项目结案数占比 + */ + private BigDecimal projectClosedRatio; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsPartyMemberVanguardService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsPartyMemberVanguardService.java new file mode 100644 index 0000000000..c4ba1d4fe2 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsPartyMemberVanguardService.java @@ -0,0 +1,31 @@ +package com.epmet.service; + +import com.epmet.dto.StatsFormDTO; +import com.epmet.dto.group.form.GroupStatsFormDTO; +import com.epmet.dto.group.form.GroupTotalFormDTO; + +/** + * 党员先锋相关统计 + * @author zhaoqifeng + * @date 2021/5/13 15:07 + */ +public interface StatsPartyMemberVanguardService { + /** + * 组织统计 + * @author zhaoqifeng + * @date 2021/5/13 15:13 + * @param formDTO + * @return void + */ + void agencyStats(StatsFormDTO formDTO); + + /** + * 网格统计 + * @author zhaoqifeng + * @date 2021/5/13 15:13 + * @param formDTO + * @return void + */ + void gridStats(StatsFormDTO formDTO); + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginGroupMainDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginGroupMainDailyService.java index 21d55ac87e..89beadf503 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginGroupMainDailyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginGroupMainDailyService.java @@ -26,6 +26,7 @@ import com.epmet.dto.group.result.ExtractGroupMemberActionRecordResultDTO; import com.epmet.entity.evaluationindex.extract.FactOriginGroupMainDailyEntity; import java.util.List; +import java.util.Map; /** @@ -112,4 +113,16 @@ public interface FactOriginGroupMainDailyService extends BaseService getGroupListByCustomerId(String customerId, String dateId); + + /** + * 获取组织/网格级别党员建组统计 + * @author zhaoqifeng + * @date 2021/5/13 16:55 + * @param customerId + * @param dateId + * @param type agency grid + * @return java.util.List + */ + Map getPartyMemberGroupStatic(String customerId, String dateId, String type); + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginGroupMemberDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginGroupMemberDailyService.java index 618c340d66..53ff5cf084 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginGroupMemberDailyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginGroupMemberDailyService.java @@ -20,6 +20,7 @@ package com.epmet.service.evaluationindex.extract.todata; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; import com.epmet.dto.extract.FactOriginGroupMemberDailyDTO; +import com.epmet.dto.extract.result.OrgStatisticsResultDTO; import com.epmet.entity.evaluationindex.extract.FactOriginGroupMemberDailyEntity; import java.util.List; @@ -92,4 +93,15 @@ public interface FactOriginGroupMemberDailyService extends BaseService + */ + Map getGroupPartyMemberStatic(String customerId, String dateId, String type); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginIssueMainDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginIssueMainDailyService.java index de2ac6f8c7..a1e4ac55de 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginIssueMainDailyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginIssueMainDailyService.java @@ -22,6 +22,7 @@ import com.epmet.dto.extract.result.OrgStatisticsResultDTO; import com.epmet.entity.evaluationindex.extract.FactOriginIssueMainDailyEntity; import java.util.List; +import java.util.Map; /** * 议题主表 @@ -110,4 +111,15 @@ public interface FactOriginIssueMainDailyService extends BaseService */ List getOrgIssueCount(String customerId, String monthId, String level); + + /** + * 获取组织/网格级别党员发布话题转议题统计 + * @author zhaoqifeng + * @date 2021/5/17 14:52 + * @param customerId + * @param dateId + * @param type + * @return java.util.Map + */ + Map getPartyMemberIssueStatic(String customerId, String dateId, String type); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java index 449e546658..b160131db7 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java @@ -32,6 +32,7 @@ import com.epmet.entity.evaluationindex.extract.FactOriginProjectOrgPeriodDailyE import com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity; import java.util.List; +import java.util.Map; /** * 项目主表_日统计 @@ -367,4 +368,26 @@ public interface FactOriginProjectMainDailyService extends BaseService list, String customerId); + /** + * 获取组织/网格级别党员发布话题转项目统计 + * @author zhaoqifeng + * @date 2021/5/17 15:25 + * @param customerId + * @param dateId + * @param type + * @return java.util.Map + */ + Map getPartyMemberProjectStatic(String customerId, String dateId, String type); + + /** + * 获取组织/网格级别党员发布话题结案统计 + * @author zhaoqifeng + * @date 2021/5/17 15:39 + * @param customerId + * @param dateId + * @param type + * @return java.util.Map + */ + Map getPartyMemberClosedProjectStatic(String customerId, String dateId, String type); + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginTopicMainDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginTopicMainDailyService.java index 5c4f8da390..aa66fc44e0 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginTopicMainDailyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginTopicMainDailyService.java @@ -25,6 +25,7 @@ import com.epmet.dto.indexcollect.result.CpcIndexCommonDTO; import com.epmet.entity.evaluationindex.extract.FactOriginTopicMainDailyEntity; import java.util.List; +import java.util.Map; /** @@ -111,4 +112,15 @@ public interface FactOriginTopicMainDailyService extends BaseService */ List getOrgTopicCount(String customerId, String monthId, String level); + + /** + * 获取组织/网格级别党员发布话题统计 + * @author zhaoqifeng + * @date 2021/5/17 14:25 + * @param customerId + * @param dateId + * @param type + * @return java.util.Map + */ + Map getPartyMemberTopicStatic(String customerId, String dateId, String type); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginGroupMainDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginGroupMainDailyServiceImpl.java index d7819f31b1..164b0b76dc 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginGroupMainDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginGroupMainDailyServiceImpl.java @@ -20,6 +20,7 @@ package com.epmet.service.evaluationindex.extract.todata.impl; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.constant.OrgTypeConstant; import com.epmet.dao.evaluationindex.extract.FactOriginGroupMainDailyDao; import com.epmet.dao.evaluationindex.extract.FactOriginGroupMemberDailyDao; import com.epmet.dto.extract.FactOriginGroupMainDailyDTO; @@ -37,8 +38,13 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; +import java.math.BigDecimal; +import java.math.RoundingMode; import java.util.ArrayList; +import java.util.Collections; import java.util.List; +import java.util.Map; +import java.util.function.Function; import java.util.stream.Collectors; @@ -159,4 +165,37 @@ public class FactOriginGroupMainDailyServiceImpl extends BaseServiceImpl + * @author zhaoqifeng + * @date 2021/5/13 16:55 + */ + @Override + public Map getPartyMemberGroupStatic(String customerId, String dateId, String type) { + List result; + if (OrgTypeConstant.AGENCY.equals(type)) { + result = baseDao.selectPartyMemberGroupStaticByAgency(customerId, dateId); + } else { + result = baseDao.selectPartyMemberGroupStaticByGrid(customerId, dateId); + } + if (CollectionUtils.isEmpty(result)) { + return Collections.emptyMap(); + } + result.forEach(item -> { + BigDecimal count = new BigDecimal(item.getCount()); + BigDecimal sum = new BigDecimal(item.getSum()); + item.setRatio(count.divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + }); + if (OrgTypeConstant.AGENCY.equals(type)) { + return result.stream().collect(Collectors.toMap(OrgStatisticsResultDTO::getAgencyId, Function.identity())); + } else { + return result.stream().collect(Collectors.toMap(OrgStatisticsResultDTO::getOrgId, Function.identity())); + } + } + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginGroupMemberDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginGroupMemberDailyServiceImpl.java index aea9baa4bc..e8ab17e4d1 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginGroupMemberDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginGroupMemberDailyServiceImpl.java @@ -20,21 +20,30 @@ package com.epmet.service.evaluationindex.extract.todata.impl; 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.NumConstant; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.constant.OrgTypeConstant; import com.epmet.dao.evaluationindex.extract.FactOriginGroupMemberDailyDao; import com.epmet.dto.extract.FactOriginGroupMemberDailyDTO; +import com.epmet.dto.extract.result.OrgStatisticsResultDTO; import com.epmet.entity.evaluationindex.extract.FactOriginGroupMemberDailyEntity; import com.epmet.service.evaluationindex.extract.todata.FactOriginGroupMemberDailyService; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; +import java.math.BigDecimal; +import java.math.RoundingMode; import java.util.Arrays; +import java.util.Collections; import java.util.List; import java.util.Map; +import java.util.function.Function; +import java.util.stream.Collectors; /** * @@ -98,4 +107,39 @@ public class FactOriginGroupMemberDailyServiceImpl extends BaseServiceImpl + * @author zhaoqifeng + * @date 2021/5/14 10:33 + */ + @Override + public Map getGroupPartyMemberStatic(String customerId, String dateId, String type) { + List staticsList; + if (OrgTypeConstant.AGENCY.equals(type)) { + //组织级别统计 + staticsList = baseDao.selectGroupPartyMemberStaticByAgency(customerId, dateId); + } else { + //网格级别统计 + staticsList = baseDao.selectGroupPartyMemberStaticByGrid(customerId, dateId); + } + if (CollectionUtils.isEmpty(staticsList)) { + return Collections.emptyMap(); + } + staticsList.forEach(item -> { + BigDecimal count = new BigDecimal(item.getCount()); + BigDecimal sum = new BigDecimal(item.getSum()); + item.setRatio(count.divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + }); + if (OrgTypeConstant.AGENCY.equals(type)) { + return staticsList.stream().collect(Collectors.toMap(OrgStatisticsResultDTO::getAgencyId, Function.identity())); + } else { + return staticsList.stream().collect(Collectors.toMap(OrgStatisticsResultDTO::getOrgId, Function.identity())); + } + } + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginIssueMainDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginIssueMainDailyServiceImpl.java index 0eac851c63..86e60734b7 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginIssueMainDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginIssueMainDailyServiceImpl.java @@ -19,15 +19,24 @@ package com.epmet.service.evaluationindex.extract.todata.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.constant.OrgTypeConstant; import com.epmet.dao.evaluationindex.extract.FactOriginIssueMainDailyDao; import com.epmet.dto.extract.result.OrgStatisticsResultDTO; import com.epmet.entity.evaluationindex.extract.FactOriginIssueMainDailyEntity; import com.epmet.service.evaluationindex.extract.todata.FactOriginIssueMainDailyService; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.util.Collections; import java.util.List; +import java.util.Map; +import java.util.function.Function; +import java.util.stream.Collectors; /** * 议题主表 @@ -127,4 +136,37 @@ public class FactOriginIssueMainDailyServiceImpl extends BaseServiceImpl getOrgIssueCount(String customerId, String monthId, String level) { return baseDao.selectOrgIssueCount(customerId, monthId, level); } + + /** + * 获取组织/网格级别党员发布话题转议题统计 + * + * @param customerId + * @param dateId + * @param type + * @return java.util.Map + * @author zhaoqifeng + * @date 2021/5/17 14:52 + */ + @Override + public Map getPartyMemberIssueStatic(String customerId, String dateId, String type) { + List result; + if (OrgTypeConstant.AGENCY.equals(type)) { + result = baseDao.selectPartyMemberIssueStaticByAgency(customerId, dateId); + } else { + result = baseDao.selectPartyMemberIssueStaticByGrid(customerId, dateId); + } + if (CollectionUtils.isEmpty(result)) { + return Collections.emptyMap(); + } + result.forEach(item -> { + BigDecimal count = new BigDecimal(item.getCount()); + BigDecimal sum = new BigDecimal(item.getSum()); + item.setRatio(count.divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + }); + if (OrgTypeConstant.AGENCY.equals(type)) { + return result.stream().collect(Collectors.toMap(OrgStatisticsResultDTO::getAgencyId, Function.identity())); + } else { + return result.stream().collect(Collectors.toMap(OrgStatisticsResultDTO::getOrgId, Function.identity())); + } + } } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java index 00f8ecbb9c..73830ce377 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java @@ -23,6 +23,7 @@ import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.constant.DataSourceConstant; +import com.epmet.constant.OrgTypeConstant; import com.epmet.constant.ProjectConstant; import com.epmet.dao.evaluationindex.extract.FactOriginProjectMainDailyDao; import com.epmet.dao.evaluationindex.extract.FactOriginProjectOrgPeriodDailyDao; @@ -47,10 +48,10 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; -import java.util.ArrayList; -import java.util.Comparator; -import java.util.List; -import java.util.Map; +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.util.*; +import java.util.function.Function; import java.util.stream.Collectors; /** @@ -528,5 +529,71 @@ public class FactOriginProjectMainDailyServiceImpl extends BaseServiceImpl + * @author zhaoqifeng + * @date 2021/5/17 15:25 + */ + @Override + public Map getPartyMemberProjectStatic(String customerId, String dateId, String type) { + List result; + if (OrgTypeConstant.AGENCY.equals(type)) { + result = baseDao.selectPartyMemberProjectStaticByAgency(customerId, dateId); + } else { + result = baseDao.selectPartyMemberProjectStaticByGrid(customerId, dateId); + } + if (CollectionUtils.isEmpty(result)) { + return Collections.emptyMap(); + } + result.forEach(item -> { + BigDecimal count = new BigDecimal(item.getCount()); + BigDecimal sum = new BigDecimal(item.getSum()); + item.setRatio(count.divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + }); + if (OrgTypeConstant.AGENCY.equals(type)) { + return result.stream().collect(Collectors.toMap(OrgStatisticsResultDTO::getAgencyId, Function.identity())); + } else { + return result.stream().collect(Collectors.toMap(OrgStatisticsResultDTO::getOrgId, Function.identity())); + } + } + + /** + * 获取组织/网格级别党员发布话题结案统计 + * + * @param customerId + * @param dateId + * @param type + * @return java.util.Map + * @author zhaoqifeng + * @date 2021/5/17 15:39 + */ + @Override + public Map getPartyMemberClosedProjectStatic(String customerId, String dateId, String type) { + List result; + if (OrgTypeConstant.AGENCY.equals(type)) { + result = baseDao.selectPartyMemberClosedProjectStaticByAgency(customerId, dateId); + } else { + result = baseDao.selectPartyMemberClosedProjectStaticByGrid(customerId, dateId); + } + if (CollectionUtils.isEmpty(result)) { + return Collections.emptyMap(); + } + result.forEach(item -> { + BigDecimal count = new BigDecimal(item.getCount()); + BigDecimal sum = new BigDecimal(item.getSum()); + item.setRatio(count.divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + }); + if (OrgTypeConstant.AGENCY.equals(type)) { + return result.stream().collect(Collectors.toMap(OrgStatisticsResultDTO::getAgencyId, Function.identity())); + } else { + return result.stream().collect(Collectors.toMap(OrgStatisticsResultDTO::getOrgId, Function.identity())); + } + } + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginTopicMainDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginTopicMainDailyServiceImpl.java index 7519d9496d..ac1e8af7a3 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginTopicMainDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginTopicMainDailyServiceImpl.java @@ -26,6 +26,7 @@ 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.constant.OrgTypeConstant; import com.epmet.dao.evaluationindex.extract.FactOriginTopicLogDailyDao; import com.epmet.dao.evaluationindex.extract.FactOriginTopicMainDailyDao; import com.epmet.dto.extract.form.ExtractOriginFormDTO; @@ -46,10 +47,10 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.util.*; +import java.util.function.Function; import java.util.stream.Collectors; @@ -325,4 +326,37 @@ public class FactOriginTopicMainDailyServiceImpl extends BaseServiceImpl + * @author zhaoqifeng + * @date 2021/5/17 14:25 + */ + @Override + public Map getPartyMemberTopicStatic(String customerId, String dateId, String type) { + List result; + if (OrgTypeConstant.AGENCY.equals(type)) { + result = baseDao.selectPartyMemberTopicStaticByAgency(customerId, dateId); + } else { + result = baseDao.selectPartyMemberTopicStaticByGrid(customerId, dateId); + } + if (CollectionUtils.isEmpty(result)) { + return Collections.emptyMap(); + } + result.forEach(item -> { + BigDecimal count = new BigDecimal(item.getCount()); + BigDecimal sum = new BigDecimal(item.getSum()); + item.setRatio(count.divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + }); + if (OrgTypeConstant.AGENCY.equals(type)) { + return result.stream().collect(Collectors.toMap(OrgStatisticsResultDTO::getAgencyId, Function.identity())); + } else { + return result.stream().collect(Collectors.toMap(OrgStatisticsResultDTO::getOrgId, Function.identity())); + } + } + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsPartyMemberVanguardServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsPartyMemberVanguardServiceImpl.java new file mode 100644 index 0000000000..080a168591 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsPartyMemberVanguardServiceImpl.java @@ -0,0 +1,414 @@ +package com.epmet.service.impl; + +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.constant.OrgTypeConstant; +import com.epmet.dto.StatsFormDTO; +import com.epmet.dto.extract.result.OrgStatisticsResultDTO; +import com.epmet.dto.stats.DimAgencyDTO; +import com.epmet.dto.stats.DimGridDTO; +import com.epmet.entity.stats.DimGridEntity; +import com.epmet.entity.stats.FactPartyMemberVanguardAgencyDailyEntity; +import com.epmet.entity.stats.FactPartyMemberVanguardGridDailyEntity; +import com.epmet.service.StatsPartyMemberVanguardService; +import com.epmet.service.evaluationindex.extract.todata.*; +import com.epmet.service.stats.*; +import com.epmet.util.DimIdGenerator; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.math.BigDecimal; +import java.text.DateFormat; +import java.text.SimpleDateFormat; +import java.util.Calendar; +import java.util.Date; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * @author zhaoqifeng + * @dscription + * @date 2021/5/13 15:13 + */ +@Slf4j +@Service +public class StatsPartyMemberVanguardServiceImpl implements StatsPartyMemberVanguardService { + + @Resource + private DimCustomerService dimCustomerService; + @Resource + private DimAgencyService dimAgencyService; + @Resource + private DimGridService dimGridService; + @Resource + private FactPartyMemberVanguardAgencyDailyService factPartyMemberVanguardAgencyDailyService; + @Resource + private FactPartyMemberVanguardGridDailyService factPartyMemberVanguardGridDailyService; + @Resource + private FactOriginGroupMainDailyService factOriginGroupMainDailyService; + @Resource + private FactOriginGroupMemberDailyService factOriginGroupMemberDailyService; + @Resource + private FactOriginTopicMainDailyService factOriginTopicMainDailyService; + @Resource + private FactOriginIssueMainDailyService factOriginIssueMainDailyService; + @Resource + private FactOriginProjectMainDailyService factOriginProjectMainDailyService; + + + + + /** + * 组织统计 + * + * @param formDTO + * @return void + * @author zhaoqifeng + * @date 2021/5/13 15:13 + */ + @Override + public void agencyStats(StatsFormDTO formDTO) { + Date date = yesterday(); + //入参有时间的则按具体时间执行,没有的则按当前时间前一天执行 + if (null != formDTO && StringUtils.isNotBlank(formDTO.getDate())) { + date = DateUtils.parse(formDTO.getDate(), DateUtils.DATE_PATTERN_YYYYMMDD); + } + //入参有客户Id的则按客户Id执行,没有的则全部客户都执行 + if (null != formDTO && StringUtils.isNotBlank(formDTO.getCustomerId())) { + customerAgencyStats(formDTO.getCustomerId(), date); + } else { + int pageNo = 1; + int pageSize = 100; + List customerIdList; + do { + customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize); + if (CollectionUtils.isNotEmpty(customerIdList)) { + for (String customerId : customerIdList) { + try { + //遍历统计每一个客户数据 + customerAgencyStats(customerId, date); + } catch (Exception e) { + log.error("Error creating model JSON", e); + } + } + } + } while (CollectionUtils.isNotEmpty(customerIdList) && customerIdList.size() == pageSize); + } + } + + private void customerAgencyStats(String customerId, Date date) { + //1:查询日期各维度表Id + DimIdGenerator.DimIdBean dimId = DimIdGenerator.getDimIdBean(date); + + //2:根据客户Id查询机关维度表数据 + log.info("根据客户Id查询机关维度数据,对应客户Id:" + customerId); + DimAgencyDTO dimAgencyDTO = new DimAgencyDTO(); + dimAgencyDTO.setCustomerId(customerId); + List dimAgencyList = dimAgencyService.getDimAgencyList(dimAgencyDTO); + + if (CollectionUtils.isNotEmpty(dimAgencyList)) { + List vanguardList = dimAgencyList.stream().map(item -> initAgencyDailyEntity(item, dimId)).collect(Collectors.toList()); + //党员建组占比统计 + Map groupStatic = factOriginGroupMainDailyService.getPartyMemberGroupStatic(customerId, + dimId.getDateId(), OrgTypeConstant.AGENCY); + if (!groupStatic.isEmpty()) { + vanguardList.forEach(item -> { + OrgStatisticsResultDTO dto = groupStatic.get(item.getAgencyId()); + if (null != dto) { + item.setGroupCount(dto.getCount()); + item.setGroupRatio(dto.getRatio()); + item.setGroupTotal(dto.getSum()); + } + }); + } + + //小组成员党员占比统计 + Map memberStatic = factOriginGroupMemberDailyService.getGroupPartyMemberStatic(customerId, + dimId.getDateId(), OrgTypeConstant.AGENCY); + if (!memberStatic.isEmpty()) { + vanguardList.forEach(item -> { + OrgStatisticsResultDTO dto = memberStatic.get(item.getAgencyId()); + if (null != dto) { + item.setGroupMemberCount(dto.getCount()); + item.setGroupMemberRatio(dto.getRatio()); + item.setGroupMemberTotal(dto.getSum()); + } + }); + } + //党员发布话题占比统计 + Map topicStatic = factOriginTopicMainDailyService.getPartyMemberTopicStatic(customerId, + dimId.getDateId(), OrgTypeConstant.AGENCY); + if (!topicStatic.isEmpty()) { + vanguardList.forEach(item -> { + OrgStatisticsResultDTO dto = topicStatic.get(item.getAgencyId()); + if (null != dto) { + item.setGroupMemberCount(dto.getCount()); + item.setGroupMemberRatio(dto.getRatio()); + item.setGroupMemberTotal(dto.getSum()); + } + }); + } + //党员发布话题转议题占比统计 + Map issueStatic = factOriginIssueMainDailyService.getPartyMemberIssueStatic(customerId, + dimId.getDateId(), OrgTypeConstant.AGENCY); + if (!issueStatic.isEmpty()) { + vanguardList.forEach(item -> { + OrgStatisticsResultDTO dto = issueStatic.get(item.getAgencyId()); + if (null != dto) { + item.setGroupMemberCount(dto.getCount()); + item.setGroupMemberRatio(dto.getRatio()); + item.setGroupMemberTotal(dto.getSum()); + } + }); + } + //党员发布话题转项目占比统计 + Map projectStatic = factOriginProjectMainDailyService.getPartyMemberProjectStatic(customerId, + dimId.getDateId(), OrgTypeConstant.AGENCY); + if (!projectStatic.isEmpty()) { + vanguardList.forEach(item -> { + OrgStatisticsResultDTO dto = projectStatic.get(item.getAgencyId()); + if (null != dto) { + item.setGroupMemberCount(dto.getCount()); + item.setGroupMemberRatio(dto.getRatio()); + item.setGroupMemberTotal(dto.getSum()); + } + }); + } + //项目结案占比统计 + Map closedStatic = factOriginProjectMainDailyService.getPartyMemberClosedProjectStatic(customerId, + dimId.getDateId(), OrgTypeConstant.AGENCY); + if (!closedStatic.isEmpty()) { + vanguardList.forEach(item -> { + OrgStatisticsResultDTO dto = closedStatic.get(item.getAgencyId()); + if (null != dto) { + item.setGroupMemberCount(dto.getCount()); + item.setGroupMemberRatio(dto.getRatio()); + item.setGroupMemberTotal(dto.getSum()); + } + }); + } + //删除旧数据 + factPartyMemberVanguardAgencyDailyService.deleteDailyData(customerId, dimId.getDateId()); + //批量插入 + factPartyMemberVanguardAgencyDailyService.insertBatch(vanguardList); + } + } + /** + * 网格统计 + * + * @param formDTO + * @return void + * @author zhaoqifeng + * @date 2021/5/13 15:13 + */ + @Override + public void gridStats(StatsFormDTO formDTO) { + Date date = yesterday(); + //入参有时间的则按具体时间执行,没有的则按当前时间前一天执行 + if (null != formDTO && StringUtils.isNotBlank(formDTO.getDate())) { + date = DateUtils.parse(formDTO.getDate(), DateUtils.DATE_PATTERN_YYYYMMDD); + } + //入参有客户Id的则按客户Id执行,没有的则全部客户都执行 + if (null != formDTO && StringUtils.isNotBlank(formDTO.getCustomerId())) { + customerAgencyStats(formDTO.getCustomerId(), date); + } else { + int pageNo = 1; + int pageSize = 100; + List customerIdList; + do { + customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize); + if (CollectionUtils.isNotEmpty(customerIdList)) { + for (String customerId : customerIdList) { + try { + //遍历统计每一个客户数据 + customerGridStats(customerId, date); + } catch (Exception e) { + log.error("Error creating model JSON", e); + } + } + } + } while (CollectionUtils.isNotEmpty(customerIdList) && customerIdList.size() == pageSize); + } + } + + private void customerGridStats(String customerId, Date date) { + //1:查询日期各维度表Id + DimIdGenerator.DimIdBean dimId = DimIdGenerator.getDimIdBean(date); + + //2:根据客户Id查询机关维度表数据 + log.info("根据客户Id查询网格维度数据,对应客户Id:" + customerId); + DimAgencyDTO dimAgencyDTO = new DimAgencyDTO(); + dimAgencyDTO.setCustomerId(customerId); + List dimGridList = dimGridService.getGridListByCustomerId(customerId); + + if (CollectionUtils.isNotEmpty(dimGridList)) { + List vanguardList = + dimGridList.stream().map(item -> initGridDailyEntity(item, dimId)).collect(Collectors.toList()); + //党员建组占比统计 + Map groupStatic = factOriginGroupMainDailyService.getPartyMemberGroupStatic(customerId, + dimId.getDateId(), OrgTypeConstant.GRID); + if (!groupStatic.isEmpty()) { + vanguardList.forEach(item -> { + OrgStatisticsResultDTO dto = groupStatic.get(item.getGridId()); + if (null != dto) { + item.setGroupCount(dto.getCount()); + item.setGroupRatio(dto.getRatio()); + item.setGroupTotal(dto.getSum()); + } + }); + } + + //小组成员党员占比统计 + Map memberStatic = factOriginGroupMemberDailyService.getGroupPartyMemberStatic(customerId, + dimId.getDateId(), OrgTypeConstant.GRID); + if (!memberStatic.isEmpty()) { + vanguardList.forEach(item -> { + OrgStatisticsResultDTO dto = memberStatic.get(item.getGridId()); + if (null != dto) { + item.setGroupMemberCount(dto.getCount()); + item.setGroupMemberRatio(dto.getRatio()); + item.setGroupMemberTotal(dto.getSum()); + } + }); + } + //党员发布话题占比统计 + Map topicStatic = factOriginTopicMainDailyService.getPartyMemberTopicStatic(customerId, + dimId.getDateId(), OrgTypeConstant.GRID); + if (!topicStatic.isEmpty()) { + vanguardList.forEach(item -> { + OrgStatisticsResultDTO dto = topicStatic.get(item.getGridId()); + if (null != dto) { + item.setGroupMemberCount(dto.getCount()); + item.setGroupMemberRatio(dto.getRatio()); + item.setGroupMemberTotal(dto.getSum()); + } + }); + } + //党员发布话题转议题占比统计 + Map issueStatic = factOriginIssueMainDailyService.getPartyMemberIssueStatic(customerId, + dimId.getDateId(), OrgTypeConstant.GRID); + if (!issueStatic.isEmpty()) { + vanguardList.forEach(item -> { + OrgStatisticsResultDTO dto = issueStatic.get(item.getGridId()); + if (null != dto) { + item.setGroupMemberCount(dto.getCount()); + item.setGroupMemberRatio(dto.getRatio()); + item.setGroupMemberTotal(dto.getSum()); + } + }); + } + //党员发布话题转项目占比统计 + Map projectStatic = factOriginProjectMainDailyService.getPartyMemberProjectStatic(customerId, + dimId.getDateId(), OrgTypeConstant.GRID); + if (!projectStatic.isEmpty()) { + vanguardList.forEach(item -> { + OrgStatisticsResultDTO dto = projectStatic.get(item.getGridId()); + if (null != dto) { + item.setGroupMemberCount(dto.getCount()); + item.setGroupMemberRatio(dto.getRatio()); + item.setGroupMemberTotal(dto.getSum()); + } + }); + } + //项目结案占比统计 + Map closedStatic = factOriginProjectMainDailyService.getPartyMemberClosedProjectStatic(customerId, + dimId.getDateId(), OrgTypeConstant.GRID); + if (!closedStatic.isEmpty()) { + vanguardList.forEach(item -> { + OrgStatisticsResultDTO dto = closedStatic.get(item.getGridId()); + if (null != dto) { + item.setGroupMemberCount(dto.getCount()); + item.setGroupMemberRatio(dto.getRatio()); + item.setGroupMemberTotal(dto.getSum()); + } + }); + } + //删除旧数据 + factPartyMemberVanguardGridDailyService.deleteDailyData(customerId, dimId.getDateId()); + //批量插入 + factPartyMemberVanguardGridDailyService.insertBatch(vanguardList); + } + } + + + private Date yesterday() { + Date date = new Date(); + try { + DateFormat sdf = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); + Calendar calendar = Calendar.getInstance(); + calendar.set(Calendar.HOUR_OF_DAY, -24); + String str = sdf.format(calendar.getTime()); + date = sdf.parse(str); + } catch (Exception e) { + e.printStackTrace(); + } + return date; + } + + private FactPartyMemberVanguardAgencyDailyEntity initAgencyDailyEntity(DimAgencyDTO agency, DimIdGenerator.DimIdBean dimId) { + FactPartyMemberVanguardAgencyDailyEntity entity = new FactPartyMemberVanguardAgencyDailyEntity(); + entity.setCustomerId(agency.getCustomerId()); + entity.setAgencyId(agency.getId()); + entity.setPid(agency.getPid()); + entity.setDateId(dimId.getDateId()); + entity.setWeekId(dimId.getWeekId()); + entity.setMonthId(dimId.getMonthId()); + entity.setQuarterId(dimId.getQuarterId()); + entity.setYearId(dimId.getYearId()); + entity.setGroupCount(NumConstant.ZERO); + entity.setGroupRatio(new BigDecimal(NumConstant.ZERO)); + entity.setGroupTotal(NumConstant.ZERO); + entity.setGroupMemberCount(NumConstant.ZERO); + entity.setGroupMemberRatio(new BigDecimal(NumConstant.ZERO)); + entity.setGroupMemberTotal(NumConstant.ZERO); + entity.setTopicCount(NumConstant.ZERO); + entity.setTopicRatio(new BigDecimal(NumConstant.ZERO)); + entity.setTopicTotal(NumConstant.ZERO); + entity.setIssueCount(NumConstant.ZERO); + entity.setIssueRatio(new BigDecimal(NumConstant.ZERO)); + entity.setIssueTotal(NumConstant.ZERO); + entity.setProjectCount(NumConstant.ZERO); + entity.setProjectRatio(new BigDecimal(NumConstant.ZERO)); + entity.setProjectTotal(NumConstant.ZERO); + entity.setProjectClosedCount(NumConstant.ZERO); + entity.setProjectClosedRatio(new BigDecimal(NumConstant.ZERO)); + entity.setProjectClosedTotal(NumConstant.ZERO); + return entity; + } + + + private FactPartyMemberVanguardGridDailyEntity initGridDailyEntity(DimGridEntity grid, DimIdGenerator.DimIdBean dimId) { + FactPartyMemberVanguardGridDailyEntity entity = new FactPartyMemberVanguardGridDailyEntity(); + entity.setCustomerId(grid.getCustomerId()); + entity.setAgencyId(grid.getAgencyId()); + entity.setGridId(grid.getId()); + entity.setDateId(dimId.getDateId()); + entity.setWeekId(dimId.getWeekId()); + entity.setMonthId(dimId.getMonthId()); + entity.setQuarterId(dimId.getQuarterId()); + entity.setYearId(dimId.getYearId()); + entity.setGroupCount(NumConstant.ZERO); + entity.setGroupRatio(new BigDecimal(NumConstant.ZERO)); + entity.setGroupTotal(NumConstant.ZERO); + entity.setGroupMemberCount(NumConstant.ZERO); + entity.setGroupMemberRatio(new BigDecimal(NumConstant.ZERO)); + entity.setGroupMemberTotal(NumConstant.ZERO); + entity.setTopicCount(NumConstant.ZERO); + entity.setTopicRatio(new BigDecimal(NumConstant.ZERO)); + entity.setTopicTotal(NumConstant.ZERO); + entity.setIssueCount(NumConstant.ZERO); + entity.setIssueRatio(new BigDecimal(NumConstant.ZERO)); + entity.setIssueTotal(NumConstant.ZERO); + entity.setProjectCount(NumConstant.ZERO); + entity.setProjectRatio(new BigDecimal(NumConstant.ZERO)); + entity.setProjectTotal(NumConstant.ZERO); + entity.setProjectClosedCount(NumConstant.ZERO); + entity.setProjectClosedRatio(new BigDecimal(NumConstant.ZERO)); + entity.setProjectClosedTotal(NumConstant.ZERO); + return entity; + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactPartyMemberVanguardAgencyDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactPartyMemberVanguardAgencyDailyService.java new file mode 100644 index 0000000000..385b615549 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactPartyMemberVanguardAgencyDailyService.java @@ -0,0 +1,105 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.stats.FactPartyMemberVanguardAgencyDailyDTO; +import com.epmet.entity.stats.FactPartyMemberVanguardAgencyDailyEntity; + +import java.util.List; +import java.util.Map; + +/** + * 党员先锋-机关日统计数据 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-13 + */ +public interface FactPartyMemberVanguardAgencyDailyService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-05-13 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-05-13 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return FactPartyMemberVanguardAgencyDailyDTO + * @author generator + * @date 2021-05-13 + */ + FactPartyMemberVanguardAgencyDailyDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-05-13 + */ + void save(FactPartyMemberVanguardAgencyDailyDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-05-13 + */ + void update(FactPartyMemberVanguardAgencyDailyDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-05-13 + */ + void delete(String[] ids); + + /** + * 清除日数据 + * @author zhaoqifeng + * @date 2021/5/17 15:55 + * @param customerId + * @param dateId + * @return void + */ + void deleteDailyData(String customerId, String dateId); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactPartyMemberVanguardGridDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactPartyMemberVanguardGridDailyService.java new file mode 100644 index 0000000000..bfe7d258ce --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactPartyMemberVanguardGridDailyService.java @@ -0,0 +1,105 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.stats.FactPartyMemberVanguardGridDailyDTO; +import com.epmet.entity.stats.FactPartyMemberVanguardGridDailyEntity; + +import java.util.List; +import java.util.Map; + +/** + * 党员先锋-网格日统计数据 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-13 + */ +public interface FactPartyMemberVanguardGridDailyService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-05-13 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-05-13 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return FactPartyMemberVanguardGridDailyDTO + * @author generator + * @date 2021-05-13 + */ + FactPartyMemberVanguardGridDailyDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-05-13 + */ + void save(FactPartyMemberVanguardGridDailyDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-05-13 + */ + void update(FactPartyMemberVanguardGridDailyDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-05-13 + */ + void delete(String[] ids); + + /** + * 清除日数据 + * @author zhaoqifeng + * @date 2021/5/17 15:55 + * @param customerId + * @param dateId + * @return void + */ + void deleteDailyData(String customerId, String dateId); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactPartyMemberVanguardAgencyDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactPartyMemberVanguardAgencyDailyServiceImpl.java new file mode 100644 index 0000000000..9c951b7b2f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactPartyMemberVanguardAgencyDailyServiceImpl.java @@ -0,0 +1,118 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.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.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.constant.DataSourceConstant; +import com.epmet.dao.stats.FactPartyMemberVanguardAgencyDailyDao; +import com.epmet.dto.stats.FactPartyMemberVanguardAgencyDailyDTO; +import com.epmet.entity.stats.FactPartyMemberVanguardAgencyDailyEntity; +import com.epmet.service.stats.FactPartyMemberVanguardAgencyDailyService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 党员先锋-机关日统计数据 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-13 + */ +@Service +@DataSource(DataSourceConstant.STATS) +public class FactPartyMemberVanguardAgencyDailyServiceImpl extends BaseServiceImpl implements FactPartyMemberVanguardAgencyDailyService { + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, FactPartyMemberVanguardAgencyDailyDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, FactPartyMemberVanguardAgencyDailyDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public FactPartyMemberVanguardAgencyDailyDTO get(String id) { + FactPartyMemberVanguardAgencyDailyEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, FactPartyMemberVanguardAgencyDailyDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(FactPartyMemberVanguardAgencyDailyDTO dto) { + FactPartyMemberVanguardAgencyDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactPartyMemberVanguardAgencyDailyEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(FactPartyMemberVanguardAgencyDailyDTO dto) { + FactPartyMemberVanguardAgencyDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactPartyMemberVanguardAgencyDailyEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * 清除日数据 + * + * @param customerId + * @param dateId + * @return void + * @author zhaoqifeng + * @date 2021/5/17 15:55 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void deleteDailyData(String customerId, String dateId) { + baseDao.deleteDailyData(customerId, dateId); + } + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactPartyMemberVanguardGridDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactPartyMemberVanguardGridDailyServiceImpl.java new file mode 100644 index 0000000000..235cf53e23 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactPartyMemberVanguardGridDailyServiceImpl.java @@ -0,0 +1,118 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.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.constant.FieldConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.constant.DataSourceConstant; +import com.epmet.dao.stats.FactPartyMemberVanguardGridDailyDao; +import com.epmet.dto.stats.FactPartyMemberVanguardGridDailyDTO; +import com.epmet.entity.stats.FactPartyMemberVanguardGridDailyEntity; +import com.epmet.service.stats.FactPartyMemberVanguardGridDailyService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 党员先锋-网格日统计数据 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-13 + */ +@Service +@DataSource(DataSourceConstant.STATS) +public class FactPartyMemberVanguardGridDailyServiceImpl extends BaseServiceImpl implements FactPartyMemberVanguardGridDailyService { + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, FactPartyMemberVanguardGridDailyDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, FactPartyMemberVanguardGridDailyDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public FactPartyMemberVanguardGridDailyDTO get(String id) { + FactPartyMemberVanguardGridDailyEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, FactPartyMemberVanguardGridDailyDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(FactPartyMemberVanguardGridDailyDTO dto) { + FactPartyMemberVanguardGridDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactPartyMemberVanguardGridDailyEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(FactPartyMemberVanguardGridDailyDTO dto) { + FactPartyMemberVanguardGridDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactPartyMemberVanguardGridDailyEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * 清除日数据 + * + * @param customerId + * @param dateId + * @return void + * @author zhaoqifeng + * @date 2021/5/17 15:55 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void deleteDailyData(String customerId, String dateId) { + baseDao.deleteDailyData(customerId, dateId); + } + +} \ No newline at end of file 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 index 2f40e1de70..eeec0fa8e5 100644 --- 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 @@ -350,5 +350,31 @@ AND customer_id = #{customerId} + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginGroupMemberDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginGroupMemberDailyDao.xml index 1c0a1d4edb..c0fb2fb43c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginGroupMemberDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginGroupMemberDailyDao.xml @@ -27,6 +27,50 @@ + + \ 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 42949df17b..259e46c150 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 @@ -291,4 +291,24 @@ AND f.MONTH_ID = #{monthId} GROUP BY f.AGENCY_ID + + \ 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 18aa1d5123..92fe50a99c 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 @@ -761,5 +761,47 @@ WHERE CUSTOMER_ID = #{customerId} AND DEL_FLAG = '0' + + + + 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 a4f2d9bbaa..c8136df35a 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 @@ -177,4 +177,24 @@ AND f.MONTH_ID = #{monthId} GROUP BY f.AGENCY_ID + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactPartyMemberVanguardAgencyDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactPartyMemberVanguardAgencyDailyDao.xml new file mode 100644 index 0000000000..f6de9644d1 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactPartyMemberVanguardAgencyDailyDao.xml @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + delete from fact_party_member_vanguard_agency_daily where 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/FactPartyMemberVanguardGridDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactPartyMemberVanguardGridDailyDao.xml new file mode 100644 index 0000000000..311262a04f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactPartyMemberVanguardGridDailyDao.xml @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + delete from fact_party_member_vanguard_grid_daily where customer_id = #{customerId} and DATE_ID = #{dateId} + + + + \ No newline at end of file From abc72c6be96212ebfa0f54a612492418ce9d5475 Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Tue, 18 May 2021 10:24:49 +0800 Subject: [PATCH 026/128] =?UTF-8?q?=E5=B0=8F=E7=BB=84=E6=88=90=E5=91=98?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=98=AF=E5=90=A6=E5=85=9A=E5=91=98=E8=BA=AB?= =?UTF-8?q?=E4=BB=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../feign/DataStatisticalOpenFeignClient.java | 20 ++++++++ ...ataStatisticalOpenFeignClientFallBack.java | 26 ++++++++++ .../StatsPartyMemberVanguardController.java | 49 +++++++++++++++++++ .../StatsPartyMemberVanguardService.java | 29 +++++++++++ .../StatsPartyMemberVanguardServiceImpl.java | 47 ++++++++++++++++++ .../task/StatsPartyMemberVanguardTask.java | 46 +++++++++++++++++ 6 files changed, 217 insertions(+) create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsPartyMemberVanguardController.java create mode 100644 epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/StatsPartyMemberVanguardService.java create mode 100644 epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/StatsPartyMemberVanguardServiceImpl.java create mode 100644 epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/StatsPartyMemberVanguardTask.java 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 27a471f2d4..e6a46879f4 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 @@ -236,4 +236,24 @@ public interface DataStatisticalOpenFeignClient { @PostMapping(value = "/data/stats/indexdict/initCustomerIndex") Result initCustomerIndex(@RequestBody InitCustomerIndexForm formDTO); + /** + * 党员先锋统计-机关 + * @author zhaoqifeng + * @date 2021/5/18 9:26 + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + */ + @PostMapping("/data/stats/vanguard/agencyvanguardstats") + Result agencyVanguardStats(StatsFormDTO formDTO); + + /** + * 党员先锋统计-网格 + * @author zhaoqifeng + * @date 2021/5/18 9:27 + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + */ + @PostMapping("/data/stats/vanguard/gridvanguardstats") + Result gridVanguardStats(StatsFormDTO 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 88574dbd8d..d842746b35 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 @@ -230,4 +230,30 @@ public class DataStatisticalOpenFeignClientFallBack implements DataStatisticalOp public Result initCustomerIndex(InitCustomerIndexForm formDTO) { return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "initCustomerIndex", formDTO); } + + /** + * 党员先锋统计-机关 + * + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @author zhaoqifeng + * @date 2021/5/18 9:26 + */ + @Override + public Result agencyVanguardStats(StatsFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "agencyVanguardStats", formDTO); + } + + /** + * 党员先锋统计-网格 + * + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @author zhaoqifeng + * @date 2021/5/18 9:27 + */ + @Override + public Result gridVanguardStats(StatsFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "gridVanguardStats", formDTO); + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsPartyMemberVanguardController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsPartyMemberVanguardController.java new file mode 100644 index 0000000000..a8dd3c8892 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsPartyMemberVanguardController.java @@ -0,0 +1,49 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.StatsFormDTO; +import com.epmet.service.StatsPartyMemberVanguardService; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import javax.annotation.Resource; + +/** + * @author zhaoqifeng + * @dscription + * @date 2021/5/18 9:23 + */ +@RequestMapping("vanguard") +@RestController +public class StatsPartyMemberVanguardController { + @Resource + private StatsPartyMemberVanguardService statsPartyMemberVanguardService; + + /** + * 党员先锋统计-机关 + * @author zhaoqifeng + * @date 2021/5/18 9:26 + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + */ + @PostMapping("agencyvanguardstats") + public Result agencyVanguardStats(StatsFormDTO formDTO) { + statsPartyMemberVanguardService.agencyStats(formDTO); + return new Result(); + } + + /** + * 党员先锋统计-网格 + * @author zhaoqifeng + * @date 2021/5/18 9:27 + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + */ + @PostMapping("gridvanguardstats") + public Result gridVanguardStats(StatsFormDTO formDTO) { + statsPartyMemberVanguardService.gridStats(formDTO); + return new Result(); + } + +} diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/StatsPartyMemberVanguardService.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/StatsPartyMemberVanguardService.java new file mode 100644 index 0000000000..d6c0543b9c --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/StatsPartyMemberVanguardService.java @@ -0,0 +1,29 @@ +package com.epmet.service; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.StatsFormDTO; + +/** + * @author zhaoqifeng + * @dscription + * @date 2021/5/18 9:56 + */ +public interface StatsPartyMemberVanguardService { + /** + * 党员先锋统计-机关 + * @author zhaoqifeng + * @date 2021/5/18 9:58 + * @param params + * @return com.epmet.commons.tools.utils.Result + */ + Result agencyVanguardStats(StatsFormDTO params); + + /** + * 党员先锋统计-网格 + * @author zhaoqifeng + * @date 2021/5/18 9:58 + * @param params + * @return com.epmet.commons.tools.utils.Result + */ + Result gridVanguardStats(StatsFormDTO params); +} diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/StatsPartyMemberVanguardServiceImpl.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/StatsPartyMemberVanguardServiceImpl.java new file mode 100644 index 0000000000..0db94fcfb7 --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/StatsPartyMemberVanguardServiceImpl.java @@ -0,0 +1,47 @@ +package com.epmet.service.impl; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.StatsFormDTO; +import com.epmet.feign.DataStatisticalOpenFeignClient; +import com.epmet.service.StatsPartyMemberVanguardService; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; + +/** + * @author zhaoqifeng + * @dscription + * @date 2021/5/18 9:56 + */ +@Service +public class StatsPartyMemberVanguardServiceImpl implements StatsPartyMemberVanguardService { + @Resource + private DataStatisticalOpenFeignClient dataStatisticalOpenFeignClient; + + + /** + * 党员先锋统计-机关 + * + * @param params + * @return com.epmet.commons.tools.utils.Result + * @author zhaoqifeng + * @date 2021/5/18 9:58 + */ + @Override + public Result agencyVanguardStats(StatsFormDTO params) { + return dataStatisticalOpenFeignClient.agencyVanguardStats(params); + } + + /** + * 党员先锋统计-网格 + * + * @param params + * @return com.epmet.commons.tools.utils.Result + * @author zhaoqifeng + * @date 2021/5/18 9:58 + */ + @Override + public Result gridVanguardStats(StatsFormDTO params) { + return dataStatisticalOpenFeignClient.gridVanguardStats(params); + } +} diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/StatsPartyMemberVanguardTask.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/StatsPartyMemberVanguardTask.java new file mode 100644 index 0000000000..8972bd1832 --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/StatsPartyMemberVanguardTask.java @@ -0,0 +1,46 @@ +package com.epmet.task; + +import com.alibaba.fastjson.JSON; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.StatsFormDTO; +import com.epmet.service.StatsPartyMemberVanguardService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Component; + +import javax.annotation.Resource; + +/** + * @author zhaoqifeng + * @dscription + * @date 2021/5/18 9:55 + */ +@Component("statsVanguardTask") +@Slf4j +public class StatsPartyMemberVanguardTask implements ITask { + + @Resource + private StatsPartyMemberVanguardService statsPartyMemberVanguardService; + + @Override + public void run(String params) { + log.info("statsVanguardTask定时任务正在执行,参数为:{}", params); + StatsFormDTO statsFormDTO = new StatsFormDTO(); + if (StringUtils.isNotBlank(params)) { + statsFormDTO = JSON.parseObject(params, StatsFormDTO.class); + } + Result result = statsPartyMemberVanguardService.agencyVanguardStats(statsFormDTO); + if (result.success()) { + log.info("statsVanguardTask组织级别定时任务执行成功"); + } else { + log.error("statsVanguardTask组织级别定时任务执行失败:" + result.getMsg()); + } + + result = statsPartyMemberVanguardService.gridVanguardStats(statsFormDTO); + if (result.success()) { + log.info("statsVanguardTask网格级别定时任务执行成功"); + } else { + log.error("statsVanguardTask网格级别定时任务执行失败:" + result.getMsg()); + } + } +} From fc195cdf7972ac3df74380ed4a2dc788318cca36 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Tue, 18 May 2021 10:50:07 +0800 Subject: [PATCH 027/128] =?UTF-8?q?=E7=83=AD=E8=AE=AE=E4=B8=AD=E8=AF=9D?= =?UTF-8?q?=E9=A2=98=E7=BD=91=E6=A0=BC=E3=80=81=E6=9C=BA=E5=85=B3=E6=97=A5?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E7=A8=8B=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../FactTopicHotdiscussAgencyDailyDTO.java | 126 +++++++++ .../FactTopicHotdiscussGridDailyDTO.java | 126 +++++++++ .../stats/topic/form/TopicStatusFormDTO.java | 24 ++ .../topic/result/TopicListResultDTO.java | 39 +++ .../controller/StatsTopicController.java | 23 ++ .../FactTopicHotdiscussAgencyDailyDao.java | 38 +++ .../FactTopicHotdiscussGridDailyDao.java | 38 +++ .../java/com/epmet/dao/topic/TopicDao.java | 7 + .../FactTopicHotdiscussAgencyDailyEntity.java | 96 +++++++ .../FactTopicHotdiscussGridDailyEntity.java | 96 +++++++ .../com/epmet/service/StatsTopicService.java | 13 + .../impl/FactOriginExtractServiceImpl.java | 34 +++ .../service/impl/StatsGroupServiceImpl.java | 6 +- .../service/impl/StatsTopicServiceImpl.java | 250 +++++++++++++++++- ...FactTopicHotdiscussAgencyDailyService.java | 101 +++++++ .../FactTopicHotdiscussGridDailyService.java | 101 +++++++ ...TopicHotdiscussAgencyDailyServiceImpl.java | 109 ++++++++ ...ctTopicHotdiscussGridDailyServiceImpl.java | 109 ++++++++ .../com/epmet/service/topic/TopicService.java | 7 + .../service/topic/impl/TopicServiceImpl.java | 11 + .../FactTopicHotdiscussAgencyDailyDao.xml | 15 ++ .../stats/FactTopicHotdiscussGridDailyDao.xml | 15 ++ .../main/resources/mapper/topic/TopicDao.xml | 19 ++ 23 files changed, 1392 insertions(+), 11 deletions(-) create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/topic/FactTopicHotdiscussAgencyDailyDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/topic/FactTopicHotdiscussGridDailyDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/topic/form/TopicStatusFormDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/topic/result/TopicListResultDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTopicHotdiscussAgencyDailyDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTopicHotdiscussGridDailyDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTopicHotdiscussAgencyDailyEntity.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTopicHotdiscussGridDailyEntity.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTopicHotdiscussAgencyDailyService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTopicHotdiscussGridDailyService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTopicHotdiscussAgencyDailyServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTopicHotdiscussGridDailyServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTopicHotdiscussAgencyDailyDao.xml create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTopicHotdiscussGridDailyDao.xml diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/topic/FactTopicHotdiscussAgencyDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/topic/FactTopicHotdiscussAgencyDailyDTO.java new file mode 100644 index 0000000000..c5c5eeaa21 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/topic/FactTopicHotdiscussAgencyDailyDTO.java @@ -0,0 +1,126 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.stats.topic; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 热议中话题机关日统计表【热议中指的没有被关闭、屏蔽、转议题的话题】 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-17 + */ +@Data +public class FactTopicHotdiscussAgencyDailyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 机构ID 关联机关dm表 + */ + private String agencyId; + + /** + * 父级机关ID + */ + private String pid; + + /** + * 统计日期 关联日期dm表 + */ + private String dateId; + + /** + * 周ID + */ + private String weekId; + + /** + * 月ID + */ + private String monthId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 年ID + */ + private String yearId; + + /** + * 话题总数 + */ + private Integer topicTotal; + + /** + * 话题状态【热议中:hot_discuss】 + */ + private String status; + + /** + * 状态话题数量 + */ + private Integer topicCount; + + /** + * 删除标识 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/topic/FactTopicHotdiscussGridDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/topic/FactTopicHotdiscussGridDailyDTO.java new file mode 100644 index 0000000000..340f07dc49 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/topic/FactTopicHotdiscussGridDailyDTO.java @@ -0,0 +1,126 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.stats.topic; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 热议中话题网格日统计表【热议中指的没有被关闭、屏蔽、转议题的话题】 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-17 + */ +@Data +public class FactTopicHotdiscussGridDailyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 网格ID 关联网格dm表 + */ + private String gridId; + + /** + * 日期ID + */ + private String dateId; + + /** + * 周ID + */ + private String weekId; + + /** + * 月ID + */ + private String monthId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 年ID + */ + private String yearId; + + /** + * 话题总数 + */ + private Integer topicTotal; + + /** + * 话题状态【热议中:hot_discuss】 + */ + private String status; + + /** + * 状态话题数量 + */ + private Integer topicCount; + + /** + * 删除标识 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/topic/form/TopicStatusFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/topic/form/TopicStatusFormDTO.java new file mode 100644 index 0000000000..4fd7830330 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/topic/form/TopicStatusFormDTO.java @@ -0,0 +1,24 @@ +package com.epmet.dto.stats.topic.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author sun + * 热议中话题-网格、机关日统计-接口入参 + */ +@Data +public class TopicStatusFormDTO implements Serializable { + + private static final long serialVersionUID = -4527492073390715391L; + + /** + * 客户Id + */ + private String customerId = ""; + /** + * 需要执行的日期(格式:yyyyMMdd) + */ + private String dateId = ""; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/topic/result/TopicListResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/topic/result/TopicListResultDTO.java new file mode 100644 index 0000000000..01c5f60075 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/topic/result/TopicListResultDTO.java @@ -0,0 +1,39 @@ +package com.epmet.dto.stats.topic.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author sun + * 热议中话题-网格、机关日统计-接口返参 + */ +@Data +public class TopicListResultDTO implements Serializable { + private static final long serialVersionUID = -7427128491727512781L; + + /** + * 客户Id + */ + private String customerId; + /** + * 话题Id + */ + private String topicId; + /** + * 网格id + */ + private String gridId; + /** + * 小组Id + */ + private String groupId; + /** + * 话题状态(讨论中 - discussing、 已屏蔽 - hidden、 已关闭 - closed) + */ + private String status; + /** + * 是否转为议题,0:false,1:true + * */ + private Boolean shiftIssue; +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsTopicController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsTopicController.java index e76badc8a3..6fffd887bc 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsTopicController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsTopicController.java @@ -2,6 +2,8 @@ package com.epmet.controller; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.StatsFormDTO; +import com.epmet.dto.group.form.GroupTotalFormDTO; +import com.epmet.dto.stats.topic.form.TopicStatusFormDTO; import com.epmet.service.StatsTopicService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; @@ -27,4 +29,25 @@ public class StatsTopicController { statsTopicService.partition(formDTO); return new Result(); } + + /** + * @Author sun + * @Description 热议中话题-网格日统计 + **/ + @PostMapping("gridtopicstatus") + public Result gridTopicStatus(@RequestBody(required = false) TopicStatusFormDTO formDTO) { + statsTopicService.gridTopicStatus(formDTO); + return new Result(); + } + + /** + * @Author sun + * @Description 热议中话题-机关日统计 + **/ + @PostMapping("agencytopicstatus") + public Result agencyTopicStatus(@RequestBody(required = false) TopicStatusFormDTO formDTO) { + statsTopicService.agencyTopicStatus(formDTO); + return new Result(); + } + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTopicHotdiscussAgencyDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTopicHotdiscussAgencyDailyDao.java new file mode 100644 index 0000000000..a0ea409d91 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTopicHotdiscussAgencyDailyDao.java @@ -0,0 +1,38 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.stats; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.stats.FactTopicHotdiscussAgencyDailyEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 热议中话题机关日统计表【热议中指的没有被关闭、屏蔽、转议题的话题】 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-17 + */ +@Mapper +public interface FactTopicHotdiscussAgencyDailyDao extends BaseDao { + + /** + * @Author sun + * @Description 根据客户Id、日维度Id批量物理删除一下可能存在的历史数据 + **/ + void delTopicAgency(FactTopicHotdiscussAgencyDailyEntity delEntity); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTopicHotdiscussGridDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTopicHotdiscussGridDailyDao.java new file mode 100644 index 0000000000..6a2237cee6 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTopicHotdiscussGridDailyDao.java @@ -0,0 +1,38 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.stats; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.stats.FactTopicHotdiscussGridDailyEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 热议中话题网格日统计表【热议中指的没有被关闭、屏蔽、转议题的话题】 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-17 + */ +@Mapper +public interface FactTopicHotdiscussGridDailyDao extends BaseDao { + + /** + * @Author sun + * @Description 根据客户Id、日维度Id批量物理删除一下可能存在的历史数据 + **/ + void delTopicGrid(FactTopicHotdiscussGridDailyEntity delEntity); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/topic/TopicDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/topic/TopicDao.java index d9b11ddc6a..4f37200359 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/topic/TopicDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/topic/TopicDao.java @@ -11,6 +11,7 @@ import com.epmet.dto.group.result.TopicContentResultDTO; import com.epmet.dto.screen.ScreenProjectDataDTO; import com.epmet.dto.screen.ScreenProjectImgDataDTO; import com.epmet.dto.screen.form.ProjectSourceMapFormDTO; +import com.epmet.dto.stats.topic.result.TopicListResultDTO; import com.epmet.dto.topic.ResiTopicDTO; import com.epmet.dto.extract.result.TopicInfoResultDTO; import com.epmet.dto.topic.TopicOriginInfoDTO; @@ -142,4 +143,10 @@ public interface TopicDao { List initNewScreenProjectImgData(@Param("customerId") String customerId, @Param("list") List list); ResiTopicAndImgResultDTO getTopicAndImgs(@Param("topicId") String topicId); + + /** + * @Author sun + * @Description 根据客户Id和截止日期查询话题业务数据 + **/ + List selectTopicList(@Param("customerId") String customerId, @Param("dateId") String dateId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTopicHotdiscussAgencyDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTopicHotdiscussAgencyDailyEntity.java new file mode 100644 index 0000000000..4590334147 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTopicHotdiscussAgencyDailyEntity.java @@ -0,0 +1,96 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.stats; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 热议中话题机关日统计表【热议中指的没有被关闭、屏蔽、转议题的话题】 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-17 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_topic_hotdiscuss_agency_daily") +public class FactTopicHotdiscussAgencyDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 机构ID 关联机关dm表 + */ + private String agencyId; + + /** + * 父级机关ID + */ + private String pid; + + /** + * 统计日期 关联日期dm表 + */ + private String dateId; + + /** + * 周ID + */ + private String weekId; + + /** + * 月ID + */ + private String monthId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 年ID + */ + private String yearId; + + /** + * 话题总数 + */ + private Integer topicTotal; + + /** + * 话题状态【热议中:hot_discuss】 + */ + private String status; + + /** + * 状态话题数量 + */ + private Integer topicCount; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTopicHotdiscussGridDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTopicHotdiscussGridDailyEntity.java new file mode 100644 index 0000000000..9b1fde9b74 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTopicHotdiscussGridDailyEntity.java @@ -0,0 +1,96 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.stats; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 热议中话题网格日统计表【热议中指的没有被关闭、屏蔽、转议题的话题】 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-17 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_topic_hotdiscuss_grid_daily") +public class FactTopicHotdiscussGridDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 网格ID 关联网格dm表 + */ + private String gridId; + + /** + * 日期ID + */ + private String dateId; + + /** + * 周ID + */ + private String weekId; + + /** + * 月ID + */ + private String monthId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 年ID + */ + private String yearId; + + /** + * 话题总数 + */ + private Integer topicTotal; + + /** + * 话题状态【热议中:hot_discuss】 + */ + private String status; + + /** + * 状态话题数量 + */ + private Integer topicCount; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsTopicService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsTopicService.java index 0c17e21420..8a6464c255 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsTopicService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsTopicService.java @@ -1,6 +1,7 @@ package com.epmet.service; import com.epmet.dto.StatsFormDTO; +import com.epmet.dto.stats.topic.form.TopicStatusFormDTO; /** * @Description 话题统计Service接口 @@ -18,4 +19,16 @@ public interface StatsTopicService { * @date 2020.06.28 14:38 **/ void partition(StatsFormDTO formDTO); + + /** + * @Author sun + * @Description 热议中话题-网格日统计 + **/ + void gridTopicStatus(TopicStatusFormDTO formDTO); + + /** + * @Author sun + * @Description 热议中话题-机关日统计 + **/ + void agencyTopicStatus(TopicStatusFormDTO formDTO); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginExtractServiceImpl.java index 62a4950f7b..2ec8212d21 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginExtractServiceImpl.java @@ -7,7 +7,9 @@ import com.epmet.commons.tools.utils.DateUtils; import com.epmet.dto.extract.form.ExtractOriginFormDTO; import com.epmet.dto.group.form.GroupTotalFormDTO; import com.epmet.dto.stats.form.CustomerIdAndDateIdFormDTO; +import com.epmet.dto.stats.topic.form.TopicStatusFormDTO; import com.epmet.service.StatsGroupService; +import com.epmet.service.StatsTopicService; import com.epmet.service.evaluationindex.extract.todata.*; import com.epmet.service.stats.DimCustomerPartymemberService; import com.epmet.service.stats.DimCustomerService; @@ -54,6 +56,8 @@ public class FactOriginExtractServiceImpl implements FactOriginExtractService { private FactGroupActDailyService factGroupActDailyService; @Autowired private StatsGroupService statsGroupService; + @Autowired + private StatsTopicService statsTopicService; @Override @@ -263,6 +267,36 @@ public class FactOriginExtractServiceImpl implements FactOriginExtractService { } }); + //热议中话题网格、机关日统计 + threadPool.submit(() -> { + TopicStatusFormDTO formDTO = new TopicStatusFormDTO(); + formDTO.setCustomerId(param.getCustomerId()); + if (!isRange) { + formDTO.setDateId(param.getDateId()); + try { + statsTopicService.gridTopicStatus(formDTO); + } catch (Exception e) { + log.error("热议中话题-网格日统计计算错误,参数:" + JSON.toJSONString(formDTO), e); + } + try { + statsTopicService.agencyTopicStatus(formDTO); + } catch (Exception e) { + log.error("热议中话题-机关日统计计算错误,参数:" + JSON.toJSONString(formDTO), e); + } + } else { + try { + statsTopicService.gridTopicStatus(formDTO); + } catch (Exception e) { + log.error("热议中话题-网格日统计计算错误,参数:" + JSON.toJSONString(formDTO), e); + } + try { + statsTopicService.agencyTopicStatus(formDTO); + } catch (Exception e) { + log.error("热议中话题-机关日统计计算错误,参数:" + JSON.toJSONString(formDTO), e); + } + } + }); + submitProjectRelationData(param, finalDaysBetween); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java index f222a9ee8e..50382aa75e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java @@ -583,11 +583,11 @@ public class StatsGroupServiceImpl implements StatsGroupService { FactGroupTotalAgencyDailyEntity delEntity = new FactGroupTotalAgencyDailyEntity(); delEntity.setCustomerId(customerId); delEntity.setDateId(dimId.getDateId()); - log.info("StatsGroupServiceImpl.agencyGroupStats-根据客户Id、日维度Id批量删除小组总数网格日统计表数据,对应客户Id:" + customerId + ",日维度Id:" + dimId.getDateId()); + log.info("StatsGroupServiceImpl.agencyGroupStats-根据客户Id、日维度Id批量删除小组总数机关日统计表数据,对应客户Id:" + customerId + ",日维度Id:" + dimId.getDateId()); factGroupTotalAgencyDailyService.delDateGroupTotal(delEntity); - //5.2:批量保存网格日统计数据 - log.info("StatsGroupServiceImpl.agencyGroupStats-批量新增小组总数网格日统计表数据,对应客户Id:" + customerId + ",日维度Id:" + dimId.getDateId()); + //5.2:批量保存机关日统计数据 + log.info("StatsGroupServiceImpl.agencyGroupStats-批量新增小组总数机关日统计表数据,对应客户Id:" + customerId + ",日维度Id:" + dimId.getDateId()); factGroupTotalAgencyDailyService.insertBatch(list); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsTopicServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsTopicServiceImpl.java index 423c47174e..74e0c8615b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsTopicServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsTopicServiceImpl.java @@ -6,12 +6,15 @@ import com.epmet.commons.tools.utils.DateUtils; import com.epmet.constant.ProjectConstant; import com.epmet.dto.AgencySubTreeDto; import com.epmet.dto.StatsFormDTO; +import com.epmet.dto.stats.DimAgencyDTO; import com.epmet.dto.stats.DimTopicStatusDTO; +import com.epmet.dto.stats.topic.form.TopicStatusFormDTO; +import com.epmet.dto.stats.topic.result.TopicListResultDTO; import com.epmet.dto.stats.topic.result.TopicStatisticalData; +import com.epmet.entity.evaluationindex.extract.FactOriginGroupMainDailyEntity; +import com.epmet.entity.stats.*; import com.epmet.service.StatsTopicService; -import com.epmet.service.stats.DimAgencyService; -import com.epmet.service.stats.DimCustomerService; -import com.epmet.service.stats.DimTopicStatusService; +import com.epmet.service.stats.*; import com.epmet.service.stats.topic.TopicStatisticalService; import com.epmet.service.topic.TopicService; import com.epmet.util.DimIdGenerator; @@ -23,7 +26,9 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; +import java.text.SimpleDateFormat; import java.util.*; +import java.util.concurrent.atomic.AtomicInteger; /** * @Description 话题统计Service @@ -35,21 +40,22 @@ import java.util.*; public class StatsTopicServiceImpl implements StatsTopicService { protected static final Logger log = LoggerFactory.getLogger(StatsTopicServiceImpl.class); - @Autowired private DimCustomerService dimCustomerService; - @Autowired private DimAgencyService dimAgencyService; - @Autowired private DimTopicStatusService dimTopicStatusService; - @Autowired private TopicService topicService; - @Autowired private TopicStatisticalService topicStatisticalService; + @Autowired + private DimGridService dimGridService; + @Autowired + private FactTopicHotdiscussGridDailyService factTopicHotdiscussGridDailyService; + @Autowired + private FactTopicHotdiscussAgencyDailyService factTopicHotdiscussAgencyDailyService; /** * @param formDTO 如果目标日期为空,则自动计算为T-1天 @@ -122,4 +128,232 @@ public class StatsTopicServiceImpl implements StatsTopicService { } } + + /** + * @Author sun + * @Description 热议中话题-网格日统计 + **/ + @Override + public void gridTopicStatus(TopicStatusFormDTO formDTO) { + //入参有日期的则按具体时间执行,没有的则按当前时间前一天执行 + if (StringUtils.isBlank(formDTO.getDateId())) { + Date yesterday = DateUtils.addDateDays(new Date(), -1); + SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); + formDTO.setDateId(format.format(yesterday)); + } + //入参有客户Id的则按客户Id执行,没有的则全部客户都执行 + if (null != formDTO && StringUtils.isNotBlank(formDTO.getCustomerId())) { + log.info("热议中话题网格日统计数据,当前统计的客户Id:" + formDTO.getCustomerId()); + gridTopic(formDTO.getCustomerId(), formDTO.getDateId()); + } else { + int pageNo = 1; + int pageSize = 100; + List customerIdList = null; + do { + //获取有效客户列表 + customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize); + if (!CollectionUtils.isEmpty(customerIdList)) { + for (String customerId : customerIdList) { + try { + log.info("for循环统计热议中话题网格日统计数据,当前统计的客户Id:" + customerId); + //遍历统计每一个客户数据 + gridTopic(customerId, formDTO.getDateId()); + } catch (Exception e) { + log.error("热议中话题-网格日统计-程序错误,对应客户Id:" + customerId, e); + log.error("Error creating model JSON", e); + } + } + } + } while (!CollectionUtils.isEmpty(customerIdList) && customerIdList.size() == pageSize); + } + + } + + /** + * @Author sun + * @Description 热议中话题-网格日统计 + **/ + private void gridTopic(String customerId, String dateId) { + //1:查询各维度表Id,方便使用 + Date date = DateUtils.parseDate(dateId,DateUtils.DATE_PATTERN_YYYYMMDD); + DimIdGenerator.DimIdBean dimId = DimIdGenerator.getDimIdBean(date); + + //2:根据客户Id查询网格维度表数据 + log.info("StatsGroupServiceImpl.customerGridStats-根据客户Id查询网格维度数据,对应客户Id:" + customerId); + List dimGridList = dimGridService.getGridListByCustomerId(customerId); + + //3.根据客户Id查询客户下有效的话题数据,查询dateId之前的数据 + List list = topicService.getTopicList(customerId, dateId); + + //4.遍历封装数据 + List saveList = new ArrayList<>(); + dimGridList.forEach(grid->{ + FactTopicHotdiscussGridDailyEntity entity = new FactTopicHotdiscussGridDailyEntity(); + AtomicInteger total = new AtomicInteger(0); + AtomicInteger num = new AtomicInteger(0); + list.forEach(l->{ + if(grid.getId().equals(l.getGridId()) ){ + total.addAndGet(1); + if(l.getStatus().equals("discussing") && !l.getShiftIssue()){ + num.addAndGet(1); + } + } + }); + entity.setCustomerId(customerId); + entity.setAgencyId(grid.getAgencyId()); + entity.setGridId(grid.getId()); + entity.setDateId(dimId.getDateId()); + entity.setWeekId(dimId.getWeekId()); + entity.setMonthId(dimId.getMonthId()); + entity.setQuarterId(dimId.getQuarterId()); + entity.setYearId(dimId.getYearId()); + entity.setTopicTotal(total.get()); + entity.setStatus("hot_discuss"); + entity.setTopicCount(num.get()); + saveList.add(entity); + }); + + //5.批量插入数据库,先删后增的逻辑 + if (!CollectionUtils.isEmpty(saveList)) { + //5.1:根据客户Id、日维度Id批量物理删除一下可能存在的历史数据 + FactTopicHotdiscussGridDailyEntity delEntity = new FactTopicHotdiscussGridDailyEntity(); + delEntity.setCustomerId(customerId); + delEntity.setDateId(dimId.getDateId()); + factTopicHotdiscussGridDailyService.delTopicGrid(delEntity); + + //5.2:批量保存网格日统计数据 + log.info("StatsTopicServiceImpl.gridTopic-批量新增热议中话题网格日统计表数据,对应客户Id:" + customerId + ",日维度Id:" + dimId.getDateId()); + factTopicHotdiscussGridDailyService.insertBatch(saveList); + } + + } + + /** + * @Author sun + * @Description 热议中话题-机关日统计 + **/ + @Override + public void agencyTopicStatus(TopicStatusFormDTO formDTO) { + //入参有日期的则按具体时间执行,没有的则按当前时间前一天执行 + if (StringUtils.isBlank(formDTO.getDateId())) { + Date yesterday = DateUtils.addDateDays(new Date(), -1); + SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); + formDTO.setDateId(format.format(yesterday)); + } + //入参有客户Id的则按客户Id执行,没有的则全部客户都执行 + if (null != formDTO && StringUtils.isNotBlank(formDTO.getCustomerId())) { + log.info("单独统计客户组织下热议中话题日统计数据,当前统计的客户Id:" + formDTO.getCustomerId()); + agencyTopic(formDTO.getCustomerId(), formDTO.getDateId()); + } else { + int pageNo = 1; + int pageSize = 100; + List customerIdList = null; + do { + customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize); + if (!CollectionUtils.isEmpty(customerIdList)) { + for (String customerId : customerIdList) { + try { + log.info("for循环统计机关热议中话题日统计数据,当前统计的客户Id:" + customerId); + //遍历统计每一个客户数据 + agencyTopic(customerId, formDTO.getDateId()); + } catch (Exception e) { + log.error("热议中话题机关日统计程序错误,对应客户Id:" + customerId, e); + log.error("Error creating model JSON", e); + } + } + } + } while (!CollectionUtils.isEmpty(customerIdList) && customerIdList.size() == pageSize); + } + + } + + /** + * @Author sun + * @Description 热议中话题-机关日统计数据 + **/ + private void agencyTopic(String customerId, String dateId) { + //1:查询各维度表Id,方便使用 + Date date = DateUtils.parseDate(dateId,DateUtils.DATE_PATTERN_YYYYMMDD); + DimIdGenerator.DimIdBean dimId = DimIdGenerator.getDimIdBean(date); + + //2:根据客户Id查询机关维度表数据 + log.info("StatsTopicServiceImpl.agencyTopic-根据客户Id查询机关维度数据,对应客户Id:" + customerId); + DimAgencyDTO dimAgencyDTO = new DimAgencyDTO(); + dimAgencyDTO.setCustomerId(customerId); + List agencyList = dimAgencyService.getDimAgencyList(dimAgencyDTO); + + //3.根据客户Id查询网格维度表数据 + List gridList = dimGridService.getGridListByCustomerId(customerId); + + //4..根据客户Id查询客户下有效的话题数据,查询dateId之前的数据 + List groupList = topicService.getTopicList(customerId, dateId); + + List list = new ArrayList<>(); + //5.遍历组织维度数据分别计算每个组织下话题数据 + DimIdGenerator.DimIdBean finalDimId = dimId; + agencyList.forEach(agency->{ + FactTopicHotdiscussAgencyDailyEntity entity = new FactTopicHotdiscussAgencyDailyEntity(); + //5-1.汇总组织及所有下级组织列表 + Map map = new HashMap<>(); + map.put(agency.getId(), agency.getId()); + String subPids = ((null == agency.getPids() || "".equals(agency.getPids())) ? agency.getId() : agency.getPids() + ":" + agency.getId()); + agencyList.forEach(sub -> { + if (sub.getPids().contains(subPids)) { + map.put(sub.getId(), sub.getId()); + } + }); + + //5-2.汇总组织及下级所有的网格列表 + List agencyGridList = new ArrayList<>(); + gridList.forEach(grid->{ + if (map.containsKey(grid.getAgencyId())) { + agencyGridList.add(grid.getId()); + } + }); + + AtomicInteger total = new AtomicInteger(0); + AtomicInteger num = new AtomicInteger(0); + //5-3.根据汇总的网格列表统计对应的群组数据 + agencyGridList.forEach(gridId -> { + groupList.forEach(l -> { + if (gridId.equals(l.getGridId())) { + total.addAndGet(1); + if(l.getStatus().equals("discussing") && !l.getShiftIssue()){ + num.addAndGet(1); + } + } + }); + }); + //封装数据 + entity.setCustomerId(agency.getCustomerId()); + entity.setAgencyId(agency.getId()); + entity.setPid(agency.getPid()); + entity.setDateId(finalDimId.getDateId()); + entity.setWeekId(finalDimId.getWeekId()); + entity.setMonthId(finalDimId.getMonthId()); + entity.setQuarterId(finalDimId.getQuarterId()); + entity.setYearId(finalDimId.getYearId()); + entity.setTopicTotal(total.get()); + entity.setStatus("hot_discuss"); + entity.setTopicCount(num.get()); + list.add(entity); + }); + + //6.批量插入数据库,先删后增的逻辑 + if (!CollectionUtils.isEmpty(list)) { + //5.1:根据客户Id、日维度Id批量物理删除一下可能存在的历史数据 + FactTopicHotdiscussAgencyDailyEntity delEntity = new FactTopicHotdiscussAgencyDailyEntity(); + delEntity.setCustomerId(customerId); + delEntity.setDateId(dimId.getDateId()); + log.info("StatsTopicServiceImpl.agencyTopic-根据客户Id、日维度Id批量删除热议中话题机关日统计表数据,对应客户Id:" + customerId + ",日维度Id:" + dimId.getDateId()); + factTopicHotdiscussAgencyDailyService.delTopicAgency(delEntity); + + //5.2:批量保存机关日统计数据 + log.info("StatsTopicServiceImpl.agencyTopic-批量新增小组总数网格日统计表数据,对应客户Id:" + customerId + ",日维度Id:" + dimId.getDateId()); + factTopicHotdiscussAgencyDailyService.insertBatch(list); + } + + } + + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTopicHotdiscussAgencyDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTopicHotdiscussAgencyDailyService.java new file mode 100644 index 0000000000..7e60409a73 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTopicHotdiscussAgencyDailyService.java @@ -0,0 +1,101 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.stats.topic.FactTopicHotdiscussAgencyDailyDTO; +import com.epmet.entity.stats.FactTopicHotdiscussAgencyDailyEntity; + +import java.util.List; +import java.util.Map; + +/** + * 热议中话题机关日统计表【热议中指的没有被关闭、屏蔽、转议题的话题】 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-17 + */ +public interface FactTopicHotdiscussAgencyDailyService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-05-17 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-05-17 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return FactTopicHotdiscussAgencyDailyDTO + * @author generator + * @date 2021-05-17 + */ + FactTopicHotdiscussAgencyDailyDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-05-17 + */ + void save(FactTopicHotdiscussAgencyDailyDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-05-17 + */ + void update(FactTopicHotdiscussAgencyDailyDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-05-17 + */ + void delete(String[] ids); + + /** + * @Author sun + * @Description 根据客户Id、日维度Id批量物理删除一下可能存在的历史数据 + **/ + void delTopicAgency(FactTopicHotdiscussAgencyDailyEntity delEntity); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTopicHotdiscussGridDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTopicHotdiscussGridDailyService.java new file mode 100644 index 0000000000..e7a3fbfe0a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTopicHotdiscussGridDailyService.java @@ -0,0 +1,101 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.stats.topic.FactTopicHotdiscussGridDailyDTO; +import com.epmet.entity.stats.FactTopicHotdiscussGridDailyEntity; + +import java.util.List; +import java.util.Map; + +/** + * 热议中话题网格日统计表【热议中指的没有被关闭、屏蔽、转议题的话题】 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-17 + */ +public interface FactTopicHotdiscussGridDailyService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-05-17 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-05-17 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return FactTopicHotdiscussGridDailyDTO + * @author generator + * @date 2021-05-17 + */ + FactTopicHotdiscussGridDailyDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-05-17 + */ + void save(FactTopicHotdiscussGridDailyDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-05-17 + */ + void update(FactTopicHotdiscussGridDailyDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-05-17 + */ + void delete(String[] ids); + + /** + * @Author sun + * @Description 根据客户Id、日维度Id批量物理删除一下可能存在的历史数据 + **/ + void delTopicGrid(FactTopicHotdiscussGridDailyEntity delEntity); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTopicHotdiscussAgencyDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTopicHotdiscussAgencyDailyServiceImpl.java new file mode 100644 index 0000000000..af5f866943 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTopicHotdiscussAgencyDailyServiceImpl.java @@ -0,0 +1,109 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.stats.impl; + +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.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.dao.stats.FactTopicHotdiscussAgencyDailyDao; +import com.epmet.dto.stats.topic.FactTopicHotdiscussAgencyDailyDTO; +import com.epmet.entity.stats.FactTopicHotdiscussAgencyDailyEntity; +import com.epmet.service.stats.FactTopicHotdiscussAgencyDailyService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 热议中话题机关日统计表【热议中指的没有被关闭、屏蔽、转议题的话题】 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-17 + */ +@Service +public class FactTopicHotdiscussAgencyDailyServiceImpl extends BaseServiceImpl implements FactTopicHotdiscussAgencyDailyService { + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, FactTopicHotdiscussAgencyDailyDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, FactTopicHotdiscussAgencyDailyDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public FactTopicHotdiscussAgencyDailyDTO get(String id) { + FactTopicHotdiscussAgencyDailyEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, FactTopicHotdiscussAgencyDailyDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(FactTopicHotdiscussAgencyDailyDTO dto) { + FactTopicHotdiscussAgencyDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactTopicHotdiscussAgencyDailyEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(FactTopicHotdiscussAgencyDailyDTO dto) { + FactTopicHotdiscussAgencyDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactTopicHotdiscussAgencyDailyEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * @Author sun + * @Description 根据客户Id、日维度Id批量物理删除一下可能存在的历史数据 + **/ + @Override + public void delTopicAgency(FactTopicHotdiscussAgencyDailyEntity delEntity) { + baseDao.delTopicAgency(delEntity); + } + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTopicHotdiscussGridDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTopicHotdiscussGridDailyServiceImpl.java new file mode 100644 index 0000000000..697143bfd2 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTopicHotdiscussGridDailyServiceImpl.java @@ -0,0 +1,109 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.stats.impl; + +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.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.dao.stats.FactTopicHotdiscussGridDailyDao; +import com.epmet.dto.stats.topic.FactTopicHotdiscussGridDailyDTO; +import com.epmet.entity.stats.FactTopicHotdiscussGridDailyEntity; +import com.epmet.service.stats.FactTopicHotdiscussGridDailyService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 热议中话题网格日统计表【热议中指的没有被关闭、屏蔽、转议题的话题】 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-17 + */ +@Service +public class FactTopicHotdiscussGridDailyServiceImpl extends BaseServiceImpl implements FactTopicHotdiscussGridDailyService { + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, FactTopicHotdiscussGridDailyDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, FactTopicHotdiscussGridDailyDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public FactTopicHotdiscussGridDailyDTO get(String id) { + FactTopicHotdiscussGridDailyEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, FactTopicHotdiscussGridDailyDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(FactTopicHotdiscussGridDailyDTO dto) { + FactTopicHotdiscussGridDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactTopicHotdiscussGridDailyEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(FactTopicHotdiscussGridDailyDTO dto) { + FactTopicHotdiscussGridDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactTopicHotdiscussGridDailyEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * @Author sun + * @Description 根据客户Id、日维度Id批量物理删除一下可能存在的历史数据 + **/ + @Override + public void delTopicGrid(FactTopicHotdiscussGridDailyEntity delEntity) { + baseDao.delTopicGrid(delEntity); + } + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/TopicService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/TopicService.java index 475fb886c7..78a823b155 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/TopicService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/TopicService.java @@ -6,6 +6,7 @@ import com.epmet.dto.screen.ScreenProjectDataDTO; import com.epmet.dto.screen.ScreenProjectImgDataDTO; import com.epmet.dto.screen.form.ProjectSourceMapFormDTO; import com.epmet.dto.stats.DimTopicStatusDTO; +import com.epmet.dto.stats.topic.result.TopicListResultDTO; import com.epmet.dto.stats.topic.result.TopicStatisticalData; import com.epmet.dto.topic.ResiTopicDTO; import com.epmet.dto.topic.TopicOriginInfoDTO; @@ -116,4 +117,10 @@ public interface TopicService { * @date 2021/4/13 5:39 下午 */ ResiTopicAndImgResultDTO getTopicAndImgs(String topicId,String attachmentType); + + /** + * @Author sun + * @Description 根据客户Id和截止日期查询话题业务数据 + **/ + List getTopicList(String customerId, String dateId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java index 0b74adba49..a47baa85bd 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java @@ -14,6 +14,7 @@ import com.epmet.dto.screen.form.ProjectSourceMapFormDTO; import com.epmet.dto.stats.DimTopicStatusDTO; import com.epmet.dto.stats.topic.*; import com.epmet.dto.stats.topic.result.GroupTopicData; +import com.epmet.dto.stats.topic.result.TopicListResultDTO; import com.epmet.dto.stats.topic.result.TopicStatisticalData; import com.epmet.dto.topic.ResiTopicDTO; import com.epmet.dto.topic.TopicOriginInfoDTO; @@ -1413,4 +1414,14 @@ public class TopicServiceImpl implements TopicService { public List queryTopicOriginInfoList(String customerId, String dateId) { return topicDao.selectListTopicOriginInfo(customerId, dateId); } + + /** + * @Author sun + * @Description 根据客户Id和截止日期查询话题业务数据 + **/ + @Override + public List getTopicList(String customerId, String dateId) { + return topicDao.selectTopicList(customerId, dateId); + } + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTopicHotdiscussAgencyDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTopicHotdiscussAgencyDailyDao.xml new file mode 100644 index 0000000000..27d63b02e0 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTopicHotdiscussAgencyDailyDao.xml @@ -0,0 +1,15 @@ + + + + + + + DELETE + FROM + fact_topic_hotdiscuss_agency_daily + WHERE + 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/FactTopicHotdiscussGridDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTopicHotdiscussGridDailyDao.xml new file mode 100644 index 0000000000..f82d421f42 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTopicHotdiscussGridDailyDao.xml @@ -0,0 +1,15 @@ + + + + + + + DELETE + FROM + fact_topic_hotdiscuss_grid_daily + WHERE + 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/topic/TopicDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/topic/TopicDao.xml index 8dfb2aae2e..ae18ea2b7c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/topic/TopicDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/topic/TopicDao.xml @@ -307,4 +307,23 @@ AND ATTACHMENT_TYPE = 'image' and TOPIC_ID = #{topicId} + + + From 417f41056480f578ea013598c06e3aa8f4d602c1 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Tue, 18 May 2021 10:59:21 +0800 Subject: [PATCH 028/128] =?UTF-8?q?=E5=B0=8F=E7=BB=84=E6=80=BB=E6=95=B0?= =?UTF-8?q?=E3=80=81=E7=83=AD=E8=AE=AE=E8=AF=9D=E9=A2=98=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?sql=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../V0.0.13__group_and_topic_stats.sql | 87 +++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.13__group_and_topic_stats.sql diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.13__group_and_topic_stats.sql b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.13__group_and_topic_stats.sql new file mode 100644 index 0000000000..5e2b260221 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.13__group_and_topic_stats.sql @@ -0,0 +1,87 @@ +CREATE TABLE `fact_group_total_agency_daily` ( + `ID` varchar(64) NOT NULL COMMENT '唯一标识', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID', + `AGENCY_ID` varchar(64) NOT NULL COMMENT '机构ID 关联机关dim表', + `PID` varchar(64) DEFAULT NULL COMMENT '父级机关ID', + `DATE_ID` varchar(32) NOT NULL COMMENT '统计日期 关联日期dim表', + `WEEK_ID` varchar(32) NOT NULL COMMENT '周ID', + `MONTH_ID` varchar(32) NOT NULL COMMENT '月份ID', + `QUARTER_ID` varchar(32) NOT NULL COMMENT '季度ID', + `YEAR_ID` varchar(32) NOT NULL COMMENT '年ID', + `GROUP_TOTAL` int(11) DEFAULT '0' COMMENT '当前组织及下级小组总数', + `ORDINARY_TOTAL` int(11) DEFAULT NULL COMMENT '当前组织及下级楼院小组总数', + `BRANCH_TOTAL` int(11) DEFAULT NULL COMMENT '当前组织及下级支部小组总数', + `DEL_FLAG` char(1) NOT NULL DEFAULT '0' COMMENT '删除标识 未删除:0,已删除:1', + `REVISION` int(11) NOT NULL DEFAULT '0' COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='小组总数-机关日统计表'; + +CREATE TABLE `fact_group_total_grid_daily` ( + `ID` varchar(64) NOT NULL COMMENT '唯一标识', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID', + `AGENCY_ID` varchar(64) NOT NULL COMMENT '机构ID 关联机关dim表', + `GRID_ID` varchar(64) NOT NULL COMMENT '网格ID', + `DATE_ID` varchar(32) NOT NULL COMMENT '统计日期 关联日期dim表', + `WEEK_ID` varchar(32) NOT NULL COMMENT '周ID', + `MONTH_ID` varchar(32) NOT NULL COMMENT '月份ID', + `QUARTER_ID` varchar(32) NOT NULL COMMENT '季度ID', + `YEAR_ID` varchar(32) NOT NULL COMMENT '年ID', + `GROUP_TOTAL` int(11) DEFAULT '0' COMMENT '网格下小组总数', + `ORDINARY_TOTAL` int(11) DEFAULT NULL COMMENT '网格下楼院小组总数', + `BRANCH_TOTAL` int(11) DEFAULT NULL COMMENT '网格下支部小组总数', + `DEL_FLAG` char(1) NOT NULL DEFAULT '0' COMMENT '删除标识 未删除:0,已删除:1', + `REVISION` int(11) NOT NULL DEFAULT '0' COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='小组总数-网格日统计表'; + +CREATE TABLE `fact_topic_hotdiscuss_agency_daily` ( + `ID` varchar(64) NOT NULL COMMENT '唯一标识', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID', + `AGENCY_ID` varchar(64) NOT NULL COMMENT '机构ID 关联机关dm表', + `PID` varchar(64) NOT NULL COMMENT '父级机关ID', + `DATE_ID` varchar(32) NOT NULL COMMENT '统计日期 关联日期dm表', + `WEEK_ID` varchar(32) NOT NULL COMMENT '周ID', + `MONTH_ID` varchar(32) NOT NULL COMMENT '月ID', + `QUARTER_ID` varchar(32) NOT NULL COMMENT '季度ID', + `YEAR_ID` varchar(32) NOT NULL COMMENT '年ID', + `TOPIC_TOTAL` int(11) DEFAULT '0' COMMENT '话题总数', + `STATUS` varchar(32) DEFAULT NULL COMMENT '话题状态【热议中:hot_discuss】', + `TOPIC_COUNT` int(11) DEFAULT '0' COMMENT '状态话题数量', + `DEL_FLAG` char(1) NOT NULL DEFAULT '0' COMMENT '删除标识', + `REVISION` int(11) NOT NULL DEFAULT '0' COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='热议中话题机关日统计表【热议中指的没有被关闭、屏蔽、转议题的话题】'; + +CREATE TABLE `fact_topic_hotdiscuss_grid_daily` ( + `ID` varchar(64) NOT NULL COMMENT '唯一标识', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID', + `AGENCY_ID` varchar(64) NOT NULL COMMENT '机关ID', + `GRID_ID` varchar(64) NOT NULL COMMENT '网格ID 关联网格dm表', + `DATE_ID` varchar(32) NOT NULL COMMENT '日期ID', + `WEEK_ID` varchar(32) NOT NULL COMMENT '周ID', + `MONTH_ID` varchar(32) NOT NULL COMMENT '月ID', + `QUARTER_ID` varchar(32) NOT NULL COMMENT '季度ID', + `YEAR_ID` varchar(32) NOT NULL COMMENT '年ID', + `TOPIC_TOTAL` int(11) DEFAULT '0' COMMENT '话题总数', + `STATUS` varchar(32) DEFAULT NULL COMMENT '话题状态【热议中:hot_discuss】', + `TOPIC_COUNT` int(11) DEFAULT '0' COMMENT '状态话题数量', + `DEL_FLAG` varchar(32) NOT NULL DEFAULT '0' COMMENT '删除标识', + `REVISION` int(11) NOT NULL DEFAULT '0' COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='热议中话题网格日统计表【热议中指的没有被关闭、屏蔽、转议题的话题】'; \ No newline at end of file From a54d1ce689e3750daee37e0090c111c969297324 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Tue, 18 May 2021 14:06:30 +0800 Subject: [PATCH 029/128] =?UTF-8?q?=E5=9F=BA=E7=A1=80=E6=95=B0=E6=8D=AE-?= =?UTF-8?q?=E6=B6=89=E5=8F=8A=E8=AF=9D=E9=A2=98=E6=95=B0=E6=8D=AE=E8=AE=A1?= =?UTF-8?q?=E7=AE=97=E7=9A=84=E9=87=8D=E6=96=B0=E8=B0=83=E6=95=B4=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/datastats/form/SubAgencyFormDTO.java | 2 + .../dto/datastats/form/SubGridFormDTO.java | 2 + .../result/AgencyBasicDataResultDTO.java | 2 + .../dataaggre/dao/datastats/DataStatsDao.java | 18 +++++++ .../datastats/impl/DataStatsServiceImpl.java | 47 ++++++++++++------- .../mapper/datastats/DatsStatsDao.xml | 43 +++++++++++++++++ 6 files changed, 96 insertions(+), 18 deletions(-) diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/SubAgencyFormDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/SubAgencyFormDTO.java index d5d3d8a66a..4789d534dd 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/SubAgencyFormDTO.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/SubAgencyFormDTO.java @@ -38,6 +38,8 @@ public class SubAgencyFormDTO implements Serializable { public static class Topic implements Serializable { //组织Id private String agencyId; + //话题总量 + private Integer topicTotal; //话题数量 private Integer topicCount; //话题状态 已关闭:closed、已屏蔽:hidden、 讨论中:discussing diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/SubGridFormDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/SubGridFormDTO.java index d429b47b7c..51e790560c 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/SubGridFormDTO.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/SubGridFormDTO.java @@ -38,6 +38,8 @@ public class SubGridFormDTO implements Serializable { public static class Topic implements Serializable { //网格Id private String gridId; + //话题总量 + private Integer topicTotal; //话题数量 private Integer topicCount; //话题状态 已关闭:closed、已屏蔽:hidden、 讨论中:discussing diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/AgencyBasicDataResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/AgencyBasicDataResultDTO.java index ad7869fd0b..d2202643c8 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/AgencyBasicDataResultDTO.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/AgencyBasicDataResultDTO.java @@ -81,6 +81,8 @@ public class AgencyBasicDataResultDTO implements Serializable { @Data public static class Topic implements Serializable { + //话题总量 + private Integer topicTotal; //话题数量 private Integer topicCount; //话题状态 已关闭:closed、已屏蔽:hidden、 讨论中:discussing diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/datastats/DataStatsDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/datastats/DataStatsDao.java index c96b053cba..d84e733e50 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/datastats/DataStatsDao.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/datastats/DataStatsDao.java @@ -58,6 +58,12 @@ public interface DataStatsDao { */ AgencyBasicDataResultDTO.Topic getAgencyTopicShiftIssue(@Param("agencyId") String agencyId, @Param("dateId") String dateId); + /** + * @Description 热议中话题-机关日统计数据 + * @author sun + */ + AgencyBasicDataResultDTO.Topic getAgencyTopicHotDiscuss(@Param("agencyId") String agencyId, @Param("dateId") String dateId); + /** * @Description 查询组织下最新议题日统计数据 * @author sun @@ -118,6 +124,12 @@ public interface DataStatsDao { */ List getSubAgencyTopicShiftIssue(@Param("agencyIds") List agencyIds, @Param("dateId") String dateId); + /** + * @Description 查询直属下级组织热议中话题-机关日统计数据 + * @author sun + */ + List getSubAgencyTopicHotDiscuss(@Param("agencyIds") List agencyIds, @Param("dateId") String dateId); + /** * @Description 查询网格层级状态话题-日统计数据 * @author sun @@ -130,6 +142,12 @@ public interface DataStatsDao { */ List getSubGridTopicShiftIssue(@Param("gridIds") List gridIds, @Param("dateId") String dateId); + /** + * @Description 查询网格层级热议中话题-日统计数据 + * @author sun + */ + List getSubGridTopicHotDiscuss(@Param("gridIds") List gridIds, @Param("dateId") String dateId); + /** * @Description 查询直属下级组织议题日统计数据,默认按议题总数降序 * @author sun diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java index 900144795e..cf3eefefb7 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java @@ -78,29 +78,32 @@ public class DataStatsServiceImpl implements DataStatsService { //3.查询组织下最新话题日统计数据 //状态话题-机关日统计数据表最新日期三种状态数据 - //机关日表里三种类型数据之和就是话题总量,讨论中数量与热议中不是一个概念,热议中=总量-关闭数-屏蔽数-转议题数 + //机关日表里三种类型数据之和就是话题总量,讨论中数量与热议中不是一个概念 List topic = dataStatsDao.getAgencyTopic(formDTO.getAgencyId(), formDTO.getDateId()); //转议题话题-机关日统计数据表 AgencyBasicDataResultDTO.Topic topicSHiftIssue = dataStatsDao.getAgencyTopicShiftIssue(formDTO.getAgencyId(), formDTO.getDateId()); + //热议中话题-机关日统计数据 + AgencyBasicDataResultDTO.Topic hotdiscuss = dataStatsDao.getAgencyTopicHotDiscuss(formDTO.getAgencyId(), formDTO.getDateId()); AtomicReference closedTotal = new AtomicReference<>(0); - AtomicReference hiddenTotal = new AtomicReference<>(0); if (topic.size() > NumConstant.ZERO) { resultDTO.setTopicTotal(topic.stream().collect(Collectors.summingInt(AgencyBasicDataResultDTO.Topic::getTopicCount))); topic.forEach(t -> { if (t.getTopicStatus().equals("closed")) { closedTotal.set(t.getTopicCount()); } - if (t.getTopicStatus().equals("hidden")) { - hiddenTotal.set(t.getTopicCount()); - } }); } + //转议题 if (null != topicSHiftIssue) { resultDTO.setShiftIssueTotal(topicSHiftIssue.getShiftedIssueTotal()); resultDTO.setShiftIssueRatio(resultDTO.getShiftIssueTotal() == 0 || resultDTO.getTopicTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getShiftIssueTotal() / (float) resultDTO.getTopicTotal()))); } - resultDTO.setDiscussingTotal(resultDTO.getTopicTotal() - closedTotal.get() - hiddenTotal.get() - resultDTO.getShiftIssueTotal()); - resultDTO.setDiscussingRatio(resultDTO.getDiscussingTotal() == 0 || resultDTO.getTopicTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getDiscussingTotal() / (float) resultDTO.getTopicTotal()))); + //热议中 + if (null != hotdiscuss) { + resultDTO.setDiscussingTotal(hotdiscuss.getTopicCount()); + resultDTO.setDiscussingRatio(resultDTO.getDiscussingTotal() == 0 || resultDTO.getTopicTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getDiscussingTotal() / (float) resultDTO.getTopicTotal()))); + } + //已处理 resultDTO.setClosedTopicTotal(closedTotal.get()); resultDTO.setClosedTopicRatio(resultDTO.getClosedTopicTotal() == 0 || resultDTO.getTopicTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getClosedTopicTotal() / (float) resultDTO.getTopicTotal()))); @@ -404,16 +407,18 @@ public class DataStatsServiceImpl implements DataStatsService { List agencyIds = subAgencyList.stream().map(DimAgencyEntity::getId).collect(Collectors.toList()); //2.查询直属下级组织状态话题-日统计数据 - //机关日表里三种类型数据之和就是话题总量,讨论中数量与热议中不是一个概念,热议中=总量-关闭数-屏蔽数-转议题数 + //机关日表里三种类型数据之和就是话题总量,讨论中数量与热议中不是一个概念 List topic = dataStatsDao.getSubAgencyTopic(agencyIds, formDTO.getDateId()); //查询直属下级组织转议题话题-日统计数据表 List topicShiftIssue = dataStatsDao.getSubAgencyTopicShiftIssue(agencyIds, formDTO.getDateId()); + //查询直属下级组织热议中话题-机关日统计数据 + List hotdiscuss = dataStatsDao.getSubAgencyTopicHotDiscuss(agencyIds, formDTO.getDateId()); agencyIds.forEach(agencyId -> { SubAgencyTopicResultDTO resultDTO = new SubAgencyTopicResultDTO(); AtomicInteger topicTotal = new AtomicInteger(0); AtomicInteger closedTotal = new AtomicInteger(0); - AtomicInteger hiddenTotal = new AtomicInteger(0); AtomicInteger shiftIssueTotal = new AtomicInteger(0); + AtomicInteger hotdiscussTotal = new AtomicInteger(0); AtomicReference agencyName = new AtomicReference<>(""); topic.forEach(t -> { if (t.getAgencyId().equals(agencyId)) { @@ -421,9 +426,6 @@ public class DataStatsServiceImpl implements DataStatsService { if (t.getTopicStatus().equals("closed")) { closedTotal.set(t.getTopicCount()); } - if (t.getTopicStatus().equals("hidden")) { - hiddenTotal.set(t.getTopicCount()); - } } }); topicShiftIssue.forEach(t -> { @@ -431,6 +433,11 @@ public class DataStatsServiceImpl implements DataStatsService { shiftIssueTotal.addAndGet(t.getShiftedIssueTotal()); } }); + hotdiscuss.forEach(t -> { + if (t.getAgencyId().equals(agencyId)) { + hotdiscussTotal.addAndGet(t.getTopicCount()); + } + }); subAgencyList.forEach(sub -> { if (agencyId.equals(sub.getId())) { agencyName.set(sub.getAgencyName()); @@ -440,7 +447,7 @@ public class DataStatsServiceImpl implements DataStatsService { resultDTO.setAgencyId(agencyId); resultDTO.setAgencyName(agencyName.get()); resultDTO.setTopicTotal(topicTotal.get()); - resultDTO.setDiscussingTotal(topicTotal.get() - closedTotal.get() - hiddenTotal.get() - shiftIssueTotal.get()); + resultDTO.setDiscussingTotal(hotdiscussTotal.get()); resultDTO.setDiscussingRatio(resultDTO.getDiscussingTotal() == 0 || resultDTO.getTopicTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getDiscussingTotal() / (float) resultDTO.getTopicTotal()))); resultDTO.setClosedTopicTotal(closedTotal.get()); resultDTO.setClosedTopicRatio(resultDTO.getClosedTopicTotal() == 0 || resultDTO.getTopicTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getClosedTopicTotal() / (float) resultDTO.getTopicTotal()))); @@ -504,12 +511,14 @@ public class DataStatsServiceImpl implements DataStatsService { List topic = dataStatsDao.getSubGridTopic(gridIds, formDTO.getDateId()); //查询网格层级转议题话题-日统计数据表 List topicShiftIssue = dataStatsDao.getSubGridTopicShiftIssue(gridIds, formDTO.getDateId()); + //查询网格层级热议中话题-日统计数据 + List hotdiscuss = dataStatsDao.getSubGridTopicHotDiscuss(gridIds, formDTO.getDateId()); gridIds.forEach(gridId -> { SubGridTopicResultDTO resultDTO = new SubGridTopicResultDTO(); AtomicInteger topicTotal = new AtomicInteger(0); AtomicInteger closedTotal = new AtomicInteger(0); - AtomicInteger hiddenTotal = new AtomicInteger(0); AtomicInteger shiftIssueTotal = new AtomicInteger(0); + AtomicInteger hotdiscussTotal = new AtomicInteger(0); AtomicReference gridName = new AtomicReference<>(""); topic.forEach(t -> { if (t.getGridId().equals(gridId)) { @@ -517,9 +526,6 @@ public class DataStatsServiceImpl implements DataStatsService { if (t.getTopicStatus().equals("closed")) { closedTotal.set(t.getTopicCount()); } - if (t.getTopicStatus().equals("hidden")) { - hiddenTotal.set(t.getTopicCount()); - } } }); topicShiftIssue.forEach(t -> { @@ -527,6 +533,11 @@ public class DataStatsServiceImpl implements DataStatsService { shiftIssueTotal.addAndGet(t.getShiftedIssueTotal()); } }); + hotdiscuss.forEach(t -> { + if (t.getGridId().equals(gridId)) { + hotdiscussTotal.addAndGet(t.getTopicCount()); + } + }); gridList.forEach(sub -> { if (gridId.equals(sub.getId())) { gridName.set(sub.getGridName()); @@ -536,7 +547,7 @@ public class DataStatsServiceImpl implements DataStatsService { resultDTO.setGridId(gridId); resultDTO.setGridName(gridName.get()); resultDTO.setTopicTotal(topicTotal.get()); - resultDTO.setDiscussingTotal(topicTotal.get() - closedTotal.get() - hiddenTotal.get() - shiftIssueTotal.get()); + resultDTO.setDiscussingTotal(hotdiscussTotal.get()); resultDTO.setDiscussingRatio(resultDTO.getDiscussingTotal() == 0 || resultDTO.getTopicTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getDiscussingTotal() / (float) resultDTO.getTopicTotal()))); resultDTO.setClosedTopicTotal(closedTotal.get()); resultDTO.setClosedTopicRatio(resultDTO.getClosedTopicTotal() == 0 || resultDTO.getTopicTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getClosedTopicTotal() / (float) resultDTO.getTopicTotal()))); diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml index 06967cceab..4096010837 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml @@ -58,6 +58,19 @@ LIMIT 1 + + + + + + + + + UPDATE issue_project_category_dict SET diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/MassesDiscontentFormDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/MassesDiscontentFormDTO.java new file mode 100644 index 0000000000..5a2e934a99 --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/MassesDiscontentFormDTO.java @@ -0,0 +1,43 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotNull; +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/5/13 5:16 下午 + * @DESC + */ +@Data +public class MassesDiscontentFormDTO implements Serializable { + + private static final long serialVersionUID = -9104774532905137856L; + + public interface MassesDiscontentForm{} + + /** + * 时间区间,三个月:threeMonth;半年:sixMonth;一年:twelveMonth + * 一个月按照30天,三个月90天,半年180天,一年365天 + */ + private String timeSection; + + /** + * asc:分数由低到高 + * desc:分数由高到低 + */ + private String sortType; + + /** + * 组织ID + */ + private String agencyId; + + @NotNull(message = "pageNo不能为空",groups = MassesDiscontentForm.class) + private Integer pageNo; + + @NotNull(message = "pageSize不能为空",groups = MassesDiscontentForm.class) + private Integer pageSize; + +} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/MassesDiscontentResultDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/MassesDiscontentResultDTO.java new file mode 100644 index 0000000000..905dd0be8d --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/MassesDiscontentResultDTO.java @@ -0,0 +1,62 @@ +package com.epmet.dto.result; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2021/5/14 9:04 上午 + * @DESC + */ +@Data +public class MassesDiscontentResultDTO implements Serializable { + + private static final long serialVersionUID = 8954504790464516198L; + + /** + * 项目ID + */ + private String projectId; + + /** + * 议题ID + */ + private String issueId; + + /** + * 话题所在网格 + */ + private String gridName; + + /** + * 话题图片 + */ + private List photos; + + /** + * 话题内容 + */ + private String topicContent; + + /** + * 项目分类标签 + */ + private String projectCategory; + + /** + * 项目评价分数 + */ + @JsonIgnore + private Integer score; + + public MassesDiscontentResultDTO() { + this.gridName = ""; + this.photos = new ArrayList<>(); + this.topicContent = ""; + this.projectCategory = ""; + } +} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectScoreResultDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectScoreResultDTO.java new file mode 100644 index 0000000000..9b2127224b --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectScoreResultDTO.java @@ -0,0 +1,31 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/5/18 1:29 下午 + * @DESC + */ +@Data +public class ProjectScoreResultDTO implements Serializable { + + private static final long serialVersionUID = 8559486245200043097L; + + /** + * 项目ID + */ + private String projectId; + + /** + * 项目评价分数 + */ + private Integer score; + + /** + * 议题ID + */ + private String issueId; +} diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/constant/ProjectConstant.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/constant/ProjectConstant.java index 71402799e8..992871d265 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/constant/ProjectConstant.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/constant/ProjectConstant.java @@ -174,4 +174,18 @@ public interface ProjectConstant { String NOT_EXIST_PROJECT = "未查询带此项目信息......"; String EXTERNAL_SYSTEM = "third_platform_project_send"; + + /** + * 三个月,六个月,12个月 + */ + String THREE_MONTH = "threeMonth"; + String SIX_MONTH = "sixMonth"; + String TWELVE_MONTH = "twelveMonth"; + + /** + * 排序 + */ + String SORT_ASC = "asc"; + String SORT_DESC = "desc"; + } diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectSatisfactionStatisticsController.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectSatisfactionStatisticsController.java index 78fed6b459..62fbe24a59 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectSatisfactionStatisticsController.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectSatisfactionStatisticsController.java @@ -26,7 +26,9 @@ import com.epmet.commons.tools.validator.group.AddGroup; import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.commons.tools.validator.group.DefaultGroup; import com.epmet.dto.ProjectSatisfactionStatisticsDTO; +import com.epmet.dto.form.MassesDiscontentFormDTO; import com.epmet.dto.form.ProjectEvaluateScoreFormDTO; +import com.epmet.dto.result.MassesDiscontentResultDTO; import com.epmet.dto.result.ProjectEvaluateScoreResultDTO; import com.epmet.excel.ProjectSatisfactionStatisticsExcel; import com.epmet.service.ProjectSatisfactionStatisticsService; @@ -105,4 +107,16 @@ public class ProjectSatisfactionStatisticsController { return new Result().ok(projectSatisfactionStatisticsService.projectEvaluateScore(formDTO)); } + /** + * @Description 群众不满 + * @Param formDTO + * @author zxc + * @date 2021/5/14 10:46 上午 + */ + @PostMapping("massesdiscontent") + public Result> massesDiscontent(@RequestBody MassesDiscontentFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, MassesDiscontentFormDTO.MassesDiscontentForm.class); + return new Result>().ok(projectSatisfactionStatisticsService.massesDiscontent(formDTO)); + } + } \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectCategoryDao.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectCategoryDao.java index 247f239261..cc2d336344 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectCategoryDao.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectCategoryDao.java @@ -20,6 +20,7 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.ProjectCategoryDTO; import com.epmet.dto.form.DelCategoryFormDTO; +import com.epmet.dto.result.ProjectCategoryDisPoseResultDTO; import com.epmet.entity.ProjectCategoryEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -52,4 +53,12 @@ public interface ProjectCategoryDao extends BaseDao { * @Author sun **/ List selectProjectCategoryList(DelCategoryFormDTO formDTO); + + /** + * @Description 根据项目ID查询项目分类 + * @Param projectIds + * @author zxc + * @date 2021/5/17 10:47 上午 + */ + List selectCategoryByIds(@Param("projectIds")List projectIds); } \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectDao.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectDao.java index 5eccc08f67..ed73518a58 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectDao.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectDao.java @@ -147,4 +147,14 @@ public interface ProjectDao extends BaseDao { @Param("customerId") String customerId); ProjectInfoDTO queryProjectInfoByProjectId(String projectId); + + /** + * @Description 查询时间段内的项目ID + * @Param agencyId + * @Param startDate + * @Param endDate + * @author zxc + * @date 2021/5/14 1:59 下午 + */ + List selectProjectIdByTime(@Param("agencyId")String agencyId,@Param("endDate")Integer endDate,@Param("startDate")Integer startDate); } \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectSatisfactionStatisticsDao.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectSatisfactionStatisticsDao.java index 60a2852e8f..b174075bcd 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectSatisfactionStatisticsDao.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectSatisfactionStatisticsDao.java @@ -18,10 +18,14 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.result.MassesDiscontentResultDTO; +import com.epmet.dto.result.ProjectScoreResultDTO; import com.epmet.entity.ProjectSatisfactionStatisticsEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; +import java.util.List; + /** * 项目满意度调查统计表 * @@ -39,4 +43,12 @@ public interface ProjectSatisfactionStatisticsDao extends BaseDao selectProjectByScore(@Param("projectIds")List projectIds, @Param("setScore")Integer setScore, @Param("sortType")String sortType); + } \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectSatisfactionStatisticsService.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectSatisfactionStatisticsService.java index fa035d53f6..24b4f24b5b 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectSatisfactionStatisticsService.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectSatisfactionStatisticsService.java @@ -20,7 +20,9 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; import com.epmet.dto.ProjectSatisfactionStatisticsDTO; +import com.epmet.dto.form.MassesDiscontentFormDTO; import com.epmet.dto.form.ProjectEvaluateScoreFormDTO; +import com.epmet.dto.result.MassesDiscontentResultDTO; import com.epmet.dto.result.ProjectEvaluateScoreResultDTO; import com.epmet.entity.ProjectSatisfactionStatisticsEntity; @@ -102,4 +104,12 @@ public interface ProjectSatisfactionStatisticsService extends BaseService massesDiscontent(MassesDiscontentFormDTO formDTO); } \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectSatisfactionStatisticsServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectSatisfactionStatisticsServiceImpl.java index 222a96644a..ed20dfd167 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectSatisfactionStatisticsServiceImpl.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectSatisfactionStatisticsServiceImpl.java @@ -21,24 +21,42 @@ 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.NumConstant; +import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.constant.ProjectConstant; +import com.epmet.dao.ProjectCategoryDao; +import com.epmet.dao.ProjectDao; import com.epmet.dao.ProjectSatisfactionStatisticsDao; import com.epmet.dto.ProjectSatisfactionStatisticsDTO; +import com.epmet.dto.form.MassesDiscontentFormDTO; import com.epmet.dto.form.ProjectEvaluateScoreFormDTO; +import com.epmet.dto.result.MassesDiscontentResultDTO; +import com.epmet.dto.result.ProjectCategoryDisPoseResultDTO; import com.epmet.dto.result.ProjectEvaluateScoreResultDTO; +import com.epmet.dto.result.ProjectScoreResultDTO; import com.epmet.entity.ProjectSatisfactionStatisticsEntity; +import com.epmet.feign.GovIssueOpenFeignClient; import com.epmet.redis.ProjectSatisfactionStatisticsRedis; +import com.epmet.resi.group.dto.topic.result.TopicInfoResultDTO; +import com.epmet.resi.group.feign.ResiGroupOpenFeignClient; import com.epmet.service.ProjectSatisfactionStatisticsService; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; 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.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Map; +import java.util.stream.Collectors; /** * 项目满意度调查统计表 @@ -51,6 +69,14 @@ public class ProjectSatisfactionStatisticsServiceImpl extends BaseServiceImpl page(Map params) { @@ -125,4 +151,80 @@ public class ProjectSatisfactionStatisticsServiceImpl extends BaseServiceImpl massesDiscontent(MassesDiscontentFormDTO formDTO) { + List projectIds = projectDao.selectProjectIdByTime(formDTO.getAgencyId(), getDateId("yesterday"), getDateId(formDTO.getTimeSection())); + if (CollectionUtils.isEmpty(projectIds)){ + return new ArrayList<>(); + } + PageInfo pageInfo = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.selectProjectByScore(projectIds.stream().map(m -> m.getProjectId()).collect(Collectors.toList()), NumConstant.SEVENTY_FIVE, formDTO.getSortType())); + List projects = pageInfo.getList(); + if (CollectionUtils.isEmpty(projects)){ + return new ArrayList<>(); + } + List projectCategoryDisPoseResultDTOS = projectCategoryDao.selectCategoryByIds(projects.stream().map(m -> m.getProjectId()).collect(Collectors.toList())); + List projectCategoryData = new ArrayList<>(); + if (!CollectionUtils.isEmpty(projectCategoryDisPoseResultDTOS)){ + Result> projectCategory = issueOpenFeignClient.getProjectCategory(projectCategoryDisPoseResultDTOS); + if (!projectCategory.success()){ + throw new RenException("查询项目分类标签失败".concat(projectCategory.getMsg())); + } + projectCategoryData = projectCategory.getData(); + } + Result> topicInfos = resiGroupOpenFeignClient.getTopicInfos(projects.stream().map(m -> m.getIssueId()).collect(Collectors.toList())); + if (!topicInfos.success()){ + throw new RenException("查询话题信息失败".concat(topicInfos.getMsg())); + } + List finalProjectCategoryData = projectCategoryData; + projects.forEach(p -> { + if (!CollectionUtils.isEmpty(finalProjectCategoryData)){ + finalProjectCategoryData.forEach(cate -> { + if (p.getProjectId().equals(cate.getProjectId())){ + p.setProjectCategory(cate.getProjectCategory()); + } + }); + } + if (!CollectionUtils.isEmpty(topicInfos.getData())){ + topicInfos.getData().forEach(t -> { + if (p.getIssueId().equals(t.getIssueId())){ + p.setGridName(t.getGridName()); + p.setTopicContent(t.getTopicContent()); + p.setPhotos(t.getPhotos()); + } + }); + } + }); + return projects; + } + + /** + * @Description 处理时间 + * @Param dateType + * @author zxc + * @date 2021/5/18 2:28 下午 + */ + public Integer getDateId(String dateType){ + String beforeNDay = DateUtils.getBeforeNDay(NumConstant.ONE); + Integer result = Integer.valueOf(beforeNDay); + switch (dateType) { + case ProjectConstant.THREE_MONTH: + result = Integer.valueOf(DateUtils.getBeforeNDay(NumConstant.NINETY)); + break; + case ProjectConstant.SIX_MONTH: + result = Integer.valueOf(DateUtils.getBeforeNDay(NumConstant.ONE_HUNDRED_AND_EIGHTY)); + break; + case ProjectConstant.TWELVE_MONTH: + result = Integer.valueOf(DateUtils.getBeforeNDay(NumConstant.THREE_HUNDRED_AND_SIXTY_FIVE)); + break; + default: + } + return result; + } + } \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectCategoryDao.xml b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectCategoryDao.xml index 30033c620e..3f9c27f6d2 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectCategoryDao.xml +++ b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectCategoryDao.xml @@ -35,4 +35,19 @@ project_id = #{projectId} + + + \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectDao.xml b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectDao.xml index 0a430eab87..4a8c18c125 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectDao.xml +++ b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectDao.xml @@ -269,4 +269,18 @@ where P.DEL_FLAG='0' AND p.id=#{projectId} + + + + \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectSatisfactionStatisticsDao.xml b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectSatisfactionStatisticsDao.xml index 90be9c1c62..9a194a2db4 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectSatisfactionStatisticsDao.xml +++ b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectSatisfactionStatisticsDao.xml @@ -8,5 +8,29 @@ select * from project_satisfaction_statistics where DEL_FLAG = '0' AND PROJECT_ID = #{projectId} + + + \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/TopicInfoResultDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/TopicInfoResultDTO.java new file mode 100644 index 0000000000..4a2d43ea8e --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/TopicInfoResultDTO.java @@ -0,0 +1,42 @@ +package com.epmet.resi.group.dto.topic.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2021/5/17 2:44 下午 + * @DESC + */ +@Data +public class TopicInfoResultDTO implements Serializable { + + private static final long serialVersionUID = 4068679301595597877L; + + /** + * 议题ID + */ + private String issueId; + + /** + * 话题所在网格 + */ + private String gridName; + + /** + * 网格ID + */ + private String gridId; + + /** + * 话题图片 + */ + private List photos; + + /** + * 话题内容 + */ + private String topicContent; +} diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/ResiGroupOpenFeignClient.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/ResiGroupOpenFeignClient.java index 292972c45e..64879dc601 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/ResiGroupOpenFeignClient.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/ResiGroupOpenFeignClient.java @@ -10,6 +10,7 @@ import com.epmet.resi.group.dto.topic.MyCreateTopicsFormDTO; import com.epmet.resi.group.dto.topic.ResiTopicDTO; import com.epmet.resi.group.dto.topic.form.*; import com.epmet.resi.group.dto.topic.result.*; +import com.epmet.resi.group.dto.topic.result.TopicInfoResultDTO; import com.epmet.resi.group.feign.fallback.ResiGroupOpenFeignClientFallback; import com.epmet.resi.mine.dto.from.MyPartProjectsFormDTO; import org.springframework.cloud.openfeign.FeignClient; @@ -253,4 +254,14 @@ public interface ResiGroupOpenFeignClient { */ @PostMapping("resi/group/group/groupPointDetail/{groupId}") Result groupPointDetail(@PathVariable String groupId); + + /** + * @Description 查询话题信息 + * @Param issueIds + * @author zxc + * @date 2021/5/17 4:19 下午 + */ + @PostMapping("resi/group/topic/gettopicinfos") + Result> getTopicInfos(@RequestBody List issueIds); + } diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/fallback/ResiGroupOpenFeignClientFallback.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/fallback/ResiGroupOpenFeignClientFallback.java index 84dee1113d..84d0385b47 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/fallback/ResiGroupOpenFeignClientFallback.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/fallback/ResiGroupOpenFeignClientFallback.java @@ -10,6 +10,7 @@ import com.epmet.resi.group.dto.topic.MyCreateTopicsFormDTO; import com.epmet.resi.group.dto.topic.ResiTopicDTO; import com.epmet.resi.group.dto.topic.form.*; import com.epmet.resi.group.dto.topic.result.*; +import com.epmet.resi.group.dto.topic.result.TopicInfoResultDTO; import com.epmet.resi.group.feign.ResiGroupOpenFeignClient; import com.epmet.resi.mine.dto.from.MyPartProjectsFormDTO; import org.springframework.stereotype.Component; @@ -198,4 +199,9 @@ public class ResiGroupOpenFeignClientFallback implements ResiGroupOpenFeignClien public Result groupPointDetail(String groupId) { return ModuleUtils.feignConError(ServiceConstant.RESI_GROUP_SERVER, "groupPointDetail", groupId); } + + @Override + public Result> getTopicInfos(List issueIds) { + return ModuleUtils.feignConError(ServiceConstant.RESI_GROUP_SERVER, "getTopicInfos", issueIds); + } } diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/controller/ResiTopicController.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/controller/ResiTopicController.java index ef4a773ccf..062662457a 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/controller/ResiTopicController.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/controller/ResiTopicController.java @@ -485,4 +485,15 @@ public class ResiTopicController { ValidatorUtils.validateEntity(formDTO, GetPastTopicListV2FormDTO.GetPastTopicListV2Form.class); return new Result>().ok(topicService.allMessages(formDTO)); } + + /** + * @Description 查询话题信息 + * @Param issueIds + * @author zxc + * @date 2021/5/17 4:19 下午 + */ + @PostMapping("gettopicinfos") + public Result> getTopicInfos(@RequestBody List issueIds){ + return new Result>().ok(topicService.getTopicInfos(issueIds)); + } } diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/ResiTopicDao.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/ResiTopicDao.java index abc817659d..88bc4abad0 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/ResiTopicDao.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/ResiTopicDao.java @@ -224,4 +224,12 @@ public interface ResiTopicDao extends BaseDao { * @author sun */ int upTopicList(@Param("delIdList") List delIdList, @Param("userId") String userId); + + /** + * @Description 查询话题信息 + * @Param issueIds + * @author zxc + * @date 2021/5/17 4:54 下午 + */ + List getTopicInfos(@Param("issueIds") List issueIds); } \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/ResiTopicService.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/ResiTopicService.java index 064255c04c..cf496a8c5b 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/ResiTopicService.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/ResiTopicService.java @@ -389,4 +389,12 @@ public interface ResiTopicService extends BaseService { * @date 2021/4/28 上午10:41 */ List allMessages(AllMessagesFormDTO formDTO); + + /** + * @Description 查询话题信息 + * @Param issueIds + * @author zxc + * @date 2021/5/17 4:19 下午 + */ + List getTopicInfos(List issueIds); } diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java index 6c4ff65b4f..ec51f04815 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java @@ -103,6 +103,7 @@ import com.epmet.resi.group.dto.topic.form.*; import com.epmet.resi.group.dto.topic.result.CheckTopicPublisherResultDTO; import com.epmet.resi.group.dto.topic.result.GovTopicIssueInfoResultDTO; import com.epmet.resi.group.dto.topic.result.*; +import com.epmet.resi.group.dto.topic.result.TopicInfoResultDTO; import com.epmet.send.SendMqMsgUtil; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; @@ -2746,6 +2747,32 @@ public class ResiTopicServiceImpl extends BaseServiceImpl getTopicInfos(List issueIds) { + if (CollectionUtils.isEmpty(issueIds)){ + return new ArrayList<>(); + } + List topicInfos = baseDao.getTopicInfos(issueIds); + Result> gridNames = govOrgOpenFeignClient.getGridListByGridIds(topicInfos.stream().map(m -> m.getGridId()).collect(Collectors.toList())); + if (!gridNames.success()){ + throw new RenException("查询网格Name失败"); + } + topicInfos.forEach(t -> { + gridNames.getData().forEach(g -> { + if (t.getGridId().equals(g.getGridId())){ + t.setGridName(g.getGridName()); + } + }); + }); + return topicInfos; + } + } diff --git a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/ResiTopicDao.xml b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/ResiTopicDao.xml index b5f35a8a7a..d912ca952b 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/ResiTopicDao.xml +++ b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/ResiTopicDao.xml @@ -606,5 +606,30 @@ + + + + + + + + + + From d8847b1a6d770525cd77e68bd3df64671f633f37 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Tue, 18 May 2021 15:21:34 +0800 Subject: [PATCH 031/128] =?UTF-8?q?=E7=BD=91=E6=A0=BC=E5=B1=82=E7=BA=A7?= =?UTF-8?q?=E4=BA=94=E9=A1=B9=E5=9F=BA=E7=A1=80=E6=95=B0=E6=8D=AE=E6=9F=A5?= =?UTF-8?q?=E7=9C=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../datastats/form/GridBasicDataFormDTO.java | 28 ++++ .../result/GridBasicDataResultDTO.java | 96 ++++++++++++++ .../controller/DataStatsController.java | 12 ++ .../service/datastats/DataStatsService.java | 9 ++ .../datastats/impl/DataStatsServiceImpl.java | 120 ++++++++++++++++-- 5 files changed, 254 insertions(+), 11 deletions(-) create mode 100644 epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/GridBasicDataFormDTO.java create mode 100644 epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/GridBasicDataResultDTO.java diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/GridBasicDataFormDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/GridBasicDataFormDTO.java new file mode 100644 index 0000000000..eb1b981134 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/GridBasicDataFormDTO.java @@ -0,0 +1,28 @@ +package com.epmet.dataaggre.dto.datastats.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Description 基础数据-网格各种数据汇总-接口入参 + * @Auth sun + */ +@Data +public class GridBasicDataFormDTO implements Serializable { + + private static final long serialVersionUID = -3381286960911634231L; + /** + * 网格Id + */ + @NotBlank(message = "网格ID不能为空",groups = GridBasicDataFormDTO.Grid.class) + private String gridId; + /** + * 日维度Id + */ + private String dateId; + public interface Grid extends CustomerClientShowGroup{} + +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/GridBasicDataResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/GridBasicDataResultDTO.java new file mode 100644 index 0000000000..1ee5dc9b8a --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/GridBasicDataResultDTO.java @@ -0,0 +1,96 @@ +package com.epmet.dataaggre.dto.datastats.result; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * @Description 基础数据-网格各种数据汇总-接口返参 + * @Auth sun + */ +@Data +public class GridBasicDataResultDTO implements Serializable { + private static final long serialVersionUID = 466974582608407121L; + @JsonIgnore + BigDecimal bi = new BigDecimal(0); + /** + * 网格Id + */ + private String gridId; + //用户总数 + private Integer userTotal = 0; + //党员总数 + private Integer partyMemberTotal = 0; + //党员总数占比 + private BigDecimal partyMemberRatio = bi; + //居民总数 + private Integer resiTotal = 0; + //居民总数占比 + private BigDecimal resiRatio = bi; + //党群小组总数 + private Integer groupTotal = 0; + //楼院小组总数 + private Integer ordinaryTotal = 0; + //楼院小组总数占比 + private BigDecimal ordinaryRatio = bi; + //支部小组总数 + private Integer branchTotal = 0; + //支部小组总数占比 + private BigDecimal branchRatio = bi; + //话题总数 + private Integer topicTotal = 0; + //热议中总数 + private Integer discussingTotal = 0; + //热议中总数占比 + private BigDecimal discussingRatio = bi; + //已处理总数 + private Integer closedTopicTotal = 0; + //已处理总数占比 + private BigDecimal closedTopicRatio = bi; + //转议题总数 + private Integer shiftIssueTotal = 0; + //转议题总数占比 + private BigDecimal shiftIssueRatio = bi; + //议题总数 + private Integer issueTotal = 0; + //表决中总数 + private Integer votingTotal = 0; + //表决中总数占比 + private BigDecimal votingRatio = bi; + //已处理总数 + private Integer closedIssueTotal = 0; + //已处理总数占比 + private BigDecimal closedIssueRatio = bi; + //已转项目总数 + private Integer shiftProjectTotal = 0; + //已转项目总数占比 + private BigDecimal shiftProjectRatio = bi; + //项目总数 + private Integer projectTotal = 0; + //处理中总数 + private Integer pendingTotal = 0; + //处理中总数占比 + private BigDecimal pendingRatio = bi; + //已结案总数 + private Integer closedProjectTotal = 0; + //已结案总数占比 + private BigDecimal closedProjectRatio = bi; + + + @Data + public static class Topic implements Serializable { + //话题总量 + private Integer topicTotal; + //话题数量 + private Integer topicCount; + //话题状态 已关闭:closed、已屏蔽:hidden、 讨论中:discussing + private String topicStatus; + //话题已转议题数量 + private Integer shiftedIssueTotal; + //数据更新至 时间 + private String deadline; + } + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/DataStatsController.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/DataStatsController.java index 951696b919..162b7e5671 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/DataStatsController.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/DataStatsController.java @@ -3,6 +3,7 @@ package com.epmet.dataaggre.controller; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dataaggre.dto.datastats.form.AgenctBasicDataFormDTO; +import com.epmet.dataaggre.dto.datastats.form.GridBasicDataFormDTO; import com.epmet.dataaggre.dto.datastats.form.SubAgencyFormDTO; import com.epmet.dataaggre.dto.datastats.form.SubGridFormDTO; import com.epmet.dataaggre.dto.datastats.result.*; @@ -37,6 +38,17 @@ public class DataStatsController { return new Result().ok(dataStatsService.agencyBasicData(formDTO)); } + /** + * @Param formDTO + * @Description 网格下五项基础数据汇总 + * @author sun + */ + @PostMapping("gridbasicdata") + public Result gridBasicData(@RequestBody GridBasicDataFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, GridBasicDataFormDTO.Grid.class); + return new Result().ok(dataStatsService.gridBasicData(formDTO)); + } + /** * @Param formDTO * @Description 查询当前组织的直属下级组织用户数据 diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/DataStatsService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/DataStatsService.java index 6eb826dc8d..256aaeb15c 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/DataStatsService.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/DataStatsService.java @@ -1,6 +1,7 @@ package com.epmet.dataaggre.service.datastats; import com.epmet.dataaggre.dto.datastats.form.AgenctBasicDataFormDTO; +import com.epmet.dataaggre.dto.datastats.form.GridBasicDataFormDTO; import com.epmet.dataaggre.dto.datastats.form.SubAgencyFormDTO; import com.epmet.dataaggre.dto.datastats.form.SubGridFormDTO; import com.epmet.dataaggre.dto.datastats.result.*; @@ -20,6 +21,13 @@ public interface DataStatsService { */ AgencyBasicDataResultDTO agencyBasicData(AgenctBasicDataFormDTO formDTO); + /** + * @Param formDTO + * @Description 网格下五项基础数据汇总 + * @author sun + */ + GridBasicDataResultDTO gridBasicData(GridBasicDataFormDTO formDTO); + /** * @Param formDTO * @Description 查询当前组织的直属下级组织用户数据 @@ -91,4 +99,5 @@ public interface DataStatsService { * @author sun */ List subGridProject(SubGridFormDTO formDTO); + } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java index cf3eefefb7..f8ddfde557 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java @@ -6,6 +6,7 @@ import com.epmet.commons.tools.utils.DateUtils; import com.epmet.dataaggre.constant.DataSourceConstant; import com.epmet.dataaggre.dao.datastats.DataStatsDao; import com.epmet.dataaggre.dto.datastats.form.AgenctBasicDataFormDTO; +import com.epmet.dataaggre.dto.datastats.form.GridBasicDataFormDTO; import com.epmet.dataaggre.dto.datastats.form.SubAgencyFormDTO; import com.epmet.dataaggre.dto.datastats.form.SubGridFormDTO; import com.epmet.dataaggre.dto.datastats.result.*; @@ -47,7 +48,7 @@ public class DataStatsServiceImpl implements DataStatsService { AgencyBasicDataResultDTO resultDTO = new AgencyBasicDataResultDTO(); resultDTO.setAgencyId(formDTO.getAgencyId()); NumberFormat numberFormat = NumberFormat.getInstance(); - numberFormat.setMaximumFractionDigits(NumConstant.FOUR); + numberFormat.setMaximumFractionDigits(NumConstant.THREE); //入参有日期的则按具体时间执行,没有的则按当前时间前一天执行 if (StringUtils.isBlank(formDTO.getDateId())) { @@ -132,6 +133,103 @@ public class DataStatsServiceImpl implements DataStatsService { return resultDTO; } + /** + * @Param formDTO + * @Description 网格下五项基础数据汇总 + * @author sun + */ + @Override + public GridBasicDataResultDTO gridBasicData(GridBasicDataFormDTO formDTO) { + GridBasicDataResultDTO resultDTO = new GridBasicDataResultDTO(); + resultDTO.setGridId(formDTO.getGridId()); + NumberFormat numberFormat = NumberFormat.getInstance(); + numberFormat.setMaximumFractionDigits(NumConstant.THREE); + + //入参有日期的则按具体时间执行,没有的则按当前时间前一天执行 + if (StringUtils.isBlank(formDTO.getDateId())) { + Date yesterday = DateUtils.addDateDays(new Date(), -1); + SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); + formDTO.setDateId(format.format(yesterday)); + } + + //1.查询网格下注册用户最新日统计数据【只查询注册用户的统计数据,不涉及参与用户的】 + List gridIds = new ArrayList<>(); + gridIds.add(formDTO.getGridId()); + List userList = dataStatsDao.getSubGridUser(gridIds, formDTO.getDateId()); + if (userList.size() > NumConstant.ZERO) { + resultDTO.setUserTotal(userList.get(0).getUserTotal()); + resultDTO.setResiTotal(userList.get(0).getResiTotal()); + resultDTO.setResiRatio(resultDTO.getResiTotal() == 0 || resultDTO.getUserTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getResiTotal() / (float) resultDTO.getUserTotal()))); + resultDTO.setPartyMemberTotal(userList.get(0).getPartyMemberTotal()); + resultDTO.setPartyMemberRatio(resultDTO.getPartyMemberTotal() == 0 || resultDTO.getUserTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getPartyMemberTotal() / (float) resultDTO.getUserTotal()))); + } + + //2.查询网格下最新群组日统计数据 + List groupList = dataStatsDao.getSubGridGroup(gridIds, formDTO.getDateId()); + if (groupList.size() > NumConstant.ZERO) { + resultDTO.setGroupTotal(groupList.get(0).getGroupTotal()); + resultDTO.setOrdinaryTotal(groupList.get(0).getOrdinaryTotal()); + resultDTO.setOrdinaryRatio(resultDTO.getOrdinaryTotal() == 0 || resultDTO.getGroupTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getOrdinaryTotal() / (float) resultDTO.getGroupTotal()))); + resultDTO.setBranchTotal(groupList.get(0).getBranchTotal()); + resultDTO.setBranchRatio(resultDTO.getBranchTotal() == 0 || resultDTO.getGroupTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getBranchTotal() / (float) resultDTO.getGroupTotal()))); + } + + //3.查询网格下最新话题日统计数据 + //状态话题-网格日统计数据表最新日期三种状态数据 + //网格日表里三种类型数据之和就是话题总量,讨论中数量与热议中不是一个概念 + List topicList = dataStatsDao.getSubGridTopic(gridIds, formDTO.getDateId()); + //转议题话题-网格日统计数据表 + List topicShiftIssueList = dataStatsDao.getSubGridTopicShiftIssue(gridIds, formDTO.getDateId()); + //热议中话题-网格日统计数据 + List hotdiscussList = dataStatsDao.getSubGridTopicHotDiscuss(gridIds, formDTO.getDateId()); + AtomicReference closedTotal = new AtomicReference<>(0); + if (topicList.size() > NumConstant.ZERO) { + resultDTO.setTopicTotal(topicList.stream().collect(Collectors.summingInt(SubGridFormDTO.Topic::getTopicCount))); + topicList.forEach(t -> { + if (t.getTopicStatus().equals("closed")) { + closedTotal.set(t.getTopicCount()); + } + }); + } + //转议题 + if (topicShiftIssueList.size() > NumConstant.ZERO) { + resultDTO.setShiftIssueTotal(topicShiftIssueList.get(0).getShiftedIssueTotal()); + resultDTO.setShiftIssueRatio(resultDTO.getShiftIssueTotal() == 0 || resultDTO.getTopicTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getShiftIssueTotal() / (float) resultDTO.getTopicTotal()))); + } + //热议中 + if (hotdiscussList.size() > NumConstant.ZERO) { + resultDTO.setDiscussingTotal(hotdiscussList.get(0).getTopicCount()); + resultDTO.setDiscussingRatio(resultDTO.getDiscussingTotal() == 0 || resultDTO.getTopicTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getDiscussingTotal() / (float) resultDTO.getTopicTotal()))); + } + //已处理 + resultDTO.setClosedTopicTotal(closedTotal.get()); + resultDTO.setClosedTopicRatio(resultDTO.getClosedTopicTotal() == 0 || resultDTO.getTopicTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getClosedTopicTotal() / (float) resultDTO.getTopicTotal()))); + + //4.查询网格下最新议题日统计数据 + List issueList = dataStatsDao.getSubGridIssue(gridIds, formDTO.getDateId()); + if (issueList.size() > NumConstant.ZERO) { + resultDTO.setIssueTotal(issueList.get(0).getIssueTotal()); + resultDTO.setVotingTotal(issueList.get(0).getVotingTotal()); + resultDTO.setVotingRatio(resultDTO.getVotingTotal() == 0 || resultDTO.getIssueTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getVotingTotal() / (float) resultDTO.getIssueTotal()))); + resultDTO.setClosedIssueTotal(issueList.get(0).getClosedIssueTotal()); + resultDTO.setClosedIssueRatio(resultDTO.getClosedIssueTotal() == 0 || resultDTO.getIssueTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getClosedIssueTotal() / (float) resultDTO.getIssueTotal()))); + resultDTO.setShiftProjectTotal(issueList.get(0).getShiftProjectTotal()); + resultDTO.setShiftProjectRatio(resultDTO.getShiftProjectTotal() == 0 || resultDTO.getIssueTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getShiftProjectTotal() / (float) resultDTO.getIssueTotal()))); + } + + //5.查询网格下最新项目日统计数据 + List projectList = dataStatsDao.getSubGridProject(gridIds, formDTO.getDateId()); + if (projectList.size() > NumConstant.ZERO) { + resultDTO.setProjectTotal(projectList.get(0).getProjectTotal()); + resultDTO.setPendingTotal(projectList.get(0).getPendingTotal()); + resultDTO.setPendingRatio(resultDTO.getPendingTotal() == 0 || resultDTO.getProjectTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getPendingTotal() / (float) resultDTO.getProjectTotal()))); + resultDTO.setClosedProjectTotal(projectList.get(0).getClosedProjectTotal()); + resultDTO.setClosedProjectRatio(resultDTO.getClosedProjectTotal() == 0 || resultDTO.getProjectTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getClosedProjectTotal() / (float) resultDTO.getProjectTotal()))); + } + + return resultDTO; + } + /** * @Param formDTO * @Description 查询当前组织的直属下级组织用户数据 @@ -141,7 +239,7 @@ public class DataStatsServiceImpl implements DataStatsService { public List subAgencyUser(SubAgencyFormDTO formDTO) { List resultList = new ArrayList<>(); NumberFormat numberFormat = NumberFormat.getInstance(); - numberFormat.setMaximumFractionDigits(NumConstant.FOUR); + numberFormat.setMaximumFractionDigits(NumConstant.THREE); //入参有日期的则按具体时间执行,没有的则按当前时间前一天执行 if (StringUtils.isBlank(formDTO.getDateId())) { @@ -204,7 +302,7 @@ public class DataStatsServiceImpl implements DataStatsService { public List subGridUser(SubGridFormDTO formDTO) { List resultList = new ArrayList<>(); NumberFormat numberFormat = NumberFormat.getInstance(); - numberFormat.setMaximumFractionDigits(NumConstant.FOUR); + numberFormat.setMaximumFractionDigits(NumConstant.THREE); //入参有日期的则按具体时间执行,没有的则按当前时间前一天执行 if (StringUtils.isBlank(formDTO.getDateId())) { @@ -265,7 +363,7 @@ public class DataStatsServiceImpl implements DataStatsService { public List subAgencyGroup(SubAgencyFormDTO formDTO) { List resultList = new ArrayList<>(); NumberFormat numberFormat = NumberFormat.getInstance(); - numberFormat.setMaximumFractionDigits(NumConstant.FOUR); + numberFormat.setMaximumFractionDigits(NumConstant.THREE); //入参有日期的则按具体时间执行,没有的则按当前时间前一天执行 if (StringUtils.isBlank(formDTO.getDateId())) { @@ -325,7 +423,7 @@ public class DataStatsServiceImpl implements DataStatsService { public List subGridGroup(SubGridFormDTO formDTO) { List resultList = new ArrayList<>(); NumberFormat numberFormat = NumberFormat.getInstance(); - numberFormat.setMaximumFractionDigits(NumConstant.FOUR); + numberFormat.setMaximumFractionDigits(NumConstant.THREE); //入参有日期的则按具体时间执行,没有的则按当前时间前一天执行 if (StringUtils.isBlank(formDTO.getDateId())) { @@ -386,7 +484,7 @@ public class DataStatsServiceImpl implements DataStatsService { public List subAgencyTopic(SubAgencyFormDTO formDTO) { List resultList = new ArrayList<>(); NumberFormat numberFormat = NumberFormat.getInstance(); - numberFormat.setMaximumFractionDigits(NumConstant.FOUR); + numberFormat.setMaximumFractionDigits(NumConstant.THREE); //入参有日期的则按具体时间执行,没有的则按当前时间前一天执行 if (StringUtils.isBlank(formDTO.getDateId())) { @@ -486,7 +584,7 @@ public class DataStatsServiceImpl implements DataStatsService { public List subGridTopic(SubGridFormDTO formDTO) { List resultList = new ArrayList<>(); NumberFormat numberFormat = NumberFormat.getInstance(); - numberFormat.setMaximumFractionDigits(NumConstant.FOUR); + numberFormat.setMaximumFractionDigits(NumConstant.THREE); //入参有日期的则按具体时间执行,没有的则按当前时间前一天执行 if (StringUtils.isBlank(formDTO.getDateId())) { @@ -585,7 +683,7 @@ public class DataStatsServiceImpl implements DataStatsService { public List subAgencyIssue(SubAgencyFormDTO formDTO) { List resultList = new ArrayList<>(); NumberFormat numberFormat = NumberFormat.getInstance(); - numberFormat.setMaximumFractionDigits(NumConstant.FOUR); + numberFormat.setMaximumFractionDigits(NumConstant.THREE); //入参有日期的则按具体时间执行,没有的则按当前时间前一天执行 if (StringUtils.isBlank(formDTO.getDateId())) { @@ -648,7 +746,7 @@ public class DataStatsServiceImpl implements DataStatsService { public List subGridIssue(SubGridFormDTO formDTO) { List resultList = new ArrayList<>(); NumberFormat numberFormat = NumberFormat.getInstance(); - numberFormat.setMaximumFractionDigits(NumConstant.FOUR); + numberFormat.setMaximumFractionDigits(NumConstant.THREE); //入参有日期的则按具体时间执行,没有的则按当前时间前一天执行 if (StringUtils.isBlank(formDTO.getDateId())) { @@ -711,7 +809,7 @@ public class DataStatsServiceImpl implements DataStatsService { public List subAgencyProject(SubAgencyFormDTO formDTO) { List resultList = new ArrayList<>(); NumberFormat numberFormat = NumberFormat.getInstance(); - numberFormat.setMaximumFractionDigits(NumConstant.FOUR); + numberFormat.setMaximumFractionDigits(NumConstant.THREE); //入参有日期的则按具体时间执行,没有的则按当前时间前一天执行 if (StringUtils.isBlank(formDTO.getDateId())) { @@ -771,7 +869,7 @@ public class DataStatsServiceImpl implements DataStatsService { public List subGridProject(SubGridFormDTO formDTO) { List resultList = new ArrayList<>(); NumberFormat numberFormat = NumberFormat.getInstance(); - numberFormat.setMaximumFractionDigits(NumConstant.FOUR); + numberFormat.setMaximumFractionDigits(NumConstant.THREE); //入参有日期的则按具体时间执行,没有的则按当前时间前一天执行 if (StringUtils.isBlank(formDTO.getDateId())) { From 58d051118469ff6aa3b7890888ad403c876676ae Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Tue, 18 May 2021 16:13:37 +0800 Subject: [PATCH 032/128] =?UTF-8?q?=E8=BD=AC=E8=AE=AE=E9=A2=98=E8=AF=9D?= =?UTF-8?q?=E9=A2=98=E4=B8=8D=E5=85=81=E8=AE=B8=E5=B1=8F=E8=94=BD=E6=88=96?= =?UTF-8?q?=E5=85=B3=E9=97=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../commons/tools/exception/EpmetErrorCode.java | 1 + .../topic/service/impl/ResiTopicServiceImpl.java | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java index b7b70c5159..a38c4cbb0e 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java @@ -150,6 +150,7 @@ public enum EpmetErrorCode { TOPIC_ALREADY_SHIFTED_TO_ISSUE(9005,"该话题已被转为议题,请勿重复操作"), TOPIC_IS_HIDDEN(9006,"该话题已被屏蔽,请先解除屏蔽"), TOPIC_IS_CLOSED(9008,"该话题已关闭,无法转为议题"), + TOPIC_SHIFT_ISSUE(9008,"该话题已转议题,不允许关闭或屏蔽"), CUSTOMER_CATEGORY(9101,"分类已使用,不允许删除"), CATEGORY_NAME(9102,"分类名称已存在,不允许重复"), diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java index ec51f04815..abf3c2a315 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java @@ -630,6 +630,12 @@ public class ResiTopicServiceImpl extends BaseServiceImpl Date: Tue, 18 May 2021 16:25:04 +0800 Subject: [PATCH 033/128] =?UTF-8?q?=E5=85=9A=E5=91=98=E5=85=88=E9=94=8B?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=B1=95=E7=A4=BA=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/dataaggre/constant/OrgConstant.java | 2 + .../form/PartyMemberVanguardFormDTO.java | 18 ++ .../PartyMemberVanguardDetailResultDTO.java | 74 ++++++++ .../PartyMemberVanguardRankResultDTO.java | 18 ++ .../PartyMemberVanguardController.java | 51 +++++ .../dataaggre/dao/datastats/DataStatsDao.java | 36 ++++ .../service/datastats/DataStatsService.java | 19 ++ .../datastats/impl/DataStatsServiceImpl.java | 68 +++++++ .../mapper/datastats/DatsStatsDao.xml | 174 ++++++++++++++++++ .../com/epmet/controller/DemoController.java | 2 +- .../StatsPartyMemberVanguardServiceImpl.java | 50 ++--- .../extract/FactOriginProjectMainDailyDao.xml | 4 + 12 files changed, 490 insertions(+), 26 deletions(-) create mode 100644 epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/PartyMemberVanguardFormDTO.java create mode 100644 epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/PartyMemberVanguardDetailResultDTO.java create mode 100644 epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/PartyMemberVanguardRankResultDTO.java create mode 100644 epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/PartyMemberVanguardController.java diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/constant/OrgConstant.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/constant/OrgConstant.java index 987c2a2697..a7da3d564b 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/constant/OrgConstant.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/constant/OrgConstant.java @@ -5,4 +5,6 @@ package com.epmet.dataaggre.constant; * @DateTime 2020/12/25 上午10:55 */ public interface OrgConstant { + String AGENCY = "agency"; + String GRID = "grid"; } diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/PartyMemberVanguardFormDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/PartyMemberVanguardFormDTO.java new file mode 100644 index 0000000000..2b70bbeaa0 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/PartyMemberVanguardFormDTO.java @@ -0,0 +1,18 @@ +package com.epmet.dataaggre.dto.datastats.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2021/5/18 14:25 + */ +@Data +public class PartyMemberVanguardFormDTO implements Serializable { + private static final long serialVersionUID = -4331281350678714877L; + private String agencyId; + private String orgId; + private String orgType; +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/PartyMemberVanguardDetailResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/PartyMemberVanguardDetailResultDTO.java new file mode 100644 index 0000000000..929178031d --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/PartyMemberVanguardDetailResultDTO.java @@ -0,0 +1,74 @@ +package com.epmet.dataaggre.dto.datastats.result; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * @author zhaoqifeng + * @dscription + * @date 2021/5/18 14:27 + */ +@NoArgsConstructor +@Data +public class PartyMemberVanguardDetailResultDTO implements Serializable { + private static final long serialVersionUID = 8315392246739995430L; + /** + * 组织ID + */ + private String orgId; + /** + * 组织名 + */ + private String orgName; + /** + * 党员建组数 + */ + private Integer groupCount; + /** + * 党员建组数占比 + */ + private BigDecimal groupRatio; + /** + * 组内党员人数 + */ + private Integer groupMemberCount; + /** + * 组内党员人数占比 + */ + private BigDecimal groupMemberRatio; + /** + * 党员发布话题数 + */ + private Integer topicCount; + /** + * 党员发布话题数占比 + */ + private BigDecimal topicRatio; + /** + * 党员发布话题转议题数 + */ + private Integer issueCount; + /** + * 党员发布话题转议题数占比 + */ + private BigDecimal issueRatio; + /** + * 党员发布话题转项目数 + */ + private Integer projectCount; + /** + * 党员发布话题转项目数占比 + */ + private BigDecimal projectRatio; + /** + * 党员发布话题转项目结案数 + */ + private Integer projectClosedCount; + /** + * 党员发布话题转项目结案数占比 + */ + private BigDecimal projectClosedRatio; +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/PartyMemberVanguardRankResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/PartyMemberVanguardRankResultDTO.java new file mode 100644 index 0000000000..9d2f643229 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/PartyMemberVanguardRankResultDTO.java @@ -0,0 +1,18 @@ +package com.epmet.dataaggre.dto.datastats.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @author zhaoqifeng + * @dscription + * @date 2021/5/18 14:30 + */ +@Data +public class PartyMemberVanguardRankResultDTO implements Serializable { + private static final long serialVersionUID = -3103242333633668412L; + private List agencyRank; + private List gridRank; +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/PartyMemberVanguardController.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/PartyMemberVanguardController.java new file mode 100644 index 0000000000..6acf23d69e --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/PartyMemberVanguardController.java @@ -0,0 +1,51 @@ +package com.epmet.dataaggre.controller; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.dataaggre.dto.datastats.form.PartyMemberVanguardFormDTO; +import com.epmet.dataaggre.dto.datastats.result.PartyMemberVanguardDetailResultDTO; +import com.epmet.dataaggre.dto.datastats.result.PartyMemberVanguardRankResultDTO; +import com.epmet.dataaggre.service.datastats.DataStatsService; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import javax.annotation.Resource; + +/** + * @author zhaoqifeng + * @dscription + * @date 2021/5/18 14:19 + */ +@RestController +@RequestMapping("vanguard") +public class PartyMemberVanguardController { + @Resource + private DataStatsService dataStatsService; + + /** + * 党员先锋--组织/网格详情 + * @author zhaoqifeng + * @date 2021/5/18 15:16 + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + */ + @PostMapping("detail") + public Result vanguardDetail(@RequestBody PartyMemberVanguardFormDTO formDTO) { + PartyMemberVanguardDetailResultDTO result = dataStatsService.vanguardDetail(formDTO); + return new Result().ok(result); + } + + /** + * 党员先锋--下级组织排行 + * @author zhaoqifeng + * @date 2021/5/18 15:16 + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + */ + @PostMapping("orgrank") + public Result vanguardRank(@RequestBody PartyMemberVanguardFormDTO formDTO) { + PartyMemberVanguardRankResultDTO result = dataStatsService.vanguardRank(formDTO); + return new Result().ok(result); + } +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/datastats/DataStatsDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/datastats/DataStatsDao.java index d84e733e50..d6729152b5 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/datastats/DataStatsDao.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/datastats/DataStatsDao.java @@ -172,4 +172,40 @@ public interface DataStatsDao { */ List getSubGridProject(@Param("gridIds") List gridIds, @Param("dateId") String dateId); + /** + * 查询组织党员先锋详情 + * @author zhaoqifeng + * @date 2021/5/18 14:40 + * @param agencyId + * @return com.epmet.dataaggre.dto.datastats.result.PartyMemberVanguardDetailResultDTO + */ + PartyMemberVanguardDetailResultDTO selectAgencyVanguardDetail(@Param("agencyId") String agencyId); + + /** + * 查询网格党员先锋详情 + * @author zhaoqifeng + * @date 2021/5/18 14:40 + * @param grid + * @return com.epmet.dataaggre.dto.datastats.result.PartyMemberVanguardDetailResultDTO + */ + PartyMemberVanguardDetailResultDTO selectGridVanguardDetail(@Param("grid") String grid); + + /** + * 查询组织党员先锋排行 + * @author zhaoqifeng + * @date 2021/5/18 15:02 + * @param agencyId + * @return java.util.List + */ + List selectAgencyVanguardRank(@Param("agencyId") String agencyId); + + /** + * 查询网格党员先锋排行 + * @author zhaoqifeng + * @date 2021/5/18 15:03 + * @param agencyId + * @return java.util.List + */ + List selectGridVanguardRank(@Param("agencyId") String agencyId); + } \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/DataStatsService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/DataStatsService.java index 256aaeb15c..282a2d8f8a 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/DataStatsService.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/DataStatsService.java @@ -1,6 +1,7 @@ package com.epmet.dataaggre.service.datastats; import com.epmet.dataaggre.dto.datastats.form.AgenctBasicDataFormDTO; +import com.epmet.dataaggre.dto.datastats.form.PartyMemberVanguardFormDTO; import com.epmet.dataaggre.dto.datastats.form.GridBasicDataFormDTO; import com.epmet.dataaggre.dto.datastats.form.SubAgencyFormDTO; import com.epmet.dataaggre.dto.datastats.form.SubGridFormDTO; @@ -100,4 +101,22 @@ public interface DataStatsService { */ List subGridProject(SubGridFormDTO formDTO); + /** + * 党员先锋--组织/网格详情 + * @author zhaoqifeng + * @date 2021/5/18 14:35 + * @param formDTO + * @return com.epmet.dataaggre.dto.datastats.result.PartyMemberVanguardDetailResultDTO + */ + PartyMemberVanguardDetailResultDTO vanguardDetail(PartyMemberVanguardFormDTO formDTO); + + /** + * 党员先锋--下级组织排行 + * @author zhaoqifeng + * @date 2021/5/18 14:36 + * @param formDTO + * @return com.epmet.dataaggre.dto.datastats.result.PartyMemberVanguardDetailResultDTO + */ + PartyMemberVanguardRankResultDTO vanguardRank(PartyMemberVanguardFormDTO formDTO); + } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java index f8ddfde557..2fdbdc353e 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java @@ -4,8 +4,10 @@ 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.dataaggre.constant.DataSourceConstant; +import com.epmet.dataaggre.constant.OrgConstant; import com.epmet.dataaggre.dao.datastats.DataStatsDao; import com.epmet.dataaggre.dto.datastats.form.AgenctBasicDataFormDTO; +import com.epmet.dataaggre.dto.datastats.form.PartyMemberVanguardFormDTO; import com.epmet.dataaggre.dto.datastats.form.GridBasicDataFormDTO; import com.epmet.dataaggre.dto.datastats.form.SubAgencyFormDTO; import com.epmet.dataaggre.dto.datastats.form.SubGridFormDTO; @@ -14,11 +16,13 @@ import com.epmet.dataaggre.entity.datastats.DimAgencyEntity; import com.epmet.dataaggre.entity.datastats.DimGridEntity; import com.epmet.dataaggre.service.datastats.DataStatsService; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.math.BigDecimal; +import java.math.RoundingMode; import java.text.NumberFormat; import java.text.SimpleDateFormat; import java.util.*; @@ -920,4 +924,68 @@ public class DataStatsServiceImpl implements DataStatsService { return resultList; } + /** + * 党员先锋--组织/网格详情 + * + * @param formDTO + * @return com.epmet.dataaggre.dto.datastats.result.PartyMemberVanguardDetailResultDTO + * @author zhaoqifeng + * @date 2021/5/18 14:35 + */ + @Override + public PartyMemberVanguardDetailResultDTO vanguardDetail(PartyMemberVanguardFormDTO formDTO) { + PartyMemberVanguardDetailResultDTO result; + if (OrgConstant.AGENCY.equals(formDTO.getOrgType())) { + result = dataStatsDao.selectAgencyVanguardDetail(formDTO.getOrgId()); + } else { + result = dataStatsDao.selectGridVanguardDetail(formDTO.getOrgId()); + } + result.setGroupRatio(transform(result.getGroupRatio())); + result.setGroupMemberRatio(transform(result.getGroupMemberRatio())); + result.setTopicRatio(transform(result.getTopicRatio())); + result.setIssueRatio(transform(result.getIssueRatio())); + result.setProjectRatio(transform(result.getProjectRatio())); + result.setProjectClosedRatio(transform(result.getProjectClosedRatio())); + return result; + } + + /** + * 党员先锋--下级组织排行 + * + * @param formDTO + * @return com.epmet.dataaggre.dto.datastats.result.PartyMemberVanguardDetailResultDTO + * @author zhaoqifeng + * @date 2021/5/18 14:36 + */ + @Override + public PartyMemberVanguardRankResultDTO vanguardRank(PartyMemberVanguardFormDTO formDTO) { + List agencyRank = dataStatsDao.selectAgencyVanguardRank(formDTO.getAgencyId()); + List gridRank = dataStatsDao.selectGridVanguardRank(formDTO.getAgencyId()); + PartyMemberVanguardRankResultDTO result = new PartyMemberVanguardRankResultDTO(); + result.setAgencyRank(CollectionUtils.isNotEmpty(agencyRank)?agencyRank:Collections.emptyList()); + result.setGridRank(CollectionUtils.isNotEmpty(gridRank)?gridRank:Collections.emptyList()); + result.getAgencyRank().forEach(item -> { + item.setGroupRatio(transform(item.getGroupRatio())); + item.setGroupMemberRatio(transform(item.getGroupMemberRatio())); + item.setTopicRatio(transform(item.getTopicRatio())); + item.setIssueRatio(transform(item.getIssueRatio())); + item.setProjectRatio(transform(item.getProjectRatio())); + item.setProjectClosedRatio(transform(item.getProjectClosedRatio())); + }); + result.getGridRank().forEach(item -> { + item.setGroupRatio(transform(item.getGroupRatio())); + item.setGroupMemberRatio(transform(item.getGroupMemberRatio())); + item.setTopicRatio(transform(item.getTopicRatio())); + item.setIssueRatio(transform(item.getIssueRatio())); + item.setProjectRatio(transform(item.getProjectRatio())); + item.setProjectClosedRatio(transform(item.getProjectClosedRatio())); + }); + return result; + } + + private BigDecimal transform(BigDecimal count) { + return count.multiply(new BigDecimal(NumConstant.ONE_HUNDRED) ).setScale(NumConstant.ONE, + RoundingMode.HALF_UP); + } + } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml index 4096010837..ffaeff4e5d 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml @@ -356,5 +356,179 @@ ORDER BY project_total DESC + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java index 018dc35102..644830e3a2 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 @@ -878,7 +878,7 @@ public class DemoController { } @PostMapping("vanguard") - public Result partyMemberVanguard(StatsFormDTO formDTO) { + public Result partyMemberVanguard(@RequestBody StatsFormDTO formDTO) { statsPartyMemberVanguardService.agencyStats(formDTO); statsPartyMemberVanguardService.gridStats(formDTO); return new Result(); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsPartyMemberVanguardServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsPartyMemberVanguardServiceImpl.java index 080a168591..7147774894 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsPartyMemberVanguardServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsPartyMemberVanguardServiceImpl.java @@ -146,9 +146,9 @@ public class StatsPartyMemberVanguardServiceImpl implements StatsPartyMemberVang vanguardList.forEach(item -> { OrgStatisticsResultDTO dto = topicStatic.get(item.getAgencyId()); if (null != dto) { - item.setGroupMemberCount(dto.getCount()); - item.setGroupMemberRatio(dto.getRatio()); - item.setGroupMemberTotal(dto.getSum()); + item.setTopicCount(dto.getCount()); + item.setTopicRatio(dto.getRatio()); + item.setTopicTotal(dto.getSum()); } }); } @@ -159,9 +159,9 @@ public class StatsPartyMemberVanguardServiceImpl implements StatsPartyMemberVang vanguardList.forEach(item -> { OrgStatisticsResultDTO dto = issueStatic.get(item.getAgencyId()); if (null != dto) { - item.setGroupMemberCount(dto.getCount()); - item.setGroupMemberRatio(dto.getRatio()); - item.setGroupMemberTotal(dto.getSum()); + item.setIssueCount(dto.getCount()); + item.setIssueRatio(dto.getRatio()); + item.setIssueTotal(dto.getSum()); } }); } @@ -172,9 +172,9 @@ public class StatsPartyMemberVanguardServiceImpl implements StatsPartyMemberVang vanguardList.forEach(item -> { OrgStatisticsResultDTO dto = projectStatic.get(item.getAgencyId()); if (null != dto) { - item.setGroupMemberCount(dto.getCount()); - item.setGroupMemberRatio(dto.getRatio()); - item.setGroupMemberTotal(dto.getSum()); + item.setProjectCount(dto.getCount()); + item.setProjectRatio(dto.getRatio()); + item.setProjectTotal(dto.getSum()); } }); } @@ -185,9 +185,9 @@ public class StatsPartyMemberVanguardServiceImpl implements StatsPartyMemberVang vanguardList.forEach(item -> { OrgStatisticsResultDTO dto = closedStatic.get(item.getAgencyId()); if (null != dto) { - item.setGroupMemberCount(dto.getCount()); - item.setGroupMemberRatio(dto.getRatio()); - item.setGroupMemberTotal(dto.getSum()); + item.setProjectClosedCount(dto.getCount()); + item.setProjectClosedRatio(dto.getRatio()); + item.setProjectClosedTotal(dto.getSum()); } }); } @@ -214,7 +214,7 @@ public class StatsPartyMemberVanguardServiceImpl implements StatsPartyMemberVang } //入参有客户Id的则按客户Id执行,没有的则全部客户都执行 if (null != formDTO && StringUtils.isNotBlank(formDTO.getCustomerId())) { - customerAgencyStats(formDTO.getCustomerId(), date); + customerGridStats(formDTO.getCustomerId(), date); } else { int pageNo = 1; int pageSize = 100; @@ -282,9 +282,9 @@ public class StatsPartyMemberVanguardServiceImpl implements StatsPartyMemberVang vanguardList.forEach(item -> { OrgStatisticsResultDTO dto = topicStatic.get(item.getGridId()); if (null != dto) { - item.setGroupMemberCount(dto.getCount()); - item.setGroupMemberRatio(dto.getRatio()); - item.setGroupMemberTotal(dto.getSum()); + item.setTopicCount(dto.getCount()); + item.setTopicRatio(dto.getRatio()); + item.setTopicTotal(dto.getSum()); } }); } @@ -295,9 +295,9 @@ public class StatsPartyMemberVanguardServiceImpl implements StatsPartyMemberVang vanguardList.forEach(item -> { OrgStatisticsResultDTO dto = issueStatic.get(item.getGridId()); if (null != dto) { - item.setGroupMemberCount(dto.getCount()); - item.setGroupMemberRatio(dto.getRatio()); - item.setGroupMemberTotal(dto.getSum()); + item.setIssueCount(dto.getCount()); + item.setIssueRatio(dto.getRatio()); + item.setIssueTotal(dto.getSum()); } }); } @@ -308,9 +308,9 @@ public class StatsPartyMemberVanguardServiceImpl implements StatsPartyMemberVang vanguardList.forEach(item -> { OrgStatisticsResultDTO dto = projectStatic.get(item.getGridId()); if (null != dto) { - item.setGroupMemberCount(dto.getCount()); - item.setGroupMemberRatio(dto.getRatio()); - item.setGroupMemberTotal(dto.getSum()); + item.setProjectCount(dto.getCount()); + item.setProjectRatio(dto.getRatio()); + item.setProjectTotal(dto.getSum()); } }); } @@ -321,9 +321,9 @@ public class StatsPartyMemberVanguardServiceImpl implements StatsPartyMemberVang vanguardList.forEach(item -> { OrgStatisticsResultDTO dto = closedStatic.get(item.getGridId()); if (null != dto) { - item.setGroupMemberCount(dto.getCount()); - item.setGroupMemberRatio(dto.getRatio()); - item.setGroupMemberTotal(dto.getSum()); + item.setProjectClosedCount(dto.getCount()); + item.setProjectClosedRatio(dto.getRatio()); + item.setProjectClosedTotal(dto.getSum()); } }); } 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 92fe50a99c..dc6b766fb7 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 @@ -769,6 +769,7 @@ FROM fact_origin_project_main_daily WHERE CUSTOMER_ID = #{customerId} AND DATE_ID <= #{dateId} + AND ORIGIN = 'issue' GROUP BY AGENCY_ID From e8cfbdfbd77b6ee72a07859750ec22490a3ebd8b Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Tue, 18 May 2021 16:27:32 +0800 Subject: [PATCH 034/128] =?UTF-8?q?=E5=85=9A=E5=91=98=E5=85=88=E9=94=8B?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=B1=95=E7=A4=BA=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/feign/DataStatisticalOpenFeignClient.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 e6a46879f4..dfafe94a1e 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 @@ -244,7 +244,7 @@ public interface DataStatisticalOpenFeignClient { * @return com.epmet.commons.tools.utils.Result */ @PostMapping("/data/stats/vanguard/agencyvanguardstats") - Result agencyVanguardStats(StatsFormDTO formDTO); + Result agencyVanguardStats(@RequestBody StatsFormDTO formDTO); /** * 党员先锋统计-网格 @@ -254,6 +254,6 @@ public interface DataStatisticalOpenFeignClient { * @return com.epmet.commons.tools.utils.Result */ @PostMapping("/data/stats/vanguard/gridvanguardstats") - Result gridVanguardStats(StatsFormDTO formDTO); + Result gridVanguardStats(@RequestBody StatsFormDTO formDTO); } From 28da367a68a2d06545134c9564c7b46f695e1dd4 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 18 May 2021 16:57:06 +0800 Subject: [PATCH 035/128] =?UTF-8?q?=E6=94=AF=E9=83=A8=E5=BB=BA=E8=AE=BE?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3v1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/datastats/FactGroupActDailyDTO.java | 96 +++++++++++ .../dto/resigroup/ActCategoryDictDTO.java | 76 +++++++++ .../form/BranchConAnalysisFormDTO.java | 42 +++++ .../form/GroupActCategoryQueryFormDTO.java | 32 ++++ .../form/SubAnalysisByCodeFormDTO.java | 44 +++++ .../result/BranchConAnalysisDetailDTO.java | 20 +++ .../result/BranchConAnalysisResultDTO.java | 37 +++++ .../resigroup/result/OrgInfoCommonDTO.java | 20 +++ .../result/SubAnalysisByCodeResultDTO.java | 30 ++++ .../controller/GroupActController.java | 74 +++++++++ .../dataaggre/dao/datastats/DataStatsDao.java | 11 ++ .../dao/govorg/CustomerAgencyDao.java | 3 + .../dataaggre/dao/resigroup/ResiGroupDao.java | 5 +- .../service/datastats/DataStatsService.java | 5 + .../datastats/impl/DataStatsServiceImpl.java | 11 ++ .../service/govorg/GovOrgService.java | 3 + .../govorg/impl/GovOrgServiceImpl.java | 26 +++ .../service/resigroup/ResiGroupService.java | 31 +++- .../resigroup/impl/ResiGroupServiceImpl.java | 156 +++++++++++++++++- .../mapper/datastats/DatsStatsDao.xml | 47 ++++++ .../mapper/govorg/CustomerAgencyDao.xml | 14 ++ .../mapper/resigroup/ResiGroupDao.xml | 13 ++ 22 files changed, 792 insertions(+), 4 deletions(-) create mode 100644 epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/FactGroupActDailyDTO.java create mode 100644 epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/ActCategoryDictDTO.java create mode 100644 epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/form/BranchConAnalysisFormDTO.java create mode 100644 epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/form/GroupActCategoryQueryFormDTO.java create mode 100644 epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/form/SubAnalysisByCodeFormDTO.java create mode 100644 epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/result/BranchConAnalysisDetailDTO.java create mode 100644 epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/result/BranchConAnalysisResultDTO.java create mode 100644 epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/result/OrgInfoCommonDTO.java create mode 100644 epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/result/SubAnalysisByCodeResultDTO.java create mode 100644 epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/GroupActController.java diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/FactGroupActDailyDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/FactGroupActDailyDTO.java new file mode 100644 index 0000000000..a4f834fbb2 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/FactGroupActDailyDTO.java @@ -0,0 +1,96 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dataaggre.dto.datastats; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 组织活动(参加人数、组织次数、平均参加人数)按天累计值分析 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-13 + */ +@Data +public class FactGroupActDailyDTO implements Serializable { + + private static final long serialVersionUID = 4411632223804355342L; + /** + * 客户ID + */ + private String customerId; + + /** + * 数据更新至日期Id:yyyyMMdd + */ + private String dateId; + + /** + * 网格id + */ + private String orgId; + + /** + * 网格:grid;组织:agency + */ + private String orgType; + + /** + * 1)orgType=grid: pid=网格所属组织id; +2)orgType=agency: pid=当前组织的上级组织 + */ + private String pid; + + /** + * 1)orgType=grid: pids=网格所有上级组织,包括pid; +2)orgType=agency: pids=当前组织的所有上级组织,包括pid. + */ + private String pids; + + /** + * 活动分类编码 + */ + private String categoryCode; + + /** + * 上级分类编码 + */ + private String parentCode; + + /** + * 分类等级 + */ + private Integer level; + + /** + * 截止到dateId: 组织次数;包含dateId这一天的数据 + */ + private Integer organizeTotal; + + /** + * 截止到dateId: 参加人数;包含dateId这一天的数据 + */ + private Integer participateUserTotal; + + /** + * 截止到dateId: 平均参加人数;包含dateId这一天的数据 + */ + private Integer avgParticipateUserTotal; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/ActCategoryDictDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/ActCategoryDictDTO.java new file mode 100644 index 0000000000..3cee85b0bd --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/ActCategoryDictDTO.java @@ -0,0 +1,76 @@ +/** + * 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.dataaggre.dto.resigroup; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; + + +/** + * 活动类别字典 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-04-16 + */ +@Data +public class ActCategoryDictDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + @JsonIgnore + private String id; + + /** + * 客户id + */ + @JsonIgnore + private String customerId; + + /** + * 类别编码 + */ + private String categoryCode; + + /** + * 活动类别名称;eg:支部建设、联建共建 + */ + private String categoryName; + + /** + * 等级1,2...... + */ + @JsonIgnore + private Integer level; + + /** + * 排序 + */ + @JsonIgnore + private Integer sort; + + /** + * 上级类别编码 + */ + @JsonIgnore + private String parentCode; +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/form/BranchConAnalysisFormDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/form/BranchConAnalysisFormDTO.java new file mode 100644 index 0000000000..7090008a4f --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/form/BranchConAnalysisFormDTO.java @@ -0,0 +1,42 @@ +package com.epmet.dataaggre.dto.resigroup.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 001、【支建+联建】统计分析 入参 + * + * @author yinzuomei@elink-cn.com + * @date 2021/5/18 9:16 + */ +@Data +public class BranchConAnalysisFormDTO implements Serializable { + public interface AddUserInternalGroup { + } + + /** + * 支部建设:100;联建共建:101 + */ + @NotBlank(message = "firstCategoryCode必传,支部建设:100;联建共建:101", groups = AddUserInternalGroup.class) + private String firstCategoryCode; + + /** + * 当前客户id + */ + @NotBlank(message = "客户id不能为空", groups = AddUserInternalGroup.class) + private String customerId; + + /** + * 当前组织或者网格id + */ + @NotBlank(message = "orgId不能为空", groups = AddUserInternalGroup.class) + private String orgId; + + /** + * 默认传组织:agency; 网格:grid + */ + @NotBlank(message = "orgType不能为空", groups = AddUserInternalGroup.class) + private String orgType; +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/form/GroupActCategoryQueryFormDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/form/GroupActCategoryQueryFormDTO.java new file mode 100644 index 0000000000..63bb6b1771 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/form/GroupActCategoryQueryFormDTO.java @@ -0,0 +1,32 @@ +package com.epmet.dataaggre.dto.resigroup.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 002、【支建+联建】二级分类字典查询 入参 + * + * @author yinzuomei@elink-cn.com + * @date 2021/5/18 13:42 + */ +@Data +public class GroupActCategoryQueryFormDTO implements Serializable { + private static final long serialVersionUID = 8373780230315448396L; + + public interface AddUserInternalGroup { + } + + /** + * 支部建设:100;联建共建:101 + */ + @NotBlank(message = "firstCategoryCode必传,支部建设:100;联建共建:101", groups = AddUserInternalGroup.class) + private String firstCategoryCode; + + /** + * 当前客户id + */ + @NotBlank(message = "客户id不能为空", groups = BranchConAnalysisFormDTO.AddUserInternalGroup.class) + private String customerId; +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/form/SubAnalysisByCodeFormDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/form/SubAnalysisByCodeFormDTO.java new file mode 100644 index 0000000000..5f92ede5cb --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/form/SubAnalysisByCodeFormDTO.java @@ -0,0 +1,44 @@ +package com.epmet.dataaggre.dto.resigroup.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 003、【支建+联建】下级组织折线图 入参 + * + * @author yinzuomei@elink-cn.com + * @date 2021/5/18 13:52 + */ +@Data +public class SubAnalysisByCodeFormDTO implements Serializable { + private static final long serialVersionUID = -4132250208377993452L; + + public interface AddUserInternalGroup { + } + + /** + * 分类编码;002接口返回的 + */ + @NotBlank(message = "categoryCode不能为空", groups = AddUserInternalGroup.class) + private String categoryCode; + + /** + * 当前客户id + */ + @NotBlank(message = "客户id不能为空", groups = AddUserInternalGroup.class) + private String customerId; + + /** + * 当前组织或者网格id + */ + @NotBlank(message = "orgId不能为空", groups = AddUserInternalGroup.class) + private String orgId; + + /** + * 默认传组织:agency; 网格:grid + */ + @NotBlank(message = "orgType不能为空", groups = AddUserInternalGroup.class) + private String orgType; +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/result/BranchConAnalysisDetailDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/result/BranchConAnalysisDetailDTO.java new file mode 100644 index 0000000000..da57f1f74f --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/result/BranchConAnalysisDetailDTO.java @@ -0,0 +1,20 @@ +package com.epmet.dataaggre.dto.resigroup.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 001、【支建+联建】统计分析 返参 + * + * @author yinzuomei@elink-cn.com + * @date 2021/5/18 15:12 + */ +@Data +public class BranchConAnalysisDetailDTO implements Serializable { + private String name; + private String type; + private Integer value; + private Integer avg; + private String categoryCode; +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/result/BranchConAnalysisResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/result/BranchConAnalysisResultDTO.java new file mode 100644 index 0000000000..7b25d8d8fc --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/result/BranchConAnalysisResultDTO.java @@ -0,0 +1,37 @@ +package com.epmet.dataaggre.dto.resigroup.result; + +import com.epmet.commons.tools.constant.NumConstant; +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +/** + * 001、【支建+联建】统计分析 返参 + * + * @author yinzuomei@elink-cn.com + * @date 2021/5/18 10:01 + */ +@Data +public class BranchConAnalysisResultDTO implements Serializable { + private static final long serialVersionUID = -4998343002705222898L; + + /** + * 组织活动次数 + */ + private Integer organizeTotal; + + /** + * 参加活动人数 + */ + private Integer participateUserTotal; + + private List dataList; + + public BranchConAnalysisResultDTO() { + this.organizeTotal = NumConstant.ZERO; + this.participateUserTotal = NumConstant.ZERO; + this.dataList=new ArrayList<>(); + } +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/result/OrgInfoCommonDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/result/OrgInfoCommonDTO.java new file mode 100644 index 0000000000..79b6460be4 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/result/OrgInfoCommonDTO.java @@ -0,0 +1,20 @@ +package com.epmet.dataaggre.dto.resigroup.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 组织或者网格基本信息 + * + * @author yinzuomei@elink-cn.com + * @date 2021/5/18 14:36 + */ +@Data +public class OrgInfoCommonDTO implements Serializable { + private static final long serialVersionUID = -2191521364070476999L; + + private String orgId; + private String orgName; + private String orgType; +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/result/SubAnalysisByCodeResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/result/SubAnalysisByCodeResultDTO.java new file mode 100644 index 0000000000..4b4ec0fe06 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/result/SubAnalysisByCodeResultDTO.java @@ -0,0 +1,30 @@ +package com.epmet.dataaggre.dto.resigroup.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 003、【支建+联建】下级组织折线图 返参 + * + * @author yinzuomei@elink-cn.com + * @date 2021/5/18 14:09 + */ +@Data +public class SubAnalysisByCodeResultDTO implements Serializable { + private static final long serialVersionUID = -6025482721295705372L; + + /** + * 横坐标名称:组织名或者网格名 + */ + private String name; + + /** + * 参加人数、组织次数、平均参加人数 + */ + private String type; + + private Integer value; + + private String orgId; +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/GroupActController.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/GroupActController.java new file mode 100644 index 0000000000..487b938fbc --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/GroupActController.java @@ -0,0 +1,74 @@ +package com.epmet.dataaggre.controller; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.dataaggre.dto.resigroup.ActCategoryDictDTO; +import com.epmet.dataaggre.dto.resigroup.form.BranchConAnalysisFormDTO; +import com.epmet.dataaggre.dto.resigroup.form.GroupActCategoryQueryFormDTO; +import com.epmet.dataaggre.dto.resigroup.form.SubAnalysisByCodeFormDTO; +import com.epmet.dataaggre.dto.resigroup.result.BranchConAnalysisResultDTO; +import com.epmet.dataaggre.dto.resigroup.result.SubAnalysisByCodeResultDTO; +import com.epmet.dataaggre.service.resigroup.ResiGroupService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + +/** + * 专项组-组织活动相关API放这 + * + * @author yinzuomei@elink-cn.com + * @date 2021/5/18 9:08 + */ +@RestController +@RequestMapping("groupact") +public class GroupActController { + + @Autowired + private ResiGroupService resiGroupService; + + + /** + * @return com.epmet.commons.tools.utils.Result + * @param formDTO + * @author yinzuomei + * @description 001、【支建+联建】统计分析 + * @Date 2021/5/18 10:17 + **/ + @PostMapping("branchconanalysis") + public Result branchConAnalysis(@RequestBody BranchConAnalysisFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO,BranchConAnalysisFormDTO.AddUserInternalGroup.class); + return new Result().ok(resiGroupService.branchConAnalysis(formDTO)); + } + + /** + * @return com.epmet.commons.tools.utils.Result> + * @param formDTO + * @author yinzuomei + * @description 002、【支建+联建】二级分类字典查询 + * @Date 2021/5/18 13:49 + **/ + @PostMapping("categorydictlist") + public Result> queryCategoryDictList(@RequestBody GroupActCategoryQueryFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO,GroupActCategoryQueryFormDTO.AddUserInternalGroup.class); + return new Result>().ok(resiGroupService.queryActCategoryDictList(formDTO.getCustomerId(),formDTO.getFirstCategoryCode())); + } + + + /** + * @return com.epmet.commons.tools.utils.Result + * @param formDTO + * @author yinzuomei + * @description 003、【支建+联建】下级组织折线图 + * @Date 2021/5/18 14:31 + **/ + @PostMapping("subanalysisbycode") + public Result> querySubAnalysisByCode(@RequestBody SubAnalysisByCodeFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO,GroupActCategoryQueryFormDTO.AddUserInternalGroup.class); + return new Result>().ok(resiGroupService.querySubAnalysisByCode(formDTO)); + } + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/datastats/DataStatsDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/datastats/DataStatsDao.java index c96b053cba..4f9ee94c72 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/datastats/DataStatsDao.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/datastats/DataStatsDao.java @@ -17,6 +17,7 @@ package com.epmet.dataaggre.dao.datastats; +import com.epmet.dataaggre.dto.datastats.FactGroupActDailyDTO; import com.epmet.dataaggre.dto.datastats.form.SubAgencyFormDTO; import com.epmet.dataaggre.dto.datastats.form.SubGridFormDTO; import com.epmet.dataaggre.dto.datastats.result.*; @@ -154,4 +155,14 @@ public interface DataStatsDao { */ List getSubGridProject(@Param("gridIds") List gridIds, @Param("dateId") String dateId); + List branchConAnalysis(@Param("customerId")String customerId, + @Param("orgId")String orgId, + @Param("orgType")String orgType, + @Param("dateId")String dateId, + @Param("parentCode")String parentCode); + + List querySubAnalysisByCode(@Param("customerId")String customerId, + @Param("pid")String pid, + @Param("dateId")String dateId, + @Param("categoryCode")String categoryCode); } \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerAgencyDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerAgencyDao.java index fc33ce00bb..7d705c2aa3 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerAgencyDao.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerAgencyDao.java @@ -49,4 +49,7 @@ public interface CustomerAgencyDao extends BaseDao { String getAgencyIdByUserId(@Param("userId") String userId); List selectUsedAreaCodeList(@Param("parentAreaCode") String parentAreaCode); + + + List selectNextAgency(@Param("customerId")String customerId, @Param("pid")String pid); } \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/resigroup/ResiGroupDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/resigroup/ResiGroupDao.java index f297a4f82f..0632f8bbf8 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/resigroup/ResiGroupDao.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/resigroup/ResiGroupDao.java @@ -18,6 +18,7 @@ package com.epmet.dataaggre.dao.resigroup; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dataaggre.dto.resigroup.ActCategoryDictDTO; import com.epmet.dataaggre.dto.resigroup.result.CandidateListResultDTO; import com.epmet.dataaggre.entity.resigroup.ResiGroupEntity; import org.apache.ibatis.annotations.Mapper; @@ -41,5 +42,7 @@ public interface ResiGroupDao extends BaseDao { * @date 2021/3/30 上午10:13 */ List candidateList(@Param("groupId")String groupId); - + + List selectActCategoryDictDTOByPcode(@Param("customerId")String customerId, + @Param("categoryCode")String firstCategoryCode); } \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/DataStatsService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/DataStatsService.java index 6eb826dc8d..1f842209d9 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/DataStatsService.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/DataStatsService.java @@ -1,5 +1,6 @@ package com.epmet.dataaggre.service.datastats; +import com.epmet.dataaggre.dto.datastats.FactGroupActDailyDTO; import com.epmet.dataaggre.dto.datastats.form.AgenctBasicDataFormDTO; import com.epmet.dataaggre.dto.datastats.form.SubAgencyFormDTO; import com.epmet.dataaggre.dto.datastats.form.SubGridFormDTO; @@ -91,4 +92,8 @@ public interface DataStatsService { * @author sun */ List subGridProject(SubGridFormDTO formDTO); + + List branchConAnalysis(String customerId, String orgId, String orgType, String dateId, String parentCode); + + List querySubAnalysisByCode(String customerId, String pid, String dateId, String categoryCode); } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java index 900144795e..d41fd93a24 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java @@ -5,6 +5,7 @@ import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.dataaggre.constant.DataSourceConstant; import com.epmet.dataaggre.dao.datastats.DataStatsDao; +import com.epmet.dataaggre.dto.datastats.FactGroupActDailyDTO; import com.epmet.dataaggre.dto.datastats.form.AgenctBasicDataFormDTO; import com.epmet.dataaggre.dto.datastats.form.SubAgencyFormDTO; import com.epmet.dataaggre.dto.datastats.form.SubGridFormDTO; @@ -811,4 +812,14 @@ public class DataStatsServiceImpl implements DataStatsService { return resultList; } + @Override + public List branchConAnalysis(String customerId, String orgId, String orgType, String dateId, String parentCode) { + return dataStatsDao.branchConAnalysis(customerId,orgId,orgType,dateId,parentCode); + } + + @Override + public List querySubAnalysisByCode(String customerId, String pid, String dateId, String categoryCode) { + return dataStatsDao.querySubAnalysisByCode(customerId,pid,dateId,categoryCode); + } + } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java index 7d9fc8f339..d0780b046d 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java @@ -5,6 +5,7 @@ import com.epmet.dataaggre.dto.govorg.result.AgencyGridResultDTO; import com.epmet.dataaggre.dto.govorg.result.GridInfoResultDTO; import com.epmet.dataaggre.dto.govorg.result.GridsInfoListResultDTO; import com.epmet.dataaggre.dto.govorg.result.NextAreaCodeResultDTO; +import com.epmet.dataaggre.dto.resigroup.result.OrgInfoCommonDTO; import java.util.List; @@ -45,4 +46,6 @@ public interface GovOrgService { String getAgencyIdByUserId(String userId); List queryNextLevelAreaCodeList(NextAreaCodeFormDTO formDTO); + + List queryNextOrgInfoDTO(String customerId, String orgId, String orgType); } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java index b09414f1bd..18ad900fc6 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java @@ -15,6 +15,7 @@ import com.epmet.dataaggre.dto.govorg.result.AgencyGridResultDTO; import com.epmet.dataaggre.dto.govorg.result.GridInfoResultDTO; import com.epmet.dataaggre.dto.govorg.result.GridsInfoListResultDTO; import com.epmet.dataaggre.dto.govorg.result.NextAreaCodeResultDTO; +import com.epmet.dataaggre.dto.resigroup.result.OrgInfoCommonDTO; import com.epmet.dataaggre.entity.govorg.CustomerAgencyEntity; import com.epmet.dataaggre.service.commonservice.AreaCodeService; import com.epmet.dataaggre.service.govorg.GovOrgService; @@ -162,6 +163,31 @@ public class GovOrgServiceImpl implements GovOrgService { return allList; } + @Override + public List queryNextOrgInfoDTO(String customerId, String orgId, String orgType) { + List result=new ArrayList<>(); + if("agency".equals(orgType)){ + List customerAgencyEntityList = customerAgencyDao.selectNextAgency(customerId, orgId); + customerAgencyEntityList.forEach(agencyEntity->{ + OrgInfoCommonDTO agecnyInfo=new OrgInfoCommonDTO(); + agecnyInfo.setOrgId(agencyEntity.getId()); + agecnyInfo.setOrgName(agencyEntity.getOrganizationName()); + agecnyInfo.setOrgType("agency"); + result.add(agecnyInfo); + }); + }else if("grid".equals(orgType)){ + List list= customerGridDao.selectGridListByAgencyId(orgId); + list.forEach(grid->{ + OrgInfoCommonDTO gridInfo=new OrgInfoCommonDTO(); + gridInfo.setOrgId(grid.getGridId()); + gridInfo.setOrgName(grid.getGridName()); + gridInfo.setOrgType("grid"); + result.add(gridInfo); + }); + } + return result; + } + public static void main(String[] args) { List allList = new ArrayList<>(); NextAreaCodeResultDTO m1 = new NextAreaCodeResultDTO(); diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/resigroup/ResiGroupService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/resigroup/ResiGroupService.java index 5b163c4f5d..66c3b991dd 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/resigroup/ResiGroupService.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/resigroup/ResiGroupService.java @@ -1,9 +1,13 @@ package com.epmet.dataaggre.service.resigroup; +import com.epmet.dataaggre.dto.resigroup.ActCategoryDictDTO; import com.epmet.dataaggre.dto.resigroup.ResiTopicDTO; +import com.epmet.dataaggre.dto.resigroup.form.BranchConAnalysisFormDTO; import com.epmet.dataaggre.dto.resigroup.form.CandidateListFormDTO; +import com.epmet.dataaggre.dto.resigroup.form.SubAnalysisByCodeFormDTO; +import com.epmet.dataaggre.dto.resigroup.result.BranchConAnalysisResultDTO; import com.epmet.dataaggre.dto.resigroup.result.CandidateListResultDTO; -import org.apache.ibatis.annotations.Param; +import com.epmet.dataaggre.dto.resigroup.result.SubAnalysisByCodeResultDTO; import java.util.List; @@ -20,4 +24,29 @@ public interface ResiGroupService { */ List candidateList(CandidateListFormDTO formDTO); List selectTopicInfoByIds(List topicIds); + + /** + * 001、【支建+联建】统计分析 + * + * @param formDTO + * @return com.epmet.dataaggre.dto.resigroup.result.BranchConAnalysisResultDTO + */ + BranchConAnalysisResultDTO branchConAnalysis(BranchConAnalysisFormDTO formDTO); + + /** + * 002、【支建+联建】二级分类字典查询 + * + * @param customerId + * @param firstCategoryCode + * @return com.epmet.dataaggre.dto.resigroup.ActCategoryDictDTO + */ + List queryActCategoryDictList(String customerId, String firstCategoryCode); + + /** + * 003、【支建+联建】下级组织折线图 + * + * @param formDTO + * @return com.epmet.dataaggre.dto.resigroup.result.DataCommonDTO + */ + List querySubAnalysisByCode(SubAnalysisByCodeFormDTO formDTO); } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/resigroup/impl/ResiGroupServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/resigroup/impl/ResiGroupServiceImpl.java index 253d42f78b..141158f063 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/resigroup/impl/ResiGroupServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/resigroup/impl/ResiGroupServiceImpl.java @@ -1,17 +1,25 @@ package com.epmet.dataaggre.service.resigroup.impl; import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.tools.constant.Constant; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.utils.DateUtils; import com.epmet.dataaggre.constant.DataSourceConstant; import com.epmet.dataaggre.dao.resigroup.ResiGroupDao; import com.epmet.dataaggre.dao.resigroup.ResiTopicDao; +import com.epmet.dataaggre.dto.datastats.FactGroupActDailyDTO; import com.epmet.dataaggre.dto.epmetuser.result.UserInfosResultDTO; -import com.epmet.dataaggre.dto.resigroup.ResiGroupDTO; +import com.epmet.dataaggre.dto.resigroup.ActCategoryDictDTO; import com.epmet.dataaggre.dto.resigroup.ResiTopicDTO; +import com.epmet.dataaggre.dto.resigroup.form.BranchConAnalysisFormDTO; import com.epmet.dataaggre.dto.resigroup.form.CandidateListFormDTO; -import com.epmet.dataaggre.dto.resigroup.result.CandidateListResultDTO; +import com.epmet.dataaggre.dto.resigroup.form.SubAnalysisByCodeFormDTO; +import com.epmet.dataaggre.dto.resigroup.result.*; import com.epmet.dataaggre.entity.resigroup.ResiGroupEntity; import com.epmet.dataaggre.redis.ResiGroupRedis; +import com.epmet.dataaggre.service.datastats.DataStatsService; import com.epmet.dataaggre.service.epmetuser.EpmetUserService; +import com.epmet.dataaggre.service.govorg.GovOrgService; import com.epmet.dataaggre.service.resigroup.ResiGroupService; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; @@ -22,6 +30,7 @@ import org.springframework.util.CollectionUtils; import java.util.ArrayList; import java.util.List; +import java.util.Map; import java.util.stream.Collectors; /** @@ -40,6 +49,10 @@ public class ResiGroupServiceImpl implements ResiGroupService { private EpmetUserService epmetUserService; @Autowired private ResiGroupRedis resiGroupRedis; + @Autowired + private DataStatsService dataStatsService; + @Autowired + private GovOrgService govOrgService; @Override public List selectTopicInfoByIds(List topicIds) { @@ -92,4 +105,143 @@ public class ResiGroupServiceImpl implements ResiGroupService { showUsers.forEach(u -> result.stream().filter(r -> u.equals(r.getUserId())).forEach(r -> disResult.add(r))); return disResult; } + + + /** + * 001、【支建+联建】统计分析 + * + * @param formDTO + * @return Result + */ + @Override + public BranchConAnalysisResultDTO branchConAnalysis(BranchConAnalysisFormDTO formDTO) { + List categoryList = queryActCategoryDictList(formDTO.getCustomerId(), formDTO.getFirstCategoryCode()); + if (CollectionUtils.isEmpty(categoryList)) { + return new BranchConAnalysisResultDTO(); + } + String dateId = DateUtils.getBeforeNDay(NumConstant.ONE); + List factGroupActDailyDTOList = dataStatsService.branchConAnalysis(formDTO.getCustomerId(), formDTO.getOrgId(), formDTO.getOrgType(), + dateId, formDTO.getFirstCategoryCode()); + /** + * List -> Map + * 需要注意的是: + * toMap 如果集合对象有重复的key,会报错Duplicate key .... * apple1,apple12的id都为1。 + * 可以用 (k1,k2)->k1 来设置,如果有重复的key,则保留key1,舍弃key2 + */ + Map map = factGroupActDailyDTOList.stream().collect(Collectors.toMap(FactGroupActDailyDTO::getCategoryCode, a -> a,(k1,k2)->k1)); + + // 组织活动次数 + int organizeTotal=0; + // 参加活动人数 + int participateUserTotal=0; + List dataList=new ArrayList<>(); + + for (ActCategoryDictDTO categoryDictDTO : categoryList) { + + BranchConAnalysisDetailDTO participateUserTotalObject=new BranchConAnalysisDetailDTO(); + participateUserTotalObject.setName(categoryDictDTO.getCategoryName()); + participateUserTotalObject.setType("参加人数"); + participateUserTotalObject.setCategoryCode(categoryDictDTO.getCategoryCode()); + + BranchConAnalysisDetailDTO organizeTotalObject=new BranchConAnalysisDetailDTO(); + organizeTotalObject.setName(categoryDictDTO.getCategoryName()); + organizeTotalObject.setType("组织次数"); + organizeTotalObject.setCategoryCode(categoryDictDTO.getCategoryCode()); + + + /*DataCommonDTO avgParticipateUserTotalObject=new DataCommonDTO(); + avgParticipateUserTotalObject.setName(categoryDictDTO.getCategoryName()); + avgParticipateUserTotalObject.setType("平均参加人数");*/ + + if (map.containsKey(categoryDictDTO.getCategoryCode())) { + + participateUserTotalObject.setValue(map.get(categoryDictDTO.getCategoryCode()).getParticipateUserTotal()); + organizeTotalObject.setValue(map.get(categoryDictDTO.getCategoryCode()).getOrganizeTotal()); + // avgParticipateUserTotalObject.setValue(map.get(categoryDictDTO.getCategoryCode()).getAvgParticipateUserTotal()); + participateUserTotalObject.setAvg(map.get(categoryDictDTO.getCategoryCode()).getAvgParticipateUserTotal()); + organizeTotalObject.setAvg(map.get(categoryDictDTO.getCategoryCode()).getAvgParticipateUserTotal()); + + + organizeTotal += map.get(categoryDictDTO.getCategoryCode()).getOrganizeTotal(); + participateUserTotal += map.get(categoryDictDTO.getCategoryCode()).getParticipateUserTotal(); + + } else { + participateUserTotalObject.setValue(NumConstant.ZERO); + organizeTotalObject.setValue(NumConstant.ZERO); + participateUserTotalObject.setAvg(NumConstant.ZERO); + organizeTotalObject.setAvg(NumConstant.ZERO); + // avgParticipateUserTotalObject.setValue(NumConstant.ZERO); + } + dataList.add(participateUserTotalObject); + dataList.add(organizeTotalObject); + // dataList.add(avgParticipateUserTotalObject); + } + BranchConAnalysisResultDTO resultDTO = new BranchConAnalysisResultDTO(); + resultDTO.setOrganizeTotal(organizeTotal); + resultDTO.setParticipateUserTotal(participateUserTotal); + resultDTO.setDataList(dataList); + return resultDTO; + } + + @Override + public List queryActCategoryDictList(String customerId, String firstCategoryCode) { + List categoryList=resiGroupDao.selectActCategoryDictDTOByPcode(customerId,firstCategoryCode); + if(CollectionUtils.isEmpty(categoryList)){ + categoryList=resiGroupDao.selectActCategoryDictDTOByPcode(Constant.DEFAULT_CUSTOMER,firstCategoryCode); + } + return categoryList; + } + + /** + * 003、【支建+联建】下级组织折线图 + * + * @param formDTO + * @return com.epmet.dataaggre.dto.resigroup.result.SubAnalysisByCodeResultDTO + */ + @Override + public List querySubAnalysisByCode(SubAnalysisByCodeFormDTO formDTO) { + List orgInfoDTOList = govOrgService.queryNextOrgInfoDTO(formDTO.getCustomerId(), formDTO.getOrgId(), formDTO.getOrgType()); + if (CollectionUtils.isEmpty(orgInfoDTOList)) { + return new ArrayList<>(); + } + + String dateId = DateUtils.getBeforeNDay(NumConstant.ONE); + List factGroupActDailyDTOList = dataStatsService.querySubAnalysisByCode(formDTO.getCustomerId(), formDTO.getOrgId(), + dateId, formDTO.getCategoryCode()); + Map map = factGroupActDailyDTOList.stream().collect(Collectors.toMap(FactGroupActDailyDTO::getOrgId, a -> a, (k1, k2) -> k1)); + List resultList = new ArrayList<>(); + for (OrgInfoCommonDTO orgInfo : orgInfoDTOList) { + + SubAnalysisByCodeResultDTO participateUserTotalObject=new SubAnalysisByCodeResultDTO(); + participateUserTotalObject.setName(orgInfo.getOrgName()); + participateUserTotalObject.setType("参加人数"); + participateUserTotalObject.setOrgId(orgInfo.getOrgId()); + + SubAnalysisByCodeResultDTO organizeTotalObject=new SubAnalysisByCodeResultDTO(); + organizeTotalObject.setName(orgInfo.getOrgName()); + organizeTotalObject.setType("组织次数"); + organizeTotalObject.setOrgId(orgInfo.getOrgId()); + + + SubAnalysisByCodeResultDTO avgParticipateUserTotalObject=new SubAnalysisByCodeResultDTO(); + avgParticipateUserTotalObject.setName(orgInfo.getOrgName()); + avgParticipateUserTotalObject.setType("平均参加人数"); + avgParticipateUserTotalObject.setOrgId(orgInfo.getOrgId()); + + if (map.containsKey(orgInfo.getOrgId())) { + participateUserTotalObject.setValue(map.get(orgInfo.getOrgId()).getParticipateUserTotal()); + organizeTotalObject.setValue(map.get(orgInfo.getOrgId()).getOrganizeTotal()); + avgParticipateUserTotalObject.setValue(map.get(orgInfo.getOrgId()).getAvgParticipateUserTotal()); + } else { + participateUserTotalObject.setValue(NumConstant.ZERO); + organizeTotalObject.setValue(NumConstant.ZERO); + avgParticipateUserTotalObject.setValue(NumConstant.ZERO); + } + resultList.add(participateUserTotalObject); + resultList.add(organizeTotalObject); + resultList.add(avgParticipateUserTotalObject); + + } + return resultList; + } } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml index 06967cceab..8d6299ec86 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml @@ -314,4 +314,51 @@ project_total DESC + + + \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerAgencyDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerAgencyDao.xml index fda4f7245c..3033937191 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerAgencyDao.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerAgencyDao.xml @@ -31,4 +31,18 @@ ca.DEL_FLAG = '0' AND ca.PARENT_AREA_CODE = #{parentAreaCode} + + \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/resigroup/ResiGroupDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/resigroup/ResiGroupDao.xml index 8a350ceec9..1549b66d21 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/resigroup/ResiGroupDao.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/resigroup/ResiGroupDao.xml @@ -15,4 +15,17 @@ AND rgm.GROUP_LEADER_FLAG != 'leader' AND rgm.RESI_GROUP_ID = #{groupId} + + \ No newline at end of file From 018dc14a9d79a91ed0d00d6c31b93368622c08fc Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 18 May 2021 17:16:21 +0800 Subject: [PATCH 036/128] =?UTF-8?q?=E6=94=AF=E9=83=A8=E5=BB=BA=E8=AE=BE?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3v2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resigroup/result/RankCodeResultDTO.java | 18 +++++++++++++ .../controller/GroupActController.java | 15 +++++++++++ .../service/resigroup/ResiGroupService.java | 10 +++++++ .../resigroup/impl/ResiGroupServiceImpl.java | 27 +++++++++++++++++++ 4 files changed, 70 insertions(+) create mode 100644 epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/result/RankCodeResultDTO.java diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/result/RankCodeResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/result/RankCodeResultDTO.java new file mode 100644 index 0000000000..50d8531978 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/result/RankCodeResultDTO.java @@ -0,0 +1,18 @@ +package com.epmet.dataaggre.dto.resigroup.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 004、【支建+联建】排序方式下拉框 + * + * @author yinzuomei@elink-cn.com + * @date 2021/5/18 17:01 + */ +@Data +public class RankCodeResultDTO implements Serializable { + private static final long serialVersionUID = 7991057885312015889L; + private String rankCode; + private String rankName; +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/GroupActController.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/GroupActController.java index 487b938fbc..a88f86456e 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/GroupActController.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/GroupActController.java @@ -7,6 +7,7 @@ import com.epmet.dataaggre.dto.resigroup.form.BranchConAnalysisFormDTO; import com.epmet.dataaggre.dto.resigroup.form.GroupActCategoryQueryFormDTO; import com.epmet.dataaggre.dto.resigroup.form.SubAnalysisByCodeFormDTO; import com.epmet.dataaggre.dto.resigroup.result.BranchConAnalysisResultDTO; +import com.epmet.dataaggre.dto.resigroup.result.RankCodeResultDTO; import com.epmet.dataaggre.dto.resigroup.result.SubAnalysisByCodeResultDTO; import com.epmet.dataaggre.service.resigroup.ResiGroupService; import org.springframework.beans.factory.annotation.Autowired; @@ -71,4 +72,18 @@ public class GroupActController { return new Result>().ok(resiGroupService.querySubAnalysisByCode(formDTO)); } + /** + * @return com.epmet.commons.tools.utils.Result> + * @param formDTO + * @author yinzuomei + * @description 004、【支建+联建】排序方式下拉框 + * @Date 2021/5/18 17:14 + **/ + @PostMapping("rankcodelist") + public Result> queryRankCodeList(@RequestBody GroupActCategoryQueryFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO,GroupActCategoryQueryFormDTO.AddUserInternalGroup.class); + return new Result>().ok(resiGroupService.queryRankCodeList(formDTO)); + } + + } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/resigroup/ResiGroupService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/resigroup/ResiGroupService.java index 66c3b991dd..d0cb64fade 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/resigroup/ResiGroupService.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/resigroup/ResiGroupService.java @@ -4,9 +4,11 @@ import com.epmet.dataaggre.dto.resigroup.ActCategoryDictDTO; import com.epmet.dataaggre.dto.resigroup.ResiTopicDTO; import com.epmet.dataaggre.dto.resigroup.form.BranchConAnalysisFormDTO; import com.epmet.dataaggre.dto.resigroup.form.CandidateListFormDTO; +import com.epmet.dataaggre.dto.resigroup.form.GroupActCategoryQueryFormDTO; import com.epmet.dataaggre.dto.resigroup.form.SubAnalysisByCodeFormDTO; import com.epmet.dataaggre.dto.resigroup.result.BranchConAnalysisResultDTO; import com.epmet.dataaggre.dto.resigroup.result.CandidateListResultDTO; +import com.epmet.dataaggre.dto.resigroup.result.RankCodeResultDTO; import com.epmet.dataaggre.dto.resigroup.result.SubAnalysisByCodeResultDTO; import java.util.List; @@ -49,4 +51,12 @@ public interface ResiGroupService { * @return com.epmet.dataaggre.dto.resigroup.result.DataCommonDTO */ List querySubAnalysisByCode(SubAnalysisByCodeFormDTO formDTO); + + /** + * 004、【支建+联建】排序方式下拉框 + * + * @param formDTO + * @return com.epmet.dataaggre.dto.resigroup.result.RankCodeResultDTO + */ + List queryRankCodeList(GroupActCategoryQueryFormDTO formDTO); } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/resigroup/impl/ResiGroupServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/resigroup/impl/ResiGroupServiceImpl.java index 141158f063..6d726bba69 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/resigroup/impl/ResiGroupServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/resigroup/impl/ResiGroupServiceImpl.java @@ -13,6 +13,7 @@ import com.epmet.dataaggre.dto.resigroup.ActCategoryDictDTO; import com.epmet.dataaggre.dto.resigroup.ResiTopicDTO; import com.epmet.dataaggre.dto.resigroup.form.BranchConAnalysisFormDTO; import com.epmet.dataaggre.dto.resigroup.form.CandidateListFormDTO; +import com.epmet.dataaggre.dto.resigroup.form.GroupActCategoryQueryFormDTO; import com.epmet.dataaggre.dto.resigroup.form.SubAnalysisByCodeFormDTO; import com.epmet.dataaggre.dto.resigroup.result.*; import com.epmet.dataaggre.entity.resigroup.ResiGroupEntity; @@ -244,4 +245,30 @@ public class ResiGroupServiceImpl implements ResiGroupService { } return resultList; } + + /** + * 004、【支建+联建】排序方式下拉框 + * + * @param formDTO + * @return com.epmet.dataaggre.dto.resigroup.result.RankCodeResultDTO + */ + @Override + public List queryRankCodeList(GroupActCategoryQueryFormDTO formDTO) { + List resultList=new ArrayList<>(); + RankCodeResultDTO defaultResult=new RankCodeResultDTO(); + defaultResult.setRankCode("orgtotal"); + defaultResult.setRankName("组织活动总次数"); + resultList.add(defaultResult); + List categoryList=resiGroupDao.selectActCategoryDictDTOByPcode(formDTO.getCustomerId(),formDTO.getFirstCategoryCode()); + if(CollectionUtils.isEmpty(categoryList)){ + categoryList=resiGroupDao.selectActCategoryDictDTOByPcode(Constant.DEFAULT_CUSTOMER,formDTO.getFirstCategoryCode()); + } + categoryList.forEach(category->{ + RankCodeResultDTO result=new RankCodeResultDTO(); + result.setRankCode(category.getCategoryCode()); + result.setRankName(category.getCategoryName().concat("-组织次数")); + resultList.add(result); + }); + return resultList; + } } From 112c6efef4d58786890dc37d87322aa5ad9e6190 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 19 May 2021 09:49:17 +0800 Subject: [PATCH 037/128] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E8=AF=84=E4=BB=B7bug?= =?UTF-8?q?=E5=8F=91=E5=B8=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resigroup/form/GroupActRankFormDTO.java | 45 +++++++++++++++++++ .../result/GroupActRankDetailDTO.java | 13 ++++++ .../result/GroupActRankResultDTO.java | 22 +++++++++ .../controller/GroupActController.java | 15 +++++++ .../govorg/impl/GovOrgServiceImpl.java | 9 ---- .../service/resigroup/ResiGroupService.java | 18 ++++---- .../resigroup/impl/ResiGroupServiceImpl.java | 21 +++++++-- 7 files changed, 122 insertions(+), 21 deletions(-) create mode 100644 epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/form/GroupActRankFormDTO.java create mode 100644 epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/result/GroupActRankDetailDTO.java create mode 100644 epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/result/GroupActRankResultDTO.java diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/form/GroupActRankFormDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/form/GroupActRankFormDTO.java new file mode 100644 index 0000000000..e9a920f869 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/form/GroupActRankFormDTO.java @@ -0,0 +1,45 @@ +package com.epmet.dataaggre.dto.resigroup.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 005、【支建+联建】下级组织排行列表 + * + * @author yinzuomei@elink-cn.com + * @date 2021/5/18 17:30 + */ +@Data +public class GroupActRankFormDTO implements Serializable { + private static final long serialVersionUID = 2293552582281839132L; + public interface AddUserInternalGroup { + } + + /** + * 支部建设:100;联建共建:101 + */ + @NotBlank(message = "firstCategoryCode必传,支部建设:100;联建共建:101", groups = BranchConAnalysisFormDTO.AddUserInternalGroup.class) + private String firstCategoryCode; + + /** + * 当前客户id + */ + @NotBlank(message = "客户id不能为空", groups = BranchConAnalysisFormDTO.AddUserInternalGroup.class) + private String customerId; + + /** + * 当前组织或者网格id + */ + @NotBlank(message = "orgId不能为空", groups = BranchConAnalysisFormDTO.AddUserInternalGroup.class) + private String orgId; + + /** + * 默认传组织:agency; 网格:grid + */ + @NotBlank(message = "orgType不能为空", groups = BranchConAnalysisFormDTO.AddUserInternalGroup.class) + private String orgType; + + private String rankCode; +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/result/GroupActRankDetailDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/result/GroupActRankDetailDTO.java new file mode 100644 index 0000000000..21e3dc29fd --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/result/GroupActRankDetailDTO.java @@ -0,0 +1,13 @@ +package com.epmet.dataaggre.dto.resigroup.result; + +import lombok.Data; + +/** + * 描述一下 + * + * @author yinzuomei@elink-cn.com + * @date 2021/5/19 9:31 + */ +@Data +public class GroupActRankDetailDTO { +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/result/GroupActRankResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/result/GroupActRankResultDTO.java new file mode 100644 index 0000000000..45efaa413b --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/result/GroupActRankResultDTO.java @@ -0,0 +1,22 @@ +package com.epmet.dataaggre.dto.resigroup.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 005、【支建+联建】下级组织排行列表 + * + * @author yinzuomei@elink-cn.com + * @date 2021/5/18 17:33 + */ +@Data +public class GroupActRankResultDTO implements Serializable { + private String orgId; + private String orgType; + private String orgName; + private Integer organizeTotal; + private String organizeName = "组织总次数"; + private Integer participateUserTotal; + private String participateUserName = "参加总人数"; +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/GroupActController.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/GroupActController.java index a88f86456e..b79cb0b7f7 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/GroupActController.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/GroupActController.java @@ -5,8 +5,10 @@ import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dataaggre.dto.resigroup.ActCategoryDictDTO; import com.epmet.dataaggre.dto.resigroup.form.BranchConAnalysisFormDTO; import com.epmet.dataaggre.dto.resigroup.form.GroupActCategoryQueryFormDTO; +import com.epmet.dataaggre.dto.resigroup.form.GroupActRankFormDTO; import com.epmet.dataaggre.dto.resigroup.form.SubAnalysisByCodeFormDTO; import com.epmet.dataaggre.dto.resigroup.result.BranchConAnalysisResultDTO; +import com.epmet.dataaggre.dto.resigroup.result.GroupActRankResultDTO; import com.epmet.dataaggre.dto.resigroup.result.RankCodeResultDTO; import com.epmet.dataaggre.dto.resigroup.result.SubAnalysisByCodeResultDTO; import com.epmet.dataaggre.service.resigroup.ResiGroupService; @@ -86,4 +88,17 @@ public class GroupActController { } + /** + * @return com.epmet.commons.tools.utils.Result> + * @param formDTO + * @author yinzuomei + * @description 005、【支建+联建】下级组织排行列表 + * @Date 2021/5/18 17:46 + **/ + @PostMapping("subranklist") + public Result> querySubRankList(@RequestBody GroupActRankFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO,GroupActRankFormDTO.class); + return new Result>().ok(resiGroupService.querySubRankList(formDTO)); + } + } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java index 18ad900fc6..100978e144 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java @@ -175,15 +175,6 @@ public class GovOrgServiceImpl implements GovOrgService { agecnyInfo.setOrgType("agency"); result.add(agecnyInfo); }); - }else if("grid".equals(orgType)){ - List list= customerGridDao.selectGridListByAgencyId(orgId); - list.forEach(grid->{ - OrgInfoCommonDTO gridInfo=new OrgInfoCommonDTO(); - gridInfo.setOrgId(grid.getGridId()); - gridInfo.setOrgName(grid.getGridName()); - gridInfo.setOrgType("grid"); - result.add(gridInfo); - }); } return result; } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/resigroup/ResiGroupService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/resigroup/ResiGroupService.java index d0cb64fade..68f4afb4ee 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/resigroup/ResiGroupService.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/resigroup/ResiGroupService.java @@ -2,14 +2,8 @@ package com.epmet.dataaggre.service.resigroup; import com.epmet.dataaggre.dto.resigroup.ActCategoryDictDTO; import com.epmet.dataaggre.dto.resigroup.ResiTopicDTO; -import com.epmet.dataaggre.dto.resigroup.form.BranchConAnalysisFormDTO; -import com.epmet.dataaggre.dto.resigroup.form.CandidateListFormDTO; -import com.epmet.dataaggre.dto.resigroup.form.GroupActCategoryQueryFormDTO; -import com.epmet.dataaggre.dto.resigroup.form.SubAnalysisByCodeFormDTO; -import com.epmet.dataaggre.dto.resigroup.result.BranchConAnalysisResultDTO; -import com.epmet.dataaggre.dto.resigroup.result.CandidateListResultDTO; -import com.epmet.dataaggre.dto.resigroup.result.RankCodeResultDTO; -import com.epmet.dataaggre.dto.resigroup.result.SubAnalysisByCodeResultDTO; +import com.epmet.dataaggre.dto.resigroup.form.*; +import com.epmet.dataaggre.dto.resigroup.result.*; import java.util.List; @@ -59,4 +53,12 @@ public interface ResiGroupService { * @return com.epmet.dataaggre.dto.resigroup.result.RankCodeResultDTO */ List queryRankCodeList(GroupActCategoryQueryFormDTO formDTO); + + /** + * 005、【支建+联建】下级组织排行列表 + * + * @param formDTO + * @return com.epmet.dataaggre.dto.resigroup.result.GroupActRankResultDTO + */ + List querySubRankList(GroupActRankFormDTO formDTO); } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/resigroup/impl/ResiGroupServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/resigroup/impl/ResiGroupServiceImpl.java index 6d726bba69..030adf6b6a 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/resigroup/impl/ResiGroupServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/resigroup/impl/ResiGroupServiceImpl.java @@ -11,10 +11,7 @@ import com.epmet.dataaggre.dto.datastats.FactGroupActDailyDTO; import com.epmet.dataaggre.dto.epmetuser.result.UserInfosResultDTO; import com.epmet.dataaggre.dto.resigroup.ActCategoryDictDTO; import com.epmet.dataaggre.dto.resigroup.ResiTopicDTO; -import com.epmet.dataaggre.dto.resigroup.form.BranchConAnalysisFormDTO; -import com.epmet.dataaggre.dto.resigroup.form.CandidateListFormDTO; -import com.epmet.dataaggre.dto.resigroup.form.GroupActCategoryQueryFormDTO; -import com.epmet.dataaggre.dto.resigroup.form.SubAnalysisByCodeFormDTO; +import com.epmet.dataaggre.dto.resigroup.form.*; import com.epmet.dataaggre.dto.resigroup.result.*; import com.epmet.dataaggre.entity.resigroup.ResiGroupEntity; import com.epmet.dataaggre.redis.ResiGroupRedis; @@ -271,4 +268,20 @@ public class ResiGroupServiceImpl implements ResiGroupService { }); return resultList; } + + /** + * 005、【支建+联建】下级组织排行列表 + * + * @param formDTO + * @return com.epmet.dataaggre.dto.resigroup.result.GroupActRankResultDTO + */ + @Override + public List querySubRankList(GroupActRankFormDTO formDTO) { + List orgInfoDTOList = govOrgService.queryNextOrgInfoDTO(formDTO.getCustomerId(), formDTO.getOrgId(), formDTO.getOrgType()); + if (CollectionUtils.isEmpty(orgInfoDTOList)) { + return new ArrayList<>(); + } + // todo + return null; + } } From 535837686c082900d08863c886c18c217c028337 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 19 May 2021 12:28:14 +0800 Subject: [PATCH 038/128] =?UTF-8?q?=E6=94=AF=E9=83=A8=E5=BB=BA=E8=AE=BE?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3v3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resigroup/form/GroupActRankFormDTO.java | 3 ++ .../result/GroupActRankDetailDTO.java | 14 +++++- .../result/GroupActRankResultDTO.java | 21 +++++++++ .../controller/GroupActController.java | 2 +- .../dataaggre/dao/datastats/DataStatsDao.java | 7 +++ .../service/datastats/DataStatsService.java | 4 ++ .../datastats/impl/DataStatsServiceImpl.java | 10 ++++ .../service/govorg/GovOrgService.java | 2 +- .../govorg/impl/GovOrgServiceImpl.java | 17 +++++-- .../resigroup/impl/ResiGroupServiceImpl.java | 47 +++++++++++++++++-- .../mapper/datastats/DatsStatsDao.xml | 20 ++++++++ 11 files changed, 136 insertions(+), 11 deletions(-) diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/form/GroupActRankFormDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/form/GroupActRankFormDTO.java index e9a920f869..58a029661b 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/form/GroupActRankFormDTO.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/form/GroupActRankFormDTO.java @@ -41,5 +41,8 @@ public class GroupActRankFormDTO implements Serializable { @NotBlank(message = "orgType不能为空", groups = BranchConAnalysisFormDTO.AddUserInternalGroup.class) private String orgType; + /** + * 排序编码;可以不传,前端自己处理。 + */ private String rankCode; } diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/result/GroupActRankDetailDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/result/GroupActRankDetailDTO.java index 21e3dc29fd..575b9bd803 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/result/GroupActRankDetailDTO.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/result/GroupActRankDetailDTO.java @@ -2,12 +2,22 @@ package com.epmet.dataaggre.dto.resigroup.result; import lombok.Data; +import java.io.Serializable; + /** - * 描述一下 + * 005、【支建+联建】下级组织排行列表 * * @author yinzuomei@elink-cn.com * @date 2021/5/19 9:31 */ @Data -public class GroupActRankDetailDTO { +public class GroupActRankDetailDTO implements Serializable { + private static final long serialVersionUID = 7738751412518098478L; + + private String categoryCode; + private String categoryName; + private Integer organizeTotal; + private Integer participateUserTotal; + private String organizeName="组织总次数"; + private String participateUserName="参加总人数"; } diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/result/GroupActRankResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/result/GroupActRankResultDTO.java index 45efaa413b..56822631f2 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/result/GroupActRankResultDTO.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/result/GroupActRankResultDTO.java @@ -1,8 +1,12 @@ package com.epmet.dataaggre.dto.resigroup.result; +import com.epmet.commons.tools.constant.NumConstant; +import com.fasterxml.jackson.annotation.JsonIgnore; import lombok.Data; import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; /** * 005、【支建+联建】下级组织排行列表 @@ -19,4 +23,21 @@ public class GroupActRankResultDTO implements Serializable { private String organizeName = "组织总次数"; private Integer participateUserTotal; private String participateUserName = "参加总人数"; + private List categoryList; + + @JsonIgnore + private Integer sortValue; + + public GroupActRankResultDTO() { + this.orgId = ""; + this.orgType = ""; + this.orgName = ""; + this.organizeTotal = NumConstant.ZERO; + this.organizeName = "组织总次数"; + this.participateUserTotal = NumConstant.ZERO; + this.participateUserName = "参加总人数"; + this.categoryList = new ArrayList<>(); + } + + } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/GroupActController.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/GroupActController.java index b79cb0b7f7..ee86d8c1d1 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/GroupActController.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/GroupActController.java @@ -97,7 +97,7 @@ public class GroupActController { **/ @PostMapping("subranklist") public Result> querySubRankList(@RequestBody GroupActRankFormDTO formDTO){ - ValidatorUtils.validateEntity(formDTO,GroupActRankFormDTO.class); + ValidatorUtils.validateEntity(formDTO,GroupActRankFormDTO.AddUserInternalGroup.class); return new Result>().ok(resiGroupService.querySubRankList(formDTO)); } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/datastats/DataStatsDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/datastats/DataStatsDao.java index 2a7aae6f5e..61632b35bd 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/datastats/DataStatsDao.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/datastats/DataStatsDao.java @@ -21,6 +21,8 @@ import com.epmet.dataaggre.dto.datastats.FactGroupActDailyDTO; import com.epmet.dataaggre.dto.datastats.form.SubAgencyFormDTO; import com.epmet.dataaggre.dto.datastats.form.SubGridFormDTO; import com.epmet.dataaggre.dto.datastats.result.*; +import com.epmet.dataaggre.dto.resigroup.ActCategoryDictDTO; +import com.epmet.dataaggre.dto.resigroup.result.GroupActRankDetailDTO; import com.epmet.dataaggre.entity.datastats.DimAgencyEntity; import com.epmet.dataaggre.entity.datastats.DimGridEntity; import org.apache.ibatis.annotations.Mapper; @@ -219,4 +221,9 @@ public interface DataStatsDao { @Param("pid")String pid, @Param("dateId")String dateId, @Param("categoryCode")String categoryCode); + + List selectGroupActRankDetail(@Param("customerId") String customerId, + @Param("dateId") String dateId, + @Param("orgId") String orgId, + @Param("actCategoryDictDTOList") List actCategoryDictDTOList); } \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/DataStatsService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/DataStatsService.java index 0fe6517106..1e99251989 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/DataStatsService.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/DataStatsService.java @@ -7,6 +7,8 @@ import com.epmet.dataaggre.dto.datastats.form.GridBasicDataFormDTO; import com.epmet.dataaggre.dto.datastats.form.SubAgencyFormDTO; import com.epmet.dataaggre.dto.datastats.form.SubGridFormDTO; import com.epmet.dataaggre.dto.datastats.result.*; +import com.epmet.dataaggre.dto.resigroup.ActCategoryDictDTO; +import com.epmet.dataaggre.dto.resigroup.result.GroupActRankDetailDTO; import java.util.List; @@ -124,4 +126,6 @@ public interface DataStatsService { List branchConAnalysis(String customerId, String orgId, String orgType, String dateId, String parentCode); List querySubAnalysisByCode(String customerId, String pid, String dateId, String categoryCode); + + List selectGroupActRankDetail(String customerId, String dateId, String orgId, List actCategoryDictDTOList); } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java index acb2cc22a0..415b1e969b 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java @@ -13,6 +13,8 @@ import com.epmet.dataaggre.dto.datastats.form.GridBasicDataFormDTO; import com.epmet.dataaggre.dto.datastats.form.SubAgencyFormDTO; import com.epmet.dataaggre.dto.datastats.form.SubGridFormDTO; import com.epmet.dataaggre.dto.datastats.result.*; +import com.epmet.dataaggre.dto.resigroup.ActCategoryDictDTO; +import com.epmet.dataaggre.dto.resigroup.result.GroupActRankDetailDTO; import com.epmet.dataaggre.entity.datastats.DimAgencyEntity; import com.epmet.dataaggre.entity.datastats.DimGridEntity; import com.epmet.dataaggre.service.datastats.DataStatsService; @@ -999,4 +1001,12 @@ public class DataStatsServiceImpl implements DataStatsService { return dataStatsDao.querySubAnalysisByCode(customerId,pid,dateId,categoryCode); } + @Override + public List selectGroupActRankDetail(String customerId, String dateId, String orgId, List actCategoryDictDTOList) { + if(CollectionUtils.isNotEmpty(actCategoryDictDTOList)){ + return dataStatsDao.selectGroupActRankDetail(customerId,dateId,orgId,actCategoryDictDTOList); + } + return new ArrayList<>(); + } + } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java index d0780b046d..916044b1f3 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java @@ -47,5 +47,5 @@ public interface GovOrgService { List queryNextLevelAreaCodeList(NextAreaCodeFormDTO formDTO); - List queryNextOrgInfoDTO(String customerId, String orgId, String orgType); + List queryNextOrgInfoDTO(String customerId, String orgId); } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java index 100978e144..ec45f0419f 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java @@ -164,10 +164,10 @@ public class GovOrgServiceImpl implements GovOrgService { } @Override - public List queryNextOrgInfoDTO(String customerId, String orgId, String orgType) { + public List queryNextOrgInfoDTO(String customerId, String orgId) { List result=new ArrayList<>(); - if("agency".equals(orgType)){ - List customerAgencyEntityList = customerAgencyDao.selectNextAgency(customerId, orgId); + List customerAgencyEntityList = customerAgencyDao.selectNextAgency(customerId, orgId); + if(CollectionUtils.isNotEmpty(customerAgencyEntityList)){ customerAgencyEntityList.forEach(agencyEntity->{ OrgInfoCommonDTO agecnyInfo=new OrgInfoCommonDTO(); agecnyInfo.setOrgId(agencyEntity.getId()); @@ -175,6 +175,17 @@ public class GovOrgServiceImpl implements GovOrgService { agecnyInfo.setOrgType("agency"); result.add(agecnyInfo); }); + return result; + } + List gridInfoResultDTOList=customerGridDao.selectGridListByAgencyId(orgId); + if(CollectionUtils.isNotEmpty(gridInfoResultDTOList)){ + gridInfoResultDTOList.forEach(grid->{ + OrgInfoCommonDTO gridInfo=new OrgInfoCommonDTO(); + gridInfo.setOrgId(grid.getGridId()); + gridInfo.setOrgName(grid.getGridName()); + gridInfo.setOrgType("grid"); + result.add(gridInfo); + }); } return result; } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/resigroup/impl/ResiGroupServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/resigroup/impl/ResiGroupServiceImpl.java index 030adf6b6a..a56c37e37f 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/resigroup/impl/ResiGroupServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/resigroup/impl/ResiGroupServiceImpl.java @@ -25,8 +25,10 @@ import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; +import org.springframework.util.StringUtils; import java.util.ArrayList; +import java.util.Comparator; import java.util.List; import java.util.Map; import java.util.stream.Collectors; @@ -198,7 +200,7 @@ public class ResiGroupServiceImpl implements ResiGroupService { */ @Override public List querySubAnalysisByCode(SubAnalysisByCodeFormDTO formDTO) { - List orgInfoDTOList = govOrgService.queryNextOrgInfoDTO(formDTO.getCustomerId(), formDTO.getOrgId(), formDTO.getOrgType()); + List orgInfoDTOList = govOrgService.queryNextOrgInfoDTO(formDTO.getCustomerId(), formDTO.getOrgId()); if (CollectionUtils.isEmpty(orgInfoDTOList)) { return new ArrayList<>(); } @@ -277,11 +279,48 @@ public class ResiGroupServiceImpl implements ResiGroupService { */ @Override public List querySubRankList(GroupActRankFormDTO formDTO) { - List orgInfoDTOList = govOrgService.queryNextOrgInfoDTO(formDTO.getCustomerId(), formDTO.getOrgId(), formDTO.getOrgType()); + List orgInfoDTOList = govOrgService.queryNextOrgInfoDTO(formDTO.getCustomerId(), formDTO.getOrgId()); if (CollectionUtils.isEmpty(orgInfoDTOList)) { return new ArrayList<>(); } - // todo - return null; + List resultDTOList=new ArrayList<>(); + String dateId = DateUtils.getBeforeNDay(NumConstant.ONE); + // 1、根据以及编码查询出二级编码列表 + List actCategoryDictDTOList=queryActCategoryDictList(formDTO.getCustomerId(),formDTO.getFirstCategoryCode()); + for(OrgInfoCommonDTO orgInfo:orgInfoDTOList){ + GroupActRankResultDTO resultDTO=new GroupActRankResultDTO(); + resultDTO.setOrgId(orgInfo.getOrgId()); + resultDTO.setOrgName(orgInfo.getOrgName()); + resultDTO.setOrgType(orgInfo.getOrgType()); + if(!CollectionUtils.isEmpty(actCategoryDictDTOList)){ + int organizeTotal = NumConstant.ZERO; + int participateUserTotal = NumConstant.ZERO; + List detailList=dataStatsService.selectGroupActRankDetail(formDTO.getCustomerId(),dateId,orgInfo.getOrgId(),actCategoryDictDTOList); + for(GroupActRankDetailDTO deatil:detailList){ + organizeTotal+=deatil.getOrganizeTotal(); + participateUserTotal+=deatil.getParticipateUserTotal(); + } + resultDTO.setOrganizeTotal(organizeTotal); + resultDTO.setParticipateUserTotal(participateUserTotal); + resultDTO.setCategoryList(detailList); + } + resultDTOList.add(resultDTO); + } + + if(StringUtils.isEmpty(formDTO.getRankCode())||"orgtotal".equals(formDTO.getRankCode())){ + //按照 组织总次数降序排列 + resultDTOList.sort(Comparator.comparing(GroupActRankResultDTO::getOrganizeTotal).reversed()); + }else{ + resultDTOList.forEach(m->{ + for(GroupActRankDetailDTO categoryDto:m.getCategoryList()){ + if(formDTO.getRankCode().equals(categoryDto.getCategoryCode())){ + m.setSortValue(categoryDto.getOrganizeTotal()); + break; + } + } + }); + resultDTOList.sort(Comparator.comparing(GroupActRankResultDTO::getSortValue).reversed()); + } + return resultDTOList; } } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml index d918e91a3f..0b41cf0b15 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml @@ -578,4 +578,24 @@ AND m.DATE_ID = #{dateId} AND m.PID = #{pid} + + \ No newline at end of file From dc7c29270d572a2821391f7eace5fe6f50ab97eb Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 19 May 2021 12:50:09 +0800 Subject: [PATCH 039/128] =?UTF-8?q?=E6=94=AF=E9=83=A8=E5=BB=BA=E8=AE=BE?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3v3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../result/GroupActRankDetailDTO.java | 4 +-- .../resigroup/impl/ResiGroupServiceImpl.java | 25 +++++++++++++++++-- 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/result/GroupActRankDetailDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/result/GroupActRankDetailDTO.java index 575b9bd803..60be83657e 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/result/GroupActRankDetailDTO.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/result/GroupActRankDetailDTO.java @@ -18,6 +18,6 @@ public class GroupActRankDetailDTO implements Serializable { private String categoryName; private Integer organizeTotal; private Integer participateUserTotal; - private String organizeName="组织总次数"; - private String participateUserName="参加总人数"; + private String organizeName; + private String participateUserName; } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/resigroup/impl/ResiGroupServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/resigroup/impl/ResiGroupServiceImpl.java index a56c37e37f..a2f853dd2f 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/resigroup/impl/ResiGroupServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/resigroup/impl/ResiGroupServiceImpl.java @@ -293,16 +293,37 @@ public class ResiGroupServiceImpl implements ResiGroupService { resultDTO.setOrgName(orgInfo.getOrgName()); resultDTO.setOrgType(orgInfo.getOrgType()); if(!CollectionUtils.isEmpty(actCategoryDictDTOList)){ + + List detailList=new ArrayList<>(); + List detailRecords=dataStatsService.selectGroupActRankDetail(formDTO.getCustomerId(),dateId,orgInfo.getOrgId(),actCategoryDictDTOList); + Map map = detailRecords.stream().collect(Collectors.toMap(GroupActRankDetailDTO::getCategoryCode, a -> a, (k1, k2) -> k1)); + + for(ActCategoryDictDTO actCategoryDictDTO:actCategoryDictDTOList){ + GroupActRankDetailDTO temp=new GroupActRankDetailDTO(); + temp.setCategoryCode(actCategoryDictDTO.getCategoryCode()); + temp.setCategoryName(actCategoryDictDTO.getCategoryName()); + temp.setOrganizeName("组织总次数"); + temp.setParticipateUserName("参加总人数"); + if(map.containsKey(actCategoryDictDTO.getCategoryCode())){ + temp.setOrganizeTotal(map.get(actCategoryDictDTO.getCategoryCode()).getOrganizeTotal()); + temp.setParticipateUserTotal(map.get(actCategoryDictDTO.getCategoryCode()).getParticipateUserTotal()); + }else{ + temp.setOrganizeTotal(NumConstant.ZERO); + temp.setParticipateUserTotal(NumConstant.ZERO); + } + detailList.add(temp); + } + resultDTO.setCategoryList(detailList); + int organizeTotal = NumConstant.ZERO; int participateUserTotal = NumConstant.ZERO; - List detailList=dataStatsService.selectGroupActRankDetail(formDTO.getCustomerId(),dateId,orgInfo.getOrgId(),actCategoryDictDTOList); for(GroupActRankDetailDTO deatil:detailList){ organizeTotal+=deatil.getOrganizeTotal(); participateUserTotal+=deatil.getParticipateUserTotal(); } resultDTO.setOrganizeTotal(organizeTotal); resultDTO.setParticipateUserTotal(participateUserTotal); - resultDTO.setCategoryList(detailList); + } resultDTOList.add(resultDTO); } From 3dba5488f9e061c3350a02637a4c99d55e07e72b Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 19 May 2021 12:50:39 +0800 Subject: [PATCH 040/128] =?UTF-8?q?=E6=94=AF=E9=83=A8=E5=BB=BA=E8=AE=BE?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3v3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dataaggre/dto/resigroup/result/GroupActRankResultDTO.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/result/GroupActRankResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/result/GroupActRankResultDTO.java index 56822631f2..8bb3ed181f 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/result/GroupActRankResultDTO.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/result/GroupActRankResultDTO.java @@ -20,9 +20,9 @@ public class GroupActRankResultDTO implements Serializable { private String orgType; private String orgName; private Integer organizeTotal; - private String organizeName = "组织总次数"; + private String organizeName; private Integer participateUserTotal; - private String participateUserName = "参加总人数"; + private String participateUserName; private List categoryList; @JsonIgnore From 850ae0faa86119b8147078ef6c2fd0352a87fb03 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 19 May 2021 13:44:31 +0800 Subject: [PATCH 041/128] =?UTF-8?q?=E5=B0=8F=E7=BB=84=E6=B4=BB=E5=8A=A8?= =?UTF-8?q?=E6=8C=89=E5=A4=A9=E7=BB=9F=E8=AE=A1bug=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/group/GroupDataDao.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 ebd75dc9dd..6ced5d827a 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 @@ -284,7 +284,7 @@ AND gai.CUSTOMER_ID = #{customerId} AND gai.`STATUS` != 'canceled' AND gai.SIGNED_IN_NUM > 0 - and DATE_FORMAT(gai.CREATED_TIME,'%Y%m%d') < #{dateId} + and DATE_FORMAT(gai.CREATED_TIME,'%Y%m%d') <= #{dateId} and gai.CATEGORY_CODE like concat(#{categoryCode},'%') and gai.GRID_ID=#{gridId} GROUP BY @@ -308,7 +308,7 @@ AND gai.`STATUS` != 'canceled' AND gai.SIGNED_IN_NUM > 0 and gai.GRID_PIDS like concat('%',#{agencyId},'%') - and DATE_FORMAT(gai.CREATED_TIME,'%Y%m%d') < #{dateId} + and DATE_FORMAT(gai.CREATED_TIME,'%Y%m%d') <= #{dateId} and gai.CATEGORY_CODE like concat(#{categoryCode},'%') GROUP BY gai.CUSTOMER_ID From aa89523b1f2becc46affa1bdcbf1d140477088d6 Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 19 May 2021 13:54:05 +0800 Subject: [PATCH 042/128] =?UTF-8?q?=E7=BD=91=E6=A0=BC=E5=BE=97=E5=88=86?= =?UTF-8?q?=E8=AF=B4=E6=98=8E=E6=9A=82=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../index/dto/IndexExplainDTO.java | 5 -- .../index/dto/IndexExplainTreeDTO.java | 5 -- .../datareport/constant/IndexConstant.java | 3 +- .../index/impl/IndexExplainServiceImpl.java | 86 ++++++++++++------- .../mapper/index/IndexExplainDao.xml | 5 +- 5 files changed, 59 insertions(+), 45 deletions(-) diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/dto/IndexExplainDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/dto/IndexExplainDTO.java index 9980f5500d..d48084d3df 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/dto/IndexExplainDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/dto/IndexExplainDTO.java @@ -84,11 +84,6 @@ public class IndexExplainDTO implements Serializable { */ private String type; - /** - * 是否下钻:1 是;0否;eg:网格的下级分数 下钻到党员 - */ - private Integer goDown; - /** * 删除标记 0:未删除,1:已删除 */ diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/dto/IndexExplainTreeDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/dto/IndexExplainTreeDTO.java index e50b466e9d..d812953500 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/dto/IndexExplainTreeDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/dto/IndexExplainTreeDTO.java @@ -84,11 +84,6 @@ public class IndexExplainTreeDTO implements Serializable { */ private String type; - /** - * 是否下钻:1 是;0否;eg:网格的下级分数 下钻到党员 - */ - private Integer goDown; - /** * 子节点 */ diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/constant/IndexConstant.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/constant/IndexConstant.java index 4e2c5e01e1..5f177f9f8b 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/constant/IndexConstant.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/constant/IndexConstant.java @@ -25,8 +25,9 @@ public class IndexConstant { private static final String BEN_JI_CN = "本级"; private static final String XIA_JI_CN = "下级"; - public static final String ZI_SHEN = "ZISHEN"; + public static final String ZI_SHEN = "zishen"; public static final String XIA_JI = "xiaji"; + public static final String THRESHOLD_TEXT = "给定阈值%d%%,超过阈值不加分"; /** diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/index/impl/IndexExplainServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/index/impl/IndexExplainServiceImpl.java index 0f79d225e2..06c22aaa61 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/index/impl/IndexExplainServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/index/impl/IndexExplainServiceImpl.java @@ -94,39 +94,51 @@ public class IndexExplainServiceImpl implements IndexExplainService { } private void setTableData(IndexExplainFormDTO formDTO, Map> detailEntityMap, IndexExplainTreeDTO explainDTO, IndexExplainResult result) { - Integer goDown = explainDTO.getGoDown(); if (NumConstant.ONE == explainDTO.getIsSearch()) { - List tableHeaders = getTableHeaders(explainDTO); - result.setTableTileList(tableHeaders); + String type = explainDTO.getType(); + switch (explainDTO.getOrgLevel()) { case "grid": - String type = explainDTO.getType(); String allIndexCodePath = null; List tableList = null; - if (IndexConstant.ZI_SHEN.equals(type)) { - allIndexCodePath = "wanggexiangguan:dangjiannengli"; - tableList = setDefaultTableData(detailEntityMap, type, allIndexCodePath); - result.setTableDataList(tableList); - } else if (IndexConstant.XIA_JI.equals(type)) { - allIndexCodePath = "dangyuanxiangguan:lianxiqunzhong"; - tableList = setDefaultTableData(detailEntityMap, type, allIndexCodePath); - result.setTableDataList(tableList); - } + + List scoreList = null; //set Target value IndexScoreFormDTO ablityListFormDTO = new IndexScoreFormDTO(); ablityListFormDTO.setCustomerId(formDTO.getCustomerId()); ablityListFormDTO.setOrgId(formDTO.getOrgId()); ablityListFormDTO.setMonthId(DateUtils.getCurrentTimeBeforeMonthId()); - ablityListFormDTO.setAllParentIndexCode(allIndexCodePath); - //下钻到党员 - List scoreList = null; - if (goDown == 1) { - scoreList = factIndexCpcSubScoreDao.selecCpcAvgScore(ablityListFormDTO); - } else { + + + if (IndexConstant.ZI_SHEN.equals(type)) { + allIndexCodePath = "wanggexiangguan:dangjiannengli"; + + List tableHeaders = getTableHeaders(type, allIndexCodePath, formDTO.getOrgLevel()); + result.setTableTileList(tableHeaders); + + + tableList = setDefaultTableData(formDTO.getOrgLevel(), type, detailEntityMap, result, allIndexCodePath); + //不下钻 + ablityListFormDTO.setAllParentIndexCode(allIndexCodePath); scoreList = gridSubScoreDao.selectGridSubScore(ablityListFormDTO); + } else if (IndexConstant.XIA_JI.equals(type)) { + + allIndexCodePath = "dangyuanxiangguan:lianxiqunzhong"; + + + List tableHeaders = getTableHeaders(type, allIndexCodePath, formDTO.getOrgLevel()); + tableHeaders.add(0, "组织内党员的联系群众指数考评分(平均值)"); + result.setTableTileList(tableHeaders); + + tableList = setDefaultTableData(formDTO.getOrgLevel(), type, detailEntityMap, result, allIndexCodePath); + + //下钻到党员 + ablityListFormDTO.setAllParentIndexCode(allIndexCodePath); + scoreList = factIndexCpcSubScoreDao.selecCpcAvgScore(ablityListFormDTO); } - if (scoreList == null || tableList == null) { + + if (scoreList == null) { return; } for (IndexScoreResult score : scoreList) { @@ -135,12 +147,10 @@ public class IndexExplainServiceImpl implements IndexExplainService { tb.setOriginValue(score.getOriginValue()); tb.setScore(String.valueOf(score.getScore())); tb.setQuantity(score.getQuantity()); - tb.setWeight(score.getWeight().multiply(new BigDecimal(100)).setScale(NumConstant.TWO, BigDecimal.ROUND_HALF_UP) + "%"); + tb.setWeight(score.getWeight().multiply(new BigDecimal(NumConstant.ONE_HUNDRED)).setScale(NumConstant.TWO, BigDecimal.ROUND_HALF_UP) + "%"); } } } - - break; default: @@ -148,18 +158,27 @@ public class IndexExplainServiceImpl implements IndexExplainService { } } - private List setDefaultTableData(Map> detailEntityMap, String type, String allIndexCodePath) { + private List setDefaultTableData(String orgLevel, String type, Map> detailEntityMap, IndexExplainResult result, String allIndexCodePath) { List indexGroupDetailEntities = detailEntityMap.get(allIndexCodePath); List tableList = new ArrayList<>(); + List threlodList = new ArrayList<>(); indexGroupDetailEntities.forEach(index -> { IndexScoreDetailResult table = new IndexScoreDetailResult(); + if ("grid".equals(orgLevel) && IndexConstant.ZI_SHEN.equals(type) && index.getAllIndexCodePath().contains(IndexConstant.XIA_JI)) { + return; + } table.setIndexCode(index.getIndexCode()); table.setIndexName(index.getIndexName()); table.setOriginValue(NumConstant.ZERO_STR); table.setScore(NumConstant.ZERO_STR); table.setWeight(index.getWeight().multiply(new BigDecimal(100)).setScale(NumConstant.TWO, BigDecimal.ROUND_HALF_UP) + "%"); tableList.add(table); + if (new BigDecimal(-1).compareTo(index.getThreshold()) != 0) { + threlodList.add(index.getIndexName().concat(String.format(IndexConstant.THRESHOLD_TEXT, index.getThreshold().intValue()))); + } }); + result.setTableDataList(tableList); + result.setThresholdList(threlodList); return tableList; } @@ -182,15 +201,20 @@ public class IndexExplainServiceImpl implements IndexExplainService { } - private List getTableHeaders(IndexExplainTreeDTO explain) { - String type = explain.getType(); + private List getTableHeaders(String type, String allIndexCode, String orgLevel) { List headers = new ArrayList<>(); - if ("zishen".equals(type)) { - headers = IndexConstant.getStandardSelfHeaders(explain.getIndexCode()); - - } else if ("xiaji".equals(type)) { - headers = IndexConstant.getStandardSubHeaders(explain.getIndexCode()); + switch (orgLevel) { + case "grid": + //还没确定怎么搞 + default: + if ("zishen".equals(type)) { + headers = IndexConstant.getStandardSelfHeaders(allIndexCode); + + } else if ("xiaji".equals(type)) { + headers = IndexConstant.getStandardSubHeaders(allIndexCode); + } } + return headers; } } diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/index/IndexExplainDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/index/IndexExplainDao.xml index 392ba21ddd..9c7f5d0870 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/index/IndexExplainDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/index/IndexExplainDao.xml @@ -14,14 +14,13 @@ - \ No newline at end of file From 81c5c0775379714f31843172efb8fd6d8b3b9c90 Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Wed, 19 May 2021 17:42:34 +0800 Subject: [PATCH 049/128] =?UTF-8?q?=E5=85=9A=E5=91=98=E5=85=88=E9=94=8B?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=B1=95=E7=A4=BA=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../result/PartyMemberVanguardRankResultDTO.java | 5 +++++ .../dataaggre/dao/datastats/DataStatsDao.java | 2 ++ .../datastats/impl/DataStatsServiceImpl.java | 5 +++++ .../resources/mapper/datastats/DatsStatsDao.xml | 14 ++++++++++++++ 4 files changed, 26 insertions(+) diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/PartyMemberVanguardRankResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/PartyMemberVanguardRankResultDTO.java index 9d2f643229..57640eea9a 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/PartyMemberVanguardRankResultDTO.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/PartyMemberVanguardRankResultDTO.java @@ -13,6 +13,11 @@ import java.util.List; @Data public class PartyMemberVanguardRankResultDTO implements Serializable { private static final long serialVersionUID = -3103242333633668412L; + /** + * + * 组织级别 社区级:community,乡(镇、街道)级:street,区县级: district,市级: city,省级:province + */ + private String agencyLevel; private List agencyRank; private List gridRank; } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/datastats/DataStatsDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/datastats/DataStatsDao.java index 61632b35bd..02d6e72a76 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/datastats/DataStatsDao.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/datastats/DataStatsDao.java @@ -226,4 +226,6 @@ public interface DataStatsDao { @Param("dateId") String dateId, @Param("orgId") String orgId, @Param("actCategoryDictDTOList") List actCategoryDictDTOList); + + DimAgencyEntity getAgencyInfo(@Param("agencyId") String agencyId); } \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java index 415b1e969b..9daf0c36ab 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java @@ -962,7 +962,11 @@ public class DataStatsServiceImpl implements DataStatsService { */ @Override public PartyMemberVanguardRankResultDTO vanguardRank(PartyMemberVanguardFormDTO formDTO) { + //获取组织级别 + DimAgencyEntity agency = dataStatsDao.getAgencyInfo(formDTO.getAgencyId()); + //组织排行 List agencyRank = dataStatsDao.selectAgencyVanguardRank(formDTO.getAgencyId()); + //网格排行 List gridRank = dataStatsDao.selectGridVanguardRank(formDTO.getAgencyId()); PartyMemberVanguardRankResultDTO result = new PartyMemberVanguardRankResultDTO(); result.setAgencyRank(CollectionUtils.isNotEmpty(agencyRank)?agencyRank:Collections.emptyList()); @@ -983,6 +987,7 @@ public class DataStatsServiceImpl implements DataStatsService { item.setProjectRatio(transform(item.getProjectRatio())); item.setProjectClosedRatio(transform(item.getProjectClosedRatio())); }); + result.setAgencyLevel(agency.getLevel()); return result; } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml index 0b41cf0b15..1f1663bd49 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml @@ -598,4 +598,18 @@ AND m.ORG_ID = #{orgId} + \ No newline at end of file From 61e0c6780bc1af1fc177f9b942154cecd5f0301b Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 19 May 2021 18:02:31 +0800 Subject: [PATCH 050/128] =?UTF-8?q?=E5=BE=97=E5=88=86=E8=AF=B4=E6=98=8E-?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=9A=82=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dao/fact/FactIndexAgencySubScoreDao.java | 4 ++ .../fact/FactIndexCommunitySubScoreDao.java | 12 +++++ .../dao/fact/FactIndexGridSubScoreDao.java | 2 +- .../index/impl/IndexExplainServiceImpl.java | 50 +++++++++++++++---- .../fact/FactIndexAgencySubScoreDao.xml | 15 ++++++ .../fact/FactIndexCommunitySubScoreDao.xml | 15 ++++++ .../mapper/fact/FactIndexGridSubScoreDao.xml | 19 +------ 7 files changed, 87 insertions(+), 30 deletions(-) diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexAgencySubScoreDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexAgencySubScoreDao.java index 0fd8e29c06..5347867afc 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexAgencySubScoreDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexAgencySubScoreDao.java @@ -17,6 +17,8 @@ package com.epmet.datareport.dao.fact; +import com.epmet.evaluationindex.index.form.IndexScoreFormDTO; +import com.epmet.evaluationindex.index.result.IndexScoreResult; import com.epmet.evaluationindex.screen.dto.form.AblityListFormDTO; import com.epmet.evaluationindex.screen.dto.form.MonthAblityListFormDTO; import com.epmet.evaluationindex.screen.dto.result.AblityListResultDTO; @@ -48,4 +50,6 @@ public interface FactIndexAgencySubScoreDao { * @author sun */ LinkedList selectMonthAblityList(MonthAblityListFormDTO formDTO); + + List selectSubScore(IndexScoreFormDTO ablityListFormDTO); } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexCommunitySubScoreDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexCommunitySubScoreDao.java index 1689ab0b3c..5c38d0985e 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexCommunitySubScoreDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexCommunitySubScoreDao.java @@ -17,6 +17,8 @@ package com.epmet.datareport.dao.fact; +import com.epmet.evaluationindex.index.form.IndexScoreFormDTO; +import com.epmet.evaluationindex.index.result.IndexScoreResult; import com.epmet.evaluationindex.screen.dto.form.AblityListFormDTO; import com.epmet.evaluationindex.screen.dto.form.MonthAblityListFormDTO; import com.epmet.evaluationindex.screen.dto.result.AblityListResultDTO; @@ -48,4 +50,14 @@ public interface FactIndexCommunitySubScoreDao { * @author sun */ LinkedList selectCommunityMonthAblityList(MonthAblityListFormDTO formDTO); + + /** + * desc: 查询分数 + * + * @param ablityListFormDTO + * @return java.util.List + * @author LiuJanJun + * @date 2021/5/14 2:07 下午 + */ + List selectSubScore(IndexScoreFormDTO ablityListFormDTO); } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexGridSubScoreDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexGridSubScoreDao.java index b71adcdd4e..8a64352187 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexGridSubScoreDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexGridSubScoreDao.java @@ -59,5 +59,5 @@ public interface FactIndexGridSubScoreDao { * @author LiuJanJun * @date 2021/5/14 2:07 下午 */ - List selectGridSubScore(IndexScoreFormDTO ablityListFormDTO); + List selectSubScore(IndexScoreFormDTO ablityListFormDTO); } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/index/impl/IndexExplainServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/index/impl/IndexExplainServiceImpl.java index 4eeb95a14b..ef85b31714 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/index/impl/IndexExplainServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/index/impl/IndexExplainServiceImpl.java @@ -24,6 +24,8 @@ import com.epmet.constant.DataSourceConstant; import com.epmet.datareport.constant.IndexConstant; import com.epmet.datareport.dao.evaluationindex.index.IndexExplainDao; import com.epmet.datareport.dao.evaluationindex.index.IndexGroupDetailDao; +import com.epmet.datareport.dao.fact.FactIndexAgencySubScoreDao; +import com.epmet.datareport.dao.fact.FactIndexCommunitySubScoreDao; import com.epmet.datareport.dao.fact.FactIndexCpcSubScoreDao; import com.epmet.datareport.dao.fact.FactIndexGridSubScoreDao; import com.epmet.datareport.service.evaluationindex.index.IndexExplainService; @@ -34,6 +36,7 @@ import com.epmet.evaluationindex.index.result.IndexExplainResult; import com.epmet.evaluationindex.index.result.IndexGroupDetailResult; import com.epmet.evaluationindex.index.result.IndexScoreDetailResult; import com.epmet.evaluationindex.index.result.IndexScoreResult; +import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -51,6 +54,7 @@ import java.util.stream.Collectors; * @author generator generator@elink-cn.com * @since v1.0.0 2021-05-12 */ +@Slf4j @Service @DataSource(DataSourceConstant.EVALUATION_INDEX) public class IndexExplainServiceImpl implements IndexExplainService { @@ -63,6 +67,10 @@ public class IndexExplainServiceImpl implements IndexExplainService { private FactIndexGridSubScoreDao gridSubScoreDao; @Autowired private FactIndexCpcSubScoreDao factIndexCpcSubScoreDao; + @Autowired + private FactIndexCommunitySubScoreDao communitySubScoreDao; + @Autowired + private FactIndexAgencySubScoreDao agencySubScoreDao; @Override @@ -104,6 +112,11 @@ public class IndexExplainServiceImpl implements IndexExplainService { String type = explainDTO.getType(); String orgLevel = formDTO.getOrgLevel(); + String allIndexCodePath = explainDTO.getIndexCode(); + + //设置表头 + List tableHeaders = getTableHeaders(type, allIndexCodePath, orgLevel); + result.setTableTileList(tableHeaders); IndexScoreFormDTO ablityListFormDTO = new IndexScoreFormDTO(); ablityListFormDTO.setCustomerId(formDTO.getCustomerId()); @@ -111,32 +124,40 @@ public class IndexExplainServiceImpl implements IndexExplainService { ablityListFormDTO.setMonthId(StringUtils.isBlank(formDTO.getMonthId()) ? DateUtils.getCurrentTimeBeforeMonthId() : formDTO.getMonthId()); switch (orgLevel) { case "grid": - String allIndexCodePath = null; - if (IndexConstant.ZI_SHEN.equals(type)) { - allIndexCodePath = explainDTO.getIndexCode(); + if (IndexConstant.ZI_SHEN.equals(type)) { setDefaultTableData(orgLevel, type, detailEntityMap, result, allIndexCodePath); - //不下钻 ablityListFormDTO.setAllParentIndexCode(allIndexCodePath); - realScoreList = gridSubScoreDao.selectGridSubScore(ablityListFormDTO); + realScoreList = gridSubScoreDao.selectSubScore(ablityListFormDTO); } else if (IndexConstant.XIA_JI.equals(type)) { - allIndexCodePath = explainDTO.getIndexCode(); - setDefaultTableData(orgLevel, type, detailEntityMap, result, allIndexCodePath); - //下钻到党员 ablityListFormDTO.setAllParentIndexCode(allIndexCodePath); realScoreList = factIndexCpcSubScoreDao.selecCpcAvgScore(ablityListFormDTO); } - List tableHeaders = getTableHeaders(type, allIndexCodePath, orgLevel); - result.setTableTileList(tableHeaders); + break; case "community": - + setDefaultTableData(orgLevel, type, detailEntityMap, result, allIndexCodePath); + //不下钻 + ablityListFormDTO.setAllParentIndexCode(allIndexCodePath); + realScoreList = communitySubScoreDao.selectSubScore(ablityListFormDTO); + break; + case "street": + setDefaultTableData(orgLevel, type, detailEntityMap, result, allIndexCodePath); + //不下钻 + ablityListFormDTO.setAllParentIndexCode(allIndexCodePath); + realScoreList = agencySubScoreDao.selectSubScore(ablityListFormDTO); + break; + case "district": + setDefaultTableData(orgLevel, type, detailEntityMap, result, allIndexCodePath); + //不下钻 + ablityListFormDTO.setAllParentIndexCode(allIndexCodePath); + realScoreList = agencySubScoreDao.selectSubScore(ablityListFormDTO); break; default: @@ -174,6 +195,10 @@ public class IndexExplainServiceImpl implements IndexExplainService { private List setDefaultTableData(String orgLevel, String type, Map> detailEntityMap, IndexExplainResult result, String allIndexCodePath) { List indexGroupDetailEntities = detailEntityMap.get(allIndexCodePath); + if (CollectionUtils.isEmpty(indexGroupDetailEntities)){ + log.warn("setDefaultTableData allINdexCodePath:{} is config error",allIndexCodePath); + return null; + } List tableList = new ArrayList<>(); List threlodList = new ArrayList<>(); indexGroupDetailEntities.forEach(index -> { @@ -181,6 +206,9 @@ public class IndexExplainServiceImpl implements IndexExplainService { if ("grid".equals(orgLevel) && IndexConstant.ZI_SHEN.equals(type) && index.getAllIndexCodePath().contains(IndexConstant.XIA_JI)) { return; } + if (!"grid".equals(orgLevel) && !index.getAllIndexCodePath().contains(type)){ + return; + } table.setIndexCode(index.getIndexCode()); table.setIndexName(index.getIndexName()); table.setOriginValue(NumConstant.ZERO_STR); diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexAgencySubScoreDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexAgencySubScoreDao.xml index e1cbb6850b..3a5f74717c 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexAgencySubScoreDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexAgencySubScoreDao.xml @@ -40,5 +40,20 @@ ORDER BY fact.month_id ASC + diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCommunitySubScoreDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCommunitySubScoreDao.xml index b0fd69d5cf..35dec5b46b 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCommunitySubScoreDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCommunitySubScoreDao.xml @@ -40,5 +40,20 @@ ORDER BY fact.month_id ASC + diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexGridSubScoreDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexGridSubScoreDao.xml index eb2312455a..aa8f2550a8 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexGridSubScoreDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexGridSubScoreDao.xml @@ -40,21 +40,7 @@ ORDER BY fact.month_id ASC - SELECT fact.index_code, IF(fact.origin_value='',0,IFNULL(fact.origin_value,0)) AS origin_value, @@ -68,9 +54,6 @@ AND customer_id = #{customerId} AND grid_id = #{orgId} AND month_id = #{monthId} - - - From c2ca0073a7bfb21b24faade6cccfadb6115792d3 Mon Sep 17 00:00:00 2001 From: jianjun Date: Thu, 20 May 2021 10:29:28 +0800 Subject: [PATCH 051/128] =?UTF-8?q?=E6=8C=87=E6=A0=87=E5=AD=97=E5=85=B8?= =?UTF-8?q?=E9=A1=B9-=E8=AF=B4=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../screen/dto/result/AblityListResultDTO.java | 7 +++++++ .../controller/index/IndexExplainController.java | 15 +++++++++++++++ .../index/IndexExplainService.java | 12 ++++++++++++ .../index/impl/IndexExplainServiceImpl.java | 14 +++++++++----- .../mapper/fact/FactIndexAgencySubScoreDao.xml | 3 ++- .../mapper/fact/FactIndexCommunitySubScoreDao.xml | 3 ++- .../mapper/fact/FactIndexGridSubScoreDao.xml | 3 ++- .../main/resources/mapper/index/IndexDictDao.xml | 3 ++- 8 files changed, 51 insertions(+), 9 deletions(-) diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/AblityListResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/AblityListResultDTO.java index 2c8c7b6d00..d25c99c678 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/AblityListResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/AblityListResultDTO.java @@ -36,6 +36,13 @@ public class AblityListResultDTO implements Serializable { */ private BigDecimal weight; + /** + * 原始分数 + */ private Double score; + /** + * 加权分数(乘以权重后得分) + */ + private BigDecimal weightedScore; } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/index/IndexExplainController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/index/IndexExplainController.java index 14ab225481..abac68a416 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/index/IndexExplainController.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/index/IndexExplainController.java @@ -20,7 +20,9 @@ package com.epmet.datareport.controller.index; import com.epmet.commons.tools.utils.Result; import com.epmet.datareport.service.evaluationindex.index.IndexExplainService; import com.epmet.evaluationindex.index.form.IndexExplainFormDTO; +import com.epmet.evaluationindex.index.form.IndexScoreFormDTO; import com.epmet.evaluationindex.index.result.IndexExplainResult; +import com.epmet.evaluationindex.screen.dto.result.IndexDictResultDTO; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; @@ -58,5 +60,18 @@ public class IndexExplainController { return ok; } + /** + * desc: 指标字典项 + * + * @param formDTO + * @author LiuJanJun + * @date 2021/5/12 4:12 下午 + */ + @PostMapping("indexdict") + public Result getIndexMeaning(@RequestBody IndexScoreFormDTO formDTO){ + IndexDictResultDTO result = indexExplainService.getIndexMeaning(formDTO); + return new Result().ok(result); + } + } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/index/IndexExplainService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/index/IndexExplainService.java index 54c12aed09..c028422cd4 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/index/IndexExplainService.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/index/IndexExplainService.java @@ -18,7 +18,9 @@ package com.epmet.datareport.service.evaluationindex.index; import com.epmet.evaluationindex.index.form.IndexExplainFormDTO; +import com.epmet.evaluationindex.index.form.IndexScoreFormDTO; import com.epmet.evaluationindex.index.result.IndexExplainResult; +import com.epmet.evaluationindex.screen.dto.result.IndexDictResultDTO; import java.util.List; @@ -39,4 +41,14 @@ public interface IndexExplainService { * @date 2021/5/12 4:38 下午 */ List getScoreDetail(IndexExplainFormDTO formDTO); + + /** + * desc: 条件获取指标 + * + * @param formDTO + * @return com.epmet.evaluationindex.index.result.IndexDictResultDTO + * @author LiuJanJun + * @date 2021/5/20 10:20 上午 + */ + IndexDictResultDTO getIndexMeaning(IndexScoreFormDTO formDTO); } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/index/impl/IndexExplainServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/index/impl/IndexExplainServiceImpl.java index ef85b31714..3e035f30ae 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/index/impl/IndexExplainServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/index/impl/IndexExplainServiceImpl.java @@ -24,10 +24,7 @@ import com.epmet.constant.DataSourceConstant; import com.epmet.datareport.constant.IndexConstant; import com.epmet.datareport.dao.evaluationindex.index.IndexExplainDao; import com.epmet.datareport.dao.evaluationindex.index.IndexGroupDetailDao; -import com.epmet.datareport.dao.fact.FactIndexAgencySubScoreDao; -import com.epmet.datareport.dao.fact.FactIndexCommunitySubScoreDao; -import com.epmet.datareport.dao.fact.FactIndexCpcSubScoreDao; -import com.epmet.datareport.dao.fact.FactIndexGridSubScoreDao; +import com.epmet.datareport.dao.fact.*; import com.epmet.datareport.service.evaluationindex.index.IndexExplainService; import com.epmet.evaluationindex.index.dto.IndexExplainTreeDTO; import com.epmet.evaluationindex.index.form.IndexExplainFormDTO; @@ -36,6 +33,7 @@ import com.epmet.evaluationindex.index.result.IndexExplainResult; import com.epmet.evaluationindex.index.result.IndexGroupDetailResult; import com.epmet.evaluationindex.index.result.IndexScoreDetailResult; import com.epmet.evaluationindex.index.result.IndexScoreResult; +import com.epmet.evaluationindex.screen.dto.result.IndexDictResultDTO; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; @@ -58,7 +56,8 @@ import java.util.stream.Collectors; @Service @DataSource(DataSourceConstant.EVALUATION_INDEX) public class IndexExplainServiceImpl implements IndexExplainService { - + @Autowired + private IndexDictDao indexDictDao; @Autowired private IndexExplainDao indexExplainDao; @Autowired @@ -106,6 +105,11 @@ public class IndexExplainServiceImpl implements IndexExplainService { return results; } + @Override + public IndexDictResultDTO getIndexMeaning(IndexScoreFormDTO formDTO) { + return indexDictDao.selectIndexDict(formDTO.getIndexCode()); + } + private void setTableData(IndexExplainFormDTO formDTO, Map> detailEntityMap, IndexExplainTreeDTO explainDTO, IndexExplainResult result) { if (NumConstant.ONE == explainDTO.getIsSearch()) { List realScoreList = null; diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexAgencySubScoreDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexAgencySubScoreDao.xml index 3a5f74717c..954ce4c772 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexAgencySubScoreDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexAgencySubScoreDao.xml @@ -9,7 +9,8 @@ IF(fact.origin_value='',0,IFNULL(fact.origin_value,0)) AS "value", fact.score AS score, dict.index_name AS "name", - round(fact.WEIGHT,2) AS weight + round(fact.WEIGHT,2) AS weight, + (fact.SCORE * fact.WEIGHT) AS weightedScore FROM fact_index_agency_sub_score fact LEFT JOIN index_dict dict ON fact.index_code = dict.index_code diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCommunitySubScoreDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCommunitySubScoreDao.xml index 35dec5b46b..52f1e767f0 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCommunitySubScoreDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCommunitySubScoreDao.xml @@ -9,7 +9,8 @@ IF(fact.origin_value='',0,IFNULL(fact.origin_value,0)) AS "value", dict.index_name AS "name", fact.score AS score, - round(fact.WEIGHT,2) AS weight + round(fact.WEIGHT,2) AS weight, + (fact.SCORE * fact.WEIGHT) AS weightedScore FROM fact_index_community_sub_score fact LEFT JOIN index_dict dict ON fact.index_code = dict.index_code diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexGridSubScoreDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexGridSubScoreDao.xml index aa8f2550a8..e7b23aebcc 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexGridSubScoreDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexGridSubScoreDao.xml @@ -9,7 +9,8 @@ IF(fact.origin_value='',0,IFNULL(fact.origin_value,0)) AS "value", dict.index_name AS "name", fact.score AS score, - round(fact.WEIGHT,2) AS weight + round(fact.WEIGHT,2) AS weight, + (fact.SCORE * fact.WEIGHT) AS weightedScore FROM fact_index_grid_sub_score fact LEFT JOIN index_dict dict ON fact.index_code = dict.index_code diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/index/IndexDictDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/index/IndexDictDao.xml index fffd0604bf..28f6d1955b 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/index/IndexDictDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/index/IndexDictDao.xml @@ -18,7 +18,8 @@ SELECT index_name AS "indexName", index_code AS "indexCode", - value_type AS "valueType" + value_type AS "valueType", + INDEX_DESC FROM index_dict WHERE From c065da7cfbcde0178d97fbce3823633dc1562a94 Mon Sep 17 00:00:00 2001 From: jianjun Date: Thu, 20 May 2021 11:20:27 +0800 Subject: [PATCH 052/128] =?UTF-8?q?=E5=AF=86=E7=A0=81=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- epmet-module/data-aggregator/data-aggregator-server/pom.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/epmet-module/data-aggregator/data-aggregator-server/pom.xml b/epmet-module/data-aggregator/data-aggregator-server/pom.xml index 604d182cb8..a2cc3bc297 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/pom.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/pom.xml @@ -337,8 +337,8 @@ - epmet_data_statistical_user - EpmEt-db-UsEr + epmet + elink@833066 0 @@ -452,4 +452,4 @@ - \ No newline at end of file + From 76e989c0bfc853f4138bc3812a6aac16026295b8 Mon Sep 17 00:00:00 2001 From: jianjun Date: Thu, 20 May 2021 15:14:17 +0800 Subject: [PATCH 053/128] =?UTF-8?q?=E5=85=A8=E5=8C=BA=E6=9C=8D=E5=8A=A1?= =?UTF-8?q?=E6=8C=87=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../index/form/IndexScoreFormDTO.java | 5 +- .../datareport/constant/IndexConstant.java | 2 + .../dao/fact/FactIndexDeptSubScoreDao.java | 36 +++++++++ .../index/impl/IndexExplainServiceImpl.java | 80 ++++++++++++++----- .../fact/FactIndexAgencySubScoreDao.xml | 9 ++- .../mapper/fact/FactIndexDeptSubScoreDao.xml | 24 ++++++ 6 files changed, 135 insertions(+), 21 deletions(-) create mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexDeptSubScoreDao.java create mode 100644 epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexDeptSubScoreDao.xml diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/form/IndexScoreFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/form/IndexScoreFormDTO.java index 0ee464a9b5..f2f7f98a01 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/form/IndexScoreFormDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/form/IndexScoreFormDTO.java @@ -36,5 +36,8 @@ public class IndexScoreFormDTO implements Serializable { * 所有有权重的指标code拼接的字符串 冒号隔开 */ private String allParentIndexCode; - + /** + * pid + */ + private String pid; } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/constant/IndexConstant.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/constant/IndexConstant.java index 7bae5401c4..af1ae3588d 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/constant/IndexConstant.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/constant/IndexConstant.java @@ -31,6 +31,8 @@ public class IndexConstant { public static final String TABLE_DESC = "详见下表:"; public static final String INDEX_SCORE_TITLE = "当月指数"; public static final String INDEX_SCORE_DESC = "含义:自然月周期内,当月指数得分=党建指数得分*相关权重+治理指数得分*相关权重+服务指数得分*相关权重"; + public static final String INDEX_DISTRINCT_TABLE1_INDEX_CODE = "suoyoujiedaozlnlpjz"; + public static final String ZHI_LI_NENG_LI = "zhilinengli"; /** diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexDeptSubScoreDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexDeptSubScoreDao.java new file mode 100644 index 0000000000..7d84dd87e7 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexDeptSubScoreDao.java @@ -0,0 +1,36 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.datareport.dao.fact; + +import com.epmet.evaluationindex.index.form.IndexScoreFormDTO; +import com.epmet.evaluationindex.index.result.IndexScoreResult; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * 部门相关分数表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-02 + */ +@Mapper +public interface FactIndexDeptSubScoreDao { + + List selecDeptAvgScore(IndexScoreFormDTO ablityListFormDTO); +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/index/impl/IndexExplainServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/index/impl/IndexExplainServiceImpl.java index 3e035f30ae..6ca654a4ec 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/index/impl/IndexExplainServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/index/impl/IndexExplainServiceImpl.java @@ -70,6 +70,8 @@ public class IndexExplainServiceImpl implements IndexExplainService { private FactIndexCommunitySubScoreDao communitySubScoreDao; @Autowired private FactIndexAgencySubScoreDao agencySubScoreDao; + @Autowired + private FactIndexDeptSubScoreDao deptSubScoreDao; @Override @@ -125,43 +127,63 @@ public class IndexExplainServiceImpl implements IndexExplainService { IndexScoreFormDTO ablityListFormDTO = new IndexScoreFormDTO(); ablityListFormDTO.setCustomerId(formDTO.getCustomerId()); ablityListFormDTO.setOrgId(formDTO.getOrgId()); + ablityListFormDTO.setAllParentIndexCode(allIndexCodePath); ablityListFormDTO.setMonthId(StringUtils.isBlank(formDTO.getMonthId()) ? DateUtils.getCurrentTimeBeforeMonthId() : formDTO.getMonthId()); switch (orgLevel) { case "grid": if (IndexConstant.ZI_SHEN.equals(type)) { - setDefaultTableData(orgLevel, type, detailEntityMap, result, allIndexCodePath); + setDefaultTableData(orgLevel, type, detailEntityMap, result, allIndexCodePath, null); //不下钻 - ablityListFormDTO.setAllParentIndexCode(allIndexCodePath); realScoreList = gridSubScoreDao.selectSubScore(ablityListFormDTO); } else if (IndexConstant.XIA_JI.equals(type)) { - setDefaultTableData(orgLevel, type, detailEntityMap, result, allIndexCodePath); + setDefaultTableData(orgLevel, type, detailEntityMap, result, allIndexCodePath, null); //下钻到党员 - ablityListFormDTO.setAllParentIndexCode(allIndexCodePath); realScoreList = factIndexCpcSubScoreDao.selecCpcAvgScore(ablityListFormDTO); } break; case "community": - setDefaultTableData(orgLevel, type, detailEntityMap, result, allIndexCodePath); + setDefaultTableData(orgLevel, type, detailEntityMap, result, allIndexCodePath, null); //不下钻 - ablityListFormDTO.setAllParentIndexCode(allIndexCodePath); realScoreList = communitySubScoreDao.selectSubScore(ablityListFormDTO); break; case "street": - setDefaultTableData(orgLevel, type, detailEntityMap, result, allIndexCodePath); + setDefaultTableData(orgLevel, type, detailEntityMap, result, allIndexCodePath, null); //不下钻 - ablityListFormDTO.setAllParentIndexCode(allIndexCodePath); realScoreList = agencySubScoreDao.selectSubScore(ablityListFormDTO); break; case "district": - setDefaultTableData(orgLevel, type, detailEntityMap, result, allIndexCodePath); - //不下钻 - ablityListFormDTO.setAllParentIndexCode(allIndexCodePath); - realScoreList = agencySubScoreDao.selectSubScore(ablityListFormDTO); + System.out.println("========" + allIndexCodePath); + if (allIndexCodePath.contains(IndexConstant.ZHI_LI_NENG_LI)) { + List detailResults = detailEntityMap.get(allIndexCodePath); + + List indexGroupDetailEntities = new ArrayList<>(); + for (IndexGroupDetailResult index : detailResults) { + + if (IndexConstant.INDEX_DISTRINCT_TABLE1_INDEX_CODE.equals(index.getIndexCode())) { + indexGroupDetailEntities.add(index); + setDefaultTableData(orgLevel, type, detailEntityMap, result, allIndexCodePath, indexGroupDetailEntities); + //不下钻 + realScoreList = agencySubScoreDao.selectSubScore(ablityListFormDTO); + break; + } else { + //下钻 + setDefaultTableData(orgLevel, type, detailEntityMap, result, allIndexCodePath, null); + ablityListFormDTO.setPid(formDTO.getOrgId()); + realScoreList = deptSubScoreDao.selecDeptAvgScore(ablityListFormDTO); + } + } + } else { + setDefaultTableData(orgLevel, type, detailEntityMap, result, allIndexCodePath, null); + //不下钻 + realScoreList = agencySubScoreDao.selectSubScore(ablityListFormDTO); + } + + break; default: @@ -191,16 +213,22 @@ public class IndexExplainServiceImpl implements IndexExplainService { } tb.setOriginValue(score.getOriginValue()); tb.setScore(String.valueOf(score.getScore())); - tb.setQuantity(score.getQuantity()); + if (StringUtils.isNotBlank(score.getQuantity())) { + tb.setQuantity(score.getQuantity()); + } tb.setWeight(score.getWeight().multiply(new BigDecimal(NumConstant.ONE_HUNDRED)).setScale(NumConstant.TWO, BigDecimal.ROUND_HALF_UP) + "%"); } } } - private List setDefaultTableData(String orgLevel, String type, Map> detailEntityMap, IndexExplainResult result, String allIndexCodePath) { - List indexGroupDetailEntities = detailEntityMap.get(allIndexCodePath); - if (CollectionUtils.isEmpty(indexGroupDetailEntities)){ - log.warn("setDefaultTableData allINdexCodePath:{} is config error",allIndexCodePath); + private List setDefaultTableData(String orgLevel, String type, Map> detailEntityMap, + IndexExplainResult result, String allIndexCodePath, List indexGroupDetailEntities) { + + if (indexGroupDetailEntities == null) { + indexGroupDetailEntities = detailEntityMap.get(allIndexCodePath); + } + if (CollectionUtils.isEmpty(indexGroupDetailEntities)) { + log.warn("setDefaultTableData allINdexCodePath:{} is config error", allIndexCodePath); return null; } List tableList = new ArrayList<>(); @@ -210,7 +238,7 @@ public class IndexExplainServiceImpl implements IndexExplainService { if ("grid".equals(orgLevel) && IndexConstant.ZI_SHEN.equals(type) && index.getAllIndexCodePath().contains(IndexConstant.XIA_JI)) { return; } - if (!"grid".equals(orgLevel) && !index.getAllIndexCodePath().contains(type)){ + if ((!"grid".equals(orgLevel) && !"district".equals(orgLevel)) && !index.getAllIndexCodePath().contains(type)) { return; } table.setIndexCode(index.getIndexCode()); @@ -218,6 +246,7 @@ public class IndexExplainServiceImpl implements IndexExplainService { table.setOriginValue(NumConstant.ZERO_STR); table.setScore(NumConstant.ZERO_STR); table.setWeight(index.getWeight().multiply(new BigDecimal(100)).setScale(NumConstant.TWO, BigDecimal.ROUND_HALF_UP) + "%"); + table.setQuantity(NumConstant.ZERO_STR); tableList.add(table); if (new BigDecimal(-1).compareTo(index.getThreshold()) != 0) { threlodList.add(index.getIndexName().concat(String.format(IndexConstant.THRESHOLD_TEXT, index.getThreshold().intValue()))); @@ -257,7 +286,7 @@ public class IndexExplainServiceImpl implements IndexExplainService { headers = IndexConstant.getStandardSelfHeaders(allIndexCode); } else if ("xiaji".equals(type)) { - headers = IndexConstant.getStandardSubHeaders(allIndexCode); + headers = new ArrayList<>(IndexConstant.QuantityLastHeader); if (allIndexCode.contains("canyuyishi")) { headers.add(0, "组织内党员的参与议事指数考评分(平均值)"); } else if (allIndexCode.contains("lianxiqunzhong")) { @@ -265,6 +294,19 @@ public class IndexExplainServiceImpl implements IndexExplainService { } break; } + case "district": + if ("zishen".equals(type)) { + headers = IndexConstant.getStandardSelfHeaders(allIndexCode); + + } else if ("xiaji".equals(type)) { + headers = new ArrayList<>(IndexConstant.QuantityLastHeader); + if (allIndexCode.contains("quzhibumen")) { + headers.add(0, "区直部门各项治理指数指标"); + } else { + headers.add(0, "所有街道治理指数指标"); + } + } + break; default: if ("zishen".equals(type)) { headers = IndexConstant.getStandardSelfHeaders(allIndexCode); diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexAgencySubScoreDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexAgencySubScoreDao.xml index 954ce4c772..481d5be0f1 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexAgencySubScoreDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexAgencySubScoreDao.xml @@ -53,7 +53,14 @@ fact.del_flag = '0' AND fact.all_parent_index_code = #{allParentIndexCode} AND customer_id = #{customerId} - AND agency_id = #{orgId} + + + AND PARENT_AGENCY_ID = #{pid} + + + AND agency_id = #{orgId} + + AND month_id = #{monthId} diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexDeptSubScoreDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexDeptSubScoreDao.xml new file mode 100644 index 0000000000..af7d01495b --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexDeptSubScoreDao.xml @@ -0,0 +1,24 @@ + + + + + + + + + + From 328cccaa2922624b94c6fdb2ac591855c9d20cf8 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Thu, 20 May 2021 16:34:33 +0800 Subject: [PATCH 054/128] =?UTF-8?q?=E7=BE=A4=E4=BC=97=E4=B8=8D=E6=BB=A1?= =?UTF-8?q?=E5=BE=AE=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/IssueProjectCategoryDictServiceImpl.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueProjectCategoryDictServiceImpl.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueProjectCategoryDictServiceImpl.java index 46bed8859f..6e61017ed1 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueProjectCategoryDictServiceImpl.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueProjectCategoryDictServiceImpl.java @@ -509,6 +509,9 @@ public class IssueProjectCategoryDictServiceImpl extends BaseServiceImpl Date: Thu, 20 May 2021 17:54:25 +0800 Subject: [PATCH 055/128] =?UTF-8?q?orglevel=E6=9E=9A=E4=B8=BE=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../commons/tools/enums/OrgLevelEnum.java | 51 +++++++++++++++++++ .../index/impl/IndexExplainServiceImpl.java | 20 ++++---- .../fact/FactIndexAgencySubScoreDao.xml | 9 +--- 3 files changed, 61 insertions(+), 19 deletions(-) create mode 100644 epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/OrgLevelEnum.java diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/OrgLevelEnum.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/OrgLevelEnum.java new file mode 100644 index 0000000000..3462ad772b --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/OrgLevelEnum.java @@ -0,0 +1,51 @@ +package com.epmet.commons.tools.enums; + +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.RenException; + +/** + * 组织级别枚举类 + * dev|test|prod + * + * @author jianjun liu + * @date 2020-07-03 11:14 + **/ +public enum OrgLevelEnum { + /** + * 组织等级枚举 + */ + GRID("grid"), + COMMUNITY("community"), + STREET("street"), + DISTRICT("district"), + CITY("city"), + PROVINCE("province"), + ; + + private String code; + + + + + OrgLevelEnum(String code) { + this.code = code; + + } + + public static OrgLevelEnum getEnum(String code) { + OrgLevelEnum[] values = OrgLevelEnum.values(); + for (OrgLevelEnum value : values) { + if (value.getCode().equals(code)) { + return value; + } + } + throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode()); + } + + + + + public String getCode() { + return code; + } +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/index/impl/IndexExplainServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/index/impl/IndexExplainServiceImpl.java index 6ca654a4ec..a08c32bc6e 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/index/impl/IndexExplainServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/index/impl/IndexExplainServiceImpl.java @@ -19,6 +19,7 @@ package com.epmet.datareport.service.evaluationindex.index.impl; import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.enums.OrgLevelEnum; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.constant.DataSourceConstant; import com.epmet.datareport.constant.IndexConstant; @@ -129,9 +130,9 @@ public class IndexExplainServiceImpl implements IndexExplainService { ablityListFormDTO.setOrgId(formDTO.getOrgId()); ablityListFormDTO.setAllParentIndexCode(allIndexCodePath); ablityListFormDTO.setMonthId(StringUtils.isBlank(formDTO.getMonthId()) ? DateUtils.getCurrentTimeBeforeMonthId() : formDTO.getMonthId()); - switch (orgLevel) { - case "grid": - + OrgLevelEnum anEnum = OrgLevelEnum.getEnum(orgLevel); + switch (anEnum) { + case GRID: if (IndexConstant.ZI_SHEN.equals(type)) { setDefaultTableData(orgLevel, type, detailEntityMap, result, allIndexCodePath, null); //不下钻 @@ -144,20 +145,18 @@ public class IndexExplainServiceImpl implements IndexExplainService { realScoreList = factIndexCpcSubScoreDao.selecCpcAvgScore(ablityListFormDTO); } - break; - case "community": + case COMMUNITY: setDefaultTableData(orgLevel, type, detailEntityMap, result, allIndexCodePath, null); //不下钻 realScoreList = communitySubScoreDao.selectSubScore(ablityListFormDTO); break; - case "street": + case STREET: setDefaultTableData(orgLevel, type, detailEntityMap, result, allIndexCodePath, null); //不下钻 realScoreList = agencySubScoreDao.selectSubScore(ablityListFormDTO); break; - case "district": - System.out.println("========" + allIndexCodePath); + case DISTRICT: if (allIndexCodePath.contains(IndexConstant.ZHI_LI_NENG_LI)) { List detailResults = detailEntityMap.get(allIndexCodePath); @@ -171,7 +170,7 @@ public class IndexExplainServiceImpl implements IndexExplainService { realScoreList = agencySubScoreDao.selectSubScore(ablityListFormDTO); break; } else { - //下钻 + //下钻到区直部门 setDefaultTableData(orgLevel, type, detailEntityMap, result, allIndexCodePath, null); ablityListFormDTO.setPid(formDTO.getOrgId()); realScoreList = deptSubScoreDao.selecDeptAvgScore(ablityListFormDTO); @@ -183,10 +182,9 @@ public class IndexExplainServiceImpl implements IndexExplainService { realScoreList = agencySubScoreDao.selectSubScore(ablityListFormDTO); } - break; default: - + log.error("暂不支持更高级别的查询,level:{}",orgLevel); } setRealValue(result.getTableDataList(), realScoreList); diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexAgencySubScoreDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexAgencySubScoreDao.xml index 481d5be0f1..954ce4c772 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexAgencySubScoreDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexAgencySubScoreDao.xml @@ -53,14 +53,7 @@ fact.del_flag = '0' AND fact.all_parent_index_code = #{allParentIndexCode} AND customer_id = #{customerId} - - - AND PARENT_AGENCY_ID = #{pid} - - - AND agency_id = #{orgId} - - + AND agency_id = #{orgId} AND month_id = #{monthId} From 3ffbd3b55e3d58f881d846fe2d0cecf41653d190 Mon Sep 17 00:00:00 2001 From: jianjun Date: Fri, 21 May 2021 10:14:43 +0800 Subject: [PATCH 056/128] =?UTF-8?q?=E8=BF=94=E5=9B=9E=E6=8C=87=E6=A0=87?= =?UTF-8?q?=E8=AF=B4=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../screen/dto/result/IndexDictResultDTO.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/IndexDictResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/IndexDictResultDTO.java index 196837f220..bf3670b11f 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/IndexDictResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/IndexDictResultDTO.java @@ -3,7 +3,6 @@ package com.epmet.evaluationindex.screen.dto.result; import lombok.Data; import java.io.Serializable; -import java.util.List; /** * 评价指标字典表数据--接口返参 @@ -18,6 +17,10 @@ public class IndexDictResultDTO implements Serializable { * 指标名 */ private String indexName; + /** + * 指标名 + */ + private String indexDesc; /** * 指标code */ From 84ced263052bc7f416471b5d286da094c626a040 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Fri, 21 May 2021 15:42:40 +0800 Subject: [PATCH 057/128] =?UTF-8?q?=E6=94=AF=E9=83=A8=E5=BB=BA=E8=AE=BE?= =?UTF-8?q?=E3=80=81=E8=81=94=E5=BB=BA=E5=85=B1=E5=BB=BA=E6=96=B0=E5=A2=9E?= =?UTF-8?q?2=E5=BC=A0=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../migration/V0.0.14__groupact_analysis.sql | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.14__groupact_analysis.sql diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.14__groupact_analysis.sql b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.14__groupact_analysis.sql new file mode 100644 index 0000000000..ee35df8d10 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.14__groupact_analysis.sql @@ -0,0 +1,49 @@ +-- epmet_data_statistical 库执行以下脚本 +-- CREATE TABLE `fact_group_act_daily` ( +-- `ID` varchar(64) NOT NULL COMMENT '主键', +-- `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID', +-- `DATE_ID` varchar(8) NOT NULL COMMENT '数据更新至日期Id:yyyyMMdd', +-- `ORG_ID` varchar(64) NOT NULL COMMENT '网格id', +-- `ORG_TYPE` varchar(10) NOT NULL COMMENT '网格:grid;组织:agency', +-- `PID` varchar(255) DEFAULT NULL COMMENT '1)orgType=grid: pid=网格所属组织id;\r\n2)orgType=agency: pid=当前组织的上级组织', +-- `PIDS` varchar(255) DEFAULT NULL COMMENT '1)orgType=grid: pids=网格所有上级组织,包括pid;\r\n2)orgType=agency: pids=当前组织的所有上级组织,包括pid.', +-- `CATEGORY_CODE` varchar(255) NOT NULL COMMENT '活动分类编码', +-- `PARENT_CODE` varchar(255) NOT NULL COMMENT '上级分类编码', +-- `LEVEL` int(11) NOT NULL COMMENT '分类等级', +-- `ORGANIZE_TOTAL` int(11) NOT NULL COMMENT '截止到dateId: 组织次数;包含dateId这一天的数据', +-- `PARTICIPATE_USER_TOTAL` int(11) NOT NULL COMMENT '截止到dateId: 参加人数;包含dateId这一天的数据', +-- `AVG_PARTICIPATE_USER_TOTAL` int(11) NOT NULL COMMENT '截止到dateId: 平均参加人数;包含dateId这一天的数据', +-- `DEL_FLAG` char(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除;1已删除', +-- `REVISION` int(11) NOT NULL DEFAULT '0' COMMENT '乐观锁', +-- `CREATED_BY` varchar(64) NOT NULL COMMENT '创建人', +-- `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', +-- `UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人', +-- `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', +-- PRIMARY KEY (`ID`) USING BTREE +-- ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='组织活动(参加人数、组织次数、平均参加人数)按天累计值分析'; + + + + +-- CREATE TABLE `fact_group_act_monthly` ( +-- `ID` varchar(64) NOT NULL COMMENT '主键', +-- `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID', +-- `MONTH_ID` varchar(8) NOT NULL COMMENT '数据维度:yyyyMM', +-- `ORG_ID` varchar(64) NOT NULL COMMENT '网格id', +-- `ORG_TYPE` varchar(10) NOT NULL COMMENT '网格:grid;组织:agency', +-- `PID` varchar(255) DEFAULT NULL COMMENT '1)orgType=grid: pid=网格所属组织id;\r\n2)orgType=agency: pid=当前组织的上级组织', +-- `PIDS` varchar(255) DEFAULT NULL COMMENT '1)orgType=grid: pids=网格所有上级组织,包括pid;\r\n2)orgType=agency: pids=当前组织的所有上级组织,包括pid.', +-- `CATEGORY_CODE` varchar(255) NOT NULL COMMENT '活动分类编码', +-- `PARENT_CODE` varchar(255) NOT NULL COMMENT '上级分类编码', +-- `LEVEL` int(11) NOT NULL COMMENT '分类等级', +-- `ORGANIZE_INCR` int(11) NOT NULL COMMENT '本月内:活动组织次数', +-- `PARTICIPATE_USER__INCR` int(11) NOT NULL COMMENT '本月内:活动签到人数参加人数', +-- `AVG_PARTICIPATE_USER_INCR` int(11) NOT NULL COMMENT '本月内:平均参加人数', +-- `DEL_FLAG` char(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除;1已删除', +-- `REVISION` int(11) NOT NULL DEFAULT '0' COMMENT '乐观锁', +-- `CREATED_BY` varchar(64) NOT NULL COMMENT '创建人', +-- `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', +-- `UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人', +-- `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', +-- PRIMARY KEY (`ID`) USING BTREE +-- ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='专项组活动(参加人数、组织次数、平均参加人数)按月增量分析'; \ No newline at end of file From daf5d5dff7980c89d66c374518bbb27ad83bfd0f Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Mon, 24 May 2021 09:59:27 +0800 Subject: [PATCH 058/128] =?UTF-8?q?=E6=B2=BB=E7=90=86=E5=AE=9E=E5=86=B5-?= =?UTF-8?q?=E6=B2=BB=E7=90=86=E6=8C=87=E6=95=B0-=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../datastats/form/AgencyGovrnFormDTO.java | 28 +++++++++++ .../dto/datastats/form/GridGovrnFormDTO.java | 28 +++++++++++ .../result/AgencyGovrnResultDTO.java | 37 ++++++++++++++ .../datastats/result/GridGovrnResultDTO.java | 29 +++++++++++ .../controller/DataStatsController.java | 49 +++++++++++++++++-- .../service/datastats/DataStatsService.java | 34 +++++++++++-- .../datastats/impl/DataStatsServiceImpl.java | 46 +++++++++++++++-- 7 files changed, 237 insertions(+), 14 deletions(-) create mode 100644 epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/AgencyGovrnFormDTO.java create mode 100644 epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/GridGovrnFormDTO.java create mode 100644 epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/AgencyGovrnResultDTO.java create mode 100644 epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/GridGovrnResultDTO.java diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/AgencyGovrnFormDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/AgencyGovrnFormDTO.java new file mode 100644 index 0000000000..1ad7a8149e --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/AgencyGovrnFormDTO.java @@ -0,0 +1,28 @@ +package com.epmet.dataaggre.dto.datastats.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Description 治理实况-当前组织治理指数-接口入参 + * @Auth sun + */ +@Data +public class AgencyGovrnFormDTO implements Serializable { + + private static final long serialVersionUID = -3381286960911634231L; + /** + * 组织Id + */ + @NotBlank(message = "组织ID不能为空",groups = AgencyGovrnFormDTO.Agency.class) + private String agencyId; + /** + * 日维度Id + */ + private String dateId; + public interface Agency extends CustomerClientShowGroup {} + +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/GridGovrnFormDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/GridGovrnFormDTO.java new file mode 100644 index 0000000000..1c8fe4b861 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/GridGovrnFormDTO.java @@ -0,0 +1,28 @@ +package com.epmet.dataaggre.dto.datastats.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Description 治理实况-当前网格治理指数-接口入参 + * @Auth sun + */ +@Data +public class GridGovrnFormDTO implements Serializable { + + private static final long serialVersionUID = -3381286960911634231L; + /** + * 网格Id + */ + @NotBlank(message = "网格Id不能为空",groups = GridGovrnFormDTO.Grid.class) + private String gridId; + /** + * 日维度Id + */ + private String dateId; + public interface Grid extends CustomerClientShowGroup {} + +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/AgencyGovrnResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/AgencyGovrnResultDTO.java new file mode 100644 index 0000000000..72f331a500 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/AgencyGovrnResultDTO.java @@ -0,0 +1,37 @@ +package com.epmet.dataaggre.dto.datastats.result; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * @Description 治理实况-当前组织治理指数-接口返参 + * @Auth sun + */ +@Data +public class AgencyGovrnResultDTO implements Serializable { + private static final long serialVersionUID = 466974582608407121L; + @JsonIgnore + BigDecimal bi = new BigDecimal(0); + //组织Id + private String agencyId; + //组织名称 + private String agencyName; + //机关级别(社区级:community, 乡(镇、街道)级:street, 区县级: district, 市级: city 省级:province) + private String level; + //问题解决总数 + private Integer a = 0; + //党群自治占比 + private BigDecimal b = bi; + //网格自治占比 + private BigDecimal c = bi; + //社区解决占比 + private BigDecimal d = bi; + //区直部门解决占比 + private BigDecimal e = bi; + //街道解决占比 + private BigDecimal f = bi; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/GridGovrnResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/GridGovrnResultDTO.java new file mode 100644 index 0000000000..0aa7f5852e --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/GridGovrnResultDTO.java @@ -0,0 +1,29 @@ +package com.epmet.dataaggre.dto.datastats.result; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * @Description 治理实况-当前网格治理指数-接口返参 + * @Auth sun + */ +@Data +public class GridGovrnResultDTO implements Serializable { + private static final long serialVersionUID = 466974582608407121L; + @JsonIgnore + BigDecimal bi = new BigDecimal(0); + //网格Id + private String gridId; + //网格名称 + private String gridName; + //问题解决总数 + private Integer a = 0; + //党群自治占比 + private BigDecimal b = bi; + //网格自治占比 + private BigDecimal c = bi; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/DataStatsController.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/DataStatsController.java index 162b7e5671..0546d0c846 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/DataStatsController.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/DataStatsController.java @@ -2,10 +2,7 @@ package com.epmet.dataaggre.controller; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; -import com.epmet.dataaggre.dto.datastats.form.AgenctBasicDataFormDTO; -import com.epmet.dataaggre.dto.datastats.form.GridBasicDataFormDTO; -import com.epmet.dataaggre.dto.datastats.form.SubAgencyFormDTO; -import com.epmet.dataaggre.dto.datastats.form.SubGridFormDTO; +import com.epmet.dataaggre.dto.datastats.form.*; import com.epmet.dataaggre.dto.datastats.result.*; import com.epmet.dataaggre.service.datastats.DataStatsService; import org.springframework.beans.factory.annotation.Autowired; @@ -159,4 +156,48 @@ public class DataStatsController { return new Result>().ok(dataStatsService.subGridProject(formDTO)); } + /** + * @Param formDTO + * @Description 治理实况-当前组织治理指数 + * @author sun + */ + @PostMapping("agencygovrn") + public Result agencyGovrn(@RequestBody AgencyGovrnFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, AgencyGovrnFormDTO.Agency.class); + return new Result().ok(dataStatsService.agencyGovrn(formDTO)); + } + + /** + * @Param formDTO + * @Description 治理实况-组织直属下级治理指数列表 + * @author sun + */ + @PostMapping("subagencygovrnlist") + public Result> subAgencyGovrnList(@RequestBody AgencyGovrnFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, AgencyGovrnFormDTO.Agency.class); + return new Result>().ok(dataStatsService.subAgencyGovrnList(formDTO)); + } + + /** + * @Param formDTO + * @Description 治理实况-当前网格治理指数 + * @author sun + */ + @PostMapping("gridgovrn") + public Result gridGovrn(@RequestBody GridGovrnFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, GridGovrnFormDTO.Grid.class); + return new Result().ok(dataStatsService.gridGovrn(formDTO)); + } + + /** + * @Param formDTO + * @Description 治理实况-组织直属网格治理指数列表 + * @author sun + */ + @PostMapping("subgridgovrnlist") + public Result> subGridGovrnList(@RequestBody GridGovrnFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, GridGovrnFormDTO.Grid.class); + return new Result>().ok(dataStatsService.subGridGovrnList(formDTO)); + } + } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/DataStatsService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/DataStatsService.java index 1e99251989..472bc277b4 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/DataStatsService.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/DataStatsService.java @@ -1,11 +1,7 @@ package com.epmet.dataaggre.service.datastats; import com.epmet.dataaggre.dto.datastats.FactGroupActDailyDTO; -import com.epmet.dataaggre.dto.datastats.form.AgenctBasicDataFormDTO; -import com.epmet.dataaggre.dto.datastats.form.PartyMemberVanguardFormDTO; -import com.epmet.dataaggre.dto.datastats.form.GridBasicDataFormDTO; -import com.epmet.dataaggre.dto.datastats.form.SubAgencyFormDTO; -import com.epmet.dataaggre.dto.datastats.form.SubGridFormDTO; +import com.epmet.dataaggre.dto.datastats.form.*; import com.epmet.dataaggre.dto.datastats.result.*; import com.epmet.dataaggre.dto.resigroup.ActCategoryDictDTO; import com.epmet.dataaggre.dto.resigroup.result.GroupActRankDetailDTO; @@ -128,4 +124,32 @@ public interface DataStatsService { List querySubAnalysisByCode(String customerId, String pid, String dateId, String categoryCode); List selectGroupActRankDetail(String customerId, String dateId, String orgId, List actCategoryDictDTOList); + + /** + * @Param formDTO + * @Description 治理实况-当前组织治理指数 + * @author sun + */ + AgencyGovrnResultDTO agencyGovrn(AgencyGovrnFormDTO formDTO); + + /** + * @Param formDTO + * @Description 治理实况-组织直属下级治理指数列表 + * @author sun + */ + List subAgencyGovrnList(AgencyGovrnFormDTO formDTO); + + /** + * @Param formDTO + * @Description 治理实况-当前网格治理指数 + * @author sun + */ + GridGovrnResultDTO gridGovrn(GridGovrnFormDTO formDTO); + + /** + * @Param formDTO + * @Description 治理实况-组织直属网格治理指数列表 + * @author sun + */ + List subGridGovrnList(GridGovrnFormDTO formDTO); } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java index 9daf0c36ab..51bf154a84 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java @@ -7,11 +7,7 @@ import com.epmet.dataaggre.constant.DataSourceConstant; import com.epmet.dataaggre.constant.OrgConstant; import com.epmet.dataaggre.dao.datastats.DataStatsDao; import com.epmet.dataaggre.dto.datastats.FactGroupActDailyDTO; -import com.epmet.dataaggre.dto.datastats.form.AgenctBasicDataFormDTO; -import com.epmet.dataaggre.dto.datastats.form.PartyMemberVanguardFormDTO; -import com.epmet.dataaggre.dto.datastats.form.GridBasicDataFormDTO; -import com.epmet.dataaggre.dto.datastats.form.SubAgencyFormDTO; -import com.epmet.dataaggre.dto.datastats.form.SubGridFormDTO; +import com.epmet.dataaggre.dto.datastats.form.*; import com.epmet.dataaggre.dto.datastats.result.*; import com.epmet.dataaggre.dto.resigroup.ActCategoryDictDTO; import com.epmet.dataaggre.dto.resigroup.result.GroupActRankDetailDTO; @@ -1014,4 +1010,44 @@ public class DataStatsServiceImpl implements DataStatsService { return new ArrayList<>(); } + /** + * @Param formDTO + * @Description 治理实况-当前组织治理指数 + * @author sun + */ + @Override + public AgencyGovrnResultDTO agencyGovrn(AgencyGovrnFormDTO formDTO) { + return null; + } + + /** + * @Param formDTO + * @Description 治理实况-组织直属下级治理指数列表 + * @author sun + */ + @Override + public List subAgencyGovrnList(AgencyGovrnFormDTO formDTO) { + return null; + } + + /** + * @Param formDTO + * @Description 治理实况-当前网格治理指数 + * @author sun + */ + @Override + public GridGovrnResultDTO gridGovrn(GridGovrnFormDTO formDTO) { + return null; + } + + /** + * @Param formDTO + * @Description 治理实况-组织直属网格治理指数列表 + * @author sun + */ + @Override + public List subGridGovrnList(GridGovrnFormDTO formDTO) { + return null; + } + } From 9e9776e98b0e634ff18dd64b8b7eb51a485a3192 Mon Sep 17 00:00:00 2001 From: wxz Date: Mon, 24 May 2021 10:11:47 +0800 Subject: [PATCH 059/128] =?UTF-8?q?=E7=BD=91=E6=A0=BC=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E6=8C=87=E6=A0=87=E8=AE=A1=E7=AE=97=EF=BC=8C=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E5=B9=B3=E5=9D=87=E5=80=BC=E7=9A=84=E6=A0=B7=E6=9C=AC=E9=87=8F?= =?UTF-8?q?=E4=BF=9D=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../evaluationindex/indexcal/CpcScoreDao.java | 9 +-- .../indexcal/GridSubScoreEntity.java | 5 ++ .../com/epmet/model/AvgOperationResultVO.java | 21 +++++++ .../impl/GridCorreLationServiceImpl.java | 63 ++++++++++++++----- .../V0.0.14__cpc_subscore_add_samplecount.sql | 1 + .../evaluationindex/indexcal/CpcScoreDao.xml | 10 +-- .../indexcal/GridSubScoreDao.xml | 6 +- 7 files changed, 88 insertions(+), 27 deletions(-) create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/AvgOperationResultVO.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.14__cpc_subscore_add_samplecount.sql diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CpcScoreDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CpcScoreDao.java index c1b8e5b479..b4b6fc8869 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CpcScoreDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CpcScoreDao.java @@ -21,6 +21,7 @@ import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.indexcal.CalculateCommonFormDTO; import com.epmet.dto.indexcal.CpcScoreResultDTO; import com.epmet.entity.evaluationindex.indexcal.CpcScoreEntity; +import com.epmet.model.AvgOperationResultVO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -46,9 +47,9 @@ public interface CpcScoreDao extends BaseDao { * @description 获取网格内党员的联系群众能力考评分(平均值) * @Date 2020/8/31 10:56 **/ - BigDecimal selectGridContactMassesAvgValue(@Param("customerId") String customerId, - @Param("monthId") String monthId, - @Param("gridId") String gridId); + AvgOperationResultVO selectGridContactMassesAvgValue(@Param("customerId") String customerId, + @Param("monthId") String monthId, + @Param("gridId") String gridId); /** * @param formDTO @@ -77,7 +78,7 @@ public interface CpcScoreDao extends BaseDao { * @description 组织内党员的参与议事能力考评分(平均值) * @Date 2020/8/31 15:51 **/ - BigDecimal selectGridJoinIssueAvgValue(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("gridId") String gridId); + AvgOperationResultVO selectGridJoinIssueAvgValue(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("gridId") String gridId); int deleteByMonthId(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("indexCode") String indexCode, @Param("deleteSize") Integer deleteSize, @Param("isTotal") String isTotal); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/GridSubScoreEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/GridSubScoreEntity.java index fa88df4ba7..f6bf4bb903 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/GridSubScoreEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/GridSubScoreEntity.java @@ -101,4 +101,9 @@ public class GridSubScoreEntity extends BaseEpmetEntity { * 权重(同一组权重总和=1) */ private BigDecimal weight; + + /** + * 样本总量 + */ + private Integer sampleCount; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/AvgOperationResultVO.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/AvgOperationResultVO.java new file mode 100644 index 0000000000..d97ad2e264 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/AvgOperationResultVO.java @@ -0,0 +1,21 @@ +package com.epmet.model; + +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 平均值运算结果vo + */ +@Data +public class AvgOperationResultVO { + /** + * 样本量 + */ + private Integer sampleCount; + + /** + * 平均值 + */ + private BigDecimal avgValue; +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/GridCorreLationServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/GridCorreLationServiceImpl.java index b785d78b4a..e70200f06a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/GridCorreLationServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/GridCorreLationServiceImpl.java @@ -26,6 +26,7 @@ import com.epmet.entity.evaluationindex.indexcal.GridSelfSubScoreEntity; import com.epmet.entity.evaluationindex.indexcal.GridSubScoreEntity; import com.epmet.entity.evaluationindex.screen.IndexGroupDetailEntity; import com.epmet.eum.IndexCodeEnum; +import com.epmet.model.AvgOperationResultVO; import com.epmet.service.evaluationindex.indexcal.GridCorreLationService; import com.epmet.service.evaluationindex.indexcal.IndexCodeFieldReService; import com.epmet.service.evaluationindex.screen.IndexGroupDetailService; @@ -185,6 +186,7 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { **/ @Transactional(rollbackFor = Exception.class) public void calculateGridDangJian(CalculateCommonFormDTO formDTO) { + // 该客户下的指标列表及权重 List indexList = indexGroupDetailService.getDetailListByParentCode(formDTO.getCustomerId(), IndexCodeEnum.WANG_GE_XIANG_GUAN.getCode(), IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); @@ -192,7 +194,7 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { log.error("calculateGridDangJian customerId:{} have not any indexGroupDetail", formDTO.getCustomerId()); throw new RenException("客户【网格相关:党建能力】指标权重信息不存在"); } - //查询总记录数 + //查询总记录数(该客户下,该月份,每个网格一条,有多少条) int total = factIndexPartyAblityGridMonthlyDao.selectCount(formDTO); if (NumConstant.ZERO == total) { log.warn(String.format("customerId=%s,monthId=%s,没有上传网格相关-党建能力-五级指标数据", formDTO.getCustomerId(), formDTO.getMonthId())); @@ -210,10 +212,12 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { //指标集合 Map> indexMap = buildGridCorrelationIndexInputVO(formDTO, indexList, minAndMaxMap); List> resultMapList = new ArrayList<>(); + // 平均值计算结果,内含平均值,样本总量 + HashMap gridAvgOpeResultMap = new HashMap<>(); //分页查询采集记录 for (int pageNo = 1; pageNo <= totalPage; pageNo++) { int pageIndex = (pageNo - NumConstant.ONE) * IndexCalConstant.PAGE_SIZE; - //前10条 + //前10条。每个网格的党建能力的数据 List> recordList = queryListPartyAblityGrid(new PageQueryGridFormDTO(formDTO.getCustomerId(), formDTO.getMonthId(), pageIndex, @@ -231,8 +235,10 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { // log.info("组织内党员的联系群众能力考评分(平均值) 单独处理"); //网格内党员的联系群众能力考评分(平均值) String gridId = (String) recordMap.get(IndexCalConstant.GRID_ID); - BigDecimal contactMassesAvgValue = getGridContactMassesAvgValue(formDTO, gridId); - SampleValue contactMassesAblityValue = new SampleValue((String) recordMap.get(IndexCalConstant.GRID_ID), contactMassesAvgValue); + String monthId = (String) recordMap.get(IndexCalConstant.MONTH_ID); + AvgOperationResultVO contactMassesAvgVo = getGridContactMassesAvgValue(formDTO, gridId); + gridAvgOpeResultMap.put(gridId.concat(":").concat(monthId), contactMassesAvgVo); + SampleValue contactMassesAblityValue = new SampleValue((String) recordMap.get(IndexCalConstant.GRID_ID), contactMassesAvgVo.getAvgValue()); value.getIndexValueVOs().add(contactMassesAblityValue); }else if (StringUtils.isNotBlank(indexCodeFieldReService.getFieldNameByIndexCode(key))) { //对应的数值 @@ -251,7 +257,11 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { saveGridCorreLationResult(formDTO, resultMapList, IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(), - NumConstant.ZERO_STR); + NumConstant.ZERO_STR, + gridAvgOpeResultMap); + + // 清理map + gridAvgOpeResultMap.clear(); } /** @@ -312,10 +322,11 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { * @description 获取网格(组织)内党员的联系群众能力考评分(平均值) * @Date 2020/8/31 9:50 **/ - private BigDecimal getGridContactMassesAvgValue(CalculateCommonFormDTO calculateCommonFormDTO, String gridId) { - BigDecimal result = cpcScoreDao.selectGridContactMassesAvgValue(calculateCommonFormDTO.getCustomerId(), calculateCommonFormDTO.getMonthId(), gridId); + private AvgOperationResultVO getGridContactMassesAvgValue(CalculateCommonFormDTO calculateCommonFormDTO, String gridId) { + AvgOperationResultVO result = cpcScoreDao.selectGridContactMassesAvgValue(calculateCommonFormDTO.getCustomerId(), calculateCommonFormDTO.getMonthId(), gridId); if (null == result) { - return new BigDecimal(NumConstant.ZERO_STR); + result.setAvgValue(new BigDecimal(0)); + result.setSampleCount(0); } //FOR TEST /*BigDecimal result=null; @@ -337,10 +348,12 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { * @description 组织内党员的参与议事能力考评分(平均值) * @Date 2020/8/31 15:51 **/ - private BigDecimal getGridJoinIssueAvgValue(CalculateCommonFormDTO formDTO, String gridId) { - BigDecimal result = cpcScoreDao.selectGridJoinIssueAvgValue(formDTO.getCustomerId(), formDTO.getMonthId(), gridId); + private AvgOperationResultVO getGridJoinIssueAvgValue(CalculateCommonFormDTO formDTO, String gridId) { + AvgOperationResultVO result = cpcScoreDao.selectGridJoinIssueAvgValue(formDTO.getCustomerId(), formDTO.getMonthId(), gridId); if (null == result) { - return new BigDecimal(NumConstant.ZERO_STR); + //return new BigDecimal(NumConstant.ZERO_STR); + result.setSampleCount(0); + result.setAvgValue(new BigDecimal(0)); } //FOR TEST /*BigDecimal result=null; @@ -411,7 +424,7 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { /** * @param formDTO 客户id 月份id: yyyyMM - * @param resultMapList + * @param resultMapList key:网格id,value:该网格各项指标的计算结果 * @param indexCode 指标编码: 党建能力:dangjiannengli;治理能力:zhilinengli;服务能力:fuwunengli; * @param isTotal 1:总分;0不是 * @return void @@ -422,7 +435,8 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { private void saveGridCorreLationResult(CalculateCommonFormDTO formDTO, List> resultMapList, String indexCode, - String isTotal) { + String isTotal, + HashMap avgOpeResultVo) { String quarterId = DateUtils.getQuarterId(formDTO.getMonthId()); String yearId = DateUtils.getYearId(formDTO.getMonthId()); //三大能力结果表 @@ -463,6 +477,14 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { gridSubScoreEntity.setScore(detail.getScore()); gridSubScoreEntity.setWeight(detail.getWeight()); gridSubScoreEntity.setOriginValue(detail.getOriginValue()); + + // 为平均值类型的指标赋值样本总量 + AvgOperationResultVO avgOperationResultVO = avgOpeResultVo.get(gridSubScoreEntity.getGridId().concat(":").concat(gridSubScoreEntity.getMonthId())); + if (avgOperationResultVO != null) { + gridSubScoreEntity.setSampleCount(avgOperationResultVO.getSampleCount()); + } else { + gridSubScoreEntity.setSampleCount(0); + } gridSubScoreList.add(gridSubScoreEntity); } }); @@ -621,6 +643,7 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { //指标集合 Map> indexMap = buildGridCorrelationIndexInputVO(formDTO, indexList, minAndMaxMap); List> resultMapList = new ArrayList<>(); + HashMap avgOperationResultVo = new HashMap<>(); //分页查询采集记录 for (int pageNo = 1; pageNo <= totalPage; pageNo++) { int pageIndex = (pageNo - NumConstant.ONE) * IndexCalConstant.PAGE_SIZE; @@ -639,8 +662,11 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { if (IndexCodeEnum.ZUZHINEIDANGYDSYYSNLKPFPJZ.getCode().equals(key)) { // log.info("组织内党员的参与议事能力考评分(平均值) 单独处理"); String gridId = (String) recordMap.get(IndexCalConstant.GRID_ID); - BigDecimal joinAvgValue = getGridJoinIssueAvgValue(formDTO, gridId); - SampleValue contactMassesAblityValue = new SampleValue((String) recordMap.get(IndexCalConstant.GRID_ID), joinAvgValue); + String monthId = (String) recordMap.get(IndexCalConstant.MONTH_ID); + AvgOperationResultVO joinAvgValue = getGridJoinIssueAvgValue(formDTO, gridId); + avgOperationResultVo.put(gridId.concat(":").concat(monthId), joinAvgValue); + + SampleValue contactMassesAblityValue = new SampleValue((String) recordMap.get(IndexCalConstant.GRID_ID), joinAvgValue.getAvgValue()); value.getIndexValueVOs().add(contactMassesAblityValue); }else if (StringUtils.isNotBlank(indexCodeFieldReService.getFieldNameByIndexCode(key))) { //对应的数值 @@ -659,7 +685,8 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { saveGridCorreLationResult(formDTO, resultMapList, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(), - NumConstant.ZERO_STR); + NumConstant.ZERO_STR, + avgOperationResultVo); } @@ -696,6 +723,7 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { //指标集合 Map> indexMap = buildGridCorrelationIndexInputVO(formDTO, indexList, minAndMaxMap); List> resultMapList = new ArrayList<>(); + HashMap avgOperationResultVO = new HashMap<>(); //分页查询采集记录 for (int pageNo = 1; pageNo <= totalPage; pageNo++) { int pageIndex = (pageNo - NumConstant.ONE) * IndexCalConstant.PAGE_SIZE; @@ -730,7 +758,8 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { saveGridCorreLationResult(formDTO, resultMapList, IndexCodeEnum.FU_WU_NENG_LI.getCode(), - NumConstant.ZERO_STR); + NumConstant.ZERO_STR, + avgOperationResultVO); } /** diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.14__cpc_subscore_add_samplecount.sql b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.14__cpc_subscore_add_samplecount.sql new file mode 100644 index 0000000000..af7688ee68 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.14__cpc_subscore_add_samplecount.sql @@ -0,0 +1 @@ +alter table fact_index_grid_sub_score add column SAMPLE_COUNT int(10) comment '样本量' after ORIGIN_VALUE; \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CpcScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CpcScoreDao.xml index bf0cfd3d51..b4ad476821 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CpcScoreDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CpcScoreDao.xml @@ -46,9 +46,10 @@ - SELECT - round(AVG( SCORE ),6) AS AVG_CONTACT_MASSES_SCORE + round(AVG( SCORE ),6) AS AVG_VALUE, + count(1) AS SAMPLE_COUNT FROM fact_index_cpc_score m WHERE @@ -90,9 +91,10 @@ - SELECT - round(AVG( SCORE ),6) AS AVG_CONTACT_MASSES_SCORE + round(AVG( SCORE ),6) AS AVG_VALUE, + count(1) AS SAMPLE_COUNT FROM fact_index_cpc_score m WHERE diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/GridSubScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/GridSubScoreDao.xml index 056f92afb2..8d39d8dcc3 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/GridSubScoreDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/GridSubScoreDao.xml @@ -24,7 +24,8 @@ `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, - `UPDATED_TIME` + `UPDATED_TIME`, + `SAMPLE_COUNT` ) VALUES @@ -47,7 +48,8 @@ 'APP_USER', now(), 'APP_USER', - now() + now(), + #{item.sampleCount} ) From 7d03cd6b4169855cba62254bb7d536b461f65e25 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Mon, 24 May 2021 10:40:52 +0800 Subject: [PATCH 060/128] =?UTF-8?q?=E6=A8=A1=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../datastats/form/AgencyGovrnFormDTO.java | 10 ++ .../dto/datastats/form/GridGovrnFormDTO.java | 13 ++ .../result/AgencyGovrnResultDTO.java | 2 - .../controller/DataStatsController.java | 2 +- .../datastats/impl/DataStatsServiceImpl.java | 121 +++++++++++++++++- 5 files changed, 142 insertions(+), 6 deletions(-) diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/AgencyGovrnFormDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/AgencyGovrnFormDTO.java index 1ad7a8149e..82315c125f 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/AgencyGovrnFormDTO.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/AgencyGovrnFormDTO.java @@ -23,6 +23,16 @@ public class AgencyGovrnFormDTO implements Serializable { * 日维度Id */ private String dateId; + /** + * 排序类型字段 + * 问题解决总数:problem + * 党群自治占比:party + * 网格自治占比:grid + * 社区解决占比:community + * 区直部门解决占比:department + * 街道解决占比:street + */ + private String type; public interface Agency extends CustomerClientShowGroup {} } diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/GridGovrnFormDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/GridGovrnFormDTO.java index 1c8fe4b861..45eaa572c5 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/GridGovrnFormDTO.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/GridGovrnFormDTO.java @@ -14,6 +14,11 @@ import java.io.Serializable; public class GridGovrnFormDTO implements Serializable { private static final long serialVersionUID = -3381286960911634231L; + /** + * 组织Id + */ + @NotBlank(message = "机关Id不能为空",groups = GridGovrnFormDTO.Agency.class) + private String agencyId; /** * 网格Id */ @@ -23,6 +28,14 @@ public class GridGovrnFormDTO implements Serializable { * 日维度Id */ private String dateId; + /** + * 排序类型字段 + * 问题解决总数:problem + * 党群自治占比:party + * 网格自治占比:grid + */ + private String type; + public interface Agency extends CustomerClientShowGroup {} public interface Grid extends CustomerClientShowGroup {} } diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/AgencyGovrnResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/AgencyGovrnResultDTO.java index 72f331a500..b48a5602d7 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/AgencyGovrnResultDTO.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/AgencyGovrnResultDTO.java @@ -19,8 +19,6 @@ public class AgencyGovrnResultDTO implements Serializable { private String agencyId; //组织名称 private String agencyName; - //机关级别(社区级:community, 乡(镇、街道)级:street, 区县级: district, 市级: city 省级:province) - private String level; //问题解决总数 private Integer a = 0; //党群自治占比 diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/DataStatsController.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/DataStatsController.java index 0546d0c846..74b2552e43 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/DataStatsController.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/DataStatsController.java @@ -196,7 +196,7 @@ public class DataStatsController { */ @PostMapping("subgridgovrnlist") public Result> subGridGovrnList(@RequestBody GridGovrnFormDTO formDTO) { - ValidatorUtils.validateEntity(formDTO, GridGovrnFormDTO.Grid.class); + ValidatorUtils.validateEntity(formDTO, GridGovrnFormDTO.Agency.class); return new Result>().ok(dataStatsService.subGridGovrnList(formDTO)); } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java index 51bf154a84..1691ff528e 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java @@ -1017,6 +1017,20 @@ public class DataStatsServiceImpl implements DataStatsService { */ @Override public AgencyGovrnResultDTO agencyGovrn(AgencyGovrnFormDTO formDTO) { + AgencyGovrnResultDTO resultDTO = new AgencyGovrnResultDTO(); + resultDTO.setAgencyId(formDTO.getAgencyId()); + NumberFormat numberFormat = NumberFormat.getInstance(); + numberFormat.setMaximumFractionDigits(NumConstant.THREE); + + //入参有日期的则按具体时间执行,没有的则按当前时间前一天执行 + if (StringUtils.isBlank(formDTO.getDateId())) { + Date yesterday = DateUtils.addDateDays(new Date(), -1); + SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); + formDTO.setDateId(format.format(yesterday)); + } + //1.按日期查询当前组织事件治理指数 + + return null; } @@ -1027,7 +1041,53 @@ public class DataStatsServiceImpl implements DataStatsService { */ @Override public List subAgencyGovrnList(AgencyGovrnFormDTO formDTO) { - return null; + List resultList = new ArrayList<>(); + NumberFormat numberFormat = NumberFormat.getInstance(); + numberFormat.setMaximumFractionDigits(NumConstant.THREE); + + //入参有日期的则按具体时间执行,没有的则按当前时间前一天执行 + if (StringUtils.isBlank(formDTO.getDateId())) { + Date yesterday = DateUtils.addDateDays(new Date(), -1); + SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); + formDTO.setDateId(format.format(yesterday)); + } + //排序类型,默认按问题解决总数降序 + if (StringUtils.isBlank(formDTO.getDateId())) { + formDTO.setType("problem"); + } + + //1.查询当前组织的直属下级组织信息【机关维度】 + List subAgencyList = dataStatsDao.getSubAgencyList(formDTO.getAgencyId()); + if (subAgencyList.size() < NumConstant.ONE) { + return resultList; + } + List agencyIds = subAgencyList.stream().map(DimAgencyEntity::getId).collect(Collectors.toList()); + + //2.按日期查询所有下级组织的事件治理指数 + + //3.封装数据 + + //4.按要求排序并返回 + Collections.sort(resultList, new Comparator() { + @Override + public int compare(AgencyGovrnResultDTO o1, AgencyGovrnResultDTO o2) { + if ("party".equals(formDTO.getType())) { + return o2.getB().compareTo(o1.getB()); + } else if ("grid".equals(formDTO.getType())) { + return o2.getC().compareTo(o1.getC()); + } else if ("community".equals(formDTO.getType())) { + return o2.getD().compareTo(o1.getD()); + } else if ("department".equals(formDTO.getType())) { + return o2.getE().compareTo(o1.getE()); + } else if ("street".equals(formDTO.getType())) { + return o2.getF().compareTo(o1.getF()); + } else { + return o2.getA().compareTo(o1.getA()); + } + } + }); + + return resultList; } /** @@ -1037,7 +1097,22 @@ public class DataStatsServiceImpl implements DataStatsService { */ @Override public GridGovrnResultDTO gridGovrn(GridGovrnFormDTO formDTO) { - return null; + GridGovrnResultDTO resultDTO = new GridGovrnResultDTO(); + resultDTO.setGridId(formDTO.getGridId()); + NumberFormat numberFormat = NumberFormat.getInstance(); + numberFormat.setMaximumFractionDigits(NumConstant.THREE); + + //入参有日期的则按具体时间执行,没有的则按当前时间前一天执行 + if (StringUtils.isBlank(formDTO.getDateId())) { + Date yesterday = DateUtils.addDateDays(new Date(), -1); + SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); + formDTO.setDateId(format.format(yesterday)); + } + + //1.按日子查询网格事件治理指数 + + + return resultDTO; } /** @@ -1047,7 +1122,47 @@ public class DataStatsServiceImpl implements DataStatsService { */ @Override public List subGridGovrnList(GridGovrnFormDTO formDTO) { - return null; + List resultList = new ArrayList<>(); + NumberFormat numberFormat = NumberFormat.getInstance(); + numberFormat.setMaximumFractionDigits(NumConstant.THREE); + + //入参有日期的则按具体时间执行,没有的则按当前时间前一天执行 + if (StringUtils.isBlank(formDTO.getDateId())) { + Date yesterday = DateUtils.addDateDays(new Date(), -1); + SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); + formDTO.setDateId(format.format(yesterday)); + } + //排序类型,默认按问题解决总数降序 + if (StringUtils.isBlank(formDTO.getDateId())) { + formDTO.setType("problem"); + } + + //1.查询组织直属网格列表【网格维度】 + List gridList = dataStatsDao.getSubGridList(formDTO.getAgencyId()); + if (gridList.size() < NumConstant.ONE) { + return resultList; + } + List gridIds = gridList.stream().map(DimGridEntity::getId).collect(Collectors.toList()); + + //2.按日期查找组织直属网格事件治理指数列表 + + //3.封装数据 + + //4.按要求排序并返回 + Collections.sort(resultList, new Comparator() { + @Override + public int compare(GridGovrnResultDTO o1, GridGovrnResultDTO o2) { + if ("party".equals(formDTO.getType())) { + return o2.getB().compareTo(o1.getB()); + } else if ("grid".equals(formDTO.getType())) { + return o2.getC().compareTo(o1.getC()); + } else { + return o2.getA().compareTo(o1.getA()); + } + } + }); + + return resultList; } } From 78ad16e7e62873fcdd43fb79fd7cd7ffa0e98aa0 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Mon, 24 May 2021 14:33:21 +0800 Subject: [PATCH 061/128] =?UTF-8?q?=E6=9A=82=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/application.yml | 2 +- .../extract/FactGridGovernDailyDao.java | 33 +++++ .../extract/FactGridGovernDailyEntity.java | 135 ++++++++++++++++++ .../todata/FactGridGovernDailyService.java | 32 +++++ .../impl/FactGridGovernDailyServiceImpl.java | 35 +++++ .../extract/FactGridGovernDailyDao.xml | 7 + 6 files changed, 243 insertions(+), 1 deletion(-) create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactGridGovernDailyDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactGridGovernDailyEntity.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactGridGovernDailyService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactGridGovernDailyServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactGridGovernDailyDao.xml diff --git a/epmet-cloud-generator/src/main/resources/application.yml b/epmet-cloud-generator/src/main/resources/application.yml index 5a36af7c15..76cfc7865d 100644 --- a/epmet-cloud-generator/src/main/resources/application.yml +++ b/epmet-cloud-generator/src/main/resources/application.yml @@ -9,7 +9,7 @@ spring: type: com.alibaba.druid.pool.DruidDataSource #MySQL配置 driverClassName: com.mysql.jdbc.Driver - url: jdbc:mysql://192.168.1.130:3306/epmet_third?useUnicode=true&characterEncoding=UTF-8&useSSL=false + url: jdbc:mysql://192.168.1.130:3306/epmet_data_statistical?useUnicode=true&characterEncoding=UTF-8&useSSL=false username: epmet_dba password: EpmEt-dbA-UsEr #oracle配置 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactGridGovernDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactGridGovernDailyDao.java new file mode 100644 index 0000000000..5d35359bc7 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactGridGovernDailyDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.evaluationindex.extract; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.evaluationindex.extract.FactGridGovernDailyEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 网格的治理指数,按天统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-24 + */ +@Mapper +public interface FactGridGovernDailyDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactGridGovernDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactGridGovernDailyEntity.java new file mode 100644 index 0000000000..0fcff9c663 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactGridGovernDailyEntity.java @@ -0,0 +1,135 @@ +/** + * 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.math.BigDecimal; + +/** + * 网格的治理指数,按天统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-24 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_grid_govern_daily") +public class FactGridGovernDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 数据更新至:yyyyMMdd; + */ + private String dateId; + + /** + * 网格id + */ + private String gridId; + + /** + * 网格所属的组织id + */ + private String pid; + + /** + * 网格所有上级id + */ + private String pids; + + /** + * 界面展示:问题解决总数=1+2+3+4+5+6+7+8 + */ + private Integer problemResolvedCount; + + /** + * 界面展示:党群自治占比=(9+10)/PROBLEM_RESOLVED_COUNT; 此列存储的是小数 + */ + private BigDecimal groupSelfGovernRatio; + + /** + * 界面展示:网格自治占比=GRID_SELF_GOVERN_PROJECT_TOTAL/PROBLEM_RESOLVED_COUNT;此列存储的是小数 + */ + private BigDecimal gridSelfGovernRatio; + + /** + * 1、当前网格内,话题关闭已解决数 + */ + private Integer topicResolvedCount; + + /** + * 2、当前网格内,话题关闭无需解决数 + */ + private Integer topicUnResolvedCount; + + /** + * 3、当前网格内,议题关闭已解决数 + */ + private Integer issueResolvedCount; + + /** + * 4、当前网格内,议题关闭无需解决数 + */ + private Integer issueUnResolvedCount; + + /** + * 5、当前网格内:来源于议题的项目:结案已解决数 + */ + private Integer issueProjectResolvedCount; + + /** + * 6、当前网格内:来源于议题的项目:结案无需解决数 + */ + private Integer issueProjectUnResolvedCount; + + /** + * 7、当前网格内:项目立项,结案已解决数;默认为0, + */ + private Integer approvalProjectResolvedCount; + + /** + * 8、当前网格内:项目立项,结案无需解决数;默认为0, + */ + private Integer approvalProjectUnResolvedCount; + + /** + * 9、当前网格内,未出小组即未转议题的:话题关闭已解决数 + */ + private Integer inGroupTopicResolvedCount; + + /** + * 10、当前网格内,未出小组即未转议题的:话题关闭无需解决数 + */ + private Integer inGroupTopicUnResolvedCount; + + /** + * 未出当前网格的,结案项目数 + */ + private Integer gridSelfGovernProjectTotal; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactGridGovernDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactGridGovernDailyService.java new file mode 100644 index 0000000000..d5ffd39cd4 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactGridGovernDailyService.java @@ -0,0 +1,32 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.evaluationindex.extract.todata; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.evaluationindex.extract.FactGridGovernDailyEntity; + +/** + * 网格的治理指数,按天统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-24 + */ +public interface FactGridGovernDailyService extends BaseService { + + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactGridGovernDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactGridGovernDailyServiceImpl.java new file mode 100644 index 0000000000..99e73d3603 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactGridGovernDailyServiceImpl.java @@ -0,0 +1,35 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.evaluationindex.extract.todata.impl; + +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.dao.evaluationindex.extract.FactGridGovernDailyDao; +import com.epmet.entity.evaluationindex.extract.FactGridGovernDailyEntity; +import com.epmet.service.evaluationindex.extract.todata.FactGridGovernDailyService; +import org.springframework.stereotype.Service; + +/** + * 网格的治理指数,按天统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-24 + */ +@Service +public class FactGridGovernDailyServiceImpl extends BaseServiceImpl implements FactGridGovernDailyService { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactGridGovernDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactGridGovernDailyDao.xml new file mode 100644 index 0000000000..6fa56797fa --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactGridGovernDailyDao.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file From b474a2ce84610b6261653571eae5f46eed31bdfe Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Mon, 24 May 2021 15:24:18 +0800 Subject: [PATCH 062/128] =?UTF-8?q?=E7=BB=84=E7=BB=87=E3=80=81=E7=BD=91?= =?UTF-8?q?=E6=A0=BC=E4=BA=8B=E4=BB=B6=E6=B2=BB=E7=90=86=E6=8C=87=E6=95=B0?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E9=A6=96=E7=89=88=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../datastats/form/AgencyGovrnFormDTO.java | 2 +- .../result/AgencyGovrnResultDTO.java | 16 +++-- .../datastats/result/GridGovrnResultDTO.java | 8 +-- .../dataaggre/dao/datastats/DataStatsDao.java | 14 ++++ .../datastats/impl/DataStatsServiceImpl.java | 70 +++++++++++++++---- .../mapper/datastats/DatsStatsDao.xml | 39 +++++++++++ 6 files changed, 122 insertions(+), 27 deletions(-) diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/AgencyGovrnFormDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/AgencyGovrnFormDTO.java index 82315c125f..ad33559d5b 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/AgencyGovrnFormDTO.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/AgencyGovrnFormDTO.java @@ -29,7 +29,7 @@ public class AgencyGovrnFormDTO implements Serializable { * 党群自治占比:party * 网格自治占比:grid * 社区解决占比:community - * 区直部门解决占比:department + * 区直部门解决占比:dept * 街道解决占比:street */ private String type; diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/AgencyGovrnResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/AgencyGovrnResultDTO.java index b48a5602d7..b15017ea33 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/AgencyGovrnResultDTO.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/AgencyGovrnResultDTO.java @@ -18,18 +18,20 @@ public class AgencyGovrnResultDTO implements Serializable { //组织Id private String agencyId; //组织名称 - private String agencyName; + private String agencyName = ""; + //agency_id所属的机关级别(社区级:community,乡(镇、街道)级:street, 区县级: district, 市级: city, 省级:province) + private String level = ""; //问题解决总数 - private Integer a = 0; + private Integer problemResolvedCount = 0; //党群自治占比 - private BigDecimal b = bi; + private BigDecimal groupSelfGovernRatio = bi; //网格自治占比 - private BigDecimal c = bi; + private BigDecimal gridSelfGovernRatio = bi; //社区解决占比 - private BigDecimal d = bi; + private BigDecimal communityResolvedRatio = bi; //区直部门解决占比 - private BigDecimal e = bi; + private BigDecimal districtDeptResolvedRatio = bi; //街道解决占比 - private BigDecimal f = bi; + private BigDecimal streetResolvedRatio = bi; } diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/GridGovrnResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/GridGovrnResultDTO.java index 0aa7f5852e..9b16f7b014 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/GridGovrnResultDTO.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/GridGovrnResultDTO.java @@ -18,12 +18,12 @@ public class GridGovrnResultDTO implements Serializable { //网格Id private String gridId; //网格名称 - private String gridName; + private String gridName = ""; //问题解决总数 - private Integer a = 0; + private Integer problemResolvedCount = 0; //党群自治占比 - private BigDecimal b = bi; + private BigDecimal groupSelfGovernRatio = bi; //网格自治占比 - private BigDecimal c = bi; + private BigDecimal gridSelfGovernRatio = bi; } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/datastats/DataStatsDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/datastats/DataStatsDao.java index 02d6e72a76..b49b16fc0c 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/datastats/DataStatsDao.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/datastats/DataStatsDao.java @@ -228,4 +228,18 @@ public interface DataStatsDao { @Param("actCategoryDictDTOList") List actCategoryDictDTOList); DimAgencyEntity getAgencyInfo(@Param("agencyId") String agencyId); + + /** + * @Param formDTO + * @Description 根据组织Id查询事件治理指数 + * @author sun + */ + List getAgencyGovern(@Param("agencyIds") List agencyIds, @Param("dateId") String dateId); + + /** + * @Param formDTO + * @Description 根据网格Id查询事件治理指数 + * @author sun + */ + List getGridGovern(@Param("gridIds") List gridIds, @Param("dateId") String dateId); } \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java index 1691ff528e..3a0512349a 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java @@ -1029,9 +1029,13 @@ public class DataStatsServiceImpl implements DataStatsService { formDTO.setDateId(format.format(yesterday)); } //1.按日期查询当前组织事件治理指数 - - - return null; + List agencyIds = new ArrayList<>(); + agencyIds.add(formDTO.getAgencyId()); + List list = dataStatsDao.getAgencyGovern(agencyIds, formDTO.getDateId()); + if (list.size() > NumConstant.ZERO) { + resultDTO = list.get(NumConstant.ZERO); + } + return resultDTO; } /** @@ -1064,25 +1068,43 @@ public class DataStatsServiceImpl implements DataStatsService { List agencyIds = subAgencyList.stream().map(DimAgencyEntity::getId).collect(Collectors.toList()); //2.按日期查询所有下级组织的事件治理指数 + List list = dataStatsDao.getAgencyGovern(agencyIds, formDTO.getDateId()); //3.封装数据 + for (DimAgencyEntity sub : subAgencyList) { + AgencyGovrnResultDTO dto = new AgencyGovrnResultDTO(); + dto.setAgencyId(sub.getId()); + dto.setAgencyName(sub.getAgencyName()); + dto.setLevel(sub.getLevel()); + for (AgencyGovrnResultDTO re : list) { + if (sub.getId().equals(re.getAgencyId())) { + dto.setProblemResolvedCount(re.getProblemResolvedCount()); + dto.setGroupSelfGovernRatio(re.getGroupSelfGovernRatio()); + dto.setGridSelfGovernRatio(re.getGridSelfGovernRatio()); + dto.setCommunityResolvedRatio(re.getCommunityResolvedRatio()); + dto.setStreetResolvedRatio(re.getStreetResolvedRatio()); + dto.setDistrictDeptResolvedRatio(re.getDistrictDeptResolvedRatio()); + } + } + resultList.add(dto); + } //4.按要求排序并返回 Collections.sort(resultList, new Comparator() { @Override public int compare(AgencyGovrnResultDTO o1, AgencyGovrnResultDTO o2) { if ("party".equals(formDTO.getType())) { - return o2.getB().compareTo(o1.getB()); + return o2.getGroupSelfGovernRatio().compareTo(o1.getGroupSelfGovernRatio()); } else if ("grid".equals(formDTO.getType())) { - return o2.getC().compareTo(o1.getC()); + return o2.getGridSelfGovernRatio().compareTo(o1.getGridSelfGovernRatio()); } else if ("community".equals(formDTO.getType())) { - return o2.getD().compareTo(o1.getD()); + return o2.getCommunityResolvedRatio().compareTo(o1.getCommunityResolvedRatio()); } else if ("department".equals(formDTO.getType())) { - return o2.getE().compareTo(o1.getE()); + return o2.getDistrictDeptResolvedRatio().compareTo(o1.getDistrictDeptResolvedRatio()); } else if ("street".equals(formDTO.getType())) { - return o2.getF().compareTo(o1.getF()); + return o2.getStreetResolvedRatio().compareTo(o1.getStreetResolvedRatio()); } else { - return o2.getA().compareTo(o1.getA()); + return o2.getProblemResolvedCount().compareTo(o1.getProblemResolvedCount()); } } }); @@ -1109,9 +1131,13 @@ public class DataStatsServiceImpl implements DataStatsService { formDTO.setDateId(format.format(yesterday)); } - //1.按日子查询网格事件治理指数 - - + //1.按日期查询网格事件治理指数 + List gridIds = new ArrayList<>(); + gridIds.add(formDTO.getGridId()); + List list = dataStatsDao.getGridGovern(gridIds, formDTO.getDateId()); + if (list.size() > NumConstant.ZERO) { + resultDTO = list.get(NumConstant.ZERO); + } return resultDTO; } @@ -1145,19 +1171,33 @@ public class DataStatsServiceImpl implements DataStatsService { List gridIds = gridList.stream().map(DimGridEntity::getId).collect(Collectors.toList()); //2.按日期查找组织直属网格事件治理指数列表 + List list = dataStatsDao.getGridGovern(gridIds, formDTO.getDateId()); //3.封装数据 + for (DimGridEntity gr : gridList) { + GridGovrnResultDTO dto = new GridGovrnResultDTO(); + dto.setGridId(gr.getId()); + dto.setGridName(gr.getGridName()); + for (GridGovrnResultDTO re : list) { + if (gr.getId().equals(re.getGridId())) { + dto.setProblemResolvedCount(re.getProblemResolvedCount()); + dto.setGroupSelfGovernRatio(re.getGroupSelfGovernRatio()); + dto.setGridSelfGovernRatio(re.getGridSelfGovernRatio()); + } + } + resultList.add(dto); + } //4.按要求排序并返回 Collections.sort(resultList, new Comparator() { @Override public int compare(GridGovrnResultDTO o1, GridGovrnResultDTO o2) { if ("party".equals(formDTO.getType())) { - return o2.getB().compareTo(o1.getB()); + return o2.getGroupSelfGovernRatio().compareTo(o1.getGroupSelfGovernRatio()); } else if ("grid".equals(formDTO.getType())) { - return o2.getC().compareTo(o1.getC()); + return o2.getGridSelfGovernRatio().compareTo(o1.getGridSelfGovernRatio()); } else { - return o2.getA().compareTo(o1.getA()); + return o2.getProblemResolvedCount().compareTo(o1.getProblemResolvedCount()); } } }); diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml index 1f1663bd49..7097ca36c5 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml @@ -612,4 +612,43 @@ WHERE ID = #{agencyId} + + + + + \ No newline at end of file From eba81f662423c499fb9918f3840305f99a77c804 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Mon, 24 May 2021 15:56:13 +0800 Subject: [PATCH 063/128] =?UTF-8?q?=E6=BC=8F=E6=B4=9E=E4=BF=AE=E5=A4=8D=20?= =?UTF-8?q?=E7=A8=8B=E5=BA=8F=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../datastats/impl/DataStatsServiceImpl.java | 234 ++++++++++-------- 1 file changed, 136 insertions(+), 98 deletions(-) diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java index 3a0512349a..59bca42a8a 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java @@ -263,18 +263,24 @@ public class DataStatsServiceImpl implements DataStatsService { List agencyIds = subAgencyList.stream().map(DimAgencyEntity::getId).collect(Collectors.toList()); //2.查询直属下级组织注册用户日统计数据,默认按用户总数降序 - resultList = dataStatsDao.getSubAgencyUser(agencyIds, formDTO.getDateId()); + List list = dataStatsDao.getSubAgencyUser(agencyIds, formDTO.getDateId()); //3.封装数据 - resultList.forEach(re -> { - re.setPartyMemberRatio(re.getPartyMemberTotal() == 0 || re.getUserTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getPartyMemberTotal() / (float) re.getUserTotal()))); - re.setResiRatio(re.getResiTotal() == 0 || re.getUserTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getResiTotal() / (float) re.getUserTotal()))); - subAgencyList.forEach(sub -> { - if (re.getAgencyId().equals(sub.getId())) { - re.setAgencyName(sub.getAgencyName()); + for (DimAgencyEntity sub : subAgencyList) { + SubAgencyUserResultDTO dto = new SubAgencyUserResultDTO(); + dto.setAgencyId(sub.getId()); + dto.setAgencyName(sub.getAgencyName()); + for (SubAgencyUserResultDTO u : list) { + if (sub.getId().equals(u.getAgencyId())) { + dto.setUserTotal(u.getUserTotal()); + dto.setPartyMemberTotal(u.getPartyMemberTotal()); + dto.setResiTotal(u.getResiTotal()); } - }); - }); + } + dto.setPartyMemberRatio(dto.getPartyMemberTotal() == 0 || dto.getUserTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) dto.getPartyMemberTotal() / (float) dto.getUserTotal()))); + dto.setResiRatio(dto.getResiTotal() == 0 || dto.getUserTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) dto.getResiTotal() / (float) dto.getUserTotal()))); + resultList.add(dto); + } //4.按要求排序并返回 Collections.sort(resultList, new Comparator() { @@ -326,18 +332,24 @@ public class DataStatsServiceImpl implements DataStatsService { List gridIds = gridList.stream().map(DimGridEntity::getId).collect(Collectors.toList()); //2.查询网格层级注册用户日统计数据,默认按用户总数降序 - resultList = dataStatsDao.getSubGridUser(gridIds, formDTO.getDateId()); + List list = dataStatsDao.getSubGridUser(gridIds, formDTO.getDateId()); //3.封装数据 - resultList.forEach(re -> { - re.setPartyMemberRatio(re.getPartyMemberTotal() == 0 || re.getUserTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getPartyMemberTotal() / (float) re.getUserTotal()))); - re.setResiRatio(re.getResiTotal() == 0 || re.getUserTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getResiTotal() / (float) re.getUserTotal()))); - gridList.forEach(sub -> { - if (re.getGridId().equals(sub.getId())) { - re.setGridName(sub.getGridName()); + for (DimGridEntity gr : gridList) { + SubGridUserResultDTO dto = new SubGridUserResultDTO(); + dto.setGridId(gr.getId()); + dto.setGridName(gr.getGridName()); + for (SubGridUserResultDTO re : list) { + if (gr.getId().equals(re.getGridId())) { + dto.setUserTotal(re.getUserTotal()); + dto.setPartyMemberTotal(re.getPartyMemberTotal()); + dto.setResiTotal(re.getResiTotal()); } - }); - }); + } + dto.setPartyMemberRatio(dto.getPartyMemberTotal() == 0 || dto.getUserTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) dto.getPartyMemberTotal() / (float) dto.getUserTotal()))); + dto.setResiRatio(dto.getResiTotal() == 0 || dto.getUserTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) dto.getResiTotal() / (float) dto.getUserTotal()))); + resultList.add(dto); + } //4.按要求排序并返回 Collections.sort(resultList, new Comparator() { @@ -387,18 +399,24 @@ public class DataStatsServiceImpl implements DataStatsService { List agencyIds = subAgencyList.stream().map(DimAgencyEntity::getId).collect(Collectors.toList()); //2.查询直属下级组织小组日统计数据,默认按群组总数降序 - resultList = dataStatsDao.getSubAgencyGroup(agencyIds, formDTO.getDateId()); + List list = dataStatsDao.getSubAgencyGroup(agencyIds, formDTO.getDateId()); //3.封装数据 - resultList.forEach(re -> { - re.setOrdinaryRatio(re.getOrdinaryTotal() == 0 || re.getGroupTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getOrdinaryTotal() / (float) re.getGroupTotal()))); - re.setBranchRatio(re.getBranchTotal() == 0 || re.getGroupTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getBranchTotal() / (float) re.getGroupTotal()))); - subAgencyList.forEach(sub -> { - if (re.getAgencyId().equals(sub.getId())) { - re.setAgencyName(sub.getAgencyName()); + for (DimAgencyEntity sub : subAgencyList) { + SubAgencyGroupResultDTO dto = new SubAgencyGroupResultDTO(); + dto.setAgencyId(sub.getId()); + dto.setAgencyName(sub.getAgencyName()); + for (SubAgencyGroupResultDTO u : list) { + if (sub.getId().equals(u.getAgencyId())) { + dto.setGroupTotal(u.getGroupTotal()); + dto.setOrdinaryTotal(u.getOrdinaryTotal()); + dto.setBranchTotal(u.getBranchTotal()); } - }); - }); + } + dto.setOrdinaryRatio(dto.getOrdinaryTotal() == 0 || dto.getGroupTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) dto.getOrdinaryTotal() / (float) dto.getGroupTotal()))); + dto.setBranchRatio(dto.getBranchTotal() == 0 || dto.getGroupTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) dto.getBranchTotal() / (float) dto.getGroupTotal()))); + resultList.add(dto); + } //4.按要求排序并返回 Collections.sort(resultList, new Comparator() { @@ -447,18 +465,24 @@ public class DataStatsServiceImpl implements DataStatsService { List gridIds = gridList.stream().map(DimGridEntity::getId).collect(Collectors.toList()); //2.查询网格层级小组日统计数据,默认按群组总数降序 - resultList = dataStatsDao.getSubGridGroup(gridIds, formDTO.getDateId()); + List list = dataStatsDao.getSubGridGroup(gridIds, formDTO.getDateId()); //3.封装数据并返回 - resultList.forEach(re -> { - re.setOrdinaryRatio(re.getOrdinaryTotal() == 0 || re.getGroupTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getOrdinaryTotal() / (float) re.getGroupTotal()))); - re.setBranchRatio(re.getBranchTotal() == 0 || re.getGroupTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getBranchTotal() / (float) re.getGroupTotal()))); - gridList.forEach(sub -> { - if (re.getGridId().equals(sub.getId())) { - re.setGridName(sub.getGridName()); + for (DimGridEntity gr : gridList) { + SubGridGroupResultDTO dto = new SubGridGroupResultDTO(); + dto.setGridId(gr.getId()); + dto.setGridName(gr.getGridName()); + for (SubGridGroupResultDTO re : list) { + if (gr.getId().equals(re.getGridId())) { + dto.setGroupTotal(re.getGroupTotal()); + dto.setOrdinaryTotal(re.getOrdinaryTotal()); + dto.setBranchTotal(re.getBranchTotal()); } - }); - }); + } + dto.setOrdinaryRatio(dto.getOrdinaryTotal() == 0 || dto.getGroupTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) dto.getOrdinaryTotal() / (float) dto.getGroupTotal()))); + dto.setBranchRatio(dto.getBranchTotal() == 0 || dto.getGroupTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) dto.getBranchTotal() / (float) dto.getGroupTotal()))); + resultList.add(dto); + } //4.按要求排序并返回 Collections.sort(resultList, new Comparator() { @@ -514,15 +538,14 @@ public class DataStatsServiceImpl implements DataStatsService { List topicShiftIssue = dataStatsDao.getSubAgencyTopicShiftIssue(agencyIds, formDTO.getDateId()); //查询直属下级组织热议中话题-机关日统计数据 List hotdiscuss = dataStatsDao.getSubAgencyTopicHotDiscuss(agencyIds, formDTO.getDateId()); - agencyIds.forEach(agencyId -> { + subAgencyList.forEach(sub -> { SubAgencyTopicResultDTO resultDTO = new SubAgencyTopicResultDTO(); AtomicInteger topicTotal = new AtomicInteger(0); AtomicInteger closedTotal = new AtomicInteger(0); AtomicInteger shiftIssueTotal = new AtomicInteger(0); AtomicInteger hotdiscussTotal = new AtomicInteger(0); - AtomicReference agencyName = new AtomicReference<>(""); topic.forEach(t -> { - if (t.getAgencyId().equals(agencyId)) { + if (t.getAgencyId().equals(sub.getId())) { topicTotal.addAndGet(t.getTopicCount()); if (t.getTopicStatus().equals("closed")) { closedTotal.set(t.getTopicCount()); @@ -530,23 +553,18 @@ public class DataStatsServiceImpl implements DataStatsService { } }); topicShiftIssue.forEach(t -> { - if (t.getAgencyId().equals(agencyId)) { + if (t.getAgencyId().equals(sub.getId())) { shiftIssueTotal.addAndGet(t.getShiftedIssueTotal()); } }); hotdiscuss.forEach(t -> { - if (t.getAgencyId().equals(agencyId)) { + if (t.getAgencyId().equals(sub.getId())) { hotdiscussTotal.addAndGet(t.getTopicCount()); } }); - subAgencyList.forEach(sub -> { - if (agencyId.equals(sub.getId())) { - agencyName.set(sub.getAgencyName()); - } - }); - resultDTO.setAgencyId(agencyId); - resultDTO.setAgencyName(agencyName.get()); + resultDTO.setAgencyId(sub.getId()); + resultDTO.setAgencyName(sub.getAgencyName()); resultDTO.setTopicTotal(topicTotal.get()); resultDTO.setDiscussingTotal(hotdiscussTotal.get()); resultDTO.setDiscussingRatio(resultDTO.getDiscussingTotal() == 0 || resultDTO.getTopicTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getDiscussingTotal() / (float) resultDTO.getTopicTotal()))); @@ -614,15 +632,14 @@ public class DataStatsServiceImpl implements DataStatsService { List topicShiftIssue = dataStatsDao.getSubGridTopicShiftIssue(gridIds, formDTO.getDateId()); //查询网格层级热议中话题-日统计数据 List hotdiscuss = dataStatsDao.getSubGridTopicHotDiscuss(gridIds, formDTO.getDateId()); - gridIds.forEach(gridId -> { + gridList.forEach(gr -> { SubGridTopicResultDTO resultDTO = new SubGridTopicResultDTO(); AtomicInteger topicTotal = new AtomicInteger(0); AtomicInteger closedTotal = new AtomicInteger(0); AtomicInteger shiftIssueTotal = new AtomicInteger(0); AtomicInteger hotdiscussTotal = new AtomicInteger(0); - AtomicReference gridName = new AtomicReference<>(""); topic.forEach(t -> { - if (t.getGridId().equals(gridId)) { + if (t.getGridId().equals(gr.getId())) { topicTotal.addAndGet(t.getTopicCount()); if (t.getTopicStatus().equals("closed")) { closedTotal.set(t.getTopicCount()); @@ -630,23 +647,18 @@ public class DataStatsServiceImpl implements DataStatsService { } }); topicShiftIssue.forEach(t -> { - if (t.getGridId().equals(gridId)) { + if (t.getGridId().equals(gr.getId())) { shiftIssueTotal.addAndGet(t.getShiftedIssueTotal()); } }); hotdiscuss.forEach(t -> { - if (t.getGridId().equals(gridId)) { + if (t.getGridId().equals(gr.getId())) { hotdiscussTotal.addAndGet(t.getTopicCount()); } }); - gridList.forEach(sub -> { - if (gridId.equals(sub.getId())) { - gridName.set(sub.getGridName()); - } - }); - resultDTO.setGridId(gridId); - resultDTO.setGridName(gridName.get()); + resultDTO.setGridId(gr.getId()); + resultDTO.setGridName(gr.getGridName()); resultDTO.setTopicTotal(topicTotal.get()); resultDTO.setDiscussingTotal(hotdiscussTotal.get()); resultDTO.setDiscussingRatio(resultDTO.getDiscussingTotal() == 0 || resultDTO.getTopicTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getDiscussingTotal() / (float) resultDTO.getTopicTotal()))); @@ -707,19 +719,26 @@ public class DataStatsServiceImpl implements DataStatsService { List agencyIds = subAgencyList.stream().map(DimAgencyEntity::getId).collect(Collectors.toList()); //2.查询直属下级组织议题日统计数据,默认按议题总数降序 - resultList = dataStatsDao.getSubAgencyIssue(agencyIds, formDTO.getDateId()); + List list = dataStatsDao.getSubAgencyIssue(agencyIds, formDTO.getDateId()); //3.封装数据 - resultList.forEach(re -> { - re.setVotingRatio(re.getVotingTotal() == 0 || re.getIssueTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getVotingTotal() / (float) re.getIssueTotal()))); - re.setClosedIssueRatio(re.getClosedIssueTotal() == 0 || re.getIssueTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getClosedIssueTotal() / (float) re.getIssueTotal()))); - re.setShiftProjectRatio(re.getShiftProjectTotal() == 0 || re.getIssueTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getShiftProjectTotal() / (float) re.getIssueTotal()))); - subAgencyList.forEach(sub -> { - if (re.getAgencyId().equals(sub.getId())) { - re.setAgencyName(sub.getAgencyName()); + for (DimAgencyEntity sub : subAgencyList) { + SubAgencyIssueResultDTO dto = new SubAgencyIssueResultDTO(); + dto.setAgencyId(sub.getId()); + dto.setAgencyName(sub.getAgencyName()); + for (SubAgencyIssueResultDTO u : list) { + if (sub.getId().equals(u.getAgencyId())) { + dto.setIssueTotal(u.getIssueTotal()); + dto.setVotingTotal(u.getVotingTotal()); + dto.setClosedIssueTotal(u.getClosedIssueTotal()); + dto.setShiftProjectTotal(u.getShiftProjectTotal()); } - }); - }); + } + dto.setVotingRatio(dto.getVotingTotal() == 0 || dto.getIssueTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) dto.getVotingTotal() / (float) dto.getIssueTotal()))); + dto.setClosedIssueRatio(dto.getClosedIssueTotal() == 0 || dto.getIssueTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) dto.getClosedIssueTotal() / (float) dto.getIssueTotal()))); + dto.setShiftProjectRatio(dto.getShiftProjectTotal() == 0 || dto.getIssueTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) dto.getShiftProjectTotal() / (float) dto.getIssueTotal()))); + resultList.add(dto); + } //4.按要求排序并返回 Collections.sort(resultList, new Comparator() { @@ -770,19 +789,26 @@ public class DataStatsServiceImpl implements DataStatsService { List gridIds = gridList.stream().map(DimGridEntity::getId).collect(Collectors.toList()); //2.查询网格层级议题日统计数据,默认按议题总数降序 - resultList = dataStatsDao.getSubGridIssue(gridIds, formDTO.getDateId()); + List list = dataStatsDao.getSubGridIssue(gridIds, formDTO.getDateId()); //3.封装数据 - resultList.forEach(re -> { - re.setVotingRatio(re.getVotingTotal() == 0 || re.getIssueTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getVotingTotal() / (float) re.getIssueTotal()))); - re.setClosedIssueRatio(re.getClosedIssueTotal() == 0 || re.getIssueTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getClosedIssueTotal() / (float) re.getIssueTotal()))); - re.setShiftProjectRatio(re.getShiftProjectTotal() == 0 || re.getIssueTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getShiftProjectTotal() / (float) re.getIssueTotal()))); - gridList.forEach(sub -> { - if (re.getGridId().equals(sub.getId())) { - re.setGridName(sub.getGridName()); + for (DimGridEntity gr : gridList) { + SubGridIssueResultDTO dto = new SubGridIssueResultDTO(); + dto.setGridId(gr.getId()); + dto.setGridName(gr.getGridName()); + for (SubGridIssueResultDTO re : list) { + if (gr.getId().equals(re.getGridId())) { + dto.setIssueTotal(re.getIssueTotal()); + dto.setVotingTotal(re.getVotingTotal()); + dto.setClosedIssueTotal(re.getClosedIssueTotal()); + dto.setShiftProjectTotal(re.getShiftProjectTotal()); } - }); - }); + } + dto.setVotingRatio(dto.getVotingTotal() == 0 || dto.getIssueTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) dto.getVotingTotal() / (float) dto.getIssueTotal()))); + dto.setClosedIssueRatio(dto.getClosedIssueTotal() == 0 || dto.getIssueTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) dto.getClosedIssueTotal() / (float) dto.getIssueTotal()))); + dto.setShiftProjectRatio(dto.getShiftProjectTotal() == 0 || dto.getIssueTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) dto.getShiftProjectTotal() / (float) dto.getIssueTotal()))); + resultList.add(dto); + } //4.按要求排序并返回 Collections.sort(resultList, new Comparator() { @@ -833,18 +859,24 @@ public class DataStatsServiceImpl implements DataStatsService { List agencyIds = subAgencyList.stream().map(DimAgencyEntity::getId).collect(Collectors.toList()); //2.查询直属下级组织项目日统计数据,默认按项目总数降序 - resultList = dataStatsDao.getSubAgencyProject(agencyIds, formDTO.getDateId()); + List list = dataStatsDao.getSubAgencyProject(agencyIds, formDTO.getDateId()); //3.封装数据 - resultList.forEach(re -> { - re.setPendingRatio(re.getPendingTotal() == 0 || re.getProjectTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getPendingTotal() / (float) re.getProjectTotal()))); - re.setClosedProjectRatio(re.getClosedProjectTotal() == 0 || re.getProjectTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getClosedProjectTotal() / (float) re.getProjectTotal()))); - subAgencyList.forEach(sub -> { - if (re.getAgencyId().equals(sub.getId())) { - re.setAgencyName(sub.getAgencyName()); + for (DimAgencyEntity sub : subAgencyList) { + SubAgencyProjectResultDTO dto = new SubAgencyProjectResultDTO(); + dto.setAgencyId(sub.getId()); + dto.setAgencyName(sub.getAgencyName()); + for (SubAgencyProjectResultDTO u : list) { + if (sub.getId().equals(u.getAgencyId())) { + dto.setProjectTotal(u.getProjectTotal()); + dto.setPendingTotal(u.getPendingTotal()); + dto.setClosedProjectTotal(u.getClosedProjectTotal()); } - }); - }); + } + dto.setPendingRatio(dto.getPendingTotal() == 0 || dto.getProjectTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) dto.getPendingTotal() / (float) dto.getProjectTotal()))); + dto.setClosedProjectRatio(dto.getClosedProjectTotal() == 0 || dto.getProjectTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) dto.getClosedProjectTotal() / (float) dto.getProjectTotal()))); + resultList.add(dto); + } //4.按要求排序并返回 Collections.sort(resultList, new Comparator() { @@ -893,18 +925,24 @@ public class DataStatsServiceImpl implements DataStatsService { List gridIds = gridList.stream().map(DimGridEntity::getId).collect(Collectors.toList()); //2.查询网格层级项目日统计数据,默认按项目总数降序 - resultList = dataStatsDao.getSubGridProject(gridIds, formDTO.getDateId()); + List list = dataStatsDao.getSubGridProject(gridIds, formDTO.getDateId()); //3.封装数据 - resultList.forEach(re -> { - re.setPendingRatio(re.getPendingTotal() == 0 || re.getProjectTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getPendingTotal() / (float) re.getProjectTotal()))); - re.setClosedProjectRatio(re.getClosedProjectTotal() == 0 || re.getProjectTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) re.getClosedProjectTotal() / (float) re.getProjectTotal()))); - gridList.forEach(sub -> { - if (re.getGridId().equals(sub.getId())) { - re.setGridName(sub.getGridName()); + for (DimGridEntity gr : gridList) { + SubGridProjectResultDTO dto = new SubGridProjectResultDTO(); + dto.setGridId(gr.getId()); + dto.setGridName(gr.getGridName()); + for (SubGridProjectResultDTO re : list) { + if (gr.getId().equals(re.getGridId())) { + dto.setProjectTotal(re.getProjectTotal()); + dto.setPendingTotal(re.getPendingTotal()); + dto.setClosedProjectTotal(re.getClosedProjectTotal()); } - }); - }); + } + dto.setPendingRatio(dto.getPendingTotal() == 0 || dto.getProjectTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) dto.getPendingTotal() / (float) dto.getProjectTotal()))); + dto.setClosedProjectRatio(dto.getClosedProjectTotal() == 0 || dto.getProjectTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) dto.getClosedProjectTotal() / (float) dto.getProjectTotal()))); + resultList.add(dto); + } //4.按要求排序并返回 Collections.sort(resultList, new Comparator() { From 5d9df3fc7cfd6d673cfaebbca491a19f8cfccfb3 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Mon, 24 May 2021 16:03:22 +0800 Subject: [PATCH 064/128] fact_agency_govern_daily --- .../extract/FactAgencyGovernDailyDao.java | 33 ++++ .../extract/FactAgencyGovernDailyEntity.java | 174 ++++++++++++++++++ .../todata/FactAgencyGovernDailyService.java | 31 ++++ .../FactAgencyGovernDailyServiceImpl.java | 37 ++++ .../extract/FactAgencyGovernDailyDao.xml | 8 + 5 files changed, 283 insertions(+) create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactAgencyGovernDailyDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactAgencyGovernDailyEntity.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactAgencyGovernDailyService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactAgencyGovernDailyServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactAgencyGovernDailyDao.xml diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactAgencyGovernDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactAgencyGovernDailyDao.java new file mode 100644 index 0000000000..b88d897543 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactAgencyGovernDailyDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.evaluationindex.extract; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.evaluationindex.extract.FactAgencyGovernDailyEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 组织的治理指数,按天统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-24 + */ +@Mapper +public interface FactAgencyGovernDailyDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactAgencyGovernDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactAgencyGovernDailyEntity.java new file mode 100644 index 0000000000..2f37f9a113 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactAgencyGovernDailyEntity.java @@ -0,0 +1,174 @@ +/** + * 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.math.BigDecimal; + +/** + * 组织的治理指数,按天统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-24 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_agency_govern_daily") +public class FactAgencyGovernDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 数据更新至:yyyyMMdd; + */ + private String dateId; + + /** + * 组织id + */ + private String agencyId; + + /** + * agency_id所属的机关级别(社区级:community, +乡(镇、街道)级:street, +区县级: district, +市级: city +省级:province) + */ + private String level; + + /** + * 组织i所属的组织id + */ + private String pid; + + /** + * 组织i所有上级id + */ + private String pids; + + /** + * 界面展示:问题解决总数=1+2+3+4+5+6+7+8 + */ + private Integer problemResolvedCount; + + /** + * 界面展示:党群自治占比=(9+10)/PROBLEM_RESOLVED_COUNT; 此列存储的是小数 + */ + private BigDecimal groupSelfGovernRatio; + + /** + * 界面展示:网格自治占比=GRID_SELF_GOVERN_PROJECT_TOTAL/PROBLEM_RESOLVED_COUNT;此列存储的是小数 + */ + private BigDecimal gridSelfGovernRatio; + + /** + * 界面展示:社区解决占比=COMMUNITY_CLOSED_COUNT/PROBLEM_RESOLVED_COUNT;此列存储的是小数 + */ + private BigDecimal communityClosedRatio; + + /** + * 界面展示:街道解决占比=STREET_CLOSED_COUNT/PROBLEM_RESOLVED_COUNT;此列存储的是小数 + */ + private BigDecimal streetClosedRatio; + + /** + * 界面展示:区直部门解决占比=DISTRICT_DEPT_CLOSED_COUNT/PROBLEM_RESOLVED_COUNT;此列存储的是小数 + */ + private BigDecimal districtDeptClosedRatio; + + /** + * 1、当前组织内,话题关闭已解决数 + */ + private Integer topicResolvedCount; + + /** + * 2、当前组织内,话题关闭无需解决数 + */ + private Integer topicUnResolvedCount; + + /** + * 3、当前组织内,议题关闭已解决数 + */ + private Integer issueResolvedCount; + + /** + * 4、当前组织内,议题关闭无需解决数 + */ + private Integer issueUnResolvedCount; + + /** + * 5、当前组织内:来源于议题的项目:结案已解决数 + */ + private Integer issueProjectResolvedCount; + + /** + * 6、当前组织内:来源于议题的项目:结案无需解决数 + */ + private Integer issueProjectUnResolvedCount; + + /** + * 7、当前组织内:项目立项,结案已解决数;默认为0, + */ + private Integer approvalProjectResolvedCount; + + /** + * 8、当前组织内:项目立项,结案无需解决数;默认为0, + */ + private Integer approvalProjectUnResolvedCount; + + /** + * 9、当前组织内,未出小组即未转议题的:话题关闭已解决数 + */ + private Integer inGroupTopicResolvedCount; + + /** + * 10、当前组织内,未出小组即未转议题的:话题关闭无需解决数 + */ + private Integer inGroupTopicUnResolvedCount; + + /** + * 未出当前网格的,结案项目数 + */ + private Integer gridSelfGovernProjectTotal; + + /** + * 当前组织内结案的项目中:由社区结案的项目总数 + */ + private Integer communityClosedCount; + + /** + * 当前组织内结案的项目中:由街道结案的项目总数 + */ + private Integer streetClosedCount; + + /** + * 当前组织内结案的项目中:由区直部门结案的项目总数 + */ + private Integer districtDeptClosedCount; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactAgencyGovernDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactAgencyGovernDailyService.java new file mode 100644 index 0000000000..1f8440c281 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactAgencyGovernDailyService.java @@ -0,0 +1,31 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.evaluationindex.extract.todata; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.evaluationindex.extract.FactAgencyGovernDailyEntity; + +/** + * 组织的治理指数,按天统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-24 + */ +public interface FactAgencyGovernDailyService extends BaseService { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactAgencyGovernDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactAgencyGovernDailyServiceImpl.java new file mode 100644 index 0000000000..e40ffd49bd --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactAgencyGovernDailyServiceImpl.java @@ -0,0 +1,37 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.evaluationindex.extract.todata.impl; + +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.dao.evaluationindex.extract.FactAgencyGovernDailyDao; +import com.epmet.entity.evaluationindex.extract.FactAgencyGovernDailyEntity; +import com.epmet.service.evaluationindex.extract.todata.FactAgencyGovernDailyService; +import org.springframework.stereotype.Service; + +/** + * 组织的治理指数,按天统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-24 + */ +@Service +public class FactAgencyGovernDailyServiceImpl extends BaseServiceImpl implements FactAgencyGovernDailyService { + + + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactAgencyGovernDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactAgencyGovernDailyDao.xml new file mode 100644 index 0000000000..7b4aa4c504 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactAgencyGovernDailyDao.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file From f55f29e1e33875dc0de9275037e435eadc15ef3e Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Mon, 24 May 2021 16:33:36 +0800 Subject: [PATCH 065/128] =?UTF-8?q?=E5=9F=BA=E5=B1=82=E6=B2=BB=E7=90=86-?= =?UTF-8?q?=E6=B2=BB=E7=90=86=E8=83=BD=E5=8A=9B=E6=8E=92=E8=A1=8C=E6=95=B0?= =?UTF-8?q?=E6=8D=AE(=E6=8C=89=E5=A4=A9=E7=BB=9F=E8=AE=A1)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../FactOriginProjectMainDailyDTO.java | 5 + .../epmet/dto/project/ProjectPointDTO.java | 17 + .../screen/ScreenGovernRankDataDailyDTO.java | 132 ++++++++ .../extract/FactOriginProjectLogDailyDao.java | 43 +++ .../FactOriginProjectMainDailyDao.java | 34 ++ .../FactIndexGovrnAblityGridMonthlyDao.java | 10 + .../screen/ScreenGovernRankDataDailyDao.java | 68 ++++ .../com/epmet/dao/project/ProjectDao.java | 23 ++ .../FactOriginProjectMainDailyEntity.java | 5 + .../ScreenGovernRankDataDailyEntity.java | 102 ++++++ .../FactOriginProjectLogDailyService.java | 42 +++ .../FactOriginProjectMainDailyService.java | 31 ++ .../FactOriginProjectLogDailyServiceImpl.java | 58 ++++ ...FactOriginProjectMainDailyServiceImpl.java | 44 +++ .../GovernRankDataExtractService.java | 44 +++ .../GovernRankDataExtractServiceImpl.java | 294 ++++++++++++++++++ .../impl/ScreenExtractServiceImpl.java | 22 ++ ...actIndexGovrnAblityGridMonthlyService.java | 11 + ...ndexGovrnAblityGridMonthlyServiceImpl.java | 14 + .../ScreenGovernRankDataDailyService.java | 121 +++++++ .../ScreenGovernRankDataDailyServiceImpl.java | 169 ++++++++++ .../epmet/service/project/ProjectService.java | 10 + .../project/impl/ProjectServiceImpl.java | 41 ++- .../extract/FactOriginProjectLogDailyDao.xml | 148 +++++++-- .../extract/FactOriginProjectMainDailyDao.xml | 106 +++++++ .../FactIndexGovrnAblityGridMonthlyDao.xml | 15 + .../screen/ScreenGovernRankDataDailyDao.xml | 80 +++++ .../resources/mapper/project/ProjectDao.xml | 17 + .../stats/user/FactRegUserGridMonthlyDao.xml | 11 + 29 files changed, 1679 insertions(+), 38 deletions(-) create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/ProjectPointDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenGovernRankDataDailyDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenGovernRankDataDailyDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenGovernRankDataDailyEntity.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenGovernRankDataDailyService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenGovernRankDataDailyServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenGovernRankDataDailyDao.xml diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactOriginProjectMainDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactOriginProjectMainDailyDTO.java index 9d1484b5f4..13e1e5fba7 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactOriginProjectMainDailyDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactOriginProjectMainDailyDTO.java @@ -138,6 +138,11 @@ public class FactOriginProjectMainDailyDTO implements Serializable { */ private String isOverdue; + /** + * 是否满意 1:是 + */ + private Integer isSatisfied; + /** * 办结组织Ids(:隔开,有可能是社区id可能是网格id,无需区分级别,在统计时模糊查询) */ diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/ProjectPointDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/ProjectPointDTO.java new file mode 100644 index 0000000000..abeeab8d89 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/ProjectPointDTO.java @@ -0,0 +1,17 @@ +package com.epmet.dto.project; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2021/5/21 10:53 + */ +@Data +public class ProjectPointDTO implements Serializable { + private static final long serialVersionUID = -592430619162380664L; + private String projectId; + private Integer point; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenGovernRankDataDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenGovernRankDataDailyDTO.java new file mode 100644 index 0000000000..29d988da64 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenGovernRankDataDailyDTO.java @@ -0,0 +1,132 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.screen; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 基层治理-治理能力排行数据(按月统计) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-24 + */ +@Data +public class ScreenGovernRankDataDailyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID 主键 + */ + private String id; + + /** + * 客户Id + */ + private String customerId; + + /** + * 年Id + */ + private String yearId; + + /** + * 月份Id + */ + private String monthId; + + /** + * 数据更新至:yyyyMMdd + */ + private String dateId; + + /** + * 组织类别 agency:组织;部门:department;网格:grid + */ + private String orgType; + + /** + * 组织Id 可以为网格,机关id + */ + private String orgId; + + /** + * 上级组织Id + */ + private String parentId; + + /** + * 组织名称 + */ + private String orgName; + + /** + * 响应率 + */ + private BigDecimal responseRatio; + + /** + * 解决率 + */ + private BigDecimal resolvedRatio; + + /** + * 自治率 + */ + private BigDecimal governRatio; + + /** + * 满意率 + */ + private BigDecimal satisfactionRatio; + + /** + * 删除标识 0未删除;1已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-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 8e18ad5500..ed79666c63 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 @@ -182,6 +182,28 @@ public interface FactOriginProjectLogDailyDao extends BaseDao selectGridResponse(@Param("customerId") String customerId, @Param("monthId") String monthId); + /** + * 组织项目响应度 + * @author zhaoqifeng + * @date 2020/9/25 10:01 + * @param customerId + * @param dateId + * @param level + * @return java.util.List + */ + List selectOrgResponseDaily(@Param("customerId") String customerId, @Param("dateId") String dateId, + @Param("level")String level); + + /** + * 网格项目响应度 + * @author zhaoqifeng + * @date 2020/9/25 10:01 + * @param customerId + * @param dateId + * @return java.util.List + */ + List selectGridResponseDaily(@Param("customerId") String customerId, @Param("dateId") String dateId); + /** * 组织项目响应度 * @author zhaoqifeng @@ -215,6 +237,27 @@ public interface FactOriginProjectLogDailyDao extends BaseDao selectOrgSatisfaction(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("level")String level); + /** + * 网格满意率 + * @author zhaoqifeng + * @date 2020/9/27 15:52 + * @param customerId + * @param dateId + * @return java.util.List + */ + List selectGridSatisfactionDaily(@Param("customerId") String customerId, @Param("dateId") String dateId); + + /** + * 组织满意率 + * @author zhaoqifeng + * @date 2020/9/27 15:52 + * @param customerId + * @param level + * @param dateId + * @return java.util.List + */ + List selectOrgSatisfactionDaily(@Param("customerId") String customerId, @Param("level")String level, @Param("dateId") String dateId); + /** * 获取部门办结项目数 * @author zhaoqifeng 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 179574ae7a..e07a58613f 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 @@ -157,6 +157,18 @@ public interface FactOriginProjectMainDailyDao extends BaseDao getSelfProject(@Param("customerId") String customerId, @Param("monthId")String monthId, @Param("level") String level); + /** + * 组织自治项目数 + * @author zhaoqifeng + * @date 2020/9/25 15:16 + * @param customerId + * @param dateId + * @param level + * @return java.util.List + */ + List getSelfProjectDaily(@Param("customerId") String customerId, @Param("dateId")String dateId, + @Param("level") String level); + /** * 组织解决项目数 @@ -170,6 +182,18 @@ public interface FactOriginProjectMainDailyDao extends BaseDao getResolveProject(@Param("customerId") String customerId, @Param("monthId")String monthId, @Param("level") String level); + /** + * 组织解决项目数 + * @author zhaoqifeng + * @date 2020/9/25 15:16 + * @param customerId + * @param dateId + * @param level + * @return java.util.List + */ + List getResolveProjectDaily(@Param("customerId") String customerId, @Param("dateId")String dateId, + @Param("level") String level); + /** * 网格解决项目数 * @author zhaoqifeng @@ -180,6 +204,16 @@ public interface FactOriginProjectMainDailyDao extends BaseDao getGridResolveProject(@Param("customerId") String customerId, @Param("monthId")String monthId); + /** + * 网格解决项目数 + * @author zhaoqifeng + * @date 2020/9/25 15:16 + * @param customerId + * @param dateId + * @return java.util.List + */ + List getGridResolveProjectDaily(@Param("customerId") String customerId, @Param("dateId")String dateId); + /** * @Description 查询难点赌点的基本信息,要排除之前已经结案过的项目 * @param customerId 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 a47ebdc88d..cc7277e9e0 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 @@ -123,4 +123,14 @@ public interface FactIndexGovrnAblityGridMonthlyDao extends BaseDao */ List selectGridByCustomer(@Param("customerId")String customerId, @Param("monthId")String monthId); + + /** + * 查询客户下网格治理能力 + * @author zhaoqifeng + * @date 2020/9/24 15:26 + * @param customerId + * @param dateId + * @return java.util.List + */ + List selectGridByCustomerDaily(@Param("customerId")String customerId, @Param("dateId")String dateId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenGovernRankDataDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenGovernRankDataDailyDao.java new file mode 100644 index 0000000000..688d9b4d3f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenGovernRankDataDailyDao.java @@ -0,0 +1,68 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.evaluationindex.screen; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.evaluationindex.screen.ScreenGovernRankDataDailyEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 基层治理-治理能力排行数据(按月统计) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-24 + */ +@Mapper +public interface ScreenGovernRankDataDailyDao extends BaseDao { + /** + * 组织级别初始化数据 + * @author zhaoqifeng + * @date 2020/9/24 14:52 + * @param customerId + * @param level + * @return java.util.List + */ + List initAgencyDataList(@Param("customerId") String customerId, @Param("level") String level); + + /** + * 网格级别初始化数据 + * @author zhaoqifeng + * @date 2020/9/24 14:52 + * @param customerId + * @return java.util.List + */ + List initGridDataList(@Param("customerId") String customerId); + + /** + * 删除旧数据 + * @author zhaoqifeng + * @date 2020/9/25 10:38 + * @param customerId + * @param orgType + * @param dateId + * @param deleteSize + * @param orgIds + * @return java.lang.Integer + */ + Integer deleteRankData(@Param("customerId") String customerId, @Param("orgType") String orgType, @Param("dateId") String dateId, + @Param("deleteSize") Integer deleteSize, + @Param("orgIds")List orgIds); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectDao.java index 2d3318c262..44e47f6f92 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectDao.java @@ -18,12 +18,16 @@ package com.epmet.dao.project; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.CustomerProjectParameterDTO; import com.epmet.dto.ProjectDTO; +import com.epmet.dto.ProjectSatisfactionStatisticsDTO; import com.epmet.dto.project.ProjectAgencyDTO; import com.epmet.dto.project.ProjectCategoryDTO; import com.epmet.dto.project.ProjectGridDTO; +import com.epmet.dto.project.ProjectPointDTO; import com.epmet.dto.project.result.ProjectExceedParamsResultDTO; import com.epmet.dto.screen.ScreenProjectProcessAttachmentDTO; +import com.epmet.entity.evaluationindex.extract.FactOriginProjectMainDailyEntity; import com.epmet.entity.project.ProjectEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -135,4 +139,23 @@ public interface ProjectDao extends BaseDao { List selectProjectCategory(@Param("list")List list); List getProjectCategoryData(@Param("customerId") String customerId, @Param("dateId") String dateId); + + /** + * 获取项目满意度 + * @author zhaoqifeng + * @date 2021/5/21 10:06 + * @param customerId + * @return java.util.List + */ + List selectProjectSatisfaction(@Param("customerId") String customerId); + + /** + * 根据key查找value + * @author zhaoqifeng + * @date 2021/5/21 10:58 + * @param customerId + * @param parameterKey + * @return java.lang.String + */ + String selectValueByKey(@Param("customerId") String customerId, @Param("parameterKey") String parameterKey); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginProjectMainDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginProjectMainDailyEntity.java index 35d0e46b8f..be69a89f3d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginProjectMainDailyEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginProjectMainDailyEntity.java @@ -138,6 +138,11 @@ public class FactOriginProjectMainDailyEntity extends BaseEpmetEntity { */ private String isOverdue; + /** + * 是否满意 1:是 + */ + private Integer isSatisfied; + /** * 办结组织Ids(:隔开,有可能是社区id可能是网格id,无需区分级别,在统计时模糊查询) */ diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenGovernRankDataDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenGovernRankDataDailyEntity.java new file mode 100644 index 0000000000..8bbe10f526 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenGovernRankDataDailyEntity.java @@ -0,0 +1,102 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.evaluationindex.screen; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 基层治理-治理能力排行数据(按月统计) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-24 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("screen_govern_rank_data_daily") +public class ScreenGovernRankDataDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 年Id + */ + private String yearId; + + /** + * 月份Id + */ + private String monthId; + + /** + * 数据更新至:yyyyMMdd + */ + private String dateId; + + /** + * 组织类别 agency:组织;部门:department;网格:grid + */ + private String orgType; + + /** + * 组织Id 可以为网格,机关id + */ + private String orgId; + + /** + * 上级组织Id + */ + private String parentId; + + /** + * 组织名称 + */ + private String orgName; + + /** + * 响应率 + */ + private BigDecimal responseRatio; + + /** + * 解决率 + */ + private BigDecimal resolvedRatio; + + /** + * 自治率 + */ + private BigDecimal governRatio; + + /** + * 满意率 + */ + private BigDecimal satisfactionRatio; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectLogDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectLogDailyService.java index c337c085da..13c0e1d6c8 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectLogDailyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectLogDailyService.java @@ -218,6 +218,27 @@ public interface FactOriginProjectLogDailyService extends BaseService getOrgResponse(String customerId, String monthId, String level); + /** + * 网格项目响应度 + * @author zhaoqifeng + * @date 2020/9/25 9:56 + * @param customerId + * @param dateId + * @return java.util.List + */ + List getGridResponseDaily(String customerId, String dateId); + + /** + * 组织项目响应度 + * @author zhaoqifeng + * @date 2020/9/25 9:56 + * @param customerId + * @param dateId + * @param level + * @return java.util.List + */ + List getOrgResponseDaily(String customerId, String dateId, String level); + /** * 网格满意率 * @author zhaoqifeng @@ -239,6 +260,27 @@ public interface FactOriginProjectLogDailyService extends BaseService getOrgSatisfaction(String customerId, String monthId, String level); + /** + * 网格满意率 + * @author zhaoqifeng + * @date 2020/9/27 16:06 + * @param customerId + * @param dateId + * @return java.util.List + */ + List getGridSatisfactionDaily(String customerId, String dateId); + + /** + * 组织满意率 + * @author zhaoqifeng + * @date 2020/9/27 16:06 + * @param customerId + * @param dateId + * @param level + * @return java.util.List + */ + List getOrgSatisfactionDaily(String customerId, String dateId, String level); + /** * 获取部门办结项目数 * @author zhaoqifeng diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java index b160131db7..21994e4a98 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java @@ -146,6 +146,17 @@ public interface FactOriginProjectMainDailyService extends BaseService */ List getSelfProject(String customerId, String monthId, String level); + /** + * 自治项目数 + * @author zhaoqifeng + * @date 2020/9/25 15:34 + * @param customerId + * @param dateId + * @param level + * @return java.util.List + */ + List getSelfProjectDaily(String customerId, String dateId, String level); + /** * 已解决项目数 * @author zhaoqifeng @@ -156,6 +167,16 @@ public interface FactOriginProjectMainDailyService extends BaseService */ List getResolveProject(String customerId, String monthId, String level); + /** + * 已解决项目数 + * @author zhaoqifeng + * @date 2020/9/25 15:34 + * @param customerId + * @param dateId + * @param level + * @return java.util.List + */ + List getResolveProjectDaily(String customerId, String dateId, String level); /** * 网格已解决项目数 @@ -167,6 +188,16 @@ public interface FactOriginProjectMainDailyService extends BaseService getGridResolveProject(String customerId, String monthId); + /** + * 网格已解决项目数 + * @author zhaoqifeng + * @date 2020/9/25 15:34 + * @param customerId + * @param dateId + * @return java.util.List + */ + List getGridResolveProjectDaily(String customerId, String dateId); + /** * 网格项目数 * @author zhaoqifeng diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectLogDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectLogDailyServiceImpl.java index 9be7b9f44f..b01e714325 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectLogDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectLogDailyServiceImpl.java @@ -290,6 +290,35 @@ public class FactOriginProjectLogDailyServiceImpl extends BaseServiceImpl + * @author zhaoqifeng + * @date 2020/9/25 9:56 + */ + @Override + public List getGridResponseDaily(String customerId, String dateId) { + return baseDao.selectGridResponseDaily(customerId, dateId); + } + + /** + * 组织项目响应度 + * + * @param customerId + * @param dateId + * @param level + * @return java.util.List + * @author zhaoqifeng + * @date 2020/9/25 9:56 + */ + @Override + public List getOrgResponseDaily(String customerId, String dateId, String level) { + return baseDao.selectOrgResponseDaily(customerId, dateId, level); + } + @Override public List getGridSatisfaction(String customerId, String monthId) { return baseDao.selectGridSatisfaction(customerId, monthId); @@ -300,6 +329,35 @@ public class FactOriginProjectLogDailyServiceImpl extends BaseServiceImpl + * @author zhaoqifeng + * @date 2020/9/27 16:06 + */ + @Override + public List getGridSatisfactionDaily(String customerId, String dateId) { + return baseDao.selectGridSatisfactionDaily(customerId, dateId); + } + + /** + * 组织满意率 + * + * @param customerId + * @param dateId + * @param level + * @return java.util.List + * @author zhaoqifeng + * @date 2020/9/27 16:06 + */ + @Override + public List getOrgSatisfactionDaily(String customerId, String dateId, String level) { + return baseDao.selectOrgSatisfactionDaily(customerId, dateId, level); + } + /** * 获取部门办结项目数 * diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java index 73830ce377..12550e187f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java @@ -180,16 +180,60 @@ public class FactOriginProjectMainDailyServiceImpl extends BaseServiceImpl + * @author zhaoqifeng + * @date 2020/9/25 15:34 + */ + @Override + public List getSelfProjectDaily(String customerId, String dateId, String level) { + return baseDao.getSelfProjectDaily(customerId, dateId, level); + } + @Override public List getResolveProject(String customerId, String monthId, String level) { return baseDao.getResolveProject(customerId, monthId, level); } + /** + * 已解决项目数 + * + * @param customerId + * @param dateId + * @param level + * @return java.util.List + * @author zhaoqifeng + * @date 2020/9/25 15:34 + */ + @Override + public List getResolveProjectDaily(String customerId, String dateId, String level) { + return baseDao.getResolveProjectDaily(customerId, dateId, level); + } + @Override public List getGridResolveProject(String customerId, String monthId) { return baseDao.getGridResolveProject(customerId, monthId); } + /** + * 网格已解决项目数 + * + * @param customerId + * @param dateId + * @return java.util.List + * @author zhaoqifeng + * @date 2020/9/25 15:34 + */ + @Override + public List getGridResolveProjectDaily(String customerId, String dateId) { + return baseDao.getGridResolveProjectDaily(customerId, dateId); + } + @Override public List getGridProjectCount(String customerId, String monthId) { return baseDao.getGridProjectCount(customerId, monthId); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/GovernRankDataExtractService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/GovernRankDataExtractService.java index ef55ca765a..81b88a84bd 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/GovernRankDataExtractService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/GovernRankDataExtractService.java @@ -49,4 +49,48 @@ public interface GovernRankDataExtractService { * @date 2020/9/24 15:17 */ void extractDistrictData(String customerId, String monthId); + + /** + * 网格治理能力 + * + * @param customerId + * @param dateId + * @return void + * @author zhaoqifeng + * @date 2020/9/24 15:16 + */ + void extractGridDataDaily(String customerId, String dateId); + + /** + * 社区治理能力 + * + * @param customerId + * @param dateId + * @return void + * @author zhaoqifeng + * @date 2020/9/24 15:17 + */ + void extractCommunityDataDaily(String customerId, String dateId); + + /** + * 街道治理能力 + * + * @param customerId + * @param dateId + * @return void + * @author zhaoqifeng + * @date 2020/9/24 15:17 + */ + void extractStreetDataDaily(String customerId, String dateId); + + /** + * 全区治理能力 + * + * @param customerId + * @param dateId + * @return void + * @author zhaoqifeng + * @date 2020/9/24 15:17 + */ + void extractDistrictDataDaily(String customerId, String dateId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/GovernRankDataExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/GovernRankDataExtractServiceImpl.java index 14198e915b..8d88c42e05 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/GovernRankDataExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/GovernRankDataExtractServiceImpl.java @@ -5,12 +5,14 @@ import com.epmet.constant.IndexCalConstant; import com.epmet.constant.OrgTypeConstant; import com.epmet.dto.extract.result.OrgStatisticsResultDTO; import com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityGridMonthlyEntity; +import com.epmet.entity.evaluationindex.screen.ScreenGovernRankDataDailyEntity; import com.epmet.entity.evaluationindex.screen.ScreenGovernRankDataEntity; import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectLogDailyService; import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectMainDailyService; import com.epmet.service.evaluationindex.extract.toscreen.GovernRankDataExtractService; import com.epmet.service.evaluationindex.indexcoll.FactIndexGovrnAblityGridMonthlyService; import com.epmet.service.evaluationindex.indexcoll.FactIndexGovrnAblityOrgMonthlyService; +import com.epmet.service.evaluationindex.screen.ScreenGovernRankDataDailyService; import com.epmet.service.evaluationindex.screen.ScreenGovernRankDataService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -30,6 +32,8 @@ public class GovernRankDataExtractServiceImpl implements GovernRankDataExtractSe @Autowired private ScreenGovernRankDataService screenGovernRankDataService; @Autowired + private ScreenGovernRankDataDailyService screenGovernRankDataDailyService; + @Autowired private FactIndexGovrnAblityOrgMonthlyService factIndexGovrnAblityOrgMonthlyService; @Autowired private FactIndexGovrnAblityGridMonthlyService factIndexGovrnAblityGridMonthlyService; @@ -283,4 +287,294 @@ public class GovernRankDataExtractServiceImpl implements GovernRankDataExtractSe } screenGovernRankDataService.delAndSaveRankData(customerId, OrgTypeConstant.AGENCY, monthId, IndexCalConstant.DELETE_SIZE, list); } + + /** + * 网格治理能力 + * + * @param customerId + * @param dateId + * @return void + * @author zhaoqifeng + * @date 2020/9/24 15:16 + */ + @Override + public void extractGridDataDaily(String customerId, String dateId) { + List list = screenGovernRankDataDailyService.initList(customerId, OrgTypeConstant.GRID, null); + if (CollectionUtils.isEmpty(list)) { + return; + } + BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED); + list.forEach(entity -> { + entity.setYearId(dateId.substring(NumConstant.ZERO, NumConstant.FOUR)); + entity.setMonthId(dateId.substring(NumConstant.ZERO, NumConstant.SIX)); + entity.setDateId(dateId); + }); + //满意率 满意和非常满意占比 + List satisfactionList = factOriginProjectLogDailyService.getGridSatisfactionDaily(customerId, dateId); + if (!CollectionUtils.isEmpty(satisfactionList)) { + list.forEach(entity -> satisfactionList.stream().filter(item -> item.getOrgId().equals(entity.getOrgId())).forEach(dto -> { + if (dto.getSum() != NumConstant.ZERO) { + BigDecimal sum = new BigDecimal(dto.getSum()); + BigDecimal count = new BigDecimal(dto.getCount()); + entity.setSatisfactionRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + } + })); + } + //自治率 + List gridList = factIndexGovrnAblityGridMonthlyService.getGridByCustomerDaily(customerId, dateId); + if (CollectionUtils.isNotEmpty(gridList)) { + list.forEach(entity -> gridList.stream().filter(gridAbility -> entity.getOrgId().equals(gridAbility.getGridId())).forEach(grid -> { + BigDecimal resolveCount = new BigDecimal(grid.getResolveProjectCount()); + BigDecimal selfCount = new BigDecimal(grid.getSelfSolveProjectCount()); + if (grid.getResolveProjectCount() != NumConstant.ZERO) { + entity.setGovernRatio(selfCount.multiply(hundred).divide(resolveCount, NumConstant.SIX, RoundingMode.HALF_UP)); + } + })); + } + + //响应率 响应次数/流转到网格的次数 + List responseList = factOriginProjectLogDailyService.getGridResponseDaily(customerId, dateId); + if (CollectionUtils.isNotEmpty(responseList)) { + list.forEach(entity -> responseList.stream().filter(response -> entity.getOrgId().equals(response.getOrgId())).forEach(dto -> { + if (dto.getSum() != NumConstant.ZERO) { + BigDecimal sum = new BigDecimal(dto.getSum()); + BigDecimal count = new BigDecimal(dto.getCount()); + entity.setResponseRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + } + })); + } + + //解决率 已解决项目数/办结项目数 + List resolveList = factOriginProjectMainDailyService.getGridResolveProjectDaily(customerId, dateId); + if (CollectionUtils.isNotEmpty(resolveList)) { + list.forEach(entity -> resolveList.stream().filter(resolve -> entity.getOrgId().equals(resolve.getOrgId())).forEach(dto -> { + if (dto.getSum() != NumConstant.ZERO) { + BigDecimal sum = new BigDecimal(dto.getSum()); + BigDecimal count = new BigDecimal(dto.getCount()); + entity.setResolvedRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + } + })); + } + + screenGovernRankDataDailyService.delAndSaveRankData(customerId, OrgTypeConstant.GRID, dateId, IndexCalConstant.DELETE_SIZE, list); + } + + /** + * 社区治理能力 + * + * @param customerId + * @param dateId + * @return void + * @author zhaoqifeng + * @date 2020/9/24 15:17 + */ + @Override + public void extractCommunityDataDaily(String customerId, String dateId) { + List list = screenGovernRankDataDailyService.initList(customerId, OrgTypeConstant.AGENCY, + OrgTypeConstant.COMMUNITY); + if (CollectionUtils.isEmpty(list)) { + return; + } + BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED); + list.forEach(entity -> { + entity.setYearId(dateId.substring(NumConstant.ZERO, NumConstant.FOUR)); + entity.setMonthId(dateId.substring(NumConstant.ZERO, NumConstant.SIX)); + entity.setDateId(dateId); + }); + + //满意率 满意和非常满意占比 + List satisfactionList = factOriginProjectLogDailyService.getOrgSatisfactionDaily(customerId, dateId, + OrgTypeConstant.COMMUNITY); + if (CollectionUtils.isNotEmpty(satisfactionList)) { + list.forEach(entity -> satisfactionList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> { + if (dto.getSum() != NumConstant.ZERO) { + BigDecimal sum = new BigDecimal(dto.getSum()); + BigDecimal count = new BigDecimal(dto.getCount()); + entity.setSatisfactionRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + } + })); + } + + //响应率 响应次数/流转到网格的次数 + List responseList = factOriginProjectLogDailyService.getOrgResponseDaily(customerId, dateId, OrgTypeConstant.COMMUNITY); + if (CollectionUtils.isNotEmpty(responseList)) { + list.forEach(entity -> responseList.stream().filter(response -> entity.getOrgId().equals(response.getAgencyId())).forEach(dto -> { + if (dto.getSum() != NumConstant.ZERO) { + BigDecimal sum = new BigDecimal(dto.getSum()); + BigDecimal count = new BigDecimal(dto.getCount()); + entity.setResponseRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + } + })); + } + //自制率 自治项目数/办结项目数 + List selfList = factOriginProjectMainDailyService.getSelfProject(customerId, dateId, OrgTypeConstant.COMMUNITY); + if (CollectionUtils.isNotEmpty(selfList)) { + list.forEach(entity -> selfList.stream().filter(self -> entity.getOrgId().equals(self.getAgencyId())).forEach(dto -> { + if (dto.getSum() != NumConstant.ZERO) { + BigDecimal sum = new BigDecimal(dto.getSum()); + BigDecimal count = new BigDecimal(dto.getCount()); + entity.setGovernRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + } + })); + } + //解决率 已解决项目数/办结项目数 + List resolveList = factOriginProjectMainDailyService.getResolveProjectDaily(customerId, dateId, + OrgTypeConstant.COMMUNITY); + if (CollectionUtils.isNotEmpty(resolveList)) { + list.forEach(entity -> resolveList.stream().filter(resolve -> entity.getOrgId().equals(resolve.getAgencyId())).forEach(dto -> { + if (dto.getSum() != NumConstant.ZERO) { + BigDecimal sum = new BigDecimal(dto.getSum()); + BigDecimal count = new BigDecimal(dto.getCount()); + entity.setResolvedRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + } + })); + } + screenGovernRankDataDailyService.delAndSaveRankData(customerId, OrgTypeConstant.AGENCY, dateId, IndexCalConstant.DELETE_SIZE, list); + } + + /** + * 街道治理能力 + * + * @param customerId + * @param dateId + * @return void + * @author zhaoqifeng + * @date 2020/9/24 15:17 + */ + @Override + public void extractStreetDataDaily(String customerId, String dateId) { + List list = screenGovernRankDataDailyService.initList(customerId, OrgTypeConstant.AGENCY, + OrgTypeConstant.STREET); + if (CollectionUtils.isEmpty(list)) { + return; + } + BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED); + list.forEach(entity -> { + entity.setYearId(dateId.substring(NumConstant.ZERO, NumConstant.FOUR)); + entity.setMonthId(dateId.substring(NumConstant.ZERO, NumConstant.SIX)); + entity.setDateId(dateId); + }); + + //满意率 满意和非常满意占比 + List satisfactionList = factOriginProjectLogDailyService.getOrgSatisfactionDaily(customerId, dateId, + OrgTypeConstant.STREET); + if (CollectionUtils.isNotEmpty(satisfactionList)) { + list.forEach(entity -> satisfactionList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> { + if (dto.getSum() != NumConstant.ZERO) { + BigDecimal sum = new BigDecimal(dto.getSum()); + BigDecimal count = new BigDecimal(dto.getCount()); + entity.setSatisfactionRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + } + })); + } + + //响应率 响应次数/流转到网格的次数 + List responseList = factOriginProjectLogDailyService.getOrgResponseDaily(customerId, dateId, OrgTypeConstant.STREET); + if (CollectionUtils.isNotEmpty(responseList)) { + list.forEach(entity -> responseList.stream().filter(response -> entity.getOrgId().equals(response.getAgencyId())).forEach(dto -> { + if (dto.getSum() != NumConstant.ZERO) { + BigDecimal sum = new BigDecimal(dto.getSum()); + BigDecimal count = new BigDecimal(dto.getCount()); + entity.setResponseRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + } + })); + } + //自制率 自治项目数/办结项目数 + List selfList = factOriginProjectMainDailyService.getSelfProject(customerId, dateId, OrgTypeConstant.STREET); + if (CollectionUtils.isNotEmpty(selfList)) { + list.forEach(entity -> selfList.stream().filter(self -> entity.getOrgId().equals(self.getAgencyId())).forEach(dto -> { + if (dto.getSum() != NumConstant.ZERO) { + BigDecimal sum = new BigDecimal(dto.getSum()); + BigDecimal count = new BigDecimal(dto.getCount()); + entity.setGovernRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + } + })); + } + //解决率 已解决项目数/办结项目数 + List resolveList = factOriginProjectMainDailyService.getResolveProjectDaily(customerId, dateId, + OrgTypeConstant.STREET); + if (CollectionUtils.isNotEmpty(resolveList)) { + list.forEach(entity -> resolveList.stream().filter(resolve -> entity.getOrgId().equals(resolve.getAgencyId())).forEach(dto -> { + if (dto.getSum() != NumConstant.ZERO) { + BigDecimal sum = new BigDecimal(dto.getSum()); + BigDecimal count = new BigDecimal(dto.getCount()); + entity.setResolvedRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + } + })); + } + screenGovernRankDataDailyService.delAndSaveRankData(customerId, OrgTypeConstant.AGENCY, dateId, IndexCalConstant.DELETE_SIZE, list); + } + + /** + * 全区治理能力 + * + * @param customerId + * @param dateId + * @return void + * @author zhaoqifeng + * @date 2020/9/24 15:17 + */ + @Override + public void extractDistrictDataDaily(String customerId, String dateId) { + List list = screenGovernRankDataDailyService.initList(customerId, OrgTypeConstant.AGENCY, + OrgTypeConstant.DISTRICT); + if (CollectionUtils.isEmpty(list)) { + return; + } + BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED); + list.forEach(entity -> { + entity.setYearId(dateId.substring(NumConstant.ZERO, NumConstant.FOUR)); + entity.setMonthId(dateId.substring(NumConstant.ZERO, NumConstant.SIX)); + entity.setDateId(dateId); + }); + + //满意率 满意和非常满意占比 + List satisfactionList = factOriginProjectLogDailyService.getOrgSatisfactionDaily(customerId, dateId, + OrgTypeConstant.DISTRICT); + if (CollectionUtils.isNotEmpty(satisfactionList)) { + list.forEach(entity -> satisfactionList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> { + if (dto.getSum() != NumConstant.ZERO) { + BigDecimal sum = new BigDecimal(dto.getSum()); + BigDecimal count = new BigDecimal(dto.getCount()); + entity.setSatisfactionRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + } + })); + } + + //响应率 响应次数/流转到网格的次数 + List responseList = factOriginProjectLogDailyService.getOrgResponseDaily(customerId, dateId, OrgTypeConstant.DISTRICT); + if (CollectionUtils.isNotEmpty(responseList)) { + list.forEach(entity -> responseList.stream().filter(response -> entity.getOrgId().equals(response.getAgencyId())).forEach(dto -> { + if (dto.getSum() != NumConstant.ZERO) { + BigDecimal sum = new BigDecimal(dto.getSum()); + BigDecimal count = new BigDecimal(dto.getCount()); + entity.setResponseRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + } + })); + } + //自制率 自治项目数/办结项目数 + List selfList = factOriginProjectMainDailyService.getSelfProject(customerId, dateId, OrgTypeConstant.DISTRICT); + if (CollectionUtils.isNotEmpty(selfList)) { + list.forEach(entity -> selfList.stream().filter(self -> entity.getOrgId().equals(self.getAgencyId())).forEach(dto -> { + if (dto.getSum() != NumConstant.ZERO) { + BigDecimal sum = new BigDecimal(dto.getSum()); + BigDecimal count = new BigDecimal(dto.getCount()); + entity.setGovernRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + } + })); + } + //解决率 已解决项目数/办结项目数 + List resolveList = factOriginProjectMainDailyService.getResolveProjectDaily(customerId, dateId, + OrgTypeConstant.DISTRICT); + if (CollectionUtils.isNotEmpty(resolveList)) { + list.forEach(entity -> resolveList.stream().filter(resolve -> entity.getOrgId().equals(resolve.getAgencyId())).forEach(dto -> { + if (dto.getSum() != NumConstant.ZERO) { + BigDecimal sum = new BigDecimal(dto.getSum()); + BigDecimal count = new BigDecimal(dto.getCount()); + entity.setResolvedRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + } + })); + } + screenGovernRankDataDailyService.delAndSaveRankData(customerId, OrgTypeConstant.AGENCY, dateId, IndexCalConstant.DELETE_SIZE, list); + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java index 0697a46edd..b69cb0e595 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java @@ -221,6 +221,28 @@ public class ScreenExtractServiceImpl implements ScreenExtractService { log.error("按天统计:组织内各个分类下的项目总数,customerId为:"+customerId+"dateId为:"+dateId, e); } + //治理能力排行screen_govern_rank_data + try { + governRankDataExtractService.extractGridDataDaily(customerId, dateId); + }catch (Exception e){ + log.error("治理能力排行【网格】抽取到大屏失败,customerId为:" + customerId + "dateId为:" + dateId, e); + } + try { + governRankDataExtractService.extractCommunityDataDaily(customerId, dateId); + }catch (Exception e){ + log.error("治理能力排行【社区】抽取到大屏失败,customerId为:" + customerId + "dateId为:" + dateId, e); + } + try { + governRankDataExtractService.extractStreetDataDaily(customerId, dateId); + }catch (Exception e){ + log.error("治理能力排行【街道】抽取到大屏失败,customerId为:" + customerId + "dateId为:" + dateId, e); + } + try { + governRankDataExtractService.extractDistrictDataDaily(customerId, dateId); + }catch (Exception e){ + log.error("治理能力排行【全区】抽取到大屏失败,customerId为:" + customerId + "dateId为:" + dateId, e); + } + extractPartData(customerId, dateId); log.info("===== extractDaily method end ======"); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyService.java index 8010a566d2..c8621ab7d6 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyService.java @@ -21,4 +21,15 @@ public interface FactIndexGovrnAblityGridMonthlyService extends BaseService getGridByCustomer(String customerId, String monthId); + + /** + * 查询客户下网格治理能力 + * + * @param customerId + * @param dateId + * @return java.util.List + * @author zhaoqifeng + * @date 2020/9/24 15:41 + */ + List getGridByCustomerDaily(String customerId, String dateId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexGovrnAblityGridMonthlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexGovrnAblityGridMonthlyServiceImpl.java index 3f9c73afb3..bf3dd65e5e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexGovrnAblityGridMonthlyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexGovrnAblityGridMonthlyServiceImpl.java @@ -22,4 +22,18 @@ public class FactIndexGovrnAblityGridMonthlyServiceImpl extends BaseServiceImpl< public List getGridByCustomer(String customerId, String monthId) { return baseDao.selectGridByCustomer(customerId, monthId); } + + /** + * 查询客户下网格治理能力 + * + * @param customerId + * @param dateId + * @return java.util.List + * @author zhaoqifeng + * @date 2020/9/24 15:41 + */ + @Override + public List getGridByCustomerDaily(String customerId, String dateId) { + return baseDao.selectGridByCustomerDaily(customerId, dateId); + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenGovernRankDataDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenGovernRankDataDailyService.java new file mode 100644 index 0000000000..0fa086cfb7 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenGovernRankDataDailyService.java @@ -0,0 +1,121 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.evaluationindex.screen; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.screen.ScreenGovernRankDataDailyDTO; +import com.epmet.entity.evaluationindex.screen.ScreenGovernRankDataDailyEntity; + +import java.util.List; +import java.util.Map; + +/** + * 基层治理-治理能力排行数据(按月统计) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-24 + */ +public interface ScreenGovernRankDataDailyService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-05-24 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-05-24 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return ScreenGovernRankDataDailyDTO + * @author generator + * @date 2021-05-24 + */ + ScreenGovernRankDataDailyDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-05-24 + */ + void save(ScreenGovernRankDataDailyDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-05-24 + */ + void update(ScreenGovernRankDataDailyDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-05-24 + */ + void delete(String[] ids); + + /** + * 构造screen_govern_rank_data 初始数据,先赋值为0 + * + * @param customerId + * @param orgType + * @param agencyLevel + * @return java.util.List + * @author zhaoqifeng + * @date 2020/9/24 14:41 + */ + List initList(String customerId, String orgType, String agencyLevel); + + /** + * 保存抽取结果 + * + * @param customerId + * @param orgType + * @param dateId + * @param deleteSize + * @param entityList + * @return void + * @author zhaoqifeng + * @date 2020/9/25 10:32 + */ + void delAndSaveRankData(String customerId, String orgType, String dateId, Integer deleteSize, List entityList); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenGovernRankDataDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenGovernRankDataDailyServiceImpl.java new file mode 100644 index 0000000000..6c9054d6b0 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenGovernRankDataDailyServiceImpl.java @@ -0,0 +1,169 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.evaluationindex.screen.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.constant.DataSourceConstant; +import com.epmet.constant.OrgTypeConstant; +import com.epmet.dao.evaluationindex.screen.ScreenGovernRankDataDailyDao; +import com.epmet.dto.screen.ScreenGovernRankDataDailyDTO; +import com.epmet.entity.evaluationindex.screen.ScreenGovernRankDataDailyEntity; +import com.epmet.entity.evaluationindex.screen.ScreenGovernRankDataEntity; +import com.epmet.service.evaluationindex.screen.ScreenGovernRankDataDailyService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 基层治理-治理能力排行数据(按月统计) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-24 + */ +@Service +@Slf4j +@DataSource(DataSourceConstant.EVALUATION_INDEX) +public class ScreenGovernRankDataDailyServiceImpl extends BaseServiceImpl implements ScreenGovernRankDataDailyService { + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, ScreenGovernRankDataDailyDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, ScreenGovernRankDataDailyDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public ScreenGovernRankDataDailyDTO get(String id) { + ScreenGovernRankDataDailyEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, ScreenGovernRankDataDailyDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(ScreenGovernRankDataDailyDTO dto) { + ScreenGovernRankDataDailyEntity entity = ConvertUtils.sourceToTarget(dto, ScreenGovernRankDataDailyEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(ScreenGovernRankDataDailyDTO dto) { + ScreenGovernRankDataDailyEntity entity = ConvertUtils.sourceToTarget(dto, ScreenGovernRankDataDailyEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * 构造screen_govern_rank_data 初始数据,先赋值为0 + * + * @param customerId + * @param orgType + * @param agencyLevel + * @return java.util.List + * @author zhaoqifeng + * @date 2020/9/24 14:41 + */ + @Override + public List initList(String customerId, String orgType, String agencyLevel) { + List list = new ArrayList<>(); + switch (orgType) { + case OrgTypeConstant.AGENCY: + log.info("组织级别统计"); + list = baseDao.initAgencyDataList(customerId, agencyLevel); + break; + case OrgTypeConstant.GRID: + log.info("网格级别统计"); + list = baseDao.initGridDataList(customerId); + break; + default: + log.info("部门级别统计"); + break; + } + return list; + } + + /** + * 保存抽取结果 + * + * @param customerId + * @param orgType + * @param dateId + * @param deleteSize + * @param entityList + * @return void + * @author zhaoqifeng + * @date 2020/9/25 10:32 + */ + @Override + public void delAndSaveRankData(String customerId, String orgType, String dateId, Integer deleteSize, + List entityList) { + if (CollectionUtils.isEmpty(entityList)) { + return; + } + List orgIds = new ArrayList<>(); + for (ScreenGovernRankDataDailyEntity entity : entityList) { + orgIds.add(entity.getOrgId()); + } + int deleteNum; + do { + deleteNum = baseDao.deleteRankData(customerId, orgType, dateId, deleteSize, orgIds); + } while (deleteNum != NumConstant.ZERO); + + insertBatch(entityList); + } + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectService.java index 56a99d5257..36c3ebd05b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectService.java @@ -23,6 +23,7 @@ import com.epmet.dto.ProjectDTO; import com.epmet.dto.project.ProjectAgencyDTO; import com.epmet.dto.project.ProjectGridDTO; import com.epmet.dto.project.result.ProjectExceedParamsResultDTO; +import com.epmet.entity.evaluationindex.extract.FactOriginProjectMainDailyEntity; import com.epmet.entity.project.ProjectEntity; import org.apache.ibatis.annotations.Param; @@ -152,4 +153,13 @@ public interface ProjectService extends BaseService { */ List getProjectCategoryData(String customerId, String dateId); + /** + * 获取项目满意度 + * @author zhaoqifeng + * @date 2021/5/21 10:04 + * @param customerId + * @return java.util.List + */ + List getProjectSatisfaction(String customerId); + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java index d2a3ff001d..3581f920b1 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java @@ -26,17 +26,16 @@ import com.epmet.dto.ProjectDTO; import com.epmet.dto.project.ProjectAgencyDTO; import com.epmet.dto.project.ProjectCategoryDTO; import com.epmet.dto.project.ProjectGridDTO; +import com.epmet.dto.project.ProjectPointDTO; import com.epmet.dto.project.result.ProjectExceedParamsResultDTO; +import com.epmet.entity.evaluationindex.extract.FactOriginProjectMainDailyEntity; import com.epmet.entity.project.ProjectEntity; import com.epmet.service.project.ProjectService; import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Set; +import java.util.*; import java.util.stream.Collectors; /** @@ -163,5 +162,39 @@ public class ProjectServiceImpl extends BaseServiceImpl + * @author zhaoqifeng + * @date 2021/5/21 10:04 + */ + @Override + public List getProjectSatisfaction(String customerId) { + List list = baseDao.selectProjectSatisfaction(customerId); + if (org.apache.commons.collections4.CollectionUtils.isEmpty(list)) { + return Collections.emptyList(); + } + //获取项目满意指标 + String value = baseDao.selectValueByKey(customerId, "satisfaction"); + if (null == value) { + //客户没有自定义配置的话取默认配置 + value = baseDao.selectValueByKey("default", "satisfaction"); + } + + String finalValue = value; + return list.stream().map(item -> { + FactOriginProjectMainDailyEntity entity = new FactOriginProjectMainDailyEntity(); + entity.setId(item.getProjectId()); + if (item.getPoint() < Integer.parseInt(finalValue)) { + entity.setIsSatisfied(NumConstant.ZERO); + } else { + entity.setIsSatisfied(NumConstant.ONE); + } + return entity; + }).collect(Collectors.toList()); + } + } 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 7b2a4f9ae7..4d913d3edf 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 @@ -362,33 +362,22 @@ SELECT AGENCY_ID, - COUNT( score >= 80 OR NULL ) AS 'count', + SUM( score ) AS 'count', COUNT( ID ) AS 'sum' FROM ( SELECT fm.AGENCY_ID, fm.ID, - IFNULL( fl.score, 80 ) AS "score" + IFNULL( IS_SATISFIED, 1 ) AS "score" FROM fact_origin_project_main_daily fm - INNER JOIN dim_agency da ON fm.AGENCY_ID = da.ID - AND da.`LEVEL` = #{level} - LEFT JOIN ( - SELECT - f.PROJECT_ID, - AVG( CASE ACTION_CODE WHEN 'bad' THEN 60 WHEN 'perfect' THEN 100 ELSE 80 END ) AS score - FROM - fact_origin_project_log_daily f - INNER JOIN dim_agency da ON f.AGENCY_ID = da.ID - AND da.`LEVEL` = #{level} - WHERE - ( ACTION_CODE = 'bad' OR ACTION_CODE = 'good' OR ACTION_CODE = 'perfect' ) - AND f.CUSTOMER_ID = #{customerId} - AND f.MONTH_ID = #{monthId} - GROUP BY - PROJECT_ID - ) fl ON fm.ID = fl.PROJECT_ID WHERE fm.CUSTOMER_ID = #{customerId} AND fm.MONTH_ID = #{monthId} AND fm.PROJECT_STATUS = 'closed' + AND fm.ORIGIN = 'issue' ) a GROUP BY AGENCY_ID @@ -552,4 +525,111 @@ GROUP BY PROJECT_ID HAVING COUNT(DISTINCT(ORG_ID)) = 1 + + + + \ 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 dc6b766fb7..34156fb11b 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 @@ -807,5 +807,111 @@ AND ORIGIN = 'issue' GROUP BY GRID_ID + + + 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 755e3aab60..1285067483 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 @@ -256,6 +256,21 @@ CUSTOMER_ID = #{customerId} AND MONTH_ID = #{monthId} + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenGovernRankDataDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenGovernRankDataDailyDao.xml new file mode 100644 index 0000000000..eec63e765b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenGovernRankDataDailyDao.xml @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + delete from screen_govern_rank_data + where CUSTOMER_ID = #{customerId} + AND DATE_ID <= #{dateId} + + and ORG_TYPE=#{orgType} + + + and + ( + + ORG_ID = #{orgId} + + ) + + limit #{deleteSize} + + + + + + + \ 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 58dd19a9e5..3c5ebd884f 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 @@ -145,4 +145,21 @@ AND DATE_FORMAT(CREATED_TIME,'%Y%m%d')=#{dateId} + + 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 209d13e228..821ca24983 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 @@ -131,6 +131,17 @@ AND CUSTOMER_ID = #{customerId} AND MONTH_ID = #{monthId} + \ No newline at end of file From 70edf314c40f7e162873e73cfd83e18bb2fa6763 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Mon, 24 May 2021 17:08:38 +0800 Subject: [PATCH 066/128] zancun --- .../todata/FactGridGovernDailyService.java | 14 ++++++- .../impl/FactGridGovernDailyServiceImpl.java | 39 +++++++++++++++++++ 2 files changed, 52 insertions(+), 1 deletion(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactGridGovernDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactGridGovernDailyService.java index d5ffd39cd4..95185f2134 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactGridGovernDailyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactGridGovernDailyService.java @@ -27,6 +27,18 @@ import com.epmet.entity.evaluationindex.extract.FactGridGovernDailyEntity; * @since v1.0.0 2021-05-24 */ public interface FactGridGovernDailyService extends BaseService { - + // 指标解释: + // 1、问题解决总数:当前网格内,话题关闭(已解决+无需解决)总数、议题关闭(已解决+无需解决)总数和项目结案(议题转为项目的结案数+项目立项结案数)总数之和 + // 2、党群自治占比:当前网格内,所有小组内关闭(已解决+无需解决)的话题数与问题解决总数之比(未出小组:未转议题的) + // 3、网格自治占比:当前组织下,所有网格内结案项目数与问题解决总数之比(未出网格) + /** + * 治理指数-网格相关:问题解决总数、党群自治占比、网格自治占比 + * + * + * @param customerId + * @param dateId + * @return + */ + void extractFactGridGovernDaily(String customerId, String dateId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactGridGovernDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactGridGovernDailyServiceImpl.java index 99e73d3603..38b5a2d8a0 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactGridGovernDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactGridGovernDailyServiceImpl.java @@ -19,17 +19,56 @@ package com.epmet.service.evaluationindex.extract.todata.impl; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.dao.evaluationindex.extract.FactGridGovernDailyDao; +import com.epmet.dto.org.GridInfoDTO; import com.epmet.entity.evaluationindex.extract.FactGridGovernDailyEntity; import com.epmet.service.evaluationindex.extract.todata.FactGridGovernDailyService; +import com.epmet.service.group.GroupDataService; +import com.epmet.service.org.CustomerAgencyService; +import com.epmet.service.org.CustomerGridService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.util.List; + /** * 网格的治理指数,按天统计 * * @author generator generator@elink-cn.com * @since v1.0.0 2021-05-24 */ +@Slf4j @Service public class FactGridGovernDailyServiceImpl extends BaseServiceImpl implements FactGridGovernDailyService { + @Autowired + private GroupDataService groupDataService; + @Autowired + private CustomerAgencyService customerAgencyService; + @Autowired + private CustomerGridService customerGridService; + + // 指标解释: + // 1、问题解决总数:当前网格内,话题关闭(已解决+无需解决)总数、议题关闭(已解决+无需解决)总数和项目结案(议题转为项目的结案数+项目立项结案数)总数之和 + // 2、党群自治占比:当前网格内,所有小组内关闭(已解决+无需解决)的话题数与问题解决总数之比(未出小组:未转议题的) + // 3、网格自治占比:当前组织下,所有网格内结案项目数与问题解决总数之比(未出网格) + /** + * 治理指数-网格相关:问题解决总数、党群自治占比、网格自治占比 + * + * @param customerId + * @param dateId + * @return + */ + @Override + public void extractFactGridGovernDaily(String customerId, String dateId) { + //客户id, dateId不能为空 + if(StringUtils.isBlank(customerId)||StringUtils.isBlank(dateId)){ + return; + } + // 2、当前客户下所有的网格 + List gridInfoDTOList=customerGridService.queryGridInfoList(customerId); + //todo + // List + } } \ No newline at end of file From e789a8941667d91612e1561b0bad7242bde198ff Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Mon, 24 May 2021 17:21:05 +0800 Subject: [PATCH 067/128] FactAgencyGovernDailyService --- .../todata/FactAgencyGovernDailyService.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactAgencyGovernDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactAgencyGovernDailyService.java index 1f8440c281..2c0050903c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactAgencyGovernDailyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactAgencyGovernDailyService.java @@ -27,5 +27,20 @@ import com.epmet.entity.evaluationindex.extract.FactAgencyGovernDailyEntity; * @since v1.0.0 2021-05-24 */ public interface FactAgencyGovernDailyService extends BaseService { + // 问题解决总数:当前组织下,话题关闭(已解决+无需解决)总数、议题关闭(已解决+无需解决)总数和项目结案(议题转为项目的结案数+项目立项结案数)总数之和 + // 党群自治占比:当前组织下,所有小组内关闭(已解决+无需解决)的话题数与问题解决总数之比(未出小组:未转议题的) + // 网格自治占比:当前组织下,所有网格内结案项目数与问题解决总数之比(未出网格) + // 参考:fact_index_govrn_ablity_grid_monthly的SELF_SOLVE_PROJECT_COUNT计算 + // 社区解决占比:当前组织下,由社区结案的项目数与问题解决总数之比 + // 区直部门解决占比:当前组织下,由区级部门结案的项目数与问题解决总数之比 + // 街道解决占比:当前组织下,由街道结案的项目数与问题解决总数之比 + // 自下而上的项目解决:结案时操作人所代表的的处理部门(可以是网格、街道、组织) + // 自上而下的项目解决:向下吹哨,谁立项谁解决(后期在讨论哪样更合理) + // + // 究竟是谁解决!!: + // A社区→A街道→B社区(结案)——A街道解决(自下而上吹(饱含立项往上吹/从话题来的项目),看往上吹的最高层级) + // A社区→B社区→C社区(结案)——C社区解决(平级协助解决,看最后结案) + // A街道→A社区→B社区(结案)——A街道解决(自上而下吹,谁立项谁解决) + // 注:A社区→A街道→(退回)A社区→B社区(结案),A街道不算处理项目,仍是平级协助解决,看最后谁结案 } \ No newline at end of file From 0b54d26c6aadf46391de391b8e1c9d51e5219451 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 25 May 2021 09:37:56 +0800 Subject: [PATCH 068/128] =?UTF-8?q?=E6=B2=BB=E7=90=86=E6=8C=87=E6=95=B0?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E4=B8=A4=E5=BC=A0=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../db/migration/V0.0.15__govern.sql | 97 +++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.15__govern.sql diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.15__govern.sql b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.15__govern.sql new file mode 100644 index 0000000000..7777abc992 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.15__govern.sql @@ -0,0 +1,97 @@ +-- epmet_data_statistical新增两张表,治理指数网格按天统计,治理指数按组织按天统计 + +-- /* +-- Navicat Premium Data Transfer +-- +-- Source Server : 192.168.1.130 +-- Source Server Type : MySQL +-- Source Server Version : 50728 +-- Source Host : 192.168.1.130:3306 +-- Source Schema : epmet_data_statistical +-- +-- Target Server Type : MySQL +-- Target Server Version : 50728 +-- File Encoding : 65001 +-- +-- Date: 25/05/2021 09:31:39 +-- */ +-- +-- SET NAMES utf8mb4; +-- SET FOREIGN_KEY_CHECKS = 0; +-- +-- -- ---------------------------- +-- -- Table structure for fact_agency_govern_daily +-- -- ---------------------------- +-- DROP TABLE IF EXISTS `fact_agency_govern_daily`; +-- CREATE TABLE `fact_agency_govern_daily` ( +-- `ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '主键,customer_id+AGENCY_ID+date_id只有一条记录', +-- `CUSTOMER_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '客户id', +-- `DATE_ID` varchar(8) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '数据更新至:yyyyMMdd; ', +-- `AGENCY_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '组织id', +-- `LEVEL` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'agency_id所属的机关级别(社区级:community,\r\n乡(镇、街道)级:street,\r\n区县级: district,\r\n市级: city\r\n省级:province)', +-- `PID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '组织i所属的组织id', +-- `PIDS` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '组织i所有上级id', +-- `PROBLEM_RESOLVED_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '界面展示:问题解决总数=1+2+3+4+5+6+7+8', +-- `GROUP_SELF_GOVERN_RATIO` decimal(10, 6) NOT NULL COMMENT '界面展示:党群自治占比=(9+10)/PROBLEM_RESOLVED_COUNT; 此列存储的是小数', +-- `GRID_SELF_GOVERN_RATIO` decimal(10, 6) NOT NULL COMMENT '界面展示:网格自治占比=GRID_SELF_GOVERN_PROJECT_TOTAL/PROBLEM_RESOLVED_COUNT;此列存储的是小数', +-- `COMMUNITY_CLOSED_RATIO` decimal(10, 6) NOT NULL COMMENT '界面展示:社区解决占比=COMMUNITY_CLOSED_COUNT/PROBLEM_RESOLVED_COUNT;此列存储的是小数', +-- `STREET_CLOSED_RATIO` decimal(10, 6) NOT NULL COMMENT '界面展示:街道解决占比=STREET_CLOSED_COUNT/PROBLEM_RESOLVED_COUNT;此列存储的是小数', +-- `DISTRICT_DEPT_CLOSED_RATIO` decimal(10, 6) NOT NULL COMMENT '界面展示:区直部门解决占比=DISTRICT_DEPT_CLOSED_COUNT/PROBLEM_RESOLVED_COUNT;此列存储的是小数', +-- `TOPIC_RESOLVED_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '1、当前组织内,话题关闭已解决数', +-- `TOPIC_UN_RESOLVED_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '2、当前组织内,话题关闭无需解决数', +-- `ISSUE_RESOLVED_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '3、当前组织内,议题关闭已解决数', +-- `ISSUE_UN_RESOLVED_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '4、当前组织内,议题关闭无需解决数', +-- `ISSUE_PROJECT_RESOLVED_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '5、当前组织内:来源于议题的项目:结案已解决数', +-- `ISSUE_PROJECT_UN_RESOLVED_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '6、当前组织内:来源于议题的项目:结案无需解决数', +-- `APPROVAL_PROJECT_RESOLVED_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '7、当前组织内:项目立项,结案已解决数;默认为0,', +-- `APPROVAL_PROJECT_UN_RESOLVED_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '8、当前组织内:项目立项,结案无需解决数;默认为0,', +-- `IN_GROUP_TOPIC_RESOLVED_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '9、当前组织内,未出小组即未转议题的:话题关闭已解决数', +-- `IN_GROUP_TOPIC_UN_RESOLVED_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '10、当前组织内,未出小组即未转议题的:话题关闭无需解决数', +-- `GRID_SELF_GOVERN_PROJECT_TOTAL` int(11) NOT NULL DEFAULT 0 COMMENT '未出当前网格的,结案项目数', +-- `COMMUNITY_CLOSED_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '当前组织内结案的项目中:由社区结案的项目总数', +-- `STREET_CLOSED_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '当前组织内结案的项目中:由街道结案的项目总数', +-- `DISTRICT_DEPT_CLOSED_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '当前组织内结案的项目中:由区直部门结案的项目总数', +-- `DEL_FLAG` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除、1已删除', +-- `REVISION` int(11) NOT NULL DEFAULT 0 COMMENT '乐观锁', +-- `CREATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '创建人', +-- `CREATED_TIME` datetime(0) NOT NULL COMMENT '创建时间:第一次提交审核的时间,注意和历史表的第一条记录时间一致', +-- `UPDATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '更新人', +-- `UPDATED_TIME` datetime(0) NOT NULL COMMENT '更新时间', +-- PRIMARY KEY (`ID`) USING BTREE +-- ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '组织的治理指数,按天统计' ROW_FORMAT = Dynamic; +-- +-- -- ---------------------------- +-- -- Table structure for fact_grid_govern_daily +-- -- ---------------------------- +-- DROP TABLE IF EXISTS `fact_grid_govern_daily`; +-- CREATE TABLE `fact_grid_govern_daily` ( +-- `ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '主键,customer_id+grid_id+date_id只有一条记录', +-- `CUSTOMER_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '客户id', +-- `DATE_ID` varchar(8) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '数据更新至:yyyyMMdd; ', +-- `GRID_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '网格id', +-- `PID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '网格所属的组织id', +-- `PIDS` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '网格所有上级id', +-- `PROBLEM_RESOLVED_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '界面展示:问题解决总数=1+2+3+4+5+6+7+8', +-- `GROUP_SELF_GOVERN_RATIO` decimal(10, 6) NOT NULL COMMENT '界面展示:党群自治占比=(9+10)/PROBLEM_RESOLVED_COUNT; 此列存储的是小数', +-- `GRID_SELF_GOVERN_RATIO` decimal(10, 6) NOT NULL COMMENT '界面展示:网格自治占比=GRID_SELF_GOVERN_PROJECT_TOTAL/PROBLEM_RESOLVED_COUNT;此列存储的是小数', +-- `TOPIC_RESOLVED_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '1、当前网格内,话题关闭已解决数', +-- `TOPIC_UN_RESOLVED_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '2、当前网格内,话题关闭无需解决数', +-- `ISSUE_RESOLVED_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '3、当前网格内,议题关闭已解决数', +-- `ISSUE_UN_RESOLVED_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '4、当前网格内,议题关闭无需解决数', +-- `ISSUE_PROJECT_RESOLVED_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '5、当前网格内:来源于议题的项目:结案已解决数', +-- `ISSUE_PROJECT_UN_RESOLVED_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '6、当前网格内:来源于议题的项目:结案无需解决数', +-- `APPROVAL_PROJECT_RESOLVED_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '7、当前网格内:项目立项,结案已解决数;默认为0,', +-- `APPROVAL_PROJECT_UN_RESOLVED_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '8、当前网格内:项目立项,结案无需解决数;默认为0,', +-- `IN_GROUP_TOPIC_RESOLVED_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '9、当前网格内,未出小组即未转议题的:话题关闭已解决数', +-- `IN_GROUP_TOPIC_UN_RESOLVED_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '10、当前网格内,未出小组即未转议题的:话题关闭无需解决数', +-- `GRID_SELF_GOVERN_PROJECT_TOTAL` int(11) NOT NULL COMMENT '未出当前网格的,结案项目数', +-- `DEL_FLAG` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除、1已删除', +-- `REVISION` int(11) NOT NULL DEFAULT 0 COMMENT '乐观锁', +-- `CREATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '创建人', +-- `CREATED_TIME` datetime(0) NOT NULL COMMENT '创建时间:第一次提交审核的时间,注意和历史表的第一条记录时间一致', +-- `UPDATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '更新人', +-- `UPDATED_TIME` datetime(0) NOT NULL COMMENT '更新时间', +-- PRIMARY KEY (`ID`) USING BTREE +-- ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '网格的治理指数,按天统计' ROW_FORMAT = Dynamic; +-- +-- SET FOREIGN_KEY_CHECKS = 1; From 2feb3140670bc73441ba7afdfc8b1c29d68c1db5 Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Tue, 25 May 2021 10:15:07 +0800 Subject: [PATCH 069/128] =?UTF-8?q?=E5=9F=BA=E5=B1=82=E6=B2=BB=E7=90=86-?= =?UTF-8?q?=E6=B2=BB=E7=90=86=E8=83=BD=E5=8A=9B=E6=8E=92=E8=A1=8C=E6=95=B0?= =?UTF-8?q?=E6=8D=AE(=E6=8C=89=E5=A4=A9=E7=BB=9F=E8=AE=A1)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/controller/DemoController.java | 9 ++++ .../extract/FactOriginProjectLogDailyDao.java | 10 ++++ .../FactOriginProjectLogDailyService.java | 10 ++++ .../FactOriginProjectLogDailyServiceImpl.java | 14 +++++ .../GovernRankDataExtractServiceImpl.java | 10 ++-- .../ScreenGovernRankDataDailyServiceImpl.java | 1 + .../extract/FactOriginProjectLogDailyDao.xml | 52 +++++++++++++++---- .../extract/FactOriginProjectMainDailyDao.xml | 16 +++--- .../FactIndexGovrnAblityGridMonthlyDao.xml | 2 +- .../screen/ScreenGovernRankDataDailyDao.xml | 2 +- 10 files changed, 101 insertions(+), 25 deletions(-) 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 644830e3a2..dbedc28b8c 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 @@ -669,6 +669,15 @@ public class DemoController { return new Result(); } + @PostMapping("governRankDaily") + public Result governRankDaily(@RequestBody CustomerIdAndDateIdFormDTO formDTO){ + governRankDataExtractService.extractGridDataDaily(formDTO.getCustomerId(), formDTO.getDateId()); + governRankDataExtractService.extractCommunityDataDaily(formDTO.getCustomerId(), formDTO.getDateId()); + governRankDataExtractService.extractStreetDataDaily(formDTO.getCustomerId(), formDTO.getDateId()); + governRankDataExtractService.extractDistrictDataDaily(formDTO.getCustomerId(), formDTO.getDateId()); + return new Result(); + } + @Autowired private PioneerDataExtractService pioneerDataExtractService; @Autowired 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 ed79666c63..78f9be78e9 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 @@ -288,4 +288,14 @@ public interface FactOriginProjectLogDailyDao extends BaseDao */ List selectGridClosed(@Param("customerId") String customerId, @Param("monthId") String monthId); + + /** + * 网格自治率统计--按天 + * @author zhaoqifeng + * @date 2021/5/24 17:53 + * @param customerId + * @param dateId + * @return java.util.List + */ + List selectGridSelfDaily(@Param("customerId") String customerId, @Param("dateId") String dateId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectLogDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectLogDailyService.java index 13c0e1d6c8..141a8dc7b8 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectLogDailyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectLogDailyService.java @@ -310,4 +310,14 @@ public interface FactOriginProjectLogDailyService extends BaseService */ List getGridClosed(String customerId, String monthId); + + /** + * 网格自制率统计-按天 + * @author zhaoqifeng + * @date 2021/5/24 17:52 + * @param customerId + * @param dateId + * @return java.util.List + */ + List getGridSelfDaily(String customerId, String dateId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectLogDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectLogDailyServiceImpl.java index b01e714325..3dde0b0032 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectLogDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectLogDailyServiceImpl.java @@ -400,5 +400,19 @@ public class FactOriginProjectLogDailyServiceImpl extends BaseServiceImpl + * @author zhaoqifeng + * @date 2021/5/24 17:52 + */ + @Override + public List getGridSelfDaily(String customerId, String dateId) { + return baseDao.selectGridSelfDaily(customerId, dateId); + } + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/GovernRankDataExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/GovernRankDataExtractServiceImpl.java index 8d88c42e05..80d3f22ee7 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/GovernRankDataExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/GovernRankDataExtractServiceImpl.java @@ -321,12 +321,12 @@ public class GovernRankDataExtractServiceImpl implements GovernRankDataExtractSe })); } //自治率 - List gridList = factIndexGovrnAblityGridMonthlyService.getGridByCustomerDaily(customerId, dateId); + List gridList = factOriginProjectLogDailyService.getGridSelfDaily(customerId, dateId); if (CollectionUtils.isNotEmpty(gridList)) { - list.forEach(entity -> gridList.stream().filter(gridAbility -> entity.getOrgId().equals(gridAbility.getGridId())).forEach(grid -> { - BigDecimal resolveCount = new BigDecimal(grid.getResolveProjectCount()); - BigDecimal selfCount = new BigDecimal(grid.getSelfSolveProjectCount()); - if (grid.getResolveProjectCount() != NumConstant.ZERO) { + list.forEach(entity -> gridList.stream().filter(gridAbility -> entity.getOrgId().equals(gridAbility.getOrgId())).forEach(grid -> { + BigDecimal resolveCount = new BigDecimal(grid.getSum()); + BigDecimal selfCount = new BigDecimal(grid.getCount()); + if (grid.getSum() != NumConstant.ZERO) { entity.setGovernRatio(selfCount.multiply(hundred).divide(resolveCount, NumConstant.SIX, RoundingMode.HALF_UP)); } })); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenGovernRankDataDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenGovernRankDataDailyServiceImpl.java index 6c9054d6b0..3c48645963 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenGovernRankDataDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenGovernRankDataDailyServiceImpl.java @@ -149,6 +149,7 @@ public class ScreenGovernRankDataDailyServiceImpl extends BaseServiceImpl entityList) { if (CollectionUtils.isEmpty(entityList)) { 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 4d913d3edf..411d959a57 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 @@ -313,8 +313,7 @@ COUNT( ID ) AS "count" FROM fact_origin_project_log_daily WHERE ORG_TYPE = 'grid' - AND ( ACTION_CODE = 'response' - OR ACTION_CODE = 'close' + AND (ACTION_CODE = 'close' OR ACTION_CODE = 'transfer' OR ACTION_CODE = 'resolved' OR ACTION_CODE = 'unresolved' @@ -347,8 +346,7 @@ INNER JOIN dim_agency da ON f.AGENCY_ID = da.ID AND da.`LEVEL` = #{level} WHERE - ( ACTION_CODE = 'response' - OR ACTION_CODE = 'close' + ( ACTION_CODE = 'close' OR ACTION_CODE = 'transfer' OR ACTION_CODE = 'resolved' OR ACTION_CODE = 'unresolved' @@ -589,8 +587,7 @@ INNER JOIN dim_agency da ON f.AGENCY_ID = da.ID AND da.`LEVEL` = #{level} WHERE - ( ACTION_CODE = 'response' - OR ACTION_CODE = 'close' + (ACTION_CODE = 'close' OR ACTION_CODE = 'transfer' OR ACTION_CODE = 'resolved' OR ACTION_CODE = 'unresolved' @@ -620,11 +617,8 @@ COUNT( ID ) AS "count" FROM fact_origin_project_log_daily WHERE ORG_TYPE = 'grid' - AND ( ACTION_CODE = 'response' - OR ACTION_CODE = 'close' + AND ( ACTION_CODE = 'close' OR ACTION_CODE = 'transfer' - OR ACTION_CODE = 'resolved' - OR ACTION_CODE = 'unresolved' OR ACTION_CODE = 'created' ) AND IS_ACTIVE = 1 AND CUSTOMER_ID = #{customerId} @@ -632,4 +626,42 @@ GROUP BY ORG_ID ) b ON a.ORG_ID = b.ORG_ID + \ 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 34156fb11b..c6e024c502 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 @@ -240,7 +240,7 @@ INNER JOIN dim_agency da ON fm.AGENCY_ID = da.ID AND da.`LEVEL` = #{level} WHERE - fm.PROJECT_STATUS = 'close' + fm.PROJECT_STATUS = 'closed' AND fm.CUSTOMER_ID = #{customerId} AND fm.MONTH_ID = #{monthId} GROUP BY @@ -254,7 +254,7 @@ INNER JOIN dim_agency da ON fm.AGENCY_ID = da.ID AND da.`LEVEL` = #{level} WHERE - fm.PROJECT_STATUS = 'close' + fm.PROJECT_STATUS = 'closed' AND fm.CUSTOMER_ID = #{customerId} AND fm.MONTH_ID = #{monthId} AND fm.IS_RESOLVED = 'resolved' @@ -274,7 +274,7 @@ FROM fact_origin_project_main_daily fm WHERE - fm.PROJECT_STATUS = 'close' + fm.PROJECT_STATUS = 'closed' AND fm.GRID_ID != '' AND fm.CUSTOMER_ID = #{customerId} AND fm.MONTH_ID = #{monthId} @@ -287,7 +287,7 @@ FROM fact_origin_project_main_daily fm WHERE - fm.PROJECT_STATUS = 'close' + fm.PROJECT_STATUS = 'closed' AND fm.GRID_ID != '' AND fm.CUSTOMER_ID = #{customerId} AND fm.MONTH_ID = #{monthId} @@ -819,7 +819,7 @@ FROM fact_origin_project_main_daily fm WHERE - fm.PROJECT_STATUS = 'close' + fm.PROJECT_STATUS = 'closed' AND fm.GRID_ID != '' AND fm.CUSTOMER_ID = #{customerId} AND fm.DATE_ID <= #{dateId} @@ -832,7 +832,7 @@ FROM fact_origin_project_main_daily fm WHERE - fm.PROJECT_STATUS = 'close' + fm.PROJECT_STATUS = 'closed' AND fm.GRID_ID != '' AND fm.CUSTOMER_ID = #{customerId} AND fm.DATE_ID <= #{dateId} @@ -891,7 +891,7 @@ INNER JOIN dim_agency da ON fm.AGENCY_ID = da.ID AND da.`LEVEL` = #{level} WHERE - fm.PROJECT_STATUS = 'close' + fm.PROJECT_STATUS = 'closed' AND fm.CUSTOMER_ID = #{customerId} AND fm.DATE_ID <= #{dateId} GROUP BY @@ -905,7 +905,7 @@ INNER JOIN dim_agency da ON fm.AGENCY_ID = da.ID AND da.`LEVEL` = #{level} WHERE - fm.PROJECT_STATUS = 'close' + fm.PROJECT_STATUS = 'closed' AND fm.CUSTOMER_ID = #{customerId} AND fm.DATE_ID <= #{dateId} AND fm.IS_RESOLVED = 'resolved' 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 1285067483..800adbfb30 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 @@ -266,7 +266,7 @@ RESOLVE_PROJECT_COUNT, SATISFACTION_RATIO FROM - fact_index_govrn_ablity_grid_monthly + fact_index_govrn_ablity_grid_daily WHERE CUSTOMER_ID = #{customerId} AND DATE_ID <= #{dateId} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenGovernRankDataDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenGovernRankDataDailyDao.xml index eec63e765b..b38ec6cce5 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenGovernRankDataDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenGovernRankDataDailyDao.xml @@ -25,7 +25,7 @@ - delete from screen_govern_rank_data + delete from screen_govern_rank_data_daily where CUSTOMER_ID = #{customerId} AND DATE_ID <= #{dateId} From 93277b9580ab1fe22e63737e753a6711a2609e30 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Tue, 25 May 2021 15:25:19 +0800 Subject: [PATCH 070/128] =?UTF-8?q?=E7=BB=84=E7=BB=87/=E7=BD=91=E6=A0=BC?= =?UTF-8?q?=E4=B8=8B=E5=93=8D=E5=BA=94=E8=A7=A3=E5=86=B3=E6=BB=A1=E6=84=8F?= =?UTF-8?q?=E8=87=AA=E6=B2=BB=E7=8E=87=E6=9F=A5=E8=AF=A2=EF=BC=8C=E5=B9=B6?= =?UTF-8?q?=E5=BC=95=E5=85=A5epmet=5Fevaluation=5Findex=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E6=BA=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../constant/DataSourceConstant.java | 2 + .../dto/datastats/form/GovrnRatioFormDTO.java | 33 ++++++++++ .../datastats/result/GovrnRatioResultDTO.java | 27 +++++++++ .../data-aggregator-server/pom.xml | 60 ++++++++++++++----- .../controller/DataStatsController.java | 15 +++++ .../evaluationindex/EvaluationIndexDao.java | 37 ++++++++++++ .../service/datastats/DataStatsService.java | 7 +++ .../datastats/impl/DataStatsServiceImpl.java | 32 ++++++++++ .../EvaluationIndexService.java | 18 ++++++ .../impl/EvaluationIndexServiceImpl.java | 40 +++++++++++++ .../src/main/resources/bootstrap.yml | 11 +++- .../evaluationindex/EvaluationIndexDao.xml | 23 +++++++ 12 files changed, 286 insertions(+), 19 deletions(-) create mode 100644 epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/GovrnRatioFormDTO.java create mode 100644 epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/GovrnRatioResultDTO.java create mode 100644 epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/evaluationindex/EvaluationIndexDao.java create mode 100644 epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/evaluationindex/EvaluationIndexService.java create mode 100644 epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/evaluationindex/impl/EvaluationIndexServiceImpl.java create mode 100644 epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/evaluationindex/EvaluationIndexDao.xml diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/constant/DataSourceConstant.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/constant/DataSourceConstant.java index b5395e65b6..ce186bfffc 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/constant/DataSourceConstant.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/constant/DataSourceConstant.java @@ -28,4 +28,6 @@ public interface DataSourceConstant { String OPER_CRM="opercrm"; String DATA_STATISTICAL="datastatistical"; + + String EVALUATION_INDEX = "evaluationIndex"; } diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/GovrnRatioFormDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/GovrnRatioFormDTO.java new file mode 100644 index 0000000000..7e5407a8ef --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/GovrnRatioFormDTO.java @@ -0,0 +1,33 @@ +package com.epmet.dataaggre.dto.datastats.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Description 治理实况-组织/网格下响应解决满意自治率-接口入参 + * @Auth sun + */ +@Data +public class GovrnRatioFormDTO implements Serializable { + + private static final long serialVersionUID = -3381286960911634231L; + /** + * 组织Id + */ + @NotBlank(message = "组织或网格Id不能为空", groups = GovrnRatioFormDTO.AgencyGrid.class) + private String orgId; + /** + * 组织:agency 网格:grid + */ + @NotBlank(message = "网格Id不能为空", groups = GovrnRatioFormDTO.AgencyGrid.class) + private String orgType; + /** + * 日维度Id[日期,不传值默认查前一天的【格式:20210101】] + */ + private String dateId; + public interface AgencyGrid extends CustomerClientShowGroup {} + +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/GovrnRatioResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/GovrnRatioResultDTO.java new file mode 100644 index 0000000000..75a6f5ee1b --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/GovrnRatioResultDTO.java @@ -0,0 +1,27 @@ +package com.epmet.dataaggre.dto.datastats.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 治理实况-组织/网格下响应解决满意自治率-接口返参 + * @Auth sun + */ +@Data +public class GovrnRatioResultDTO implements Serializable { + private static final long serialVersionUID = 466974582608407121L; + //组织或网格Id + private String orgId; + //组织:agency 网格:grid + private String orgType; + //响应率 + private String responseRatio = "0%"; + //解决率 + private String resolvedRatio = "0%"; + //自治率 + private String governRatio = "0%"; + //满意率 + private String satisfactionRatio = "0%"; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/pom.xml b/epmet-module/data-aggregator/data-aggregator-server/pom.xml index a2cc3bc297..ab8c36be1a 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/pom.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/pom.xml @@ -158,11 +158,18 @@ EpmEt-db-UsEr - + - - epmet_data_statistical_user - EpmEt-db-UsEr + + epmet_data_statistical_user + EpmEt-db-UsEr + + + + + + epmet_evaluation_index_user + EpmEt-db-UsEr 0 @@ -246,11 +253,18 @@ EpmEt-db-UsEr - + - - epmet_data_statistical_user - EpmEt-db-UsEr + + epmet_data_statistical_user + EpmEt-db-UsEr + + + + + + epmet_evaluation_index_user + EpmEt-db-UsEr 0 @@ -334,11 +348,18 @@ elink@833066 - + - - epmet - elink@833066 + + epmet + elink@833066 + + + + + + epmet + elink@833066 0 @@ -422,11 +443,18 @@ EpmEt-db-UsEr - + - - epmet_data_statistical_user - EpmEt-db-UsEr + + epmet_data_statistical_user + EpmEt-db-UsEr + + + + + + epmet_evaluation_index_user + EpmEt-db-UsEr 0 diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/DataStatsController.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/DataStatsController.java index 74b2552e43..a56d769119 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/DataStatsController.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/DataStatsController.java @@ -1,5 +1,6 @@ package com.epmet.dataaggre.controller; +import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dataaggre.dto.datastats.form.*; @@ -200,4 +201,18 @@ public class DataStatsController { return new Result>().ok(dataStatsService.subGridGovrnList(formDTO)); } + /** + * @Param formDTO + * @Description 治理实况-组织/网格下响应解决满意自治率 + * @author sun + */ + @PostMapping("governratio") + public Result governRatio(@RequestBody GovrnRatioFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, GovrnRatioFormDTO.AgencyGrid.class); + if (!"agency".equals(formDTO.getOrgType()) && !"grid".equals(formDTO.getOrgType())) { + throw new RenException(String.format("入参格式错误,错误的组织或网格类型:%s", formDTO.getOrgType())); + } + return new Result().ok(dataStatsService.governRatio(formDTO)); + } + } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/evaluationindex/EvaluationIndexDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/evaluationindex/EvaluationIndexDao.java new file mode 100644 index 0000000000..c9084a0b4b --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/evaluationindex/EvaluationIndexDao.java @@ -0,0 +1,37 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dataaggre.dao.evaluationindex; + +import com.epmet.dataaggre.dto.datastats.result.GovrnRatioResultDTO; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + * @Author sun + * @Description 指标统计服务 + */ +@Mapper +public interface EvaluationIndexDao { + + /** + * @Param formDTO + * @Description 按类型、日期查询治理指数下响应解决满意自治四个统计率 + * @author sun + */ + GovrnRatioResultDTO getAgnecyOrGridGoverRatio(@Param("orgId") String orgId, @Param("orgType") String orgType, @Param("dateId") String dateId); +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/DataStatsService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/DataStatsService.java index 472bc277b4..8b08a765d2 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/DataStatsService.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/DataStatsService.java @@ -152,4 +152,11 @@ public interface DataStatsService { * @author sun */ List subGridGovrnList(GridGovrnFormDTO formDTO); + + /** + * @Param formDTO + * @Description 治理实况-组织/网格下响应解决满意自治率 + * @author sun + */ + GovrnRatioResultDTO governRatio(GovrnRatioFormDTO formDTO); } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java index 59bca42a8a..c636d2fe11 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java @@ -14,6 +14,7 @@ import com.epmet.dataaggre.dto.resigroup.result.GroupActRankDetailDTO; import com.epmet.dataaggre.entity.datastats.DimAgencyEntity; import com.epmet.dataaggre.entity.datastats.DimGridEntity; import com.epmet.dataaggre.service.datastats.DataStatsService; +import com.epmet.dataaggre.service.evaluationindex.EvaluationIndexService; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; @@ -39,6 +40,8 @@ import java.util.stream.Collectors; public class DataStatsServiceImpl implements DataStatsService { @Autowired private DataStatsDao dataStatsDao; + @Autowired + private EvaluationIndexService indexService; /** @@ -1243,4 +1246,33 @@ public class DataStatsServiceImpl implements DataStatsService { return resultList; } + /** + * @Param formDTO + * @Description 治理实况-组织/网格下响应解决满意自治率 + * @author sun + */ + @Override + public GovrnRatioResultDTO governRatio(GovrnRatioFormDTO formDTO) { + GovrnRatioResultDTO resultDTO = new GovrnRatioResultDTO(); + resultDTO.setOrgId(formDTO.getOrgId()); + resultDTO.setOrgType(formDTO.getOrgType()); + + //入参有日期的则按具体时间执行,没有的则按当前时间前一天执行 + if (StringUtils.isBlank(formDTO.getDateId())) { + Date yesterday = DateUtils.addDateDays(new Date(), -1); + SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); + formDTO.setDateId(format.format(yesterday)); + } + + //1.按类型、日期查询治理指数下响应解决满意自治四个统计率 + GovrnRatioResultDTO dto = indexService.governRatio(formDTO); + if (null != dto) { + resultDTO.setResponseRatio(dto.getResponseRatio()); + resultDTO.setResolvedRatio(dto.getResolvedRatio()); + resultDTO.setGovernRatio(dto.getGovernRatio()); + resultDTO.setSatisfactionRatio(dto.getSatisfactionRatio()); + } + return resultDTO; + } + } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/evaluationindex/EvaluationIndexService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/evaluationindex/EvaluationIndexService.java new file mode 100644 index 0000000000..909a3dc208 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/evaluationindex/EvaluationIndexService.java @@ -0,0 +1,18 @@ +package com.epmet.dataaggre.service.evaluationindex; + +import com.epmet.dataaggre.dto.datastats.form.GovrnRatioFormDTO; +import com.epmet.dataaggre.dto.datastats.result.GovrnRatioResultDTO; + +/** + * @Author sun + * @Description 指标统计服务 + */ +public interface EvaluationIndexService { + + /** + * @Param formDTO + * @Description 治理实况-组织/网格下响应解决满意自治率 + * @author sun + */ + GovrnRatioResultDTO governRatio(GovrnRatioFormDTO formDTO); +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/evaluationindex/impl/EvaluationIndexServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/evaluationindex/impl/EvaluationIndexServiceImpl.java new file mode 100644 index 0000000000..bec7bafd90 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/evaluationindex/impl/EvaluationIndexServiceImpl.java @@ -0,0 +1,40 @@ +package com.epmet.dataaggre.service.evaluationindex.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.dataaggre.constant.DataSourceConstant; +import com.epmet.dataaggre.dao.datastats.DataStatsDao; +import com.epmet.dataaggre.dao.evaluationindex.EvaluationIndexDao; +import com.epmet.dataaggre.dto.datastats.form.GovrnRatioFormDTO; +import com.epmet.dataaggre.dto.datastats.result.GovrnRatioResultDTO; +import com.epmet.dataaggre.service.evaluationindex.EvaluationIndexService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.text.SimpleDateFormat; +import java.util.Date; + +/** + * @Author sun + * @Description 指标统计服务 + */ +@Service +@DataSource(DataSourceConstant.EVALUATION_INDEX) +@Slf4j +public class EvaluationIndexServiceImpl implements EvaluationIndexService { + @Autowired + private EvaluationIndexDao evaluationIndexDao; + + /** + * @Param formDTO + * @Description 按类型、日期查询治理指数下响应解决满意自治四个统计率 + * @author sun + */ + @Override + public GovrnRatioResultDTO governRatio(GovrnRatioFormDTO formDTO) { + return evaluationIndexDao.getAgnecyOrGridGoverRatio(formDTO.getOrgId(),formDTO.getOrgType(),formDTO.getDateId()); + } + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/bootstrap.yml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/bootstrap.yml index cd8b7b8ef1..ab888fc91c 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/bootstrap.yml +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/bootstrap.yml @@ -131,9 +131,14 @@ dynamic: password: @datasource.druid.opercrm.password@ datastatistical: driver-class-name: com.mysql.cj.jdbc.Driver - url: @datasource.druid.opercrm.url@ - username: @datasource.druid.opercrm.username@ - password: @datasource.druid.opercrm.password@ + url: @datasource.druid.stats.url@ + username: @datasource.druid.stats.username@ + password: @datasource.druid.stats.password@ + evaluationIndex: + driver-class-name: com.mysql.cj.jdbc.Driver + url: @datasource.druid.evaluationIndex.url@ + username: @datasource.druid.evaluationIndex.username@ + password: @datasource.druid.evaluationIndex.password@ feign: hystrix: enabled: true diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/evaluationindex/EvaluationIndexDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/evaluationindex/EvaluationIndexDao.xml new file mode 100644 index 0000000000..a0c2e0c245 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/evaluationindex/EvaluationIndexDao.xml @@ -0,0 +1,23 @@ + + + + + + + + \ No newline at end of file From 64e3084e660997401f806eecb4804674447f14cf Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 25 May 2021 16:01:19 +0800 Subject: [PATCH 071/128] =?UTF-8?q?=E6=B2=BB=E7=90=86=E6=8C=87=E6=95=B0?= =?UTF-8?q?=E7=BD=91=E6=A0=BCv1,?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/controller/DemoController.java | 9 + .../extract/FactGridGovernDailyDao.java | 4 +- .../extract/FactOriginIssueMainDailyDao.java | 17 ++ .../extract/FactOriginTopicMainDailyDao.java | 18 ++ .../extract/FactGridGovernDailyEntity.java | 25 +- .../extract/GovernGridTotalCommonDTO.java | 18 ++ .../FactOriginIssueMainDailyService.java | 14 + .../FactOriginTopicMainDailyService.java | 15 ++ .../impl/FactGridGovernDailyServiceImpl.java | 251 +++++++++++++++++- .../FactOriginIssueMainDailyServiceImpl.java | 17 ++ .../FactOriginTopicMainDailyServiceImpl.java | 18 ++ .../db/migration/V0.0.15__govern.sql | 4 +- .../extract/FactGridGovernDailyDao.xml | 11 +- .../extract/FactOriginIssueMainDailyDao.xml | 32 +++ .../extract/FactOriginTopicMainDailyDao.xml | 31 +++ 15 files changed, 473 insertions(+), 11 deletions(-) create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/GovernGridTotalCommonDTO.java 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 644830e3a2..63be2f1da0 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 @@ -37,6 +37,7 @@ import com.epmet.entity.stats.DimMonthEntity; import com.epmet.service.StatsDemoService; import com.epmet.service.StatsPartyMemberVanguardService; import com.epmet.service.evaluationindex.extract.dataToIndex.*; +import com.epmet.service.evaluationindex.extract.todata.FactGridGovernDailyService; import com.epmet.service.evaluationindex.extract.todata.FactGroupActDailyService; import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectCategoryDailyService; import com.epmet.service.evaluationindex.extract.todata.FactOriginTopicMainDailyService; @@ -116,6 +117,8 @@ public class DemoController { private StatsPartyMemberVanguardService statsPartyMemberVanguardService; @Autowired private FactGroupActDailyService factGroupActDailyService; + @Autowired + private FactGridGovernDailyService factGridGovernDailyService; @GetMapping("testAlarm") public void testAlarm() { @@ -890,4 +893,10 @@ public class DemoController { factGroupActDailyService.extractAgencyGroupActDaily(customerId,dateId); return new Result(); } + + @PostMapping("extractgridgoverndaily") + public Result extractFactGridGovernDaily(@RequestParam("customerId") String customerId,@RequestParam("dateId")String dateId){ + factGridGovernDailyService.extractFactGridGovernDaily(customerId,dateId); + return new Result(); + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactGridGovernDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactGridGovernDailyDao.java index 5d35359bc7..1408abaeff 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactGridGovernDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactGridGovernDailyDao.java @@ -20,6 +20,7 @@ package com.epmet.dao.evaluationindex.extract; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.entity.evaluationindex.extract.FactGridGovernDailyEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; /** * 网格的治理指数,按天统计 @@ -29,5 +30,6 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface FactGridGovernDailyDao extends BaseDao { - + + int deleteBatchByCustomerIdAndDateId(@Param("customerId") String customerId, @Param("dateId") String dateId, @Param("limit") int limit); } \ 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 280e38213e..ee2e78aaa3 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 @@ -25,6 +25,7 @@ import com.epmet.dto.extract.result.OrgStatisticsResultDTO; import com.epmet.dto.extract.result.ShiftProjectCountResultDTO; import com.epmet.dto.indexcollect.result.CpcIndexCommonDTO; import com.epmet.entity.evaluationindex.extract.FactOriginIssueMainDailyEntity; +import com.epmet.entity.evaluationindex.extract.GovernGridTotalCommonDTO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -225,4 +226,20 @@ public interface FactOriginIssueMainDailyDao extends BaseDao */ List selectPartyMemberIssueStaticByGrid(@Param("customerId") String customerId, @Param("dateId") String dateId); + + /** + * 3、当前网格内,议题关闭已解决数 + * 4、当前网格内,议题关闭无需解决数 + * 这两个值可以通过此方法获得 + * + * @param customerId + * @param gridIds + * @param issueStatus 议题状态 voting 已转项目:shift_project 已关闭:closed_resloved + * @param resolveType unresolved,resolved + * @return + */ + List selectGroupByGridId(@Param("customerId")String customerId, + @Param("gridIds")List gridIds, + @Param("issueStatus")String issueStatus, + @Param("resolveType")String resolveType); } \ 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 f34fbf3a4b..96ecdef6c6 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 @@ -22,6 +22,7 @@ import com.epmet.dto.extract.result.CreateTopicCountResultDTO; import com.epmet.dto.extract.result.OrgStatisticsResultDTO; import com.epmet.dto.indexcollect.result.CpcIndexCommonDTO; import com.epmet.entity.evaluationindex.extract.FactOriginTopicMainDailyEntity; +import com.epmet.entity.evaluationindex.extract.GovernGridTotalCommonDTO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -159,4 +160,21 @@ public interface FactOriginTopicMainDailyDao extends BaseDao */ List selectPartyMemberTopicStaticByGrid(@Param("customerId") String customerId, @Param("dateId") String dateId); + + /** + * 1、当前网格内,话题关闭已解决数 + * 2、当前网格内,话题关闭无需解决数 + * 这两个值可以通过此方法获得 + * + * @param customerId + * @param gridIds + * @param topicStatus 话题状态(讨论中 - discussing、 已屏蔽 - hidden、 已关闭 - closed) + * @param closedStatus unresolved,resolved + * @return + */ + List selectTopicGroupByGridId(@Param("customerId")String customerId, + @Param("gridIds")List gridIds, + @Param("topicStatus")String topicStatus, + @Param("closedStatus")String closedStatus, + @Param("shiftIssue")String shiftIssue); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactGridGovernDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactGridGovernDailyEntity.java index 0fcff9c663..0e7b1cb889 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactGridGovernDailyEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactGridGovernDailyEntity.java @@ -19,6 +19,8 @@ package com.epmet.entity.evaluationindex.extract; import com.baomidou.mybatisplus.annotation.TableName; import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.constant.StrConstant; import lombok.Data; import lombok.EqualsAndHashCode; @@ -128,8 +130,29 @@ public class FactGridGovernDailyEntity extends BaseEpmetEntity { private Integer inGroupTopicUnResolvedCount; /** - * 未出当前网格的,结案项目数 + * 11、未出当前网格的,结案项目数 */ private Integer gridSelfGovernProjectTotal; + public FactGridGovernDailyEntity() { + this.customerId = StrConstant.EPMETY_STR; + this.dateId = StrConstant.EPMETY_STR; + this.gridId = StrConstant.EPMETY_STR; + this.pid = StrConstant.EPMETY_STR; + this.pids = StrConstant.EPMETY_STR; + this.problemResolvedCount = NumConstant.ZERO; + this.groupSelfGovernRatio=BigDecimal.ZERO; + this.gridSelfGovernProjectTotal=NumConstant.ZERO; + this.topicResolvedCount=NumConstant.ZERO; + this.topicUnResolvedCount=NumConstant.ZERO; + this.issueResolvedCount=NumConstant.ZERO; + this.issueUnResolvedCount=NumConstant.ZERO; + this.issueProjectResolvedCount=NumConstant.ZERO; + this.issueProjectUnResolvedCount=NumConstant.ZERO; + this.approvalProjectResolvedCount=NumConstant.ZERO; + this.approvalProjectUnResolvedCount=NumConstant.ZERO; + this.inGroupTopicResolvedCount=NumConstant.ZERO; + this.inGroupTopicUnResolvedCount=NumConstant.ZERO; + this.gridSelfGovernProjectTotal=NumConstant.ZERO; + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/GovernGridTotalCommonDTO.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/GovernGridTotalCommonDTO.java new file mode 100644 index 0000000000..38dae54c41 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/GovernGridTotalCommonDTO.java @@ -0,0 +1,18 @@ +package com.epmet.entity.evaluationindex.extract; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 网格的治理指数,按天统计 计算过程中,通用dto + * + * @author yinzuomei@elink-cn.com + * @date 2021/5/25 13:43 + */ +@Data +public class GovernGridTotalCommonDTO implements Serializable { + private String customerId; + private String gridId; + private Integer total; +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginIssueMainDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginIssueMainDailyService.java index a1e4ac55de..648891b0cc 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginIssueMainDailyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginIssueMainDailyService.java @@ -20,6 +20,7 @@ package com.epmet.service.evaluationindex.extract.todata; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.dto.extract.result.OrgStatisticsResultDTO; import com.epmet.entity.evaluationindex.extract.FactOriginIssueMainDailyEntity; +import com.epmet.entity.evaluationindex.extract.GovernGridTotalCommonDTO; import java.util.List; import java.util.Map; @@ -122,4 +123,17 @@ public interface FactOriginIssueMainDailyService extends BaseService */ Map getPartyMemberIssueStatic(String customerId, String dateId, String type); + + /** + * 3、当前网格内,议题关闭已解决数 + * 4、当前网格内,议题关闭无需解决数 + * 这两个值可以通过此方法获得 + * + * @param customerId + * @param gridIds + * @param issueStatus 议题状态 voting 已转项目:shift_project 已关闭:closed_resloved + * @param resolveType unresolved,resolved + * @return + */ + List queryGridIssueValue(String customerId, List gridIds, String issueStatus, String resolveType); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginTopicMainDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginTopicMainDailyService.java index aa66fc44e0..2cae521855 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginTopicMainDailyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginTopicMainDailyService.java @@ -23,6 +23,7 @@ import com.epmet.dto.extract.result.CreateTopicCountResultDTO; import com.epmet.dto.extract.result.OrgStatisticsResultDTO; import com.epmet.dto.indexcollect.result.CpcIndexCommonDTO; import com.epmet.entity.evaluationindex.extract.FactOriginTopicMainDailyEntity; +import com.epmet.entity.evaluationindex.extract.GovernGridTotalCommonDTO; import java.util.List; import java.util.Map; @@ -123,4 +124,18 @@ public interface FactOriginTopicMainDailyService extends BaseService */ Map getPartyMemberTopicStatic(String customerId, String dateId, String type); + + /** + * 1、当前网格内,话题关闭已解决数 + * 2、当前网格内,话题关闭无需解决数 + * 这两个值可以通过此方法获得 + * + * @param customerId + * @param gridIds + * @param topicStatus 话题状态(讨论中 - discussing、 已屏蔽 - hidden、 已关闭 - closed) + * @param closedStatus unresolved,resolved + * @param shiftIssue 是否转为议题,0:false,1:true; + * @return + */ + List queryGridTopicValue(String customerId, List gridIds, String topicStatus, String closedStatus, String shiftIssue); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactGridGovernDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactGridGovernDailyServiceImpl.java index 38b5a2d8a0..d3ebd1edc9 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactGridGovernDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactGridGovernDailyServiceImpl.java @@ -18,19 +18,29 @@ package com.epmet.service.evaluationindex.extract.todata.impl; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.constant.DimObjectStatusConstant; +import com.epmet.constant.ProjectConstant; import com.epmet.dao.evaluationindex.extract.FactGridGovernDailyDao; import com.epmet.dto.org.GridInfoDTO; import com.epmet.entity.evaluationindex.extract.FactGridGovernDailyEntity; +import com.epmet.entity.evaluationindex.extract.GovernGridTotalCommonDTO; import com.epmet.service.evaluationindex.extract.todata.FactGridGovernDailyService; -import com.epmet.service.group.GroupDataService; -import com.epmet.service.org.CustomerAgencyService; +import com.epmet.service.evaluationindex.extract.todata.FactOriginIssueMainDailyService; +import com.epmet.service.evaluationindex.extract.todata.FactOriginTopicMainDailyService; import com.epmet.service.org.CustomerGridService; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.math.BigDecimal; +import java.text.NumberFormat; +import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; /** * 网格的治理指数,按天统计 @@ -42,9 +52,9 @@ import java.util.List; @Service public class FactGridGovernDailyServiceImpl extends BaseServiceImpl implements FactGridGovernDailyService { @Autowired - private GroupDataService groupDataService; + private FactOriginTopicMainDailyService factOriginTopicMainDailyService; @Autowired - private CustomerAgencyService customerAgencyService; + private FactOriginIssueMainDailyService factOriginIssueMainDailyService; @Autowired private CustomerGridService customerGridService; @@ -62,13 +72,242 @@ public class FactGridGovernDailyServiceImpl extends BaseServiceImpl insertEntityList=this.constructFactGridGovernDailyEntityList(customerId,dateId,gridInfoDTOList); + // log.info(JSON.toJSONString(insertEntityList,true)); + + NumberFormat numberFormat = NumberFormat.getInstance(); + numberFormat.setMaximumFractionDigits(NumConstant.SIX); + + Map topicResolvedMap=getTopicMap(customerId, null,ProjectConstant.CLOSED, DimObjectStatusConstant.RESOLVED,NumConstant.ZERO_STR); + Map topicUnResolvedMap=getTopicMap(customerId, null,ProjectConstant.CLOSED, DimObjectStatusConstant.UNRESOLVED,NumConstant.ZERO_STR); + + Map issueResolvedMap=getIssueMap(customerId, null,ProjectConstant.CLOSED, DimObjectStatusConstant.RESOLVED); + Map issueUnResolvedMap=getIssueMap(customerId, null,ProjectConstant.CLOSED, DimObjectStatusConstant.UNRESOLVED); + + for(FactGridGovernDailyEntity insertEntity:insertEntityList){ + //1、当前网格内,话题关闭已解决数 + if(topicResolvedMap.containsKey(insertEntity.getGridId())){ + insertEntity.setTopicResolvedCount(topicResolvedMap.get(insertEntity.getGridId())); + } + //2、当前网格内,话题关闭无需解决数 + if(topicUnResolvedMap.containsKey(insertEntity.getGridId())){ + insertEntity.setTopicUnResolvedCount(topicUnResolvedMap.get(insertEntity.getGridId())); + } + //3、当前网格内,议题关闭已解决数 + if(issueResolvedMap.containsKey(insertEntity.getGridId())){ + insertEntity.setIssueResolvedCount(issueResolvedMap.get(insertEntity.getGridId())); + } + //4、当前网格内,议题关闭无需解决数 + if(issueUnResolvedMap.containsKey(insertEntity.getGridId())){ + insertEntity.setIssueUnResolvedCount(issueUnResolvedMap.get(insertEntity.getGridId())); + } + + // todo + // 5、当前网格内:来源于议题的项目:结案已解决数 + insertEntity.setIssueProjectResolvedCount(calIssueProjectResolvedCount(customerId,insertEntity.getGridId())); + // 6、当前网格内:来源于议题的项目:结案无需解决数 + insertEntity.setIssueProjectUnResolvedCount(calIssueProjectUnResolvedCount(customerId,insertEntity.getGridId())); + //7、当前网格内:项目立项,结案已解决数;默认为0, + insertEntity.setApprovalProjectResolvedCount(calApprovalProjectResolvedCount(customerId,insertEntity.getGridId())); + // 8、当前网格内:项目立项,结案无需解决数;默认为0, + insertEntity.setApprovalProjectUnResolvedCount(calApprovalProjectUnResolvedCount(customerId,insertEntity.getGridId())); + + + // 9、当前网格内,未出小组即未转议题的:话题关闭已解决数 + insertEntity.setInGroupTopicResolvedCount(calInGroupTopicResolvedCount(customerId,insertEntity.getGridId())); + // 10、当前网格内,未出小组即未转议题的:话题关闭无需解决数 + insertEntity.setInGroupTopicUnResolvedCount(calInGroupTopicUnResolvedCount(customerId,insertEntity.getGridId())); + // 11、未出当前网格的,结案项目数 + insertEntity.setGridSelfGovernProjectTotal(calGridSelfGovernProjectTotal(customerId,insertEntity.getGridId())); + + + //界面展示:1、问题解决总数=1+2+3+4+5+6+7+8 + insertEntity.setProblemResolvedCount(insertEntity.getTopicResolvedCount()+insertEntity.getTopicUnResolvedCount() + +insertEntity.getIssueResolvedCount()+insertEntity.getIssueUnResolvedCount() + +insertEntity.getIssueProjectResolvedCount()+insertEntity.getIssueProjectUnResolvedCount() + +insertEntity.getApprovalProjectResolvedCount()+insertEntity.getApprovalProjectUnResolvedCount()); + + //界面展示:2、党群自治占比=(9+10)/PROBLEM_RESOLVED_COUNT; 此列存储的是小数 + int groupSelfGovernRatioFz=insertEntity.getInGroupTopicResolvedCount()+insertEntity.getInGroupTopicUnResolvedCount(); + if (NumConstant.ZERO == groupSelfGovernRatioFz || NumConstant.ZERO == insertEntity.getProblemResolvedCount()) { + insertEntity.setGroupSelfGovernRatio(BigDecimal.ZERO); + }else{ + String groupSelfGovernRatioStr = numberFormat.format((float) groupSelfGovernRatioFz / insertEntity.getProblemResolvedCount()); + insertEntity.setGroupSelfGovernRatio(new BigDecimal(groupSelfGovernRatioStr)); + } + + //界面展示:3、网格自治占比=GRID_SELF_GOVERN_PROJECT_TOTAL/PROBLEM_RESOLVED_COUNT;此列存储的是小数 + if(NumConstant.ZERO==insertEntity.getGridSelfGovernProjectTotal()||NumConstant.ZERO == insertEntity.getProblemResolvedCount()){ + insertEntity.setGridSelfGovernRatio(BigDecimal.ZERO); + }else{ + String gridSelfGovernRatioStr = numberFormat.format((float) insertEntity.getGridSelfGovernProjectTotal() / insertEntity.getProblemResolvedCount()); + insertEntity.setGridSelfGovernRatio(new BigDecimal(gridSelfGovernRatioStr)); + } + } + // 先删除,后新增 + // 3、批量删除 + int deleteNum; + do { + deleteNum = baseDao.deleteBatchByCustomerIdAndDateId(customerId, dateId, NumConstant.TWO_HUNDRED); + } while (deleteNum > NumConstant.ZERO); + + // 4、插入数据 + this.insertBatch(insertEntityList); + log.info("extractFactGridGovernDaily completed"); } + + /** + * 构造要插入的数据,每个网格一天一条数据,初始赋值0 + * + * @param customerId + * @param dateId + * @param gridInfoDTOList + * @return com.epmet.entity.evaluationindex.extract.FactGridGovernDailyEntity + */ + private List constructFactGridGovernDailyEntityList(String customerId, String dateId, List gridInfoDTOList) { + List insertEntityList = new ArrayList<>(); + for (GridInfoDTO gridInfoDTO : gridInfoDTOList) { + FactGridGovernDailyEntity entity = new FactGridGovernDailyEntity(); + entity.setCustomerId(customerId); + entity.setDateId(dateId); + entity.setGridId(gridInfoDTO.getGridId()); + entity.setPid(gridInfoDTO.getPid()); + entity.setPids(gridInfoDTO.getPids()); + insertEntityList.add(entity); + } + return insertEntityList; + } + + /** + * 1、当前网格内,话题关闭已解决数 + * 2、当前网格内,话题关闭无需解决数 + * 这两个值可以通过此方法获得 + * + * @param customerId + * @param gridIds + * @param topicStatus 话题状态(讨论中 - discussing、 已屏蔽 - hidden、 已关闭 - closed) + * @param closedStatus unresolved,resolved + * @param shiftIssue 是否转为议题,0:false,1:true; + * @return + */ + private Map getTopicMap(String customerId, List gridIds, String topicStatus, String closedStatus,String shiftIssue) { + Map resultMap = new HashMap<>(); + List list = factOriginTopicMainDailyService.queryGridTopicValue(customerId, gridIds, topicStatus, closedStatus,shiftIssue); + for (GovernGridTotalCommonDTO gridTotalCommonDTO : list) { + resultMap.put(gridTotalCommonDTO.getGridId(), gridTotalCommonDTO.getTotal()); + } + return resultMap; + } + + /** + * 3、当前网格内,议题关闭已解决数 + * 4、当前网格内,议题关闭无需解决数 + * 这两个值可以通过此方法获得 + * + * @param customerId + * @param gridIds + * @param issueStatus 议题状态 voting 已转项目:shift_project 已关闭:closed_resloved + * @param resolveType unresolved,resolved + * @return + */ + private Map getIssueMap(String customerId, List gridIds, String issueStatus, String resolveType) { + Map resultMap = new HashMap<>(); + List list = factOriginIssueMainDailyService.queryGridIssueValue(customerId, gridIds, issueStatus, resolveType); + for (GovernGridTotalCommonDTO gridTotalCommonDTO : list) { + resultMap.put(gridTotalCommonDTO.getGridId(), gridTotalCommonDTO.getTotal()); + } + return resultMap; + } + + + /** + * 5、当前网格内:来源于议题的项目:结案已解决数 + * + * @param customerId + * @param gridId + */ + private Integer calIssueProjectResolvedCount(String customerId, String gridId) { + // todo + return 0; + } + + /** + * 6、当前网格内:来源于议题的项目:结案无需解决数 + * + * @param customerId + * @param gridId + */ + private Integer calIssueProjectUnResolvedCount(String customerId, String gridId) { + // todo + return 0; + } + + + /** + * 7、当前网格内:项目立项,结案已解决数;默认为0, + * + * @param customerId + * @param gridId + */ + private Integer calApprovalProjectResolvedCount(String customerId, String gridId) { + // todo + return 0; + } + + + /** + * 8、当前网格内:项目立项,结案无需解决数;默认为0, + * + * @param customerId + * @param gridId + */ + private Integer calApprovalProjectUnResolvedCount(String customerId, String gridId) { + // todo + return 0; + } + + /** + * 9、当前网格内,未出小组即未转议题的:话题关闭已解决数 + * + * @param customerId + * @param gridId + */ + private Integer calInGroupTopicResolvedCount(String customerId, String gridId) { + // todo + return 0; + } + + /** + * 10、当前网格内,未出小组即未转议题的:话题关闭无需解决数 + * + * @param customerId + * @param gridId + */ + private Integer calInGroupTopicUnResolvedCount(String customerId, String gridId) { + // todo + return 0; + } + + /** + * 11、未出当前网格的,结案项目数 + * + * @param customerId + * @param gridId + */ + private Integer calGridSelfGovernProjectTotal(String customerId, String gridId) { + // todo + return 0; + } + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginIssueMainDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginIssueMainDailyServiceImpl.java index 86e60734b7..09a040e630 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginIssueMainDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginIssueMainDailyServiceImpl.java @@ -25,6 +25,7 @@ import com.epmet.constant.OrgTypeConstant; import com.epmet.dao.evaluationindex.extract.FactOriginIssueMainDailyDao; import com.epmet.dto.extract.result.OrgStatisticsResultDTO; import com.epmet.entity.evaluationindex.extract.FactOriginIssueMainDailyEntity; +import com.epmet.entity.evaluationindex.extract.GovernGridTotalCommonDTO; import com.epmet.service.evaluationindex.extract.todata.FactOriginIssueMainDailyService; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; @@ -169,4 +170,20 @@ public class FactOriginIssueMainDailyServiceImpl extends BaseServiceImpl queryGridIssueValue(String customerId, List gridIds, String issueStatus, String resolveType) { + return baseDao.selectGroupByGridId(customerId,gridIds,issueStatus,resolveType); + } } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginTopicMainDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginTopicMainDailyServiceImpl.java index ac1e8af7a3..39eeffea2c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginTopicMainDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginTopicMainDailyServiceImpl.java @@ -37,6 +37,7 @@ import com.epmet.dto.org.GridInfoDTO; import com.epmet.dto.topic.TopicOriginInfoDTO; import com.epmet.entity.evaluationindex.extract.FactOriginTopicLogDailyEntity; import com.epmet.entity.evaluationindex.extract.FactOriginTopicMainDailyEntity; +import com.epmet.entity.evaluationindex.extract.GovernGridTotalCommonDTO; import com.epmet.service.evaluationindex.extract.todata.FactOriginTopicMainDailyService; import com.epmet.service.org.CustomerGridService; import com.epmet.service.topic.TopicService; @@ -359,4 +360,21 @@ public class FactOriginTopicMainDailyServiceImpl extends BaseServiceImpl queryGridTopicValue(String customerId, List gridIds, String topicStatus, String closedStatus, String shiftIssue) { + return baseDao.selectTopicGroupByGridId(customerId,gridIds,topicStatus,closedStatus,shiftIssue); + } } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.15__govern.sql b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.15__govern.sql index 7777abc992..37ccee43f9 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.15__govern.sql +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.15__govern.sql @@ -47,7 +47,7 @@ -- `APPROVAL_PROJECT_UN_RESOLVED_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '8、当前组织内:项目立项,结案无需解决数;默认为0,', -- `IN_GROUP_TOPIC_RESOLVED_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '9、当前组织内,未出小组即未转议题的:话题关闭已解决数', -- `IN_GROUP_TOPIC_UN_RESOLVED_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '10、当前组织内,未出小组即未转议题的:话题关闭无需解决数', --- `GRID_SELF_GOVERN_PROJECT_TOTAL` int(11) NOT NULL DEFAULT 0 COMMENT '未出当前网格的,结案项目数', +-- `GRID_SELF_GOVERN_PROJECT_TOTAL` int(11) NOT NULL DEFAULT 0 COMMENT '11、未出当前网格的,结案项目数', -- `COMMUNITY_CLOSED_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '当前组织内结案的项目中:由社区结案的项目总数', -- `STREET_CLOSED_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '当前组织内结案的项目中:由街道结案的项目总数', -- `DISTRICT_DEPT_CLOSED_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '当前组织内结案的项目中:由区直部门结案的项目总数', @@ -84,7 +84,7 @@ -- `APPROVAL_PROJECT_UN_RESOLVED_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '8、当前网格内:项目立项,结案无需解决数;默认为0,', -- `IN_GROUP_TOPIC_RESOLVED_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '9、当前网格内,未出小组即未转议题的:话题关闭已解决数', -- `IN_GROUP_TOPIC_UN_RESOLVED_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '10、当前网格内,未出小组即未转议题的:话题关闭无需解决数', --- `GRID_SELF_GOVERN_PROJECT_TOTAL` int(11) NOT NULL COMMENT '未出当前网格的,结案项目数', +-- `GRID_SELF_GOVERN_PROJECT_TOTAL` int(11) NOT NULL COMMENT '11、未出当前网格的,结案项目数', -- `DEL_FLAG` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除、1已删除', -- `REVISION` int(11) NOT NULL DEFAULT 0 COMMENT '乐观锁', -- `CREATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '创建人', diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactGridGovernDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactGridGovernDailyDao.xml index 6fa56797fa..3a13103f14 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactGridGovernDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactGridGovernDailyDao.xml @@ -2,6 +2,15 @@ - + + + DELETE + FROM + fact_grid_govern_daily + WHERE + CUSTOMER_ID = #{customerId} + AND DATE_ID = #{dateId} + LIMIT #{limit} + \ 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 259e46c150..e6c00c33af 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 @@ -311,4 +311,36 @@ AND DATE_ID <= #{dateId} GROUP BY GRID_ID + + + + \ 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 c8136df35a..49b0c96151 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 @@ -197,4 +197,35 @@ AND DATE_ID <= #{dateId} GROUP BY GRID_ID + + \ No newline at end of file From ac551e3f4d0cce35134239834683964c4e6d17f1 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Tue, 25 May 2021 16:33:10 +0800 Subject: [PATCH 072/128] =?UTF-8?q?=E7=BE=A4=E4=BC=97=E4=B8=8D=E6=BB=A1?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E5=BE=AE=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/constant/ProjectConstant.java | 1 + .../impl/ProjectSatisfactionStatisticsServiceImpl.java | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/constant/ProjectConstant.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/constant/ProjectConstant.java index 992871d265..eec6371298 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/constant/ProjectConstant.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/constant/ProjectConstant.java @@ -181,6 +181,7 @@ public interface ProjectConstant { String THREE_MONTH = "threeMonth"; String SIX_MONTH = "sixMonth"; String TWELVE_MONTH = "twelveMonth"; + String YESTERDAY = "yesterday"; /** * 排序 diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectSatisfactionStatisticsServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectSatisfactionStatisticsServiceImpl.java index 5ced71018a..119f217c14 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectSatisfactionStatisticsServiceImpl.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectSatisfactionStatisticsServiceImpl.java @@ -215,8 +215,7 @@ public class ProjectSatisfactionStatisticsServiceImpl extends BaseServiceImpl Date: Tue, 25 May 2021 17:40:07 +0800 Subject: [PATCH 073/128] =?UTF-8?q?=E6=B2=BB=E7=90=86=E6=8C=87=E6=95=B0?= =?UTF-8?q?=E7=BD=91=E6=A0=BCv2,?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/constant/ProjectConstant.java | 10 +++ .../FactOriginProjectMainDailyDao.java | 20 +++++ .../FactOriginProjectMainDailyService.java | 15 ++++ .../impl/FactGridGovernDailyServiceImpl.java | 82 ++++++++----------- ...FactOriginProjectMainDailyServiceImpl.java | 19 +++++ .../extract/FactOriginProjectMainDailyDao.xml | 33 ++++++++ 6 files changed, 133 insertions(+), 46 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/ProjectConstant.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/ProjectConstant.java index e1b0dd8a11..b714ce2210 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/ProjectConstant.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/ProjectConstant.java @@ -71,4 +71,14 @@ public interface ProjectConstant { String ISSUE = "issue"; + + /** + * 项目来源于议题 + */ + String PROJECT_ORIGIN_ISSUE="issue"; + + /** + * 项目来源于 工作端立项 + */ + String PROJECT_ORIGIN_AGENCY="agency"; } 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 e07a58613f..0403e29bc2 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 @@ -28,6 +28,7 @@ import com.epmet.dto.screen.ScreenProjectDataDTO; import com.epmet.dto.screen.form.ProjectSourceMapFormDTO; import com.epmet.entity.evaluationindex.extract.FactOriginProjectMainDailyEntity; import com.epmet.entity.evaluationindex.extract.FactOriginProjectOrgPeriodDailyEntity; +import com.epmet.entity.evaluationindex.extract.GovernGridTotalCommonDTO; import com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -445,4 +446,23 @@ public interface FactOriginProjectMainDailyDao extends BaseDao */ List selectPartyMemberClosedProjectStaticByGrid(@Param("customerId") String customerId, @Param("dateId") String dateId); + + /** + * 5、当前网格内:来源于议题的项目:结案已解决数、 + * 6、当前网格内:来源于议题的项目:结案无需解决数、 + * 7、当前网格内:项目立项,结案已解决数;默认为0、 + * 8、当前网格内:项目立项,结案无需解决数;默认为0、 + * + * @param customerId + * @param gridIds + * @param projectStatus 状态:待处理 pending,结案closed + * @param origin 项目来源 来源:议题issue 组织agency + * @param isResolved unresolved,resolved + * @return com.epmet.entity.evaluationindex.extract.GovernGridTotalCommonDTO + */ + List selectGroupByGrid(@Param("customerId")String customerId, + @Param("gridIds")List gridIds, + @Param("projectStatus")String projectStatus, + @Param("origin")String origin, + @Param("isResolved")String isResolved); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java index 21994e4a98..215aa74756 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java @@ -29,6 +29,7 @@ import com.epmet.dto.screen.form.ProjectSourceMapFormDTO; import com.epmet.dto.screen.form.ScreenCentralZoneDataFormDTO; import com.epmet.entity.evaluationindex.extract.FactOriginProjectMainDailyEntity; import com.epmet.entity.evaluationindex.extract.FactOriginProjectOrgPeriodDailyEntity; +import com.epmet.entity.evaluationindex.extract.GovernGridTotalCommonDTO; import com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity; import java.util.List; @@ -421,4 +422,18 @@ public interface FactOriginProjectMainDailyService extends BaseService getPartyMemberClosedProjectStatic(String customerId, String dateId, String type); + /** + * 5、当前网格内:来源于议题的项目:结案已解决数、 + * 6、当前网格内:来源于议题的项目:结案无需解决数、 + * 7、当前网格内:项目立项,结案已解决数;默认为0、 + * 8、当前网格内:项目立项,结案无需解决数;默认为0、 + * + * @param customerId + * @param gridIds + * @param projectStatus 状态:待处理 pending,结案closed + * @param origin 项目来源 来源:议题issue 组织agency + * @param isResolved unresolved,resolved + * @return + */ + List queryGridProjectValue(String customerId, List gridIds, String projectStatus, String origin, String isResolved); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactGridGovernDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactGridGovernDailyServiceImpl.java index d3ebd1edc9..b0b0abc786 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactGridGovernDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactGridGovernDailyServiceImpl.java @@ -27,6 +27,7 @@ import com.epmet.entity.evaluationindex.extract.FactGridGovernDailyEntity; import com.epmet.entity.evaluationindex.extract.GovernGridTotalCommonDTO; import com.epmet.service.evaluationindex.extract.todata.FactGridGovernDailyService; import com.epmet.service.evaluationindex.extract.todata.FactOriginIssueMainDailyService; +import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectMainDailyService; import com.epmet.service.evaluationindex.extract.todata.FactOriginTopicMainDailyService; import com.epmet.service.org.CustomerGridService; import lombok.extern.slf4j.Slf4j; @@ -56,6 +57,8 @@ public class FactGridGovernDailyServiceImpl extends BaseServiceImpl topicResolvedMap=getTopicMap(customerId, null,ProjectConstant.CLOSED, DimObjectStatusConstant.RESOLVED,NumConstant.ZERO_STR); Map topicUnResolvedMap=getTopicMap(customerId, null,ProjectConstant.CLOSED, DimObjectStatusConstant.UNRESOLVED,NumConstant.ZERO_STR); - Map issueResolvedMap=getIssueMap(customerId, null,ProjectConstant.CLOSED, DimObjectStatusConstant.RESOLVED); Map issueUnResolvedMap=getIssueMap(customerId, null,ProjectConstant.CLOSED, DimObjectStatusConstant.UNRESOLVED); + Map issueProjectResolvedMap=getGridProjectMap(customerId,null,ProjectConstant.CLOSED,ProjectConstant.PROJECT_ORIGIN_ISSUE,DimObjectStatusConstant.RESOLVED); + Map issueProjectUnResolvedMap=getGridProjectMap(customerId,null,ProjectConstant.CLOSED,ProjectConstant.PROJECT_ORIGIN_ISSUE,DimObjectStatusConstant.UNRESOLVED); + Map approvalProjectResolvedMap=getGridProjectMap(customerId,null,ProjectConstant.CLOSED,ProjectConstant.PROJECT_ORIGIN_AGENCY,DimObjectStatusConstant.RESOLVED); + Map approvalProjectUnResolvedMap=getGridProjectMap(customerId,null,ProjectConstant.CLOSED,ProjectConstant.PROJECT_ORIGIN_AGENCY,DimObjectStatusConstant.UNRESOLVED); for(FactGridGovernDailyEntity insertEntity:insertEntityList){ //1、当前网格内,话题关闭已解决数 @@ -112,18 +118,24 @@ public class FactGridGovernDailyServiceImpl extends BaseServiceImpl getGridProjectMap(String customerId, List gridIds, String projectStatus, String origin, String isResolved) { + Map resultMap = new HashMap<>(); + List list = factOriginProjectMainDailyService.queryGridProjectValue(customerId, gridIds, projectStatus, origin, isResolved); + for (GovernGridTotalCommonDTO gridTotalCommonDTO : list) { + resultMap.put(gridTotalCommonDTO.getGridId(), gridTotalCommonDTO.getTotal()); + } + return resultMap; } - /** - * 7、当前网格内:项目立项,结案已解决数;默认为0, - * - * @param customerId - * @param gridId - */ - private Integer calApprovalProjectResolvedCount(String customerId, String gridId) { - // todo - return 0; - } - - /** - * 8、当前网格内:项目立项,结案无需解决数;默认为0, - * - * @param customerId - * @param gridId - */ - private Integer calApprovalProjectUnResolvedCount(String customerId, String gridId) { - // todo - return 0; - } /** * 9、当前网格内,未出小组即未转议题的:话题关闭已解决数 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java index 12550e187f..58d625f999 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java @@ -39,6 +39,7 @@ import com.epmet.dto.screen.form.ProjectSourceMapFormDTO; import com.epmet.dto.screen.form.ScreenCentralZoneDataFormDTO; import com.epmet.entity.evaluationindex.extract.FactOriginProjectMainDailyEntity; import com.epmet.entity.evaluationindex.extract.FactOriginProjectOrgPeriodDailyEntity; +import com.epmet.entity.evaluationindex.extract.GovernGridTotalCommonDTO; import com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity; import com.epmet.feign.EpmetCommonServiceOpenFeignClient; import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectMainDailyService; @@ -639,5 +640,23 @@ public class FactOriginProjectMainDailyServiceImpl extends BaseServiceImpl queryGridProjectValue(String customerId, List gridIds, String projectStatus, String origin, String isResolved) { + return baseDao.selectGroupByGrid(customerId,gridIds,projectStatus,origin,isResolved); + } + } 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 c6e024c502..c76cfb8128 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 @@ -914,4 +914,37 @@ ON a.AGENCY_ID = b.AGENCY_ID + + From ec6e94809e4c7e901e062b710f3caf4928b963ba Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 25 May 2021 18:29:43 +0800 Subject: [PATCH 074/128] =?UTF-8?q?=E6=B2=BB=E7=90=86=E6=8C=87=E6=95=B0?= =?UTF-8?q?=E7=BD=91=E6=A0=BCv2.1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../extract/FactGridGovernDailyEntity.java | 31 ++++++++- .../impl/FactGridGovernDailyServiceImpl.java | 65 ++++++++++--------- .../db/migration/V0.0.15__govern.sql | 60 +++++++++-------- 3 files changed, 93 insertions(+), 63 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactGridGovernDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactGridGovernDailyEntity.java index 0e7b1cb889..ae45d7aa7d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactGridGovernDailyEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactGridGovernDailyEntity.java @@ -129,11 +129,32 @@ public class FactGridGovernDailyEntity extends BaseEpmetEntity { */ private Integer inGroupTopicUnResolvedCount; - /** - * 11、未出当前网格的,结案项目数 - */ + /** + * 11、来源于议题的项目,未出网格结案并且已解决的项目数 + */ + private Integer fromIssueResolvedInGridCount; + + /** + * 12、来源于议题的项目,未出网格结案并且无需解决的项目数 + */ + private Integer fromIssueUnResolvedInGridCount; + + /** + * 13、来源于项目立项的项目,未出网格结案,并且已解决的项目数;因现在网格不能立项,所以此列默认为0 + */ + private Integer fromAgencyResolvedInGridCount; + + /** + * 14、来源于项目立项的项目,未出网格结案,并且无需解决的项目数;因现在网格不能立项,所以此列默认为0 + */ + private Integer fromAgencyUnResolvedInGridCount; + + /** + * 15、未出当前网格的,结案项目数=11+12+13+14 + */ private Integer gridSelfGovernProjectTotal; + public FactGridGovernDailyEntity() { this.customerId = StrConstant.EPMETY_STR; this.dateId = StrConstant.EPMETY_STR; @@ -153,6 +174,10 @@ public class FactGridGovernDailyEntity extends BaseEpmetEntity { this.approvalProjectUnResolvedCount=NumConstant.ZERO; this.inGroupTopicResolvedCount=NumConstant.ZERO; this.inGroupTopicUnResolvedCount=NumConstant.ZERO; + this.fromIssueResolvedInGridCount=NumConstant.ZERO; + this.fromIssueUnResolvedInGridCount=NumConstant.ZERO; + this.fromAgencyResolvedInGridCount=NumConstant.ZERO; + this.fromAgencyUnResolvedInGridCount=NumConstant.ZERO; this.gridSelfGovernProjectTotal=NumConstant.ZERO; } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactGridGovernDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactGridGovernDailyServiceImpl.java index b0b0abc786..4f5483e7b4 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactGridGovernDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactGridGovernDailyServiceImpl.java @@ -92,14 +92,17 @@ public class FactGridGovernDailyServiceImpl extends BaseServiceImpl topicResolvedMap=getTopicMap(customerId, null,ProjectConstant.CLOSED, DimObjectStatusConstant.RESOLVED,NumConstant.ZERO_STR); - Map topicUnResolvedMap=getTopicMap(customerId, null,ProjectConstant.CLOSED, DimObjectStatusConstant.UNRESOLVED,NumConstant.ZERO_STR); + Map topicResolvedMap=getTopicMap(customerId, null,ProjectConstant.CLOSED, DimObjectStatusConstant.RESOLVED,null); + Map topicUnResolvedMap=getTopicMap(customerId, null,ProjectConstant.CLOSED, DimObjectStatusConstant.UNRESOLVED,null); Map issueResolvedMap=getIssueMap(customerId, null,ProjectConstant.CLOSED, DimObjectStatusConstant.RESOLVED); Map issueUnResolvedMap=getIssueMap(customerId, null,ProjectConstant.CLOSED, DimObjectStatusConstant.UNRESOLVED); Map issueProjectResolvedMap=getGridProjectMap(customerId,null,ProjectConstant.CLOSED,ProjectConstant.PROJECT_ORIGIN_ISSUE,DimObjectStatusConstant.RESOLVED); Map issueProjectUnResolvedMap=getGridProjectMap(customerId,null,ProjectConstant.CLOSED,ProjectConstant.PROJECT_ORIGIN_ISSUE,DimObjectStatusConstant.UNRESOLVED); Map approvalProjectResolvedMap=getGridProjectMap(customerId,null,ProjectConstant.CLOSED,ProjectConstant.PROJECT_ORIGIN_AGENCY,DimObjectStatusConstant.RESOLVED); Map approvalProjectUnResolvedMap=getGridProjectMap(customerId,null,ProjectConstant.CLOSED,ProjectConstant.PROJECT_ORIGIN_AGENCY,DimObjectStatusConstant.UNRESOLVED); + Map inGroupTopicResolvedMap=getTopicMap(customerId, null,ProjectConstant.CLOSED, DimObjectStatusConstant.RESOLVED,NumConstant.ONE_STR); + Map inGroupTopicUnResolvedMap=getTopicMap(customerId, null,ProjectConstant.CLOSED, DimObjectStatusConstant.UNRESOLVED,NumConstant.ONE_STR); + for(FactGridGovernDailyEntity insertEntity:insertEntityList){ //1、当前网格内,话题关闭已解决数 @@ -110,6 +113,8 @@ public class FactGridGovernDailyServiceImpl extends BaseServiceImpl Date: Wed, 26 May 2021 10:02:39 +0800 Subject: [PATCH 075/128] =?UTF-8?q?=E6=94=AF=E9=83=A8=E5=BB=BA=E8=AE=BE?= =?UTF-8?q?=E3=80=81=E8=81=94=E5=BB=BA=E5=85=B1=E5=BB=BA=E7=9B=B8=E5=85=B3?= =?UTF-8?q?DB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../migration/V0.0.14__groupact_analysis.sql | 90 +++++++++---------- 1 file changed, 44 insertions(+), 46 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.14__groupact_analysis.sql b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.14__groupact_analysis.sql index ee35df8d10..a450ab5eec 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.14__groupact_analysis.sql +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.14__groupact_analysis.sql @@ -1,49 +1,47 @@ -- epmet_data_statistical 库执行以下脚本 --- CREATE TABLE `fact_group_act_daily` ( --- `ID` varchar(64) NOT NULL COMMENT '主键', --- `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID', --- `DATE_ID` varchar(8) NOT NULL COMMENT '数据更新至日期Id:yyyyMMdd', --- `ORG_ID` varchar(64) NOT NULL COMMENT '网格id', --- `ORG_TYPE` varchar(10) NOT NULL COMMENT '网格:grid;组织:agency', --- `PID` varchar(255) DEFAULT NULL COMMENT '1)orgType=grid: pid=网格所属组织id;\r\n2)orgType=agency: pid=当前组织的上级组织', --- `PIDS` varchar(255) DEFAULT NULL COMMENT '1)orgType=grid: pids=网格所有上级组织,包括pid;\r\n2)orgType=agency: pids=当前组织的所有上级组织,包括pid.', --- `CATEGORY_CODE` varchar(255) NOT NULL COMMENT '活动分类编码', --- `PARENT_CODE` varchar(255) NOT NULL COMMENT '上级分类编码', --- `LEVEL` int(11) NOT NULL COMMENT '分类等级', --- `ORGANIZE_TOTAL` int(11) NOT NULL COMMENT '截止到dateId: 组织次数;包含dateId这一天的数据', --- `PARTICIPATE_USER_TOTAL` int(11) NOT NULL COMMENT '截止到dateId: 参加人数;包含dateId这一天的数据', --- `AVG_PARTICIPATE_USER_TOTAL` int(11) NOT NULL COMMENT '截止到dateId: 平均参加人数;包含dateId这一天的数据', --- `DEL_FLAG` char(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除;1已删除', --- `REVISION` int(11) NOT NULL DEFAULT '0' COMMENT '乐观锁', --- `CREATED_BY` varchar(64) NOT NULL COMMENT '创建人', --- `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', --- `UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人', --- `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', --- PRIMARY KEY (`ID`) USING BTREE --- ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='组织活动(参加人数、组织次数、平均参加人数)按天累计值分析'; +CREATE TABLE `fact_group_act_daily` ( + `ID` varchar(64) NOT NULL COMMENT '主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID', + `DATE_ID` varchar(8) NOT NULL COMMENT '数据更新至日期Id:yyyyMMdd', + `ORG_ID` varchar(64) NOT NULL COMMENT '网格id', + `ORG_TYPE` varchar(10) NOT NULL COMMENT '网格:grid;组织:agency', + `PID` varchar(255) DEFAULT NULL COMMENT '1)orgType=grid: pid=网格所属组织id;\r\n2)orgType=agency: pid=当前组织的上级组织', + `PIDS` varchar(255) DEFAULT NULL COMMENT '1)orgType=grid: pids=网格所有上级组织,包括pid;\r\n2)orgType=agency: pids=当前组织的所有上级组织,包括pid.', + `CATEGORY_CODE` varchar(255) NOT NULL COMMENT '活动分类编码', + `PARENT_CODE` varchar(255) NOT NULL COMMENT '上级分类编码', + `LEVEL` int(11) NOT NULL COMMENT '分类等级', + `ORGANIZE_TOTAL` int(11) NOT NULL COMMENT '截止到dateId: 组织次数;包含dateId这一天的数据', + `PARTICIPATE_USER_TOTAL` int(11) NOT NULL COMMENT '截止到dateId: 参加人数;包含dateId这一天的数据', + `AVG_PARTICIPATE_USER_TOTAL` int(11) NOT NULL COMMENT '截止到dateId: 平均参加人数;包含dateId这一天的数据', + `DEL_FLAG` char(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除;1已删除', + `REVISION` int(11) NOT NULL DEFAULT '0' COMMENT '乐观锁', + `CREATED_BY` varchar(64) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='组织活动(参加人数、组织次数、平均参加人数)按天累计值分析'; - - --- CREATE TABLE `fact_group_act_monthly` ( --- `ID` varchar(64) NOT NULL COMMENT '主键', --- `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID', --- `MONTH_ID` varchar(8) NOT NULL COMMENT '数据维度:yyyyMM', --- `ORG_ID` varchar(64) NOT NULL COMMENT '网格id', --- `ORG_TYPE` varchar(10) NOT NULL COMMENT '网格:grid;组织:agency', --- `PID` varchar(255) DEFAULT NULL COMMENT '1)orgType=grid: pid=网格所属组织id;\r\n2)orgType=agency: pid=当前组织的上级组织', --- `PIDS` varchar(255) DEFAULT NULL COMMENT '1)orgType=grid: pids=网格所有上级组织,包括pid;\r\n2)orgType=agency: pids=当前组织的所有上级组织,包括pid.', --- `CATEGORY_CODE` varchar(255) NOT NULL COMMENT '活动分类编码', --- `PARENT_CODE` varchar(255) NOT NULL COMMENT '上级分类编码', --- `LEVEL` int(11) NOT NULL COMMENT '分类等级', --- `ORGANIZE_INCR` int(11) NOT NULL COMMENT '本月内:活动组织次数', --- `PARTICIPATE_USER__INCR` int(11) NOT NULL COMMENT '本月内:活动签到人数参加人数', --- `AVG_PARTICIPATE_USER_INCR` int(11) NOT NULL COMMENT '本月内:平均参加人数', --- `DEL_FLAG` char(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除;1已删除', --- `REVISION` int(11) NOT NULL DEFAULT '0' COMMENT '乐观锁', --- `CREATED_BY` varchar(64) NOT NULL COMMENT '创建人', --- `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', --- `UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人', --- `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', --- PRIMARY KEY (`ID`) USING BTREE --- ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='专项组活动(参加人数、组织次数、平均参加人数)按月增量分析'; \ No newline at end of file +CREATE TABLE `fact_group_act_monthly` ( + `ID` varchar(64) NOT NULL COMMENT '主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID', + `MONTH_ID` varchar(8) NOT NULL COMMENT '数据维度:yyyyMM', + `ORG_ID` varchar(64) NOT NULL COMMENT '网格id', + `ORG_TYPE` varchar(10) NOT NULL COMMENT '网格:grid;组织:agency', + `PID` varchar(255) DEFAULT NULL COMMENT '1)orgType=grid: pid=网格所属组织id;\r\n2)orgType=agency: pid=当前组织的上级组织', + `PIDS` varchar(255) DEFAULT NULL COMMENT '1)orgType=grid: pids=网格所有上级组织,包括pid;\r\n2)orgType=agency: pids=当前组织的所有上级组织,包括pid.', + `CATEGORY_CODE` varchar(255) NOT NULL COMMENT '活动分类编码', + `PARENT_CODE` varchar(255) NOT NULL COMMENT '上级分类编码', + `LEVEL` int(11) NOT NULL COMMENT '分类等级', + `ORGANIZE_INCR` int(11) NOT NULL COMMENT '本月内:活动组织次数', + `PARTICIPATE_USER__INCR` int(11) NOT NULL COMMENT '本月内:活动签到人数参加人数', + `AVG_PARTICIPATE_USER_INCR` int(11) NOT NULL COMMENT '本月内:平均参加人数', + `DEL_FLAG` char(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除;1已删除', + `REVISION` int(11) NOT NULL DEFAULT '0' COMMENT '乐观锁', + `CREATED_BY` varchar(64) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='专项组活动(参加人数、组织次数、平均参加人数)按月增量分析'; \ No newline at end of file From f3338fc61eb40c8e2fb2e0aec3ecf7f825fc764f Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Wed, 26 May 2021 10:06:53 +0800 Subject: [PATCH 076/128] =?UTF-8?q?sql=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../db/migration/V0.0.15__govern.sql | 32 +++++++++++++++++++ .../db/migration/V0.0.13__add_parameter.sql | 1 + 2 files changed, 33 insertions(+) create mode 100644 epmet-module/gov-project/gov-project-server/src/main/resources/db/migration/V0.0.13__add_parameter.sql diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.15__govern.sql b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.15__govern.sql index 8d469eec21..836d3a3b7a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.15__govern.sql +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.15__govern.sql @@ -99,3 +99,35 @@ -- ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='网格的治理指数,按天统计'; -- -- SET FOREIGN_KEY_CHECKS = 1; + +# 小组成员添加是否是党员 +ALTER TABLE `epmet_data_statistical`.`fact_origin_group_member_daily` + ADD COLUMN `IS_PARTY` tinyint(1) NULL DEFAULT 0 COMMENT '是否是党员' AFTER `ACTION_CODE`; + +# 项目主表添加结案项目是否满意 +ALTER TABLE `epmet_data_statistical`.`fact_origin_project_main_daily` + ADD COLUMN `IS_SATISFIED` tinyint(1) NULL COMMENT '是否满意 1:是' AFTER `IS_OVERDUE`; + +# 添加治理能力按日统计表 +CREATE TABLE `epmet_evaluation_index`.`screen_govern_rank_data_daily` ( + `ID` varchar(64) NOT NULL COMMENT 'ID 主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id', + `YEAR_ID` varchar(32) NOT NULL COMMENT '年Id', + `MONTH_ID` varchar(32) NOT NULL COMMENT '月份Id', + `DATE_ID` varchar(8) NOT NULL COMMENT '数据更新至:yyyyMMdd', + `ORG_TYPE` varchar(32) NOT NULL DEFAULT 'agency' COMMENT '组织类别 agency:组织;部门:department;网格:grid', + `ORG_ID` varchar(64) NOT NULL COMMENT '组织Id 可以为网格,机关id', + `PARENT_ID` varchar(64) NOT NULL COMMENT '上级组织Id', + `ORG_NAME` varchar(32) NOT NULL COMMENT '组织名称', + `RESPONSE_RATIO` decimal(10,6) DEFAULT NULL COMMENT '响应率', + `RESOLVED_RATIO` decimal(10,6) DEFAULT NULL COMMENT '解决率', + `GOVERN_RATIO` decimal(10,6) DEFAULT NULL COMMENT '自治率', + `SATISFACTION_RATIO` decimal(10,6) DEFAULT NULL COMMENT '满意率', + `DEL_FLAG` char(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除;1已删除', + `REVISION` int(11) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='基层治理-治理能力排行数据(按日统计)'; \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/resources/db/migration/V0.0.13__add_parameter.sql b/epmet-module/gov-project/gov-project-server/src/main/resources/db/migration/V0.0.13__add_parameter.sql new file mode 100644 index 0000000000..4f8d970ed4 --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/resources/db/migration/V0.0.13__add_parameter.sql @@ -0,0 +1 @@ +INSERT INTO `customer_project_parameter`(`ID`, `CUSTOMER_ID`, `PARAMETER_KEY`, `PARAMETER_NAME`, `PARAMETER_VALUE`, `DESCRIPTION`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1007', 'default', 'satisfaction', '项目满意指标', '75', '评分小于当前分的为不满意', '0', 1, '1', '2020-10-26 10:57:41', '1', '2020-10-26 10:57:45'); From 6f0593bc58e4ff379ea0c368288ca02b7f0fb397 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Wed, 26 May 2021 10:16:05 +0800 Subject: [PATCH 077/128] =?UTF-8?q?=E5=B7=A5=E4=BD=9C=E7=AB=AF=E7=99=BB?= =?UTF-8?q?=E9=99=86=E5=8F=91=E9=80=81=E7=9F=AD=E4=BF=A1=E9=AA=8C=E8=AF=81?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/ThirdLoginController.java | 12 +++++ .../dto/form/ThirdSendSmsCodeFormDTO.java | 27 +++++++++++ .../com/epmet/service/ThirdLoginService.java | 12 +++-- .../service/impl/ThirdLoginServiceImpl.java | 46 +++++++++++++++++++ 4 files changed, 93 insertions(+), 4 deletions(-) create mode 100644 epmet-auth/src/main/java/com/epmet/dto/form/ThirdSendSmsCodeFormDTO.java diff --git a/epmet-auth/src/main/java/com/epmet/controller/ThirdLoginController.java b/epmet-auth/src/main/java/com/epmet/controller/ThirdLoginController.java index 00770d82bb..144e18d024 100644 --- a/epmet-auth/src/main/java/com/epmet/controller/ThirdLoginController.java +++ b/epmet-auth/src/main/java/com/epmet/controller/ThirdLoginController.java @@ -104,4 +104,16 @@ public class ThirdLoginController { return new Result().ok(""); } + /** + * @param formDTO + * @author sun + * @description 单客户-工作端微信小程序登录-发送验证码 + **/ + @PostMapping(value = "sendsmscode") + public Result sendSmsCode(@RequestBody ThirdSendSmsCodeFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO,ThirdSendSmsCodeFormDTO.AddUserShowGroup.class); + thirdLoginService.sendSmsCode(formDTO); + return new Result(); + } + } diff --git a/epmet-auth/src/main/java/com/epmet/dto/form/ThirdSendSmsCodeFormDTO.java b/epmet-auth/src/main/java/com/epmet/dto/form/ThirdSendSmsCodeFormDTO.java new file mode 100644 index 0000000000..d2588a27bb --- /dev/null +++ b/epmet-auth/src/main/java/com/epmet/dto/form/ThirdSendSmsCodeFormDTO.java @@ -0,0 +1,27 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Description 单客户-工作端微信小程序登录-发送验证码 + * @Author sun + */ +@Data +public class ThirdSendSmsCodeFormDTO implements Serializable { + private static final long serialVersionUID = -1852541457359282018L; + /** + * 小程序appId + */ + @NotBlank(message = "appId不能为空", groups = {AddUserShowGroup.class}) + private String appId; + /** + * 手机号 + */ + @NotBlank(message = "手机号不能为空", groups = {AddUserShowGroup.class}) + private String mobile; + public interface AddUserShowGroup extends CustomerClientShowGroup {} +} diff --git a/epmet-auth/src/main/java/com/epmet/service/ThirdLoginService.java b/epmet-auth/src/main/java/com/epmet/service/ThirdLoginService.java index 3d9c60cc64..c79a67d41c 100644 --- a/epmet-auth/src/main/java/com/epmet/service/ThirdLoginService.java +++ b/epmet-auth/src/main/java/com/epmet/service/ThirdLoginService.java @@ -1,9 +1,6 @@ package com.epmet.service; -import com.epmet.dto.form.GetResiWxPhoneFormDTO; -import com.epmet.dto.form.LoginFormDTO; -import com.epmet.dto.form.ThirdStaffOrgsFormDTO; -import com.epmet.dto.form.ThirdWxmpEnteOrgFormDTO; +import com.epmet.dto.form.*; import com.epmet.dto.result.StaffOrgsResultDTO; import com.epmet.dto.result.UserTokenResultDTO; @@ -62,4 +59,11 @@ public interface ThirdLoginService { * @description 单客户-获取微信用户手机号 **/ String getResiWxPhone(GetResiWxPhoneFormDTO formDTO); + + /** + * @param formDTO + * @author sun + * @description 单客户-工作端微信小程序登录-发送验证码 + **/ + void sendSmsCode(ThirdSendSmsCodeFormDTO formDTO); } diff --git a/epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java b/epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java index c9a6addb29..8dd958fe36 100644 --- a/epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java +++ b/epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java @@ -14,10 +14,13 @@ import com.epmet.commons.tools.security.dto.GovTokenDto; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.security.password.PasswordUtils; import com.epmet.commons.tools.utils.*; +import com.epmet.commons.tools.validator.PhoneValidatorUtils; import com.epmet.constant.AuthHttpUrlConstant; +import com.epmet.constant.SmsTemplateConstant; import com.epmet.dto.*; import com.epmet.dto.form.*; import com.epmet.dto.result.*; +import com.epmet.feign.EpmetMessageOpenFeignClient; import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.feign.GovOrgOpenFeignClient; import com.epmet.jwt.JwtTokenProperties; @@ -56,6 +59,8 @@ public class ThirdLoginServiceImpl implements ThirdLoginService { private EpmetUserOpenFeignClient epmetUserOpenFeignClient; @Autowired private GovOrgOpenFeignClient govOrgOpenFeignClient; + @Autowired + private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient; /** * @param formDTO @@ -589,4 +594,45 @@ public class ThirdLoginServiceImpl implements ThirdLoginService { return phone; } + /** + * @param formDTO + * @author sun + * @description 单客户-工作端微信小程序登录-发送验证码 + **/ + @Override + public void sendSmsCode(ThirdSendSmsCodeFormDTO formDTO) { + String str = "发送短信验证码异常,手机号[%s],code[%s],msg[%s]"; + //1.校验手机号是否符合规范 + if (!PhoneValidatorUtils.isMobile(formDTO.getMobile())) { + logger.warn(String.format(str, formDTO.getMobile(), EpmetErrorCode.ERROR_PHONE.getCode(), EpmetErrorCode.ERROR_PHONE.getMsg())); + throw new RenException(EpmetErrorCode.ERROR_PHONE.getCode()); + } + //2.根据手机号校验用户是否存在 + //2-1.根据appId查询对应客户Id + PaCustomerDTO customer = this.getCustomerInfo(formDTO.getAppId()); + //2-2.根据手机号查询到用户信息 + ThirdCustomerStaffFormDTO dto = new ThirdCustomerStaffFormDTO(); + dto.setCustomerId(customer.getId()); + dto.setMobile(formDTO.getMobile()); + Result> customerStaffResult = epmetUserOpenFeignClient.getCustsomerStaffByIdAndPhone(dto); + if (!customerStaffResult.success()) { + logger.warn(String.format(str, formDTO.getMobile(), customerStaffResult.getCode(), customerStaffResult.getMsg())); + throw new RenException(customerStaffResult.getCode()); + } + //3.发送短信验证码 + SendVerificationCodeFormDTO sendVerificationCodeFormDTO = new SendVerificationCodeFormDTO(); + sendVerificationCodeFormDTO.setMobile(formDTO.getMobile()); + sendVerificationCodeFormDTO.setAliyunTemplateCode(SmsTemplateConstant.LGOIN_CONFIRM); + Result smsCodeResult = epmetMessageOpenFeignClient.sendVerificationCode(sendVerificationCodeFormDTO); + if (!smsCodeResult.success()) { + logger.warn(String.format(str, formDTO.getMobile(), smsCodeResult.getCode(), smsCodeResult.getMsg())); + throw new RenException(smsCodeResult.getCode()); + } + //4.保存短信验证码(删除现有短信验证码 将新的短信验证码存入Redis) + SendSmsCodeFormDTO sendSmsCodeFormDTO = new SendSmsCodeFormDTO(); + sendSmsCodeFormDTO.setMobile(formDTO.getMobile()); + captchaRedis.saveSmsCode(sendSmsCodeFormDTO, smsCodeResult.getData().getCode()); + logger.info(String.format("发送短信验证码成功,手机号[%s]", formDTO.getMobile())); + } + } From fe3e24bdf5bc9b78edce27c215cd54b4914bac43 Mon Sep 17 00:00:00 2001 From: wxz Date: Wed, 26 May 2021 10:25:02 +0800 Subject: [PATCH 078/128] =?UTF-8?q?=E7=BD=91=E6=A0=BC=EF=BC=8C=E7=A4=BE?= =?UTF-8?q?=E5=8C=BA=EF=BC=8C=E8=A1=97=E9=81=93=EF=BC=8C=E5=8C=BA=E7=BA=A7?= =?UTF-8?q?=E5=88=AB=E7=9B=B8=E5=85=B3=E6=8C=87=E6=A0=87=E8=AE=A1=E7=AE=97?= =?UTF-8?q?=EF=BC=8C=E5=A2=9E=E5=8A=A0=E5=B9=B3=E5=9D=87=E5=80=BC=E7=9A=84?= =?UTF-8?q?=E5=8F=82=E4=B8=8E=E8=AE=A1=E7=AE=97=E7=9A=84=E6=A0=B7=E6=9C=AC?= =?UTF-8?q?=E4=B8=AA=E6=95=B0=E5=80=BC=E7=9A=84=E4=BF=9D=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/dto/indexcal/AgencyScoreDTO.java | 5 +++ .../indexcal/SubAgencyScoreAvgResultDTO.java | 5 +++ .../indexcal/SubCommunityAvgResultDTO.java | 5 +++ .../screen/FactIndexCommunityScoreDTO.java | 5 +++ .../screen/result/SubGridAvgResultDTO.java | 5 +++ .../impl/GridCorreLationServiceImpl.java | 10 ++--- .../IndexCalculateCommunityServiceImpl.java | 39 +++++++++++++++++++ .../IndexCalculateDistrictServiceImpl.java | 32 +++++++++++++++ .../impl/IndexCalculateStreetServiceImpl.java | 38 ++++++++++++++++++ .../V0.0.14__cpc_subscore_add_samplecount.sql | 6 ++- .../indexcal/AgencyScoreDao.xml | 1 + .../indexcal/AgencySubScoreDao.xml | 3 +- .../indexcal/CommunityScoreDao.xml | 1 + .../indexcal/CommunitySubScoreDao.xml | 3 +- .../evaluationindex/indexcal/GridScoreDao.xml | 1 + 15 files changed, 150 insertions(+), 9 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/AgencyScoreDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/AgencyScoreDTO.java index 42d0ce8fa3..e558c4206e 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/AgencyScoreDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/AgencyScoreDTO.java @@ -86,6 +86,11 @@ public class AgencyScoreDTO implements Serializable { */ private BigDecimal score; + /** + * 样本量 + */ + private Integer sampleCount; + /** * 党建能力:dangjiannengli;治理能力:zhilinengli;服务能力:fuwunengli;街道相关:jiedaoxiangguan;全区相关:quanquxiangguan */ diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/SubAgencyScoreAvgResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/SubAgencyScoreAvgResultDTO.java index f88e035b7b..13cfc69069 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/SubAgencyScoreAvgResultDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/SubAgencyScoreAvgResultDTO.java @@ -48,4 +48,9 @@ public class SubAgencyScoreAvgResultDTO implements Serializable { * 分数 */ private BigDecimal score; + + /** + * 样本量 + */ + private Integer sampleCount; } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/SubCommunityAvgResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/SubCommunityAvgResultDTO.java index a2c167eaeb..4376910337 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/SubCommunityAvgResultDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/SubCommunityAvgResultDTO.java @@ -50,6 +50,11 @@ public class SubCommunityAvgResultDTO implements Serializable { */ private BigDecimal score = NumConstant.ZERO_DECIMAL; + /** + * 样本量 + */ + private Integer sampleCount; + /** * 赋值状态 */ diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/FactIndexCommunityScoreDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/FactIndexCommunityScoreDTO.java index 3ca91f2a98..94c1ea6b79 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/FactIndexCommunityScoreDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/FactIndexCommunityScoreDTO.java @@ -79,6 +79,11 @@ public class FactIndexCommunityScoreDTO implements Serializable { */ private String originValue; + /** + * 参与计算的样本量 + */ + private Integer sampleCount; + /** * 分值 */ diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/SubGridAvgResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/SubGridAvgResultDTO.java index 460eb12640..92883b45dc 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/SubGridAvgResultDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/SubGridAvgResultDTO.java @@ -49,4 +49,9 @@ public class SubGridAvgResultDTO implements Serializable { */ private BigDecimal score; + /** + * 样本量 + */ + private Integer sampleCount; + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/GridCorreLationServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/GridCorreLationServiceImpl.java index e70200f06a..be8016783d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/GridCorreLationServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/GridCorreLationServiceImpl.java @@ -235,9 +235,8 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { // log.info("组织内党员的联系群众能力考评分(平均值) 单独处理"); //网格内党员的联系群众能力考评分(平均值) String gridId = (String) recordMap.get(IndexCalConstant.GRID_ID); - String monthId = (String) recordMap.get(IndexCalConstant.MONTH_ID); AvgOperationResultVO contactMassesAvgVo = getGridContactMassesAvgValue(formDTO, gridId); - gridAvgOpeResultMap.put(gridId.concat(":").concat(monthId), contactMassesAvgVo); + gridAvgOpeResultMap.put(gridId.concat(":").concat(IndexCodeEnum.ZUZHINEIDANGYDLXQZNLKPFPJZ.getCode()), contactMassesAvgVo); SampleValue contactMassesAblityValue = new SampleValue((String) recordMap.get(IndexCalConstant.GRID_ID), contactMassesAvgVo.getAvgValue()); value.getIndexValueVOs().add(contactMassesAblityValue); }else if (StringUtils.isNotBlank(indexCodeFieldReService.getFieldNameByIndexCode(key))) { @@ -252,7 +251,7 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { HashMap resultMap = calculate(indexMap); resultMapList.add(resultMap); } - // 保存中间表 + //保存中间表 deleteBeforeDataList(formDTO,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),IndexCalConstant.GRID_DJ_ALL_PARENT_INDEX_CODE); saveGridCorreLationResult(formDTO, resultMapList, @@ -479,7 +478,7 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { gridSubScoreEntity.setOriginValue(detail.getOriginValue()); // 为平均值类型的指标赋值样本总量 - AvgOperationResultVO avgOperationResultVO = avgOpeResultVo.get(gridSubScoreEntity.getGridId().concat(":").concat(gridSubScoreEntity.getMonthId())); + AvgOperationResultVO avgOperationResultVO = avgOpeResultVo.get(gridSubScoreEntity.getGridId().concat(":").concat(gridSubScoreEntity.getIndexCode())); if (avgOperationResultVO != null) { gridSubScoreEntity.setSampleCount(avgOperationResultVO.getSampleCount()); } else { @@ -662,9 +661,8 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { if (IndexCodeEnum.ZUZHINEIDANGYDSYYSNLKPFPJZ.getCode().equals(key)) { // log.info("组织内党员的参与议事能力考评分(平均值) 单独处理"); String gridId = (String) recordMap.get(IndexCalConstant.GRID_ID); - String monthId = (String) recordMap.get(IndexCalConstant.MONTH_ID); AvgOperationResultVO joinAvgValue = getGridJoinIssueAvgValue(formDTO, gridId); - avgOperationResultVo.put(gridId.concat(":").concat(monthId), joinAvgValue); + avgOperationResultVo.put(gridId.concat(":").concat(IndexCodeEnum.ZUZHINEIDANGYDSYYSNLKPFPJZ.getCode()), joinAvgValue); SampleValue contactMassesAblityValue = new SampleValue((String) recordMap.get(IndexCalConstant.GRID_ID), joinAvgValue.getAvgValue()); value.getIndexValueVOs().add(contactMassesAblityValue); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateCommunityServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateCommunityServiceImpl.java index 693f02c50d..c04cc8942a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateCommunityServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateCommunityServiceImpl.java @@ -226,9 +226,15 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni List indexInputVOS = new ArrayList<>(); Map pid = new HashMap<>(); //下属所有网格的党建能力平均值 + + // 计算党建能力平均分时候的样本量 + Map gridPartyScoreSampleCountMap = new HashMap<>(); detailListByParentCode.forEach(detail -> { if (IndexCodeEnum.XIA_SHU_SUO_YOU_WGDDJNLPJZ.getCode().equals(detail.getIndexCode())) { List subGridPartyAvgScore = factIndexGridScoreDao.selectSubGridAvgScore(customerId, monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); + subGridPartyAvgScore.stream().forEach(s -> { + gridPartyScoreSampleCountMap.put(s.getAgencyId().concat(":").concat(IndexCodeEnum.XIA_SHU_SUO_YOU_WGDDJNLPJZ.getCode()), s.getSampleCount()); + }); if (CollectionUtils.isEmpty(subGridPartyAvgScore)) { log.warn(IndexCalConstant.GRID_PARTY_AVG_NULL); } else { @@ -281,6 +287,10 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni log.info("communityPartyCalculate getScoreCountOfSampleId result:{}", JSON.toJSONString(scoreTotalOfSampleId)); CommunityCalResultDTO result = getResultB(scoreTotalOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(), IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode(), pid); deleteOldRecord(customerId,monthId); + result.getFiveLevel().forEach(s -> { + Integer sampleCount = gridPartyScoreSampleCountMap.get(s.getAgencyId().concat(":").concat(s.getIndexCode())); + s.setSampleCount(sampleCount == null ? 0 : sampleCount); + }); deleteAndInsert(result); return true; } @@ -300,9 +310,15 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni } List indexInputVOS = new ArrayList<>(); Map pid = new HashMap<>(); + + // key:agencyId,value:sampleCount样本量 + Map gridPartyScoreSampleCountMap = new HashMap<>(); detailListByParentCode.forEach(detail -> { if (IndexCodeEnum.SHE_QU_XIA_SHU_SYWGZLNLHZPJZ.getCode().equals(detail.getIndexCode())) { List subGridGovernAvg = factIndexGridScoreDao.selectSubGridAvgScore(customerId, monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); + subGridGovernAvg.forEach(s -> { + gridPartyScoreSampleCountMap.put(s.getAgencyId().concat(":").concat(IndexCodeEnum.SHE_QU_XIA_SHU_SYWGZLNLHZPJZ.getCode()), s.getSampleCount()); + }); if (CollectionUtils.isEmpty(subGridGovernAvg)){ log.warn("社区下级治理能力平均分集合为空"); }else{ @@ -353,6 +369,10 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni HashMap scoreTotalOfSampleId = batchScoreCalculator.getScoreTotalOfSampleId(indexInputVOS); log.info("communityGovernAbilityCalculate getScoreCountOfSampleId result:{}", JSON.toJSONString(scoreTotalOfSampleId)); CommunityCalResultDTO result = getResultB(scoreTotalOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(), IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode(), pid); + result.getFiveLevel().forEach(s -> { + Integer sampleCount = gridPartyScoreSampleCountMap.get(s.getAgencyId().concat(":").concat(s.getIndexCode())); + s.setSampleCount(sampleCount == null ? 0 : sampleCount); + }); deleteAndInsert(result); return true; } @@ -372,10 +392,16 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni } List indexInputVOS = new ArrayList<>(); Map pid = new HashMap<>(); + + // key:agencyId,value:sampleCount样本量 + Map gridPartyScoreSampleCountMap = new HashMap<>(); detailListByParentCode.forEach(detail -> { String indexCode = detail.getIndexCode(); if (IndexCodeEnum.SHE_QU_XIA_JI_SYWGFWNLDFPJZ.getCode().equals(indexCode)) { List subGridServiceAvg = factIndexGridScoreDao.selectSubGridAvgScore(customerId, monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode()); + subGridServiceAvg.forEach(s -> { + gridPartyScoreSampleCountMap.put(s.getAgencyId().concat(":").concat(IndexCodeEnum.SHE_QU_XIA_JI_SYWGFWNLDFPJZ.getCode()), s.getSampleCount()); + }); if (CollectionUtils.isEmpty(subGridServiceAvg)) { log.warn("查询社区下级所有网格服务能力得分平均值集合为空"); } else { @@ -425,6 +451,10 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni HashMap scoreTotalOfSampleId = batchScoreCalculator.getScoreTotalOfSampleId(indexInputVOS); log.info("communityServiceAbilityCalculate getScoreCountOfSampleId result:{}", JSON.toJSONString(scoreTotalOfSampleId)); CommunityCalResultDTO result = getResultB(scoreTotalOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.FU_WU_NENG_LI.getCode(), IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode(), pid); + result.getFiveLevel().forEach(s -> { + Integer sampleCount = gridPartyScoreSampleCountMap.get(s.getAgencyId().concat(":").concat(s.getIndexCode())); + s.setSampleCount(sampleCount == null ? 0 : sampleCount); + }); deleteAndInsert(result); return true; } @@ -662,6 +692,9 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni log.info("communityPartyCalculateExistsSub getScoreCountOfSampleId result:{}", JSON.toJSONString(scoreTotalOfSampleId)); CommunityCalResultDTO result = getResultB(scoreTotalOfSampleId, form.getCustomerId(), form.getMonthId(), NumConstant.ZERO_STR, IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(), IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode(), pid); deleteOldRecord(form.getCustomerId(),form.getMonthId()); + result.getFiveLevel().forEach(s->{ + s.setSampleCount(0); + }); deleteAndInsert(result); return true; } @@ -734,6 +767,9 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni HashMap scoreTotalOfSampleId = batchScoreCalculator.getScoreTotalOfSampleId(indexInputVOS); log.info("communityGovernAbilityCalculateExistsSub getScoreCountOfSampleId result:{}", JSON.toJSONString(scoreTotalOfSampleId)); CommunityCalResultDTO result = getResultB(scoreTotalOfSampleId, form.getCustomerId(), form.getMonthId(), NumConstant.ZERO_STR, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(), IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode(), pid); + result.getFiveLevel().forEach(s->{ + s.setSampleCount(0); + }); deleteAndInsert(result); return true; } @@ -806,6 +842,9 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni HashMap scoreTotalOfSampleId = batchScoreCalculator.getScoreTotalOfSampleId(indexInputVOS); log.info("communityServiceAbilityCalculateExistsSub getScoreCountOfSampleId result:{}", JSON.toJSONString(scoreTotalOfSampleId)); CommunityCalResultDTO result = getResultB(scoreTotalOfSampleId, form.getCustomerId(), form.getMonthId(), NumConstant.ZERO_STR, IndexCodeEnum.FU_WU_NENG_LI.getCode(), IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode(), pid); + result.getFiveLevel().forEach(s->{ + s.setSampleCount(0); + }); deleteAndInsert(result); return true; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java index 9c3328f6ca..92aae2fe95 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java @@ -222,10 +222,16 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict } List indexInputVOS = new ArrayList<>(); Map pid = new HashMap<>(); + + // key:agencyId,value:sampleCount样本量 + Map gridPartyScoreSampleCountMap = new HashMap<>(); //党建能力平均值 indexDetailList.forEach(detail -> { if (IndexCodeEnum.QU_XIA_JI_JIE_DDJNLHZPJZ.getCode().equals(detail.getIndexCode())) { List subGridPartyAvgScore = agencyScoreDao.selectAgencyScoreAvg(customerId, monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),IndexCalConstant.STREET_LEVEL); + subGridPartyAvgScore.forEach(s -> { + gridPartyScoreSampleCountMap.put(s.getParentId().concat(":").concat(IndexCodeEnum.QU_XIA_JI_JIE_DDJNLHZPJZ.getCode()), s.getSampleCount()); + }); log.info("subGridPartyAvgScore:::"+subGridPartyAvgScore.toString()); if (CollectionUtils.isEmpty(subGridPartyAvgScore)) { log.warn(IndexCalConstant.DISTRICT_PARTY_AVG_NULL); @@ -282,6 +288,11 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict log.info("districtPartyAbilityCalculate getScoreCountOfSampleId result:{}", JSON.toJSONString(scoreTotalOfSampleId)); AgencyCalResultDTO result = getResultB(scoreTotalOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(), IndexCodeEnum.QUAN_QU_XIANG_GUAN.getCode(), pid); deleteOldRecord(customerId,monthId,IndexCalConstant.DISTRICT_LEVEL); + + result.getFiveLevel().forEach(s -> { + Integer sampleCount = gridPartyScoreSampleCountMap.get(s.getAgencyId().concat(":").concat(s.getIndexCode())); + s.setSampleCount(sampleCount == null ? NumConstant.ZERO : sampleCount); + }); insertDetail(result); return true; } @@ -301,9 +312,14 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict } List indexInputVOS = new ArrayList<>(); Map pid = new HashMap<>(); + // key:agencyId,value:sampleCount样本量 + Map gridPartyScoreSampleCountMap = new HashMap<>(); detailListByParentCode.forEach(detail -> { if (IndexCodeEnum.SUO_YOU_JIE_DAO_ZLNLPJZ.getCode().equals(detail.getIndexCode())) { List districtGovernAvgList = agencyScoreDao.selectAgencyScoreAvg(customerId, monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),IndexCalConstant.STREET_LEVEL); + districtGovernAvgList.forEach(s -> { + gridPartyScoreSampleCountMap.put(s.getParentId().concat(":").concat(IndexCodeEnum.SUO_YOU_JIE_DAO_ZLNLPJZ.getCode()), s.getSampleCount()); + }); log.info("districtGovernAvgList:::"+districtGovernAvgList.toString()); for (int i = 0; i < districtGovernAvgList.size(); i++) { if (districtGovernAvgList.get(i).getAgencyId().equals(NumConstant.ZERO_STR)){ @@ -363,6 +379,11 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict log.info("districtGovernAbilityCalculate getScoreTotalOfSampleId param:{}", JSON.toJSONString(indexInputVOS)); log.info("districtGovernAbilityCalculate getScoreCountOfSampleId result:{}", JSON.toJSONString(scoreTotalOfSampleId)); AgencyCalResultDTO result = getResultB(scoreTotalOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(), IndexCodeEnum.QUAN_QU_XIANG_GUAN.getCode(), pid); + // 赋值样本量 + result.getFiveLevel().forEach(s -> { + Integer sampleCount = gridPartyScoreSampleCountMap.get(s.getAgencyId().concat(":").concat(s.getIndexCode())); + s.setSampleCount(sampleCount == null ? NumConstant.ZERO : sampleCount); + }); insertDetail(result); return true; } @@ -382,10 +403,16 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict } List indexInputVOS = new ArrayList<>(); Map pid = new HashMap<>(); + // key:agencyId,value:sampleCount样本量 + Map gridPartyScoreSampleCountMap = new HashMap<>(); detailListByParentCode.forEach(detail -> { String indexCode = detail.getIndexCode(); if (IndexCodeEnum.QU_XIA_SHU_JIE_DFWNLHZPJZ.getCode().equals(indexCode)) { List subStreetAvgList = agencyScoreDao.selectAgencyScoreAvg(customerId, monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode(),IndexCalConstant.STREET_LEVEL); + + subStreetAvgList.forEach(s -> { + gridPartyScoreSampleCountMap.put(s.getParentId().concat(":").concat(IndexCodeEnum.QU_XIA_SHU_JIE_DFWNLHZPJZ.getCode()), s.getSampleCount()); + }); log.info("subStreetAvgList:::"+subStreetAvgList.toString()); for (int i = 0; i < subStreetAvgList.size(); i++) { if (subStreetAvgList.get(i).getAgencyId().equals(NumConstant.ZERO_STR)){ @@ -421,6 +448,11 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict log.info("districtServiceAbilityCalculate getScoreTotalOfSampleId param:{}", JSON.toJSONString(indexInputVOS)); log.info("districtServiceAbilityCalculate getScoreCountOfSampleId result:{}", JSON.toJSONString(scoreTotalOfSampleId)); AgencyCalResultDTO result = getResultB(scoreTotalOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.FU_WU_NENG_LI.getCode(), IndexCodeEnum.QUAN_QU_XIANG_GUAN.getCode(), pid); + // 赋值样本量 + result.getFiveLevel().forEach(s -> { + Integer sampleCount = gridPartyScoreSampleCountMap.get(s.getAgencyId().concat(":").concat(s.getIndexCode())); + s.setSampleCount(sampleCount == null ? NumConstant.ZERO : sampleCount); + }); insertDetail(result); } return true; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateStreetServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateStreetServiceImpl.java index 8c0bcf7484..35c9bdc671 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateStreetServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateStreetServiceImpl.java @@ -227,10 +227,16 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ } List indexInputVOS = new ArrayList<>(); Map pid = new HashMap<>(); + + // key:agencyId,value:sampleCount样本量 + Map gridPartyScoreSampleCountMap = new HashMap<>(); //下属所有社区的党建能力平均值 detailListByParentCode.forEach(detail -> { if (IndexCodeEnum.JIE_DAO_XIA_SHU_SYSQDJNLHZPJZ.getCode().equals(detail.getIndexCode())) { List subCommPartyAvgScore = communityScoreDao.selectSubCommAvgScore(customerId, monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); + subCommPartyAvgScore.forEach(s -> { + gridPartyScoreSampleCountMap.put(s.getAgencyId().concat(":").concat(IndexCodeEnum.JIE_DAO_XIA_SHU_SYSQDJNLHZPJZ.getCode()), s.getSampleCount()); + }); if (CollectionUtils.isEmpty(subCommPartyAvgScore)) { log.warn(IndexCalConstant.COMMUNITY_PARTY_AVG_NULL); } else if (subCommPartyAvgScore.size() > NumConstant.ZERO) { @@ -283,6 +289,13 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ log.info("streetPartyAbilityCalculate getScoreCountOfSampleId result:{}", JSON.toJSONString(scoreTotalOfSampleId)); AgencyCalResultDTO result = getResultB(scoreTotalOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(), IndexCodeEnum.JIE_DAO_XIANG_GUAN.getCode(), pid); deleteOldRecord(customerId, monthId, IndexCalConstant.STREET_LEVEL); + + // 赋值样本量 + result.getFiveLevel().forEach(s -> { + Integer sampleCount = gridPartyScoreSampleCountMap.get(s.getAgencyId().concat(":").concat(s.getIndexCode())); + s.setSampleCount(sampleCount == null ? NumConstant.ZERO : sampleCount); + }); + insertDetail(result); return true; } @@ -302,9 +315,15 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ } List indexInputVOS = new ArrayList<>(); Map pid = new HashMap<>(); + + // key:agencyId,value:sampleCount样本量 + Map gridPartyScoreSampleCountMap = new HashMap<>(); detailListByParentCode.forEach(detail -> { if (IndexCodeEnum.JIE_DAO_XIA_SHU_SYSQZLNLHZ.getCode().equals(detail.getIndexCode())) { List subGridGovernAvg = communityScoreDao.selectSubCommAvgScore(customerId, monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); + subGridGovernAvg.forEach(s -> { + gridPartyScoreSampleCountMap.put(s.getAgencyId().concat(":").concat(IndexCodeEnum.JIE_DAO_XIA_SHU_SYSQZLNLHZ.getCode()), s.getSampleCount()); + }); if (CollectionUtils.isEmpty(subGridGovernAvg)){ log.warn("查询街道下属所有社区治理能力汇总为空"); }else if (subGridGovernAvg.size() > NumConstant.ZERO) { @@ -355,6 +374,11 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ log.info("streetGovernAbilityCalculate getScoreTotalOfSampleId param:{}", JSON.toJSONString(indexInputVOS)); log.info("streetGovernAbilityCalculate getScoreCountOfSampleId result:{}", JSON.toJSONString(scoreTotalOfSampleId)); AgencyCalResultDTO result = getResultB(scoreTotalOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(), IndexCodeEnum.JIE_DAO_XIANG_GUAN.getCode(), pid); + // 赋值样本量 + result.getFiveLevel().forEach(s -> { + Integer sampleCount = gridPartyScoreSampleCountMap.get(s.getAgencyId().concat(":").concat(s.getIndexCode())); + s.setSampleCount(sampleCount == null ? NumConstant.ZERO : sampleCount); + }); insertDetail(result); return true; } @@ -374,10 +398,19 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ } List indexInputVOS = new ArrayList<>(); Map pid = new HashMap<>(); + + // key:agencyId,value:sampleCount样本量 + Map gridPartyScoreSampleCountMap = new HashMap<>(); + detailListByParentCode.forEach(detail -> { String indexCode = detail.getIndexCode(); if (IndexCodeEnum.JIE_DAO_XIA_SHU_SQFWNLDFPYZ.getCode().equals(indexCode)) { List subCommServiceAvg = communityScoreDao.selectSubCommAvgScore(customerId, monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode()); + + subCommServiceAvg.forEach(s -> { + gridPartyScoreSampleCountMap.put(s.getAgencyId().concat(":").concat(IndexCodeEnum.JIE_DAO_XIA_SHU_SQFWNLDFPYZ.getCode()), s.getSampleCount()); + }); + if (CollectionUtils.isEmpty(subCommServiceAvg)) { log.warn("查询街道下属社区服务能力得分平均值为空"); } else if (subCommServiceAvg.size() > NumConstant.ZERO) { @@ -427,6 +460,11 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ log.info("streetServiceAbilityCalculate getScoreTotalOfSampleId param:{}", JSON.toJSONString(indexInputVOS)); log.info("streetServiceAbilityCalculate getScoreCountOfSampleId result:{}", JSON.toJSONString(scoreTotalOfSampleId)); AgencyCalResultDTO result = getResultB(scoreTotalOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.FU_WU_NENG_LI.getCode(), IndexCodeEnum.JIE_DAO_XIANG_GUAN.getCode(), pid); + // 赋值样本量 + result.getFiveLevel().forEach(s -> { + Integer sampleCount = gridPartyScoreSampleCountMap.get(s.getAgencyId().concat(":").concat(s.getIndexCode())); + s.setSampleCount(sampleCount == null ? NumConstant.ZERO : sampleCount); + }); insertDetail(result); return true; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.14__cpc_subscore_add_samplecount.sql b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.14__cpc_subscore_add_samplecount.sql index af7688ee68..b5e87ed6f5 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.14__cpc_subscore_add_samplecount.sql +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.14__cpc_subscore_add_samplecount.sql @@ -1 +1,5 @@ -alter table fact_index_grid_sub_score add column SAMPLE_COUNT int(10) comment '样本量' after ORIGIN_VALUE; \ No newline at end of file +alter table fact_index_grid_sub_score add column SAMPLE_COUNT int(10) comment '参与统计的样本个数' after ORIGIN_VALUE; +alter table fact_index_community_sub_score + add column SAMPLE_COUNT int(10) comment '参与统计的样本个数' after ORIGIN_VALUE; +alter table fact_index_agency_sub_score + add column SAMPLE_COUNT int(10) comment '参与统计的样本个数' after ORIGIN_VALUE; \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencyScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencyScoreDao.xml index 62c6226e07..215a7f3f31 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencyScoreDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencyScoreDao.xml @@ -97,6 +97,7 @@ fics.quarter_id, fics.year_id, ROUND(AVG( fics.score ),6) AS score, + COUNT(1) AS sample_count, fics.customer_id, PARENT_AGENCY_ID AS parentId FROM diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencySubScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencySubScoreDao.xml index 64cca5242c..f1c861d1e3 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencySubScoreDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencySubScoreDao.xml @@ -5,7 +5,7 @@ - INSERT INTO fact_index_agency_sub_score (ID, CUSTOMER_ID, AGENCY_ID, PARENT_AGENCY_ID, YEAR_ID, QUARTER_ID, MONTH_ID, DATA_TYPE, ORIGIN_VALUE, SCORE, INDEX_CODE,ALL_PARENT_INDEX_CODE, + INSERT INTO fact_index_agency_sub_score (ID, CUSTOMER_ID, AGENCY_ID, PARENT_AGENCY_ID, YEAR_ID, QUARTER_ID, MONTH_ID, DATA_TYPE, ORIGIN_VALUE, SCORE, SAMPLE_COUNT, INDEX_CODE,ALL_PARENT_INDEX_CODE, WEIGHT,DEL_FLAG, REVISION, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME ) VALUES @@ -20,6 +20,7 @@ #{item.dataType}, #{item.originValue}, #{item.score}, + #{item.sampleCount}, #{item.indexCode}, #{item.allParentIndexCode}, #{item.weight}, diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CommunityScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CommunityScoreDao.xml index 28eda4f99c..17e80da926 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CommunityScoreDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CommunityScoreDao.xml @@ -75,6 +75,7 @@ fics.quarter_id, fics.year_id, ROUND(AVG( fics.score ),6) AS score, + COUNT(1) AS sampleCount, fics.customer_id, sca.pid AS parentId FROM diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CommunitySubScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CommunitySubScoreDao.xml index f4dfd8fbd9..8f3bc53e6e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CommunitySubScoreDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CommunitySubScoreDao.xml @@ -5,7 +5,7 @@ - INSERT INTO fact_index_community_sub_score ( ID, CUSTOMER_ID, AGENCY_ID, PARENT_AGENCY_ID, YEAR_ID, QUARTER_ID, MONTH_ID, ORIGIN_VALUE, SCORE, INDEX_CODE,ALL_PARENT_INDEX_CODE, + INSERT INTO fact_index_community_sub_score ( ID, CUSTOMER_ID, AGENCY_ID, PARENT_AGENCY_ID, YEAR_ID, QUARTER_ID, MONTH_ID, ORIGIN_VALUE, SAMPLE_COUNT, SCORE, INDEX_CODE,ALL_PARENT_INDEX_CODE, WEIGHT,DEL_FLAG, REVISION, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME ) VALUES @@ -18,6 +18,7 @@ #{item.quarterId}, #{item.monthId}, #{item.originValue}, + #{item.sampleCount}, #{item.score}, #{item.indexCode}, #{item.allParentIndexCode}, diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/GridScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/GridScoreDao.xml index cee52bfea1..ca1de4a3b1 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/GridScoreDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/GridScoreDao.xml @@ -131,6 +131,7 @@ figc.quarter_id as quarterId, figc.year_id as yearId, ROUND(AVG( figc.score ),6) AS score, + COUNT(1) AS sampleCount, figc.customer_id as customerId, sca.pid AS parentId FROM From b051d649c10698ece2f9f556b6cd21a2e4117e70 Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 26 May 2021 10:33:45 +0800 Subject: [PATCH 079/128] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=8C=87=E6=A0=87?= =?UTF-8?q?=E8=A7=A3=E9=87=8A=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../db/migration/V0.0.17__inxdex_explain.sql | 77 +++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.17__inxdex_explain.sql diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.17__inxdex_explain.sql b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.17__inxdex_explain.sql new file mode 100644 index 0000000000..f7306c991d --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.17__inxdex_explain.sql @@ -0,0 +1,77 @@ +CREATE TABLE `index_explain` ( + `ID` varchar(64) NOT NULL COMMENT '主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户id', + `TITLE` varchar(32) NOT NULL COMMENT '名称', + `INDEX_CODE` varchar(256) NOT NULL COMMENT '指标code', + `MEANING` varchar(256) NOT NULL COMMENT '含义', + `ORG_LEVEL` varchar(16) NOT NULL COMMENT '组织级别(网格级:grid;社区级:community;乡(镇、街道)级:street;区县级: district;市级: city;省级:province)', + `PID` varchar(16) NOT NULL COMMENT '父ID', + `SORT` int(11) NOT NULL COMMENT '排序', + `IS_SEARCH` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否需要查询;1有;0:无;', + `TYPE` varchar(16) NOT NULL DEFAULT 'none' COMMENT '数据类型:none;本级:self;下级:sub', + `DEL_FLAG` varchar(1) NOT NULL DEFAULT '0' COMMENT '删除标记 0:未删除,1:已删除', + `REVISION` int(11) NOT NULL DEFAULT '0' COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL DEFAULT 'app_user' COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='指标说明文案'; + +#更新含义 +update index_dict SET INDEX_DESC='自然月周期内,网格内注册群众用户数。' WHERE INDEX_CODE = 'wanggequnzhongyhs'; +update index_dict SET INDEX_DESC='自然月周期内,网格内注册党员用户数。' WHERE INDEX_CODE = 'wanggedangyuanyhs'; +update index_dict SET INDEX_DESC='自然月周期内,参与话题、事件评论、点赞、点踩总次数大于给定阈值的群众用户。' WHERE INDEX_CODE = 'wanggehuoyueqzyhs'; +update index_dict SET INDEX_DESC='自然月周期内,参与话题、事件评论、点赞、点踩总次数大于给定阈值的党员用户。' WHERE INDEX_CODE = 'wanggehuoyuedyyhs'; +update index_dict SET INDEX_DESC='自然月周期内,网格内党员提出的总话题数与党员人数之比。' WHERE INDEX_CODE = 'wanggedangyuanrjtchts'; +update index_dict SET INDEX_DESC='自然月周期内,网格内群众提出的总话题数与群众人数之比。' WHERE INDEX_CODE = 'wanggequnzhongrjtchts'; +update index_dict SET INDEX_DESC='自然月周期内,网格内所有党员提出的议题转为项目的数目与党员人数之比。' WHERE INDEX_CODE = 'wanggedangyuanrjtcdytzxms'; +update index_dict SET INDEX_DESC='自然月周期内,网格内所有群众提出的议题转为项目的数目与群众人数之比。' WHERE INDEX_CODE = 'wanggequnzhongrjtcdytzxms'; +update index_dict SET INDEX_DESC='自然月周期内,党员自建群(群主)数量。' WHERE INDEX_CODE = 'jianqundangyuans'; +update index_dict SET INDEX_DESC='自然月周期内,党员自建群群众人数乘相关权重、党员自建群活跃群众人数乘相关权重、党员自建群活跃度-话题数乘相关权重与自建群活跃度-议题转项目率乘相关权重之和' WHERE INDEX_CODE = 'zuzhineidangydlxqznlkpfpjz'; +update index_dict SET INDEX_DESC='自然月周期内,网格内所有发文数量' WHERE INDEX_CODE = 'wanggedifawsl'; +update index_dict SET INDEX_DESC='自然月周期内,已转项目议题数与近两个自然月内议题总数之比' WHERE INDEX_CODE = 'wanggeyitizxml'; +update index_dict SET INDEX_DESC='自然月周期内,本网格内注册党员活动签到次数。' WHERE INDEX_CODE = 'dangyuancanjiashykrc'; +update index_dict SET INDEX_DESC='自然月周期内,社区下所有网格党建指数得分之和与网格总数之比' WHERE INDEX_CODE = 'xiashusuoyouwgddjnlpjz'; +update index_dict SET INDEX_DESC='自然月周期内,街道下所有社区党建指数得分之和与网格总数之比' WHERE INDEX_CODE = 'jiedaoxiashusysqdjnlhzpjz'; +update index_dict SET INDEX_DESC='自然月周期内,街道内所有发文数量' WHERE INDEX_CODE = 'jiedaomingyifwsl'; +update index_dict SET INDEX_DESC='自然月周期内,区下级所有街道党建指数得分之和与街道总数之比' WHERE INDEX_CODE = 'quxiajijieddjnlhzpjz'; +update index_dict SET INDEX_DESC='自然月周期内,区内所有发文数量' WHERE INDEX_CODE = 'qumingyifawsl'; +update index_dict SET INDEX_DESC='自然月周期内,党员提出话题数乘相关权重、党员参与话题数乘相关权重、党员提出的话题转议题数乘相关权重与党员提出的议题转项目数乘相关权重之和' WHERE INDEX_CODE = 'zuzhineidangydcyysnlkpfpjz'; +update index_dict SET INDEX_DESC='自然月周期内,网格内成员提出议题的总数量' WHERE INDEX_CODE = 'wanggezongyitsm'; +update index_dict SET INDEX_DESC='自然月周期内,新增议题数与发布议题人数去重之比' WHERE INDEX_CODE = 'wanggerenjunytsm'; +update index_dict SET INDEX_DESC='自然月周期内,议题转化的项目数' WHERE INDEX_CODE = 'wanggezongxiangms'; +update index_dict SET INDEX_DESC='自然月周期内,从议题创建到项目关闭,包括处理人,没有出过议题所属网格的项目数。' WHERE INDEX_CODE = 'wanggezizhixms'; +update index_dict SET INDEX_DESC='自然月周期内,办结的项目数' WHERE INDEX_CODE = 'wanggebanjiexms'; +update index_dict SET INDEX_DESC='自然月周期内,未被退回的项目数与项目总数之比' WHERE INDEX_CODE = 'wanggechuishaobmzql'; +update index_dict SET INDEX_DESC='自然月周期内,网格内自治办结项目的满意度评价的平均分(非常满意100,满意80,一般60)' WHERE INDEX_CODE = 'wanggeneijiejdxmdmyd'; +update index_dict SET INDEX_DESC='自然月周期内,社区下所有网格治理指数得分之和与网格总数之比' WHERE INDEX_CODE = 'shequxiashusywgzlnlhzpjz'; +update index_dict SET INDEX_DESC='自然月周期内,社区被吹哨的次数' WHERE INDEX_CODE = 'shequbeichuiscs'; +update index_dict SET INDEX_DESC='自然月周期内,社区办结项目数目' WHERE INDEX_CODE = 'shequbanjiexms'; +update index_dict SET INDEX_DESC='自然月周期内,项目受理时长(分钟)与项目数之比' WHERE INDEX_CODE = 'shequxiangmuxyd'; +update index_dict SET INDEX_DESC='自然月周期内,超期项目数与结案项目数之比' WHERE INDEX_CODE = 'shequchaoqixml'; +update index_dict SET INDEX_DESC='自然月周期内,社区办结项目数目' WHERE INDEX_CODE = 'shequbanjiexml'; +update index_dict SET INDEX_DESC='自然月周期内,社区级办结项目的满意度评价的平均分(非常满意100,满意80,一般60)' WHERE INDEX_CODE = 'shequbanjiexmmyd'; +update index_dict SET INDEX_DESC='自然月周期内,街道下所有社区治理指数得分之和与社区总数之比' WHERE INDEX_CODE = 'jiedaoxiashusysqzlnlhz'; +update index_dict SET INDEX_DESC='自然月周期内,街道被吹哨的次数' WHERE INDEX_CODE = 'jiedaobeichuiscs'; +update index_dict SET INDEX_DESC='自然月周期内,街道办结项目数目' WHERE INDEX_CODE = 'jiedaobanjiexms'; +update index_dict SET INDEX_DESC='自然月周期内,项目受理时长(分钟)与项目数之比' WHERE INDEX_CODE = 'jiedaoxiangmuxyd'; +update index_dict SET INDEX_DESC='自然月周期内,办结项目的平均处理时长的倒数' WHERE INDEX_CODE = 'jiedaobanjiexmdclxl'; +update index_dict SET INDEX_DESC='自然月周期内,街道级办结项目数目与街道级尚未办结的项目数的比例' WHERE INDEX_CODE = 'jiedaoxiangmubjl'; +update index_dict SET INDEX_DESC='自然月周期内,街道级办结项目的满意度评价的平均分(非常满意100,满意80,一般60)' WHERE INDEX_CODE = 'jiedaojixiangmmyd'; +update index_dict SET INDEX_DESC='自然月周期内,区直部门被吹哨的次数' WHERE INDEX_CODE = 'quzhibumenbcscs'; +update index_dict SET INDEX_DESC='自然月周期内,区直部门办结项目数目' WHERE INDEX_CODE = 'quzhibumenbjxms'; +update index_dict SET INDEX_DESC='自然月周期内,项目受理时长(分钟)与项目数之比' WHERE INDEX_CODE = 'quzhibumenxmxyd'; +update index_dict SET INDEX_DESC='自然月周期内,办结项目的平均处理时长的倒数' WHERE INDEX_CODE = 'quzhibumenbjxmdclxl'; +update index_dict SET INDEX_DESC='自然月周期内,区直部门办结项目数目与区直部门尚未办结的项目数的比例' WHERE INDEX_CODE = 'quzhibumenxmbjl'; +update index_dict SET INDEX_DESC='自然月周期内,区直部门办结项目的满意度评价的平均分(非常满意100,满意80,一般60)' WHERE INDEX_CODE = 'quzhibumenxmmyd'; +update index_dict SET INDEX_DESC='所有指数部门治理指数(平均值)得分=区直部门各项治理指数指标数据平均分*相关权重之和' WHERE INDEX_CODE = 'suoyouzhishubmzlnlpjz'; +update index_dict SET INDEX_DESC='自然月周期内,网格内爱心活动组织次数。' WHERE INDEX_CODE = 'wanggehuodongzzcs'; +update index_dict SET INDEX_DESC='自然月周期内,志愿者内党员数与志愿者总数之比' WHERE INDEX_CODE = 'wanggezhiyuanzzb'; +update index_dict SET INDEX_DESC='自然月周期内,网格内党员志愿者总数与网格党员总人数之比。' WHERE INDEX_CODE = 'wanggedangyuanzyzl'; +update index_dict SET INDEX_DESC='自然月周期内,社区下所有网格服务指数得分之和与网格总数之比' WHERE INDEX_CODE = 'shequxiajisywgfwnldfpjz'; +update index_dict SET INDEX_DESC='自然月周期内,社区内爱心活动组织次数。' WHERE INDEX_CODE = 'shequhuodongzzcs'; +update index_dict SET INDEX_DESC='自然月周期内,街道下所有社区服务指数得分之和与社区总数之比' WHERE INDEX_CODE = 'jiedaoxiashusqfwnldfpjz'; +update index_dict SET INDEX_DESC='自然月周期内,街道内爱心活动组织次数。' WHERE INDEX_CODE = 'jiedaohuodongzzcs'; +update index_dict SET INDEX_DESC='自然月周期内,区下级所有街道服务指数得分之和与街道总数之比' WHERE INDEX_CODE = 'quxiashujiedfwnlhzpjz'; + From d1716b5dd6b5c9cff15063432871ea111d737fad Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 26 May 2021 10:39:58 +0800 Subject: [PATCH 080/128] =?UTF-8?q?=E6=95=B0=E9=87=8F=E8=BF=94=E5=9B=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/resources/mapper/fact/FactIndexCommunitySubScoreDao.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCommunitySubScoreDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCommunitySubScoreDao.xml index 52f1e767f0..01b7bedf74 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCommunitySubScoreDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCommunitySubScoreDao.xml @@ -45,6 +45,7 @@ SELECT fact.index_code, IF(fact.origin_value='',0,IFNULL(fact.origin_value,0)) AS origin_value, + IF(fact.SAMPLE_COUNT='',0,IFNULL(fact.SAMPLE_COUNT,0)) AS quantity, round(fact.score,2) AS score, round(fact.WEIGHT,2) AS weight FROM From 9afa6466c3fcc9b5b91dc6b99169a26b18134c0a Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Wed, 26 May 2021 10:56:07 +0800 Subject: [PATCH 081/128] =?UTF-8?q?=E5=8C=BA=E5=8E=BF=E7=BA=A7=E5=88=AB=20?= =?UTF-8?q?=E4=B8=89=E5=A4=A7=E8=83=BD=E5=8A=9B=E8=AE=A1=E7=AE=97=20?= =?UTF-8?q?=E8=B5=8B=E5=80=BCparentId=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../screen/ScreenCustomerAgencyDao.java | 9 +++++++ .../IndexCalculateDistrictServiceImpl.java | 25 +++++++++++++------ .../screen/ScreenCustomerAgencyDao.xml | 12 +++++++++ 3 files changed, 39 insertions(+), 7 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java index d0cb1d1726..40118c9253 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java @@ -33,6 +33,7 @@ import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import java.util.List; +import java.util.Map; /** * 组织机构信息 @@ -99,6 +100,14 @@ public interface ScreenCustomerAgencyDao extends BaseDao selectAgencyIdAndParentId(@Param("customerId") String customerId); + /** * 返回当前客户下,未匹配到的 【乡(镇、街道)级、区县级】 组织信息 * diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java index 92aae2fe95..df8515ad11 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java @@ -222,7 +222,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict } List indexInputVOS = new ArrayList<>(); Map pid = new HashMap<>(); - + Map agencyMap = customerAgencyDao.selectAgencyIdAndParentId(customerId); // key:agencyId,value:sampleCount样本量 Map gridPartyScoreSampleCountMap = new HashMap<>(); //党建能力平均值 @@ -242,7 +242,8 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict List index1SampleValues = new ArrayList<>(); party.forEach(c -> { if (!c.getParentId().equals(NumConstant.ZERO_STR)) { - pid.put(c.getParentId(), customerAgencyDao.selectPid(c.getParentId())); +// pid.put(c.getParentId(), customerAgencyDao.selectPid(c.getParentId())); + pid.put(c.getParentId(), agencyMap.get(c.getParentId())); SampleValue s = new SampleValue(c.getParentId(), c.getScore()); index1SampleValues.add(s); } @@ -314,6 +315,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict Map pid = new HashMap<>(); // key:agencyId,value:sampleCount样本量 Map gridPartyScoreSampleCountMap = new HashMap<>(); + Map agencyMap = customerAgencyDao.selectAgencyIdAndParentId(customerId); detailListByParentCode.forEach(detail -> { if (IndexCodeEnum.SUO_YOU_JIE_DAO_ZLNLPJZ.getCode().equals(detail.getIndexCode())) { List districtGovernAvgList = agencyScoreDao.selectAgencyScoreAvg(customerId, monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),IndexCalConstant.STREET_LEVEL); @@ -335,7 +337,8 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict List index1SampleValues = new ArrayList<>(); avg.forEach(c -> { if (!c.getParentId().equals(NumConstant.ZERO_STR)) { - pid.put(c.getParentId(), customerAgencyDao.selectPid(c.getParentId())); +// pid.put(c.getParentId(), customerAgencyDao.selectPid(c.getParentId())); + pid.put(c.getParentId(), agencyMap.get(c.getParentId())); SampleValue s = new SampleValue(c.getParentId(), c.getScore()); index1SampleValues.add(s); } @@ -405,6 +408,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict Map pid = new HashMap<>(); // key:agencyId,value:sampleCount样本量 Map gridPartyScoreSampleCountMap = new HashMap<>(); + Map agencyMap = customerAgencyDao.selectAgencyIdAndParentId(customerId); detailListByParentCode.forEach(detail -> { String indexCode = detail.getIndexCode(); if (IndexCodeEnum.QU_XIA_SHU_JIE_DFWNLHZPJZ.getCode().equals(indexCode)) { @@ -429,7 +433,8 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict List index1SampleValues = new ArrayList<>(); serviceAvg.forEach(c -> { if (!c.getParentId().equals(NumConstant.ZERO_STR)) { - pid.put(c.getParentId(), customerAgencyDao.selectPid(c.getParentId())); +// pid.put(c.getParentId(), customerAgencyDao.selectPid(c.getParentId())); + pid.put(c.getParentId(), agencyMap.get(c.getParentId())); SampleValue s = new SampleValue(c.getParentId(), c.getScore()); index1SampleValues.add(s); } @@ -643,6 +648,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict } List indexInputVOS = new ArrayList<>(); Map pid = new HashMap<>(); + Map agencyMap = customerAgencyDao.selectAgencyIdAndParentId(customerId); //党建能力平均值 indexDetailList.forEach(detail -> { if (IndexCodeEnum.QU_XIA_JI_JIE_DDJNLHZPJZ.getCode().equals(detail.getIndexCode())) { @@ -657,7 +663,8 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict List index1SampleValues = new ArrayList<>(); party.forEach(c -> { if (!c.getParentId().equals(NumConstant.ZERO_STR)) { - pid.put(c.getParentId(), customerAgencyDao.selectPid(c.getParentId())); +// pid.put(c.getParentId(), customerAgencyDao.selectPid(c.getParentId())); + pid.put(c.getParentId(), agencyMap.get(c.getParentId())); SampleValue s = new SampleValue(c.getParentId(), c.getScore()); index1SampleValues.add(s); }else { @@ -727,6 +734,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict } List indexInputVOS = new ArrayList<>(); Map pid = new HashMap<>(); + Map agencyMap = customerAgencyDao.selectAgencyIdAndParentId(customerId); detailListByParentCode.forEach(detail -> { if (IndexCodeEnum.SUO_YOU_JIE_DAO_ZLNLPJZ.getCode().equals(detail.getIndexCode())) { List districtGovernAvgList = agencyScoreDao.selectAgencyScoreAvgExistsSub(monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),form.getCustomerAreaCode()); @@ -745,7 +753,8 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict List index1SampleValues = new ArrayList<>(); avg.forEach(c -> { if (!c.getParentId().equals(NumConstant.ZERO_STR)) { - pid.put(c.getParentId(), customerAgencyDao.selectPid(c.getParentId())); +// pid.put(c.getParentId(), customerAgencyDao.selectPid(c.getParentId())); + pid.put(c.getParentId(), agencyMap.get(c.getParentId())); SampleValue s = new SampleValue(c.getParentId(), c.getScore()); index1SampleValues.add(s); }else { @@ -813,6 +822,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict } List indexInputVOS = new ArrayList<>(); Map pid = new HashMap<>(); + Map agencyMap = customerAgencyDao.selectAgencyIdAndParentId(customerId); detailListByParentCode.forEach(detail -> { String indexCode = detail.getIndexCode(); if (IndexCodeEnum.QU_XIA_SHU_JIE_DFWNLHZPJZ.getCode().equals(indexCode)) { @@ -833,7 +843,8 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict List index1SampleValues = new ArrayList<>(); serviceAvg.forEach(c -> { if (!c.getParentId().equals(NumConstant.ZERO_STR)) { - pid.put(c.getParentId(), customerAgencyDao.selectPid(c.getParentId())); +// pid.put(c.getParentId(), customerAgencyDao.selectPid(c.getParentId())); + pid.put(c.getParentId(), agencyMap.get(c.getParentId())); SampleValue s = new SampleValue(c.getParentId(), c.getScore()); index1SampleValues.add(s); }else { diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerAgencyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerAgencyDao.xml index acb10f1bad..8d5a681938 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerAgencyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerAgencyDao.xml @@ -426,4 +426,16 @@ (SELECT GRID_ID AS orgId FROM screen_customer_grid WHERE DEL_FLAG = 0 AND CUSTOMER_ID = #{customerId}) UNION ALL (SELECT DEPT_ID AS orgId FROM screen_customer_dept WHERE DEL_FLAG = 0 AND CUSTOMER_ID = #{customerId}) + + + From 717d0b2f33e5d1ae6d99bcfd2c8a2b5ac82615dd Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Wed, 26 May 2021 13:56:19 +0800 Subject: [PATCH 082/128] =?UTF-8?q?=E5=8C=BA=E5=8E=BF=E7=BA=A7=E5=88=AB?= =?UTF-8?q?=E7=9A=84=E4=B8=89=E5=A4=A7=E8=83=BD=E5=8A=9B=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E5=BE=AE=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../indexcal/AgencyAndParentResultDTO.java | 26 ++++++++++++++++ .../screen/ScreenCustomerAgencyDao.java | 3 +- .../IndexCalculateDistrictServiceImpl.java | 31 +++++++++++++------ .../screen/ScreenCustomerAgencyDao.xml | 2 +- 4 files changed, 50 insertions(+), 12 deletions(-) create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/AgencyAndParentResultDTO.java diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/AgencyAndParentResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/AgencyAndParentResultDTO.java new file mode 100644 index 0000000000..02efab6132 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/AgencyAndParentResultDTO.java @@ -0,0 +1,26 @@ +package com.epmet.dto.indexcal; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/5/26 1:47 下午 + * @DESC + */ +@Data +public class AgencyAndParentResultDTO implements Serializable { + + private static final long serialVersionUID = -7300464262794241276L; + + /** + * 组织ID + */ + private String agencyId; + + /** + * parentId + */ + private String pid; +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java index 40118c9253..67cbe37e23 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java @@ -24,6 +24,7 @@ import com.epmet.dto.extract.form.ScreenPartyLinkMassesDataFormDTO; import com.epmet.dto.extract.result.AgencyMonthCountResultDTO; import com.epmet.dto.extract.result.CustomerAgencyInfoResultDTO; import com.epmet.dto.extract.result.OrgNameResultDTO; +import com.epmet.dto.indexcal.AgencyAndParentResultDTO; import com.epmet.dto.indexcollect.form.CustomerBizOrgFormDTO; import com.epmet.dto.screen.ScreenProjectOrgDailyDTO; import com.epmet.dto.screen.result.TreeResultDTO; @@ -106,7 +107,7 @@ public interface ScreenCustomerAgencyDao extends BaseDao selectAgencyIdAndParentId(@Param("customerId") String customerId); + List selectAgencyIdAndParentId(@Param("customerId") String customerId); /** * 返回当前客户下,未匹配到的 【乡(镇、街道)级、区县级】 组织信息 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java index df8515ad11..3bc97544d0 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java @@ -19,10 +19,7 @@ import com.epmet.dao.evaluationindex.indexcal.DeptScoreDao; import com.epmet.dao.evaluationindex.indexcoll.FactIndexPartyAblityOrgMonthlyDao; import com.epmet.dao.evaluationindex.screen.IndexGroupDetailDao; import com.epmet.dao.evaluationindex.screen.ScreenCustomerAgencyDao; -import com.epmet.dto.indexcal.AgencyCalResultDTO; -import com.epmet.dto.indexcal.AgencyScoreDTO; -import com.epmet.dto.indexcal.CalculateCommonFormDTO; -import com.epmet.dto.indexcal.SubAgencyScoreAvgResultDTO; +import com.epmet.dto.indexcal.*; import com.epmet.dto.screen.ScreenProjectOrgDailyDTO; import com.epmet.dto.screen.result.MaxAndMinBigDecimalResultDTO; import com.epmet.entity.evaluationindex.indexcal.AgencySelfSubScoreEntity; @@ -222,7 +219,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict } List indexInputVOS = new ArrayList<>(); Map pid = new HashMap<>(); - Map agencyMap = customerAgencyDao.selectAgencyIdAndParentId(customerId); + Map agencyMap = agencyMap(customerId); // key:agencyId,value:sampleCount样本量 Map gridPartyScoreSampleCountMap = new HashMap<>(); //党建能力平均值 @@ -315,7 +312,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict Map pid = new HashMap<>(); // key:agencyId,value:sampleCount样本量 Map gridPartyScoreSampleCountMap = new HashMap<>(); - Map agencyMap = customerAgencyDao.selectAgencyIdAndParentId(customerId); + Map agencyMap = agencyMap(customerId); detailListByParentCode.forEach(detail -> { if (IndexCodeEnum.SUO_YOU_JIE_DAO_ZLNLPJZ.getCode().equals(detail.getIndexCode())) { List districtGovernAvgList = agencyScoreDao.selectAgencyScoreAvg(customerId, monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),IndexCalConstant.STREET_LEVEL); @@ -408,7 +405,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict Map pid = new HashMap<>(); // key:agencyId,value:sampleCount样本量 Map gridPartyScoreSampleCountMap = new HashMap<>(); - Map agencyMap = customerAgencyDao.selectAgencyIdAndParentId(customerId); + Map agencyMap = agencyMap(customerId); detailListByParentCode.forEach(detail -> { String indexCode = detail.getIndexCode(); if (IndexCodeEnum.QU_XIA_SHU_JIE_DFWNLHZPJZ.getCode().equals(indexCode)) { @@ -648,7 +645,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict } List indexInputVOS = new ArrayList<>(); Map pid = new HashMap<>(); - Map agencyMap = customerAgencyDao.selectAgencyIdAndParentId(customerId); + Map agencyMap = agencyMap(customerId); //党建能力平均值 indexDetailList.forEach(detail -> { if (IndexCodeEnum.QU_XIA_JI_JIE_DDJNLHZPJZ.getCode().equals(detail.getIndexCode())) { @@ -734,7 +731,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict } List indexInputVOS = new ArrayList<>(); Map pid = new HashMap<>(); - Map agencyMap = customerAgencyDao.selectAgencyIdAndParentId(customerId); + Map agencyMap = agencyMap(customerId); detailListByParentCode.forEach(detail -> { if (IndexCodeEnum.SUO_YOU_JIE_DAO_ZLNLPJZ.getCode().equals(detail.getIndexCode())) { List districtGovernAvgList = agencyScoreDao.selectAgencyScoreAvgExistsSub(monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),form.getCustomerAreaCode()); @@ -822,7 +819,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict } List indexInputVOS = new ArrayList<>(); Map pid = new HashMap<>(); - Map agencyMap = customerAgencyDao.selectAgencyIdAndParentId(customerId); + Map agencyMap = agencyMap(customerId); detailListByParentCode.forEach(detail -> { String indexCode = detail.getIndexCode(); if (IndexCodeEnum.QU_XIA_SHU_JIE_DFWNLHZPJZ.getCode().equals(indexCode)) { @@ -918,5 +915,19 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict return true; } + /** + * @Description 查询客户下的所有组织parentId + * @Param customerId + * @author zxc + * @date 2021/5/26 1:44 下午 + */ + public Map agencyMap(String customerId){ + Map result = new HashMap<>(16); + List dtos = customerAgencyDao.selectAgencyIdAndParentId(customerId); + dtos.forEach(d -> { + result.put(d.getAgencyId(),d.getPid()); + }); + return result; + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerAgencyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerAgencyDao.xml index 8d5a681938..d71a8a36f8 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerAgencyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerAgencyDao.xml @@ -428,7 +428,7 @@ - SELECT AGENCY_ID, PID From f78c25f68b45aa0378cc9222bcf9aaebc4b45d1d Mon Sep 17 00:00:00 2001 From: wxz Date: Wed, 26 May 2021 13:59:56 +0800 Subject: [PATCH 083/128] =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E5=B9=B3=E5=9D=87?= =?UTF-8?q?=E5=80=BC=E7=9A=84=E6=97=B6=E5=80=99=EF=BC=8C=E5=81=9A=E5=B9=B3?= =?UTF-8?q?=E5=9D=87=E5=80=BC=E4=B8=BAnull=E7=9A=84=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../indexcal/impl/GridCorreLationServiceImpl.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/GridCorreLationServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/GridCorreLationServiceImpl.java index be8016783d..2a71c3e8d3 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/GridCorreLationServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/GridCorreLationServiceImpl.java @@ -327,6 +327,10 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { result.setAvgValue(new BigDecimal(0)); result.setSampleCount(0); } + + if (result.getAvgValue() == null) { + result.setAvgValue(new BigDecimal(NumConstant.ZERO)); + } //FOR TEST /*BigDecimal result=null; if(IndexCalConstant.S1_C1_G1.equals(gridId)){ @@ -354,6 +358,9 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { result.setSampleCount(0); result.setAvgValue(new BigDecimal(0)); } + if (result.getAvgValue() == null) { + result.setAvgValue(new BigDecimal(NumConstant.ZERO)); + } //FOR TEST /*BigDecimal result=null; if(IndexCalConstant.S1_C1_G1.equals(gridId)){ From 09700ffc93210a33ce624d1f97208175ecc4447d Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Wed, 26 May 2021 14:08:42 +0800 Subject: [PATCH 084/128] =?UTF-8?q?=E8=8E=B7=E5=8F=96=E7=BB=84=E7=BB=87?= =?UTF-8?q?=E6=9C=BA=E6=9E=84=E4=BF=A1=E6=81=AF=E6=8E=A5=E5=8F=A3=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E5=AE=A2=E6=88=B7=E8=B7=9F=E7=BB=84=E7=BB=87=E7=BA=A7?= =?UTF-8?q?=E5=88=AB=E8=BF=94=E5=8F=82=E7=94=A8=E4=BA=8E=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E6=B2=BB=E7=90=86=E5=AE=9E=E5=86=B5=E6=A8=A1?= =?UTF-8?q?=E5=9D=97=E4=BD=BF=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/dto/result/AgencysResultDTO.java | 5 +++++ .../java/com/epmet/controller/AgencyController.java | 5 +++-- .../com/epmet/service/impl/AgencyServiceImpl.java | 13 +++++++++++++ 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencysResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencysResultDTO.java index 175fe56674..b9cbcdc232 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencysResultDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencysResultDTO.java @@ -96,4 +96,9 @@ public class AgencysResultDTO implements Serializable { * 组织区划的名称 */ private String areaName; + + /** + * 当前组织对应客户根组织级别(社区级:community,乡(镇、街道)级:street,区县级: district,市级: city省级:province) + */ + private String rootlevel; } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java index b0ec95dfd2..263fe905e7 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java @@ -151,8 +151,9 @@ public class AgencyController { * @Description 组织首页-获取组织机构信息 */ @PostMapping("agencydetail") - @RequirePermission(requirePermission = RequirePermissionEnum.ORG_AGENCY_TRACE) - public Result agencyDetail(@LoginUser TokenDto tokenDTO, @RequestBody AgencydetailFormDTO formDTO) { + //@RequirePermission(requirePermission = RequirePermissionEnum.ORG_AGENCY_TRACE) + //public Result agencyDetail(@LoginUser TokenDto tokenDTO, @RequestBody AgencydetailFormDTO formDTO) { + public Result agencyDetail(@RequestBody AgencydetailFormDTO formDTO) { ValidatorUtils.validateEntity(formDTO, AgencydetailFormDTO.AddUserInternalGroup.class); return agencyService.agencyDetail(formDTO); } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java index e83b78ba77..2324c7d1d2 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java @@ -237,6 +237,19 @@ public class AgencyServiceImpl implements AgencyService { agencysResultDTO = ConvertUtils.sourceToTarget(entity, AgencysResultDTO.class); agencysResultDTO.setAgencyId(entity.getId()); agencysResultDTO.setAgencyName(entity.getOrganizationName()); + //2021.5.26 sun 添加当前组织对应客户的根组织级别返参 start + if (null != entity) { + if (null == entity.getPids() || "".equals(entity.getPids())) { + agencysResultDTO.setRootlevel(entity.getLevel()); + } else { + String id = Arrays.asList(entity.getPids().split(":")).get(0); + CustomerAgencyEntity rootEntity = customerAgencyDao.selectById(id); + if (null != rootEntity) { + agencysResultDTO.setRootlevel(rootEntity.getLevel()); + } + } + } + //2021.5.26 sun 添加当前组织对应客户的根组织级别返参 end //2:查询本机关的所有上级机关,按自上而下层级顺序 if (null == entity.getPids()) { agencysResultDTO.setParentList(parentList); From 20cc0ad70a0dd13cd746a6c39287cacff0baac7e Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 26 May 2021 14:52:25 +0800 Subject: [PATCH 085/128] =?UTF-8?q?=E4=BA=94=E7=BA=A7=E6=8C=87=E6=A0=87?= =?UTF-8?q?=E6=8A=BD=E5=8F=96=EF=BC=8C=E6=B7=BB=E5=8A=A0monthId=E6=A0=A1?= =?UTF-8?q?=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/dto/extract/form/ExtractIndexFormDTO.java | 7 +++++++ .../dataToIndex/impl/IndexOriginExtractServiceImpl.java | 2 ++ 2 files changed, 9 insertions(+) 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 index c188b64a57..8d948a633e 100644 --- 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 @@ -1,7 +1,9 @@ package com.epmet.dto.extract.form; import lombok.Data; +import org.hibernate.validator.constraints.Length; +import javax.validation.constraints.NotBlank; import java.io.Serializable; /** @@ -13,8 +15,13 @@ public class ExtractIndexFormDTO implements Serializable { private static final long serialVersionUID = 1248641210655148366L; + public interface AddUserInternalGroup { + } + + @NotBlank(message = "customerId不能为空", groups = AddUserInternalGroup.class) private String customerId; + @Length(min = 6, max = 6, message = "monthId不能为空", groups = {AddUserInternalGroup.class}) private String monthId; } 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 index 80e087bc3f..b21eee911b 100644 --- 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 @@ -2,6 +2,7 @@ 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.validator.ValidatorUtils; import com.epmet.dto.extract.form.ExtractIndexFormDTO; import com.epmet.service.evaluationindex.extract.dataToIndex.*; import com.epmet.service.stats.DimCustomerService; @@ -72,6 +73,7 @@ public class IndexOriginExtractServiceImpl implements IndexOriginExtractService ExtractIndexFormDTO param = new ExtractIndexFormDTO(); param.setCustomerId(cId); param.setMonthId(finalMonthId); + ValidatorUtils.validateEntity(param, ExtractIndexFormDTO.AddUserInternalGroup.class); submitJob(param); }); } From 08105949571956a10f84214006daa289868e13c5 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 26 May 2021 15:03:05 +0800 Subject: [PATCH 086/128] =?UTF-8?q?=E6=B2=BB=E7=90=86=E6=8C=87=E6=95=B0?= =?UTF-8?q?=E7=BD=91=E6=A0=BC=E8=A1=A8=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../db/migration/V0.0.15__govern.sql | 79 +++++++++---------- 1 file changed, 39 insertions(+), 40 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.15__govern.sql b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.15__govern.sql index 836d3a3b7a..59975cc83f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.15__govern.sql +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.15__govern.sql @@ -22,7 +22,6 @@ -- -- ---------------------------- -- -- Table structure for fact_agency_govern_daily -- -- ---------------------------- --- DROP TABLE IF EXISTS `fact_agency_govern_daily`; -- CREATE TABLE `fact_agency_govern_daily` ( -- `ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '主键,customer_id+AGENCY_ID+date_id只有一条记录', -- `CUSTOMER_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '客户id', @@ -60,45 +59,45 @@ -- PRIMARY KEY (`ID`) USING BTREE -- ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '组织的治理指数,按天统计' ROW_FORMAT = Dynamic; -- --- -- ---------------------------- --- -- Table structure for fact_grid_govern_daily --- -- ---------------------------- --- DROP TABLE IF EXISTS `fact_grid_govern_daily`; --- CREATE TABLE `fact_grid_govern_daily` ( --- `ID` varchar(64) NOT NULL COMMENT '主键,customer_id+grid_id+date_id只有一条记录', --- `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户id', --- `DATE_ID` varchar(8) NOT NULL COMMENT '数据更新至:yyyyMMdd; ', --- `GRID_ID` varchar(64) NOT NULL COMMENT '网格id', --- `PID` varchar(64) NOT NULL COMMENT '网格所属的组织id', --- `PIDS` varchar(255) NOT NULL COMMENT '网格所有上级id', --- `PROBLEM_RESOLVED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '界面展示:问题解决总数=1+2+3+4+5+6+7+8', --- `GROUP_SELF_GOVERN_RATIO` decimal(10,6) NOT NULL COMMENT '界面展示:党群自治占比=(9+10)/PROBLEM_RESOLVED_COUNT; 此列存储的是小数', --- `GRID_SELF_GOVERN_RATIO` decimal(10,6) NOT NULL COMMENT '界面展示:网格自治占比=GRID_SELF_GOVERN_PROJECT_TOTAL/PROBLEM_RESOLVED_COUNT;此列存储的是小数', --- `TOPIC_RESOLVED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '1、当前网格内,话题关闭已解决数', --- `TOPIC_UN_RESOLVED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '2、当前网格内,话题关闭无需解决数', --- `ISSUE_RESOLVED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '3、当前网格内,议题关闭已解决数', --- `ISSUE_UN_RESOLVED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '4、当前网格内,议题关闭无需解决数', --- `ISSUE_PROJECT_RESOLVED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '5、当前网格内:来源于议题的项目:结案已解决数', --- `ISSUE_PROJECT_UN_RESOLVED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '6、当前网格内:来源于议题的项目:结案无需解决数', --- `APPROVAL_PROJECT_RESOLVED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '7、当前网格内:项目立项,结案已解决数;默认为0,', --- `APPROVAL_PROJECT_UN_RESOLVED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '8、当前网格内:项目立项,结案无需解决数;默认为0,', --- `IN_GROUP_TOPIC_RESOLVED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '9、当前网格内,未出小组即未转议题的:话题关闭已解决数', --- `IN_GROUP_TOPIC_UN_RESOLVED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '10、当前网格内,未出小组即未转议题的:话题关闭无需解决数', --- `FROM_ISSUE_RESOLVED_IN_GRID_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '11、来源于议题的项目,未出网格结案并且已解决的项目数', --- `FROM_ISSUE_UN_RESOLVED_IN_GRID_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '12、来源于议题的项目,未出网格结案并且无需解决的项目数', --- `FROM_AGENCY_RESOLVED_IN_GRID_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '13、来源于项目立项的项目,未出网格结案,并且已解决的项目数;因现在网格不能立项,所以此列默认为0', --- `FROM_AGENCY_UN_RESOLVED_IN_GRID_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '14、来源于项目立项的项目,未出网格结案,并且无需解决的项目数;因现在网格不能立项,所以此列默认为0', --- `GRID_SELF_GOVERN_PROJECT_TOTAL` int(11) NOT NULL COMMENT '15、未出当前网格的,结案项目数=11+12+13+14', --- `DEL_FLAG` varchar(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除、1已删除', --- `REVISION` int(11) NOT NULL DEFAULT '0' COMMENT '乐观锁', --- `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', --- `CREATED_TIME` datetime NOT NULL COMMENT '创建时间:第一次提交审核的时间,注意和历史表的第一条记录时间一致', --- `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', --- `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', --- PRIMARY KEY (`ID`) USING BTREE --- ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='网格的治理指数,按天统计'; --- --- SET FOREIGN_KEY_CHECKS = 1; +CREATE TABLE `fact_grid_govern_daily` ( + `ID` varchar(64) NOT NULL COMMENT '主键,customer_id+grid_id+date_id只有一条记录', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户id', + `DATE_ID` varchar(8) NOT NULL COMMENT '数据更新至:yyyyMMdd; ', + `GRID_ID` varchar(64) NOT NULL COMMENT '网格id', + `PID` varchar(64) NOT NULL COMMENT '网格所属的组织id', + `PIDS` varchar(255) NOT NULL COMMENT '网格所有上级id', + `PROBLEM_RESOLVED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '界面展示:问题解决总数=1+2+3+4+5+6+7+8', + `GROUP_SELF_GOVERN_RATIO` decimal(10,6) NOT NULL COMMENT '界面展示:党群自治占比=(9+10)/PROBLEM_RESOLVED_COUNT; 此列存储的是小数', + `GRID_SELF_GOVERN_RATIO` decimal(10,6) NOT NULL COMMENT '界面展示:网格自治占比=GRID_SELF_GOVERN_PROJECT_TOTAL/PROBLEM_RESOLVED_COUNT;此列存储的是小数', + `COMMUNITY_CLOSED_RATIO` decimal(10,6) NOT NULL COMMENT '界面展示:社区解决占比=COMMUNITY_CLOSED_COUNT/PROBLEM_RESOLVED_COUNT;此列存储的是小数', + `STREET_CLOSED_RATIO` decimal(10,6) NOT NULL COMMENT '界面展示:街道解决占比=STREET_CLOSED_COUNT/PROBLEM_RESOLVED_COUNT;此列存储的是小数', + `DISTRICT_DEPT_CLOSED_RATIO` decimal(10,6) NOT NULL COMMENT '界面展示:区直部门解决占比=DISTRICT_DEPT_CLOSED_COUNT/PROBLEM_RESOLVED_COUNT;此列存储的是小数', + `TOPIC_RESOLVED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '1、当前网格内,话题关闭已解决数', + `TOPIC_UN_RESOLVED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '2、当前网格内,话题关闭无需解决数', + `ISSUE_RESOLVED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '3、当前网格内,议题关闭已解决数', + `ISSUE_UN_RESOLVED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '4、当前网格内,议题关闭无需解决数', + `ISSUE_PROJECT_RESOLVED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '5、当前网格内:来源于议题的项目:结案已解决数', + `ISSUE_PROJECT_UN_RESOLVED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '6、当前网格内:来源于议题的项目:结案无需解决数', + `APPROVAL_PROJECT_RESOLVED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '7、当前网格内:项目立项,结案已解决数;默认为0,', + `APPROVAL_PROJECT_UN_RESOLVED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '8、当前网格内:项目立项,结案无需解决数;默认为0,', + `IN_GROUP_TOPIC_RESOLVED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '9、当前网格内,未出小组即未转议题的:话题关闭已解决数', + `IN_GROUP_TOPIC_UN_RESOLVED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '10、当前网格内,未出小组即未转议题的:话题关闭无需解决数', + `FROM_ISSUE_RESOLVED_IN_GRID_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '11、来源于议题的项目,未出网格结案并且已解决的项目数', + `FROM_ISSUE_UN_RESOLVED_IN_GRID_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '12、来源于议题的项目,未出网格结案并且无需解决的项目数', + `FROM_AGENCY_RESOLVED_IN_GRID_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '13、来源于项目立项的项目,未出网格结案,并且已解决的项目数;因现在网格不能立项,所以此列默认为0', + `FROM_AGENCY_UN_RESOLVED_IN_GRID_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '14、来源于项目立项的项目,未出网格结案,并且无需解决的项目数;因现在网格不能立项,所以此列默认为0', + `GRID_SELF_GOVERN_PROJECT_TOTAL` int(11) NOT NULL COMMENT '15、未出当前网格的,结案项目数=11+12+13+14', + `COMMUNITY_CLOSED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '当前网格内出来的项目:由社区结案(已解决+未解决)的项目总数', + `STREET_CLOSED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '当前网格内出来的项目:由街道结案(已解决+未解决)的项目总数', + `DISTRICT_DEPT_CLOSED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '当前网格内出来的项目:由区直部门(已解决+未解决)结案的项目总数', + `DEL_FLAG` varchar(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除、1已删除', + `REVISION` int(11) NOT NULL DEFAULT '0' COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间:第一次提交审核的时间,注意和历史表的第一条记录时间一致', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='网格的治理指数,按天统计'; # 小组成员添加是否是党员 ALTER TABLE `epmet_data_statistical`.`fact_origin_group_member_daily` From e2898b66cc344252899bebf332445405e60c5687 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Wed, 26 May 2021 15:03:47 +0800 Subject: [PATCH 087/128] =?UTF-8?q?=E7=BD=91=E6=A0=BC=E5=B1=82=E7=BA=A7?= =?UTF-8?q?=E6=B2=BB=E7=90=86=E6=8C=87=E6=95=B0=E5=A2=9E=E5=8A=A0=E8=BF=94?= =?UTF-8?q?=E5=8F=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dataaggre/dto/datastats/result/GridGovrnResultDTO.java | 6 ++++++ .../src/main/resources/mapper/datastats/DatsStatsDao.xml | 5 ++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/GridGovrnResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/GridGovrnResultDTO.java index 9b16f7b014..cd88c5b0e4 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/GridGovrnResultDTO.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/GridGovrnResultDTO.java @@ -25,5 +25,11 @@ public class GridGovrnResultDTO implements Serializable { private BigDecimal groupSelfGovernRatio = bi; //网格自治占比 private BigDecimal gridSelfGovernRatio = bi; + //社区解决占比 + private BigDecimal communityResolvedRatio = bi; + //区直部门解决占比 + private BigDecimal districtDeptResolvedRatio = bi; + //街道解决占比 + private BigDecimal streetResolvedRatio = bi; } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml index 7097ca36c5..6fec43461f 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml @@ -639,7 +639,10 @@ grid_id AS gridId, problem_resolved_count AS problemResolvedCount, ROUND(group_self_govern_ratio, 3) AS groupSelfGovernRatio, - ROUND(grid_self_govern_ratio, 3) AS gridSelfGovernRatio + ROUND(grid_self_govern_ratio, 3) AS gridSelfGovernRatio, + ROUND(community_closed_ratio, 3) AS communityResolvedRatio, + ROUND(street_closed_ratio, 3) AS streetResolvedRatio, + ROUND(district_dept_closed_ratio, 3) AS districtDeptResolvedRatio FROM fact_grid_govern_daily WHERE From 5045c664b25955f22e205baa8bf4d681aee35745 Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Wed, 26 May 2021 17:47:00 +0800 Subject: [PATCH 088/128] =?UTF-8?q?=E5=9F=BA=E5=B1=82=E6=B2=BB=E7=90=86-?= =?UTF-8?q?=E7=BB=84=E7=BB=87=E7=9A=84=E6=B2=BB=E7=90=86=E6=8C=87=E6=95=B0?= =?UTF-8?q?=EF=BC=8C=E6=8C=89=E5=A4=A9=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../result/OrgStatisticsResultDTO.java | 1 + .../extract/FactOriginIssueMainDailyDao.java | 11 ++++++++ .../FactOriginProjectMainDailyDao.java | 12 +++++++++ .../extract/FactOriginTopicMainDailyDao.java | 14 ++++++++++ .../todata/FactAgencyGovernDailyService.java | 25 +++++++---------- .../FactOriginIssueMainDailyService.java | 11 ++++++++ .../FactOriginProjectMainDailyService.java | 12 +++++++++ .../FactOriginTopicMainDailyService.java | 14 ++++++++++ .../FactAgencyGovernDailyServiceImpl.java | 27 +++++++++++++++++++ .../FactOriginIssueMainDailyServiceImpl.java | 19 +++++++++++++ ...FactOriginProjectMainDailyServiceImpl.java | 20 ++++++++++++++ .../FactOriginTopicMainDailyServiceImpl.java | 21 +++++++++++++++ .../extract/FactOriginIssueMainDailyDao.xml | 15 +++++++++++ .../extract/FactOriginProjectMainDailyDao.xml | 16 +++++++++++ .../extract/FactOriginTopicMainDailyDao.xml | 16 +++++++++++ .../mapper/project/ProjectProcessDao.xml | 27 ++++++++----------- 16 files changed, 230 insertions(+), 31 deletions(-) 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 index d7fca3b15d..f57927f65d 100644 --- 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 @@ -15,6 +15,7 @@ public class OrgStatisticsResultDTO implements Serializable { private static final long serialVersionUID = 9221060553279124719L; private String customerId; private String agencyId; + private String level; private String orgId; private Integer count; private Integer sum; 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 ee2e78aaa3..ba3ddbce69 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 @@ -227,6 +227,17 @@ public interface FactOriginIssueMainDailyDao extends BaseDao selectPartyMemberIssueStaticByGrid(@Param("customerId") String customerId, @Param("dateId") String dateId); + /** + * 获取组织关闭议题数 + * @author zhaoqifeng + * @date 2021/5/25 17:18 + * @param customerId + * @param dateId + * @param closedStatus + * @return java.util.List + */ + List selectAgencyClosedIssueCount(@Param("customerId") String customerId, @Param("dateId") String dateId, @Param("closedStatus") String closedStatus); + /** * 3、当前网格内,议题关闭已解决数 * 4、当前网格内,议题关闭无需解决数 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 0403e29bc2..d5042bbb7b 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 @@ -465,4 +465,16 @@ public interface FactOriginProjectMainDailyDao extends BaseDao + */ + List selectAgencyClosedProjectCount(@Param("customerId") String customerId, @Param("dateId") String dateId, @Param( + "closedStatus") String closedStatus, @Param("origin") String origin); } 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 96ecdef6c6..eb9339e5eb 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 @@ -177,4 +177,18 @@ public interface FactOriginTopicMainDailyDao extends BaseDao + */ + List selectAgencyClosedTopicCount(@Param("customerId") String customerId, @Param("dateId") String dateId, + @Param("closedStatus") String closedStatus, @Param("shiftIssue") Integer shiftIssue); + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactAgencyGovernDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactAgencyGovernDailyService.java index 2c0050903c..0504164079 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactAgencyGovernDailyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactAgencyGovernDailyService.java @@ -27,20 +27,15 @@ import com.epmet.entity.evaluationindex.extract.FactAgencyGovernDailyEntity; * @since v1.0.0 2021-05-24 */ public interface FactAgencyGovernDailyService extends BaseService { - // 问题解决总数:当前组织下,话题关闭(已解决+无需解决)总数、议题关闭(已解决+无需解决)总数和项目结案(议题转为项目的结案数+项目立项结案数)总数之和 - // 党群自治占比:当前组织下,所有小组内关闭(已解决+无需解决)的话题数与问题解决总数之比(未出小组:未转议题的) - // 网格自治占比:当前组织下,所有网格内结案项目数与问题解决总数之比(未出网格) - // 参考:fact_index_govrn_ablity_grid_monthly的SELF_SOLVE_PROJECT_COUNT计算 - // 社区解决占比:当前组织下,由社区结案的项目数与问题解决总数之比 - // 区直部门解决占比:当前组织下,由区级部门结案的项目数与问题解决总数之比 - // 街道解决占比:当前组织下,由街道结案的项目数与问题解决总数之比 - // 自下而上的项目解决:结案时操作人所代表的的处理部门(可以是网格、街道、组织) - // 自上而下的项目解决:向下吹哨,谁立项谁解决(后期在讨论哪样更合理) - // - // 究竟是谁解决!!: - // A社区→A街道→B社区(结案)——A街道解决(自下而上吹(饱含立项往上吹/从话题来的项目),看往上吹的最高层级) - // A社区→B社区→C社区(结案)——C社区解决(平级协助解决,看最后结案) - // A街道→A社区→B社区(结案)——A街道解决(自上而下吹,谁立项谁解决) - // 注:A社区→A街道→(退回)A社区→B社区(结案),A街道不算处理项目,仍是平级协助解决,看最后谁结案 + + /** + * 治理指数-组织相关 + * @author zhaoqifeng + * @date 2021/5/25 14:10 + * @param customerId + * @param dateId + * @return void + */ + void extractFactAgencyGovernDaily(String customerId, String dateId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginIssueMainDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginIssueMainDailyService.java index 648891b0cc..cf25f79ebb 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginIssueMainDailyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginIssueMainDailyService.java @@ -136,4 +136,15 @@ public interface FactOriginIssueMainDailyService extends BaseService queryGridIssueValue(String customerId, List gridIds, String issueStatus, String resolveType); + + /** + * 获取组织关闭议题数 + * @author zhaoqifeng + * @date 2021/5/25 17:09 + * @param customerId + * @param dateId + * @param closedStatus + * @return java.util.Map + */ + Map getAgencyClosedIssueCount(String customerId, String dateId, String closedStatus); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java index 215aa74756..9445559627 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java @@ -436,4 +436,16 @@ public interface FactOriginProjectMainDailyService extends BaseService queryGridProjectValue(String customerId, List gridIds, String projectStatus, String origin, String isResolved); + + /** + * 获取组织关闭项目数 + * @author zhaoqifeng + * @date 2021/5/26 15:09 + * @param customerId + * @param dateId + * @param closedStatus + * @param origin + * @return java.util.Map + */ + Map getAgencyClosedProjectCount(String customerId, String dateId, String closedStatus, String origin); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginTopicMainDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginTopicMainDailyService.java index 2cae521855..7486daa191 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginTopicMainDailyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginTopicMainDailyService.java @@ -138,4 +138,18 @@ public interface FactOriginTopicMainDailyService extends BaseService queryGridTopicValue(String customerId, List gridIds, String topicStatus, String closedStatus, String shiftIssue); + + + /** + * 获取组织已关闭话题数 + * @author zhaoqifeng + * @date 2021/5/25 15:02 + * @param customerId + * @param dateId + * @param closedStatus + * @param shiftIssue + * @return java.util.List + */ + Map getAgencyClosedTopicCount(String customerId, String dateId, String closedStatus, Integer shiftIssue); + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactAgencyGovernDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactAgencyGovernDailyServiceImpl.java index e40ffd49bd..5603dfde68 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactAgencyGovernDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactAgencyGovernDailyServiceImpl.java @@ -33,5 +33,32 @@ import org.springframework.stereotype.Service; public class FactAgencyGovernDailyServiceImpl extends BaseServiceImpl implements FactAgencyGovernDailyService { + /** + * 治理指数-组织相关 + * + * @param customerId + * @param dateId + * @return void + * @author zhaoqifeng + * @date 2021/5/25 14:10 + */ + @Override + public void extractFactAgencyGovernDaily(String customerId, String dateId) { + // 问题解决总数:当前组织下,话题关闭(已解决+无需解决)总数、议题关闭(已解决+无需解决)总数和项目结案(议题转为项目的结案数+项目立项结案数)总数之和 + // 党群自治占比:当前组织下,所有小组内关闭(已解决+无需解决)的话题数与问题解决总数之比(未出小组:未转议题的) + // 网格自治占比:当前组织下,所有网格内结案项目数与问题解决总数之比(未出网格) + // 参考:fact_index_govrn_ablity_grid_monthly的SELF_SOLVE_PROJECT_COUNT计算 + // 社区解决占比:当前组织下,由社区结案的项目数与问题解决总数之比 + // 区直部门解决占比:当前组织下,由区级部门结案的项目数与问题解决总数之比 + // 街道解决占比:当前组织下,由街道结案的项目数与问题解决总数之比 + // 自下而上的项目解决:结案时操作人所代表的的处理部门(可以是网格、街道、组织) + // 自上而下的项目解决:向下吹哨,谁立项谁解决(后期在讨论哪样更合理) + // + // 究竟是谁解决!!: + // A社区→A街道→B社区(结案)——A街道解决(自下而上吹(饱含立项往上吹/从话题来的项目),看往上吹的最高层级) + // A社区→B社区→C社区(结案)——C社区解决(平级协助解决,看最后结案) + // A街道→A社区→B社区(结案)——A街道解决(自上而下吹,谁立项谁解决) + // 注:A社区→A街道→(退回)A社区→B社区(结案),A街道不算处理项目,仍是平级协助解决,看最后谁结案 + } } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginIssueMainDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginIssueMainDailyServiceImpl.java index 09a040e630..c9db796c53 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginIssueMainDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginIssueMainDailyServiceImpl.java @@ -186,4 +186,23 @@ public class FactOriginIssueMainDailyServiceImpl extends BaseServiceImpl queryGridIssueValue(String customerId, List gridIds, String issueStatus, String resolveType) { return baseDao.selectGroupByGridId(customerId,gridIds,issueStatus,resolveType); } + + /** + * 获取组织关闭议题数 + * + * @param customerId + * @param dateId + * @param closedStatus + * @return java.util.Map + * @author zhaoqifeng + * @date 2021/5/25 17:09 + */ + @Override + public Map getAgencyClosedIssueCount(String customerId, String dateId, String closedStatus) { + List list = baseDao.selectAgencyClosedIssueCount(customerId, dateId, closedStatus); + if (CollectionUtils.isEmpty(list)) { + return Collections.emptyMap(); + } + return list.stream().collect(Collectors.toMap(OrgStatisticsResultDTO::getAgencyId, Function.identity())); + } } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java index 58d625f999..e31ea6fbaf 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java @@ -658,5 +658,25 @@ public class FactOriginProjectMainDailyServiceImpl extends BaseServiceImpl + * @author zhaoqifeng + * @date 2021/5/26 15:09 + */ + @Override + public Map getAgencyClosedProjectCount(String customerId, String dateId, String closedStatus, String origin) { + List list = baseDao.selectAgencyClosedProjectCount(customerId, dateId, closedStatus, origin); + if (CollectionUtils.isEmpty(list)) { + return Collections.emptyMap(); + } + return list.stream().collect(Collectors.toMap(OrgStatisticsResultDTO::getAgencyId, Function.identity())); + } + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginTopicMainDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginTopicMainDailyServiceImpl.java index 39eeffea2c..d535012b15 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginTopicMainDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginTopicMainDailyServiceImpl.java @@ -377,4 +377,25 @@ public class FactOriginTopicMainDailyServiceImpl extends BaseServiceImpl queryGridTopicValue(String customerId, List gridIds, String topicStatus, String closedStatus, String shiftIssue) { return baseDao.selectTopicGroupByGridId(customerId,gridIds,topicStatus,closedStatus,shiftIssue); } + /** + * 获取组织已关闭话题数 + * + * @param customerId + * @param dateId + * @param closedStatus + * @param shiftIssue + * @return java.util.List + * @author zhaoqifeng + * @date 2021/5/25 15:02 + */ + @Override + public Map getAgencyClosedTopicCount(String customerId, String dateId, String closedStatus, Integer shiftIssue) { + List list = baseDao.selectAgencyClosedTopicCount(customerId, dateId, closedStatus,shiftIssue); + if (CollectionUtils.isEmpty(list)) { + return Collections.emptyMap(); + } + return list.stream().collect(Collectors.toMap(OrgStatisticsResultDTO::getAgencyId, Function.identity())); + } + + } \ 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 e6c00c33af..12da80a473 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 @@ -343,4 +343,19 @@ m.CUSTOMER_ID, m.GRID_ID + \ 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 c76cfb8128..f17dc573ef 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 @@ -947,4 +947,20 @@ m.CUSTOMER_ID, m.GRID_ID + 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 49b0c96151..9ad06cd4b5 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 @@ -228,4 +228,20 @@ GROUP BY m.CUSTOMER_ID,m.GRID_ID + \ No newline at end of file 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 e9079abc3b..3d4c8a5c8b 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 @@ -238,23 +238,18 @@ FROM ( SELECT - ps.PROJECT_ID, - ps.ORG_ID_PATH, - ps.GRID_ID, - ps.DEPARTMENT_ID - FROM - project_process pp - INNER JOIN project_staff ps ON pp.STAFF_ID = ps.STAFF_ID - AND pp.DEPARTMENT_NAME = ps.DEPARTMENT_NAME - AND pp.PROJECT_ID = ps.PROJECT_ID - AND ps.IS_HANDLE = 'handle' - AND pp.CREATED_TIME = ps.UPDATED_TIME - AND ps.CUSTOMER_ID = #{customerId} + PROJECT_ID, + ORG_ID_PATH, + GRID_ID, + DEPARTMENT_ID + FROM + project_process WHERE - pp.OPERATION = 'close' - - AND DATE_FORMAT(pp.CREATED_TIME , '%Y%m%d') = #{date} - + OPERATION = 'close' + AND CUSTOMER_ID = #{customerId} + + AND DATE_FORMAT(CREATED_TIME , '%Y%m%d') = #{date} + ) a LEFT JOIN ( From 513dd6fdef2b53faa02e3cad74aa9b307a6f2e3a Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 26 May 2021 21:47:30 +0800 Subject: [PATCH 089/128] =?UTF-8?q?=E6=9A=82=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../extract/FactGridGovernDailyEntity.java | 41 +++++++++++- .../GovernGridClosedTotalCommonDTO.java | 64 +++++++++++++++++++ .../extract/ProjectInfoDTO.java | 15 +++++ .../impl/FactGridGovernDailyServiceImpl.java | 55 ++++++++++++++-- 4 files changed, 169 insertions(+), 6 deletions(-) create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/GovernGridClosedTotalCommonDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/ProjectInfoDTO.java diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactGridGovernDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactGridGovernDailyEntity.java index ae45d7aa7d..22fa2b2b67 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactGridGovernDailyEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactGridGovernDailyEntity.java @@ -79,7 +79,22 @@ public class FactGridGovernDailyEntity extends BaseEpmetEntity { */ private BigDecimal gridSelfGovernRatio; - /** + /** + * 界面展示:社区解决占比=COMMUNITY_CLOSED_COUNT/PROBLEM_RESOLVED_COUNT;此列存储的是小数 + */ + private BigDecimal communityClosedRatio; + + /** + * 界面展示:街道解决占比=STREET_CLOSED_COUNT/PROBLEM_RESOLVED_COUNT;此列存储的是小数 + */ + private BigDecimal streetClosedRatio; + + /** + * 界面展示:区直部门解决占比=DISTRICT_DEPT_CLOSED_COUNT/PROBLEM_RESOLVED_COUNT;此列存储的是小数 + */ + private BigDecimal districtDeptClosedRatio; + + /** * 1、当前网格内,话题关闭已解决数 */ private Integer topicResolvedCount; @@ -155,15 +170,36 @@ public class FactGridGovernDailyEntity extends BaseEpmetEntity { private Integer gridSelfGovernProjectTotal; + /** + * 当前网格内出来的项目:由社区结案(已解决+未解决)的项目总数 + */ + private Integer communityClosedCount; + + /** + * 当前网格内出来的项目:由街道结案(已解决+未解决)的项目总数 + */ + private Integer streetClosedCount; + + /** + * 当前网格内出来的项目:由街道结案(已解决+未解决)的项目总数 + */ + private Integer districtDeptClosedCount; + + public FactGridGovernDailyEntity() { this.customerId = StrConstant.EPMETY_STR; this.dateId = StrConstant.EPMETY_STR; this.gridId = StrConstant.EPMETY_STR; this.pid = StrConstant.EPMETY_STR; this.pids = StrConstant.EPMETY_STR; + //界面展示 this.problemResolvedCount = NumConstant.ZERO; this.groupSelfGovernRatio=BigDecimal.ZERO; this.gridSelfGovernProjectTotal=NumConstant.ZERO; + this.communityClosedRatio=BigDecimal.ZERO; + this.streetClosedRatio=BigDecimal.ZERO; + this.districtDeptClosedRatio=BigDecimal.ZERO; + this.topicResolvedCount=NumConstant.ZERO; this.topicUnResolvedCount=NumConstant.ZERO; this.issueResolvedCount=NumConstant.ZERO; @@ -179,5 +215,8 @@ public class FactGridGovernDailyEntity extends BaseEpmetEntity { this.fromAgencyResolvedInGridCount=NumConstant.ZERO; this.fromAgencyUnResolvedInGridCount=NumConstant.ZERO; this.gridSelfGovernProjectTotal=NumConstant.ZERO; + this.communityClosedCount=NumConstant.ZERO; + this.streetClosedCount=NumConstant.ZERO; + this.districtDeptClosedCount=NumConstant.ZERO; } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/GovernGridClosedTotalCommonDTO.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/GovernGridClosedTotalCommonDTO.java new file mode 100644 index 0000000000..fcc4193885 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/GovernGridClosedTotalCommonDTO.java @@ -0,0 +1,64 @@ +package com.epmet.entity.evaluationindex.extract; + +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.constant.StrConstant; +import lombok.Data; + +import java.io.Serializable; + +/** + * 描述一下 + * + * @author yinzuomei@elink-cn.com + * @date 2021/5/26 15:47 + */ +@Data +public class GovernGridClosedTotalCommonDTO implements Serializable { + private static final long serialVersionUID = 7717094992132062415L; + private String gridId; + /** + * 11、来源于议题的项目,未出网格结案并且已解决的项目数 + */ + private Integer fromIssueResolvedInGridCount; + + /** + * 12、来源于议题的项目,未出网格结案并且无需解决的项目数 + */ + private Integer fromIssueUnResolvedInGridCount; + + /** + * 13、来源于项目立项的项目,未出网格结案,并且已解决的项目数;因现在网格不能立项,所以此列默认为0 + */ + private Integer fromAgencyResolvedInGridCount; + + /** + * 14、来源于项目立项的项目,未出网格结案,并且无需解决的项目数;因现在网格不能立项,所以此列默认为0 + */ + private Integer fromAgencyUnResolvedInGridCount; + + /** + * 当前网格内出来的项目:由社区结案(已解决+未解决)的项目总数 + */ + private Integer communityClosedCount; + + /** + * 当前网格内出来的项目:由街道结案(已解决+未解决)的项目总数 + */ + private Integer streetClosedCount; + + /** + * 当前网格内出来的项目:由街道结案(已解决+未解决)的项目总数 + */ + private Integer districtDeptClosedCount; + + public GovernGridClosedTotalCommonDTO(){ + this.gridId = StrConstant.EPMETY_STR; + this.fromIssueResolvedInGridCount=NumConstant.ZERO; + this.fromIssueUnResolvedInGridCount=NumConstant.ZERO; + this.fromAgencyResolvedInGridCount=NumConstant.ZERO; + this.fromAgencyUnResolvedInGridCount=NumConstant.ZERO; + this.communityClosedCount=NumConstant.ZERO; + this.streetClosedCount=NumConstant.ZERO; + this.districtDeptClosedCount=NumConstant.ZERO; + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/ProjectInfoDTO.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/ProjectInfoDTO.java new file mode 100644 index 0000000000..0b1eb1af59 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/ProjectInfoDTO.java @@ -0,0 +1,15 @@ +package com.epmet.entity.evaluationindex.extract; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 描述一下 + * + * @author yinzuomei@elink-cn.com + * @date 2021/5/26 18:00 + */ +@Data +public class ProjectInfoDTO implements Serializable { +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactGridGovernDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactGridGovernDailyServiceImpl.java index 4f5483e7b4..84c4addeea 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactGridGovernDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactGridGovernDailyServiceImpl.java @@ -24,6 +24,7 @@ import com.epmet.constant.ProjectConstant; import com.epmet.dao.evaluationindex.extract.FactGridGovernDailyDao; import com.epmet.dto.org.GridInfoDTO; import com.epmet.entity.evaluationindex.extract.FactGridGovernDailyEntity; +import com.epmet.entity.evaluationindex.extract.GovernGridClosedTotalCommonDTO; import com.epmet.entity.evaluationindex.extract.GovernGridTotalCommonDTO; import com.epmet.service.evaluationindex.extract.todata.FactGridGovernDailyService; import com.epmet.service.evaluationindex.extract.todata.FactOriginIssueMainDailyService; @@ -42,6 +43,7 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.stream.Collectors; /** * 网格的治理指数,按天统计 @@ -86,6 +88,7 @@ public class FactGridGovernDailyServiceImpl extends BaseServiceImpl gridIds=gridInfoDTOList.stream().map(GridInfoDTO::getGridId).collect(Collectors.toList()); List insertEntityList=this.constructFactGridGovernDailyEntityList(customerId,dateId,gridInfoDTOList); // log.info(JSON.toJSONString(insertEntityList,true)); @@ -102,7 +105,7 @@ public class FactGridGovernDailyServiceImpl extends BaseServiceImpl approvalProjectUnResolvedMap=getGridProjectMap(customerId,null,ProjectConstant.CLOSED,ProjectConstant.PROJECT_ORIGIN_AGENCY,DimObjectStatusConstant.UNRESOLVED); Map inGroupTopicResolvedMap=getTopicMap(customerId, null,ProjectConstant.CLOSED, DimObjectStatusConstant.RESOLVED,NumConstant.ONE_STR); Map inGroupTopicUnResolvedMap=getTopicMap(customerId, null,ProjectConstant.CLOSED, DimObjectStatusConstant.UNRESOLVED,NumConstant.ONE_STR); - + Map dtoMap=getGovernGridClosedTotalCommonDTOMap(customerId,gridIds); for(FactGridGovernDailyEntity insertEntity:insertEntityList){ //1、当前网格内,话题关闭已解决数 @@ -154,18 +157,24 @@ public class FactGridGovernDailyServiceImpl extends BaseServiceImpl getGovernGridClosedTotalCommonDTOMap(String customerId, List gridIds) { + Map resultMap=new HashMap<>(); + for(String gridId:gridIds){ + + } + return resultMap; + } + /** * 构造要插入的数据,每个网格一天一条数据,初始赋值0 * From 4fddf998fb6f5327a70841051240121f43a46dad Mon Sep 17 00:00:00 2001 From: jianjun Date: Thu, 27 May 2021 09:23:49 +0800 Subject: [PATCH 090/128] =?UTF-8?q?=E5=BE=97=E5=88=86=E8=AF=B4=E6=98=8E=20?= =?UTF-8?q?=E4=BF=9D=E7=95=99=E5=88=86=E6=95=B0=E4=BF=9D=E7=95=99=E4=B8=80?= =?UTF-8?q?=E4=BD=8D=E5=B0=8F=E6=95=B0=EF=BC=8C=E6=9D=83=E9=87=8D=E4=BF=9D?= =?UTF-8?q?=E7=95=99=E6=95=B4=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../evaluationindex/index/impl/IndexExplainServiceImpl.java | 2 +- .../resources/mapper/fact/FactIndexAgencySubScoreDao.xml | 2 +- .../resources/mapper/fact/FactIndexCommunitySubScoreDao.xml | 2 +- .../main/resources/mapper/fact/FactIndexCpcSubScoreDao.xml | 5 +++-- .../main/resources/mapper/fact/FactIndexDeptSubScoreDao.xml | 3 ++- .../main/resources/mapper/fact/FactIndexGridSubScoreDao.xml | 2 +- 6 files changed, 9 insertions(+), 7 deletions(-) diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/index/impl/IndexExplainServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/index/impl/IndexExplainServiceImpl.java index a08c32bc6e..5c8ceaf757 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/index/impl/IndexExplainServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/index/impl/IndexExplainServiceImpl.java @@ -214,7 +214,7 @@ public class IndexExplainServiceImpl implements IndexExplainService { if (StringUtils.isNotBlank(score.getQuantity())) { tb.setQuantity(score.getQuantity()); } - tb.setWeight(score.getWeight().multiply(new BigDecimal(NumConstant.ONE_HUNDRED)).setScale(NumConstant.TWO, BigDecimal.ROUND_HALF_UP) + "%"); + tb.setWeight(score.getWeight().multiply(new BigDecimal(NumConstant.ONE_HUNDRED)) + "%"); } } } diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexAgencySubScoreDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexAgencySubScoreDao.xml index 954ce4c772..d1b1dafeea 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexAgencySubScoreDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexAgencySubScoreDao.xml @@ -45,7 +45,7 @@ SELECT fact.index_code, IF(fact.origin_value='',0,IFNULL(fact.origin_value,0)) AS origin_value, - round(fact.score,2) AS score, + round(fact.score,1) AS score, round(fact.WEIGHT,2) AS weight FROM fact_index_agency_sub_score fact diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCommunitySubScoreDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCommunitySubScoreDao.xml index 01b7bedf74..784ab0ccc7 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCommunitySubScoreDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCommunitySubScoreDao.xml @@ -46,7 +46,7 @@ fact.index_code, IF(fact.origin_value='',0,IFNULL(fact.origin_value,0)) AS origin_value, IF(fact.SAMPLE_COUNT='',0,IFNULL(fact.SAMPLE_COUNT,0)) AS quantity, - round(fact.score,2) AS score, + round(fact.score,1) AS score, round(fact.WEIGHT,2) AS weight FROM fact_index_community_sub_score fact diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCpcSubScoreDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCpcSubScoreDao.xml index acf9b5a874..84ea0eca60 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCpcSubScoreDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCpcSubScoreDao.xml @@ -30,8 +30,9 @@ SELECT id, customer_id, agency_id, grid_id, year_id, month_id, user_id, COUNT(*) quantity, - ROUND(AVG(score),2) score, - index_code, all_parent_index_code, weight + ROUND(AVG(score),1) score, + index_code, all_parent_index_code, + ROUND(weight,2) weight FROM fact_index_cpc_sub_score WHERE ALL_PARENT_INDEX_CODE = #{allParentIndexCode} AND CUSTOMER_ID = #{customerId} diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexDeptSubScoreDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexDeptSubScoreDao.xml index af7d01495b..45cb19fced 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexDeptSubScoreDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexDeptSubScoreDao.xml @@ -11,7 +11,8 @@ origin_value, index_code, all_parent_index_code, weight, COUNT(*) quantity, - ROUND(AVG(score),2) score + ROUND(AVG(score),1) score, + round(weight,2) AS weight FROM fact_index_dept_sub_score WHERE ALL_PARENT_INDEX_CODE = #{allParentIndexCode} diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexGridSubScoreDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexGridSubScoreDao.xml index e7b23aebcc..5bbc687e50 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexGridSubScoreDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexGridSubScoreDao.xml @@ -45,7 +45,7 @@ SELECT fact.index_code, IF(fact.origin_value='',0,IFNULL(fact.origin_value,0)) AS origin_value, - round(fact.score,2) AS score, + round(fact.score,1) AS score, round(fact.WEIGHT,2) AS weight FROM fact_index_grid_sub_score fact From 66ccfbc41fa147654da482fe51018e23771cf9f2 Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Thu, 27 May 2021 09:29:44 +0800 Subject: [PATCH 091/128] =?UTF-8?q?=E5=9F=BA=E5=B1=82=E6=B2=BB=E7=90=86-?= =?UTF-8?q?=E7=BB=84=E7=BB=87=E7=9A=84=E6=B2=BB=E7=90=86=E6=8C=87=E6=95=B0?= =?UTF-8?q?=EF=BC=8C=E6=8C=89=E5=A4=A9=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../extract/todata/impl/ProjectExtractServiceImpl.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/ProjectExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/ProjectExtractServiceImpl.java index 77b4d843b8..68c621094a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/ProjectExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/ProjectExtractServiceImpl.java @@ -215,6 +215,12 @@ public class ProjectExtractServiceImpl implements ProjectExtractService { if (!list.isEmpty()) { factOriginProjectMainDailyService.insertBatch(list); } + + //满意度 + List satisfaction = projectService.getProjectSatisfaction(customerId); + if (CollectionUtils.isNotEmpty(satisfaction)) { + factOriginProjectMainDailyService.updateBatchById(satisfaction); + } } final List mainList = list; List logList = new ArrayList<>(); From ea6d23f43d20fdc02810786c2205300c354282aa Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Thu, 27 May 2021 10:03:17 +0800 Subject: [PATCH 092/128] =?UTF-8?q?=E7=BB=93=E6=A1=88=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E6=BB=A1=E6=84=8F=E5=BA=A6=E6=8A=BD=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../todata/impl/ProjectExtractServiceImpl.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/ProjectExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/ProjectExtractServiceImpl.java index 68c621094a..0ec9de39bb 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/ProjectExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/ProjectExtractServiceImpl.java @@ -216,12 +216,14 @@ public class ProjectExtractServiceImpl implements ProjectExtractService { factOriginProjectMainDailyService.insertBatch(list); } - //满意度 - List satisfaction = projectService.getProjectSatisfaction(customerId); - if (CollectionUtils.isNotEmpty(satisfaction)) { - factOriginProjectMainDailyService.updateBatchById(satisfaction); - } } + + //满意度 + List satisfaction = projectService.getProjectSatisfaction(customerId); + if (CollectionUtils.isNotEmpty(satisfaction)) { + factOriginProjectMainDailyService.updateBatchById(satisfaction); + } + final List mainList = list; List logList = new ArrayList<>(); //节点发起人 部门流转退回结案 From c14e069f774fabeca0f7b15c8b194d1687b2d4d5 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Thu, 27 May 2021 10:09:23 +0800 Subject: [PATCH 093/128] =?UTF-8?q?=E5=B1=85=E6=B0=91=E7=AB=AF=E4=B8=AA?= =?UTF-8?q?=E4=BA=BA=E4=B8=AD=E5=BF=83=E4=BF=AE=E6=94=B9=E6=89=8B=E6=9C=BA?= =?UTF-8?q?=E5=8F=B7=E6=93=8D=E4=BD=9C=E5=BF=85=E9=A1=BB=E6=98=AF=E5=B1=85?= =?UTF-8?q?=E6=B0=91=E6=89=8D=E5=8F=AF=E4=BB=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/service/impl/UserResiInfoServiceImpl.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserResiInfoServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserResiInfoServiceImpl.java index 4221d063f9..af8191b9a2 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserResiInfoServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserResiInfoServiceImpl.java @@ -428,6 +428,9 @@ public class UserResiInfoServiceImpl extends BaseServiceImpl Date: Thu, 27 May 2021 10:59:38 +0800 Subject: [PATCH 094/128] =?UTF-8?q?=E5=BE=97=E5=88=86=E8=AF=B4=E6=98=8E=20?= =?UTF-8?q?=E4=BF=9D=E7=95=99=E5=88=86=E6=95=B0=E4=BF=9D=E7=95=99=E4=B8=80?= =?UTF-8?q?=E4=BD=8D=E5=B0=8F=E6=95=B0=EF=BC=8C=E6=9D=83=E9=87=8D=E4=BF=9D?= =?UTF-8?q?=E7=95=99=E6=95=B4=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../index/result/IndexScoreDetailResult.java | 6 ++- .../index/result/IndexScoreResult.java | 8 +++- .../index/impl/IndexExplainServiceImpl.java | 45 ++++++++++++++----- .../fact/impl/FactIndexServiceImpl.java | 5 +++ .../fact/FactIndexAgencySubScoreDao.xml | 5 ++- .../mapper/fact/FactIndexCpcSubScoreDao.xml | 2 +- .../mapper/fact/FactIndexDeptSubScoreDao.xml | 2 +- 7 files changed, 56 insertions(+), 17 deletions(-) diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/result/IndexScoreDetailResult.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/result/IndexScoreDetailResult.java index 8b30af940f..cdec4cc3e9 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/result/IndexScoreDetailResult.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/result/IndexScoreDetailResult.java @@ -1,5 +1,6 @@ package com.epmet.evaluationindex.index.result; +import com.fasterxml.jackson.annotation.JsonIgnore; import lombok.Data; import java.io.Serializable; @@ -40,9 +41,10 @@ public class IndexScoreDetailResult implements Serializable { private String weight; /** - * 数量 + * 类型 取原始值 还是数量 */ - private String quantity; + @JsonIgnore + private String type; diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/result/IndexScoreResult.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/result/IndexScoreResult.java index c817b5de55..d6ca46a913 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/result/IndexScoreResult.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/result/IndexScoreResult.java @@ -32,9 +32,15 @@ public class IndexScoreResult implements Serializable { * 原始值 */ private String originValue; + /** * 数量 */ - private String quantity; + private String sampleCount; + + /** + * 值类型 + */ + private String valueType; } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/index/impl/IndexExplainServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/index/impl/IndexExplainServiceImpl.java index 5c8ceaf757..77252eb6ad 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/index/impl/IndexExplainServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/index/impl/IndexExplainServiceImpl.java @@ -22,6 +22,7 @@ import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.enums.OrgLevelEnum; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.constant.DataSourceConstant; +import com.epmet.datareport.constant.FactConstant; import com.epmet.datareport.constant.IndexConstant; import com.epmet.datareport.dao.evaluationindex.index.IndexExplainDao; import com.epmet.datareport.dao.evaluationindex.index.IndexGroupDetailDao; @@ -184,10 +185,10 @@ public class IndexExplainServiceImpl implements IndexExplainService { break; default: - log.error("暂不支持更高级别的查询,level:{}",orgLevel); + log.error("暂不支持更高级别的查询,level:{}", orgLevel); } - setRealValue(result.getTableDataList(), realScoreList); + setRealValue(result.getTableDataList(), realScoreList, tableHeaders); } } @@ -196,11 +197,12 @@ public class IndexExplainServiceImpl implements IndexExplainService { * * @param tableList * @param scoreList + * @param tableHeaders * @return void * @author LiuJanJun * @date 2021/5/19 2:07 下午 */ - private void setRealValue(List tableList, List scoreList) { + private void setRealValue(List tableList, List scoreList, List tableHeaders) { if (CollectionUtils.isEmpty(tableList) || CollectionUtils.isEmpty(scoreList)) { return; } @@ -209,19 +211,37 @@ public class IndexExplainServiceImpl implements IndexExplainService { if (!tb.getIndexCode().equals(score.getIndexCode())) { continue; } - tb.setOriginValue(score.getOriginValue()); tb.setScore(String.valueOf(score.getScore())); - if (StringUtils.isNotBlank(score.getQuantity())) { - tb.setQuantity(score.getQuantity()); + tb.setWeight(score.getWeight().multiply(new BigDecimal(NumConstant.ONE_HUNDRED)).setScale(0, BigDecimal.ROUND_HALF_UP) + "%"); + if (tableHeaders.contains("平均值")) { + if (StringUtils.isNotBlank(score.getSampleCount())) { + tb.setOriginValue(score.getSampleCount()); + } + } else { + tb.setOriginValue(score.getOriginValue()); + } + + + //小数类型,四舍五入保留小数点后一位 + if (FactConstant.INTEGER.equals(score.getValueType())) { + BigDecimal num = new BigDecimal(tb.getOriginValue()).setScale(0, BigDecimal.ROUND_HALF_UP); + tb.setOriginValue(num.toString()); + } + if (FactConstant.DECIMAL.equals(score.getValueType())) { + BigDecimal num = new BigDecimal(tb.getOriginValue()).setScale(1, BigDecimal.ROUND_HALF_UP); + tb.setOriginValue(num.toString()); + } + //百分数类型,四舍五入保留小数点后一位并转成百分比 + if (FactConstant.PERCENT.equals(score.getValueType())) { + BigDecimal num = new BigDecimal(tb.getOriginValue()).setScale(1, BigDecimal.ROUND_HALF_UP); + tb.setOriginValue(num + "%"); } - tb.setWeight(score.getWeight().multiply(new BigDecimal(NumConstant.ONE_HUNDRED)) + "%"); } } } private List setDefaultTableData(String orgLevel, String type, Map> detailEntityMap, IndexExplainResult result, String allIndexCodePath, List indexGroupDetailEntities) { - if (indexGroupDetailEntities == null) { indexGroupDetailEntities = detailEntityMap.get(allIndexCodePath); } @@ -236,15 +256,18 @@ public class IndexExplainServiceImpl implements IndexExplainService { if ("grid".equals(orgLevel) && IndexConstant.ZI_SHEN.equals(type) && index.getAllIndexCodePath().contains(IndexConstant.XIA_JI)) { return; } - if ((!"grid".equals(orgLevel) && !"district".equals(orgLevel)) && !index.getAllIndexCodePath().contains(type)) { + if ("district".equals(orgLevel) && !index.getAllIndexCodePath().contains(type) && !index.getAllIndexCodePath().contains(IndexConstant.ZHI_LI_NENG_LI)) { + return; + } + if (!"grid".equals(orgLevel) && !"district".equals(orgLevel) && !index.getAllIndexCodePath().contains(type)) { return; } table.setIndexCode(index.getIndexCode()); table.setIndexName(index.getIndexName()); table.setOriginValue(NumConstant.ZERO_STR); table.setScore(NumConstant.ZERO_STR); - table.setWeight(index.getWeight().multiply(new BigDecimal(100)).setScale(NumConstant.TWO, BigDecimal.ROUND_HALF_UP) + "%"); - table.setQuantity(NumConstant.ZERO_STR); + table.setWeight(index.getWeight().multiply(new BigDecimal(100)).setScale(0, BigDecimal.ROUND_HALF_UP) + "%"); + table.setType(type); tableList.add(table); if (new BigDecimal(-1).compareTo(index.getThreshold()) != 0) { threlodList.add(index.getIndexName().concat(String.format(IndexConstant.THRESHOLD_TEXT, index.getThreshold().intValue()))); diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/fact/impl/FactIndexServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/fact/impl/FactIndexServiceImpl.java index 596b1e9dd6..7a5eeee0d1 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/fact/impl/FactIndexServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/fact/impl/FactIndexServiceImpl.java @@ -335,6 +335,11 @@ public class FactIndexServiceImpl implements FactIndexService { resultList.forEach(result -> { list.stream().filter(dto -> dto.getIndexCode().equals(result.getKey())).forEach(l -> { result.setShowType(l.getValueType()); + //整数 + if (FactConstant.DECIMAL.equals(l.getValueType())) { + BigDecimal num = new BigDecimal(result.getValue()).setScale(0, BigDecimal.ROUND_HALF_UP); + result.setValue(num.toString()); + } //小数类型,四舍五入保留小数点后一位 if (FactConstant.DECIMAL.equals(l.getValueType())) { BigDecimal num = new BigDecimal(result.getValue()).setScale(1, BigDecimal.ROUND_HALF_UP); diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexAgencySubScoreDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexAgencySubScoreDao.xml index d1b1dafeea..aafd8dd25b 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexAgencySubScoreDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexAgencySubScoreDao.xml @@ -46,9 +46,12 @@ fact.index_code, IF(fact.origin_value='',0,IFNULL(fact.origin_value,0)) AS origin_value, round(fact.score,1) AS score, - round(fact.WEIGHT,2) AS weight + round(fact.WEIGHT,2) AS weight, + SAMPLE_COUNT, + dict.VALUE_TYPE FROM fact_index_agency_sub_score fact + LEFT JOIN index_dict dict ON fact.index_code = dict.index_code WHERE fact.del_flag = '0' AND fact.all_parent_index_code = #{allParentIndexCode} diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCpcSubScoreDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCpcSubScoreDao.xml index 84ea0eca60..4e7171912d 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCpcSubScoreDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCpcSubScoreDao.xml @@ -29,7 +29,7 @@ + From 1656ce8f687d1bfba9fb29534062ac53425e6027 Mon Sep 17 00:00:00 2001 From: jianjun Date: Thu, 27 May 2021 16:09:28 +0800 Subject: [PATCH 098/128] bug --- .../evaluationindex/index/impl/IndexExplainServiceImpl.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/index/impl/IndexExplainServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/index/impl/IndexExplainServiceImpl.java index 3915f53da4..572fb3b4b8 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/index/impl/IndexExplainServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/index/impl/IndexExplainServiceImpl.java @@ -264,13 +264,13 @@ public class IndexExplainServiceImpl implements IndexExplainService { List threlodList = new ArrayList<>(); indexGroupDetailEntities.forEach(index -> { IndexScoreDetailResult table = new IndexScoreDetailResult(); - if (OrgLevelEnum.GRID.equals(orgLevel) && IndexConstant.ZI_SHEN.equals(type) && index.getAllIndexCodePath().contains(IndexConstant.XIA_JI)) { + if (OrgLevelEnum.GRID.getCode().equals(orgLevel) && IndexConstant.ZI_SHEN.equals(type) && index.getAllIndexCodePath().contains(IndexConstant.XIA_JI)) { return; } - if (OrgLevelEnum.DISTRICT.equals(orgLevel) && !index.getAllIndexCodePath().contains(type) && !index.getAllIndexCodePath().contains(IndexConstant.ZHI_LI_NENG_LI)) { + if (OrgLevelEnum.DISTRICT.getCode().equals(orgLevel) && !index.getAllIndexCodePath().contains(type) && !index.getAllIndexCodePath().contains(IndexConstant.ZHI_LI_NENG_LI)) { return; } - if (!OrgLevelEnum.GRID.equals(orgLevel) && !OrgLevelEnum.DISTRICT.equals(orgLevel) && !index.getAllIndexCodePath().contains(type)) { + if (!OrgLevelEnum.GRID.getCode().equals(orgLevel) && !OrgLevelEnum.DISTRICT.getCode().equals(orgLevel) && !index.getAllIndexCodePath().contains(type)) { return; } table.setIndexCode(index.getIndexCode()); From d894dd37e17f8ca1f503cc5d5dece8ee169e4768 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 27 May 2021 16:33:21 +0800 Subject: [PATCH 099/128] =?UTF-8?q?=E6=B2=BB=E7=90=86=E6=8C=87=E8=B0=81?= =?UTF-8?q?=E7=BD=91=E6=A0=BC=E7=9B=B8=E5=85=B3v3:=20=E7=BD=91=E6=A0=BC?= =?UTF-8?q?=E8=87=AA=E6=B2=BB=E5=8D=A0=E6=AF=94=EF=BC=9A=E6=9C=AC=E7=BD=91?= =?UTF-8?q?=E6=A0=BC=E5=86=85=E4=BA=A7=E7=94=9F=E7=9A=84=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=EF=BC=8C=E5=B9=B6=E4=B8=94=E4=B8=80=E7=9B=B4=E5=9C=A8=E7=BD=91?= =?UTF-8?q?=E6=A0=BC=E7=BA=A7=E6=B5=81=E8=BD=AC=E7=9A=84=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=EF=BC=8C=E4=BB=8E=E5=93=AA=E5=87=BA=E6=9D=A5=E5=BD=92=E8=B0=81?= =?UTF-8?q?=E8=87=AA=E6=B2=BB=EF=BC=9B=E7=A4=BE=E5=8C=BA=E3=80=81=E8=A1=97?= =?UTF-8?q?=E9=81=93=E3=80=81=E5=8C=BA=E7=9B=B4=E9=83=A8=E9=97=A8=E8=A7=A3?= =?UTF-8?q?=E5=86=B3=E9=83=BD=E6=98=AF=E6=8C=87=E7=9A=84=EF=BC=8C=E4=BB=8E?= =?UTF-8?q?=E6=9C=AC=E7=BD=91=E6=A0=BC=E5=86=85=E5=87=BA=E6=9D=A5=E7=9A=84?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E4=B8=AD=EF=BC=8C=E5=86=8D=E5=8E=BB=E7=9C=8B?= =?UTF-8?q?=E8=B0=81=E8=A7=A3=E5=86=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../extract/FactOriginProjectLogDailyDTO.java | 10 +- .../constant/DimObjectActionConstant.java | 13 ++ .../extract/FactOriginProjectLogDailyDao.java | 20 +- .../FactOriginProjectMainDailyDao.java | 19 ++ .../epmet/dao/org/StatsCustomerAgencyDao.java | 8 + .../extract/GovernProjectInfoDTO.java | 20 ++ .../extract/ProjectInfoDTO.java | 15 -- .../FactOriginProjectMainDailyService.java | 19 ++ .../impl/FactGridGovernDailyServiceImpl.java | 197 +++++++++++++++++- ...FactOriginProjectMainDailyServiceImpl.java | 23 ++ .../service/org/CustomerAgencyService.java | 16 ++ .../org/impl/CustomerAgencyServiceImpl.java | 22 ++ .../extract/FactOriginProjectLogDailyDao.xml | 23 ++ .../extract/FactOriginProjectMainDailyDao.xml | 59 ++++++ .../mapper/org/StatsCustomerAgencyDao.xml | 18 ++ 15 files changed, 457 insertions(+), 25 deletions(-) create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/GovernProjectInfoDTO.java delete mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/ProjectInfoDTO.java diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactOriginProjectLogDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactOriginProjectLogDailyDTO.java index 8f5f1571db..4843b32966 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactOriginProjectLogDailyDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactOriginProjectLogDailyDTO.java @@ -17,9 +17,10 @@ package com.epmet.dto.extract; +import lombok.Data; + import java.io.Serializable; import java.util.Date; -import lombok.Data; /** @@ -44,7 +45,7 @@ public class FactOriginProjectLogDailyDTO implements Serializable { private String customerId; /** - * 网格grid,部门department + * 网格grid,部门department,组织:agency */ private String orgType; @@ -90,6 +91,11 @@ public class FactOriginProjectLogDailyDTO implements Serializable { */ private String yearId; + /** + * 项目ID + */ + private String projectId; + /** * 议题ID */ diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/DimObjectActionConstant.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/DimObjectActionConstant.java index 5476a93a1b..1b6697f1ec 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/DimObjectActionConstant.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/DimObjectActionConstant.java @@ -11,4 +11,17 @@ public interface DimObjectActionConstant { * 发布话题 */ String TOPIC_PUBLISH="discussing"; + + // response 处理/响应 + // close 结案 + // transfer 流转 + // return 退回 + // resolved 结案_已解决 + // unresolved 结案_无需解决 + // evaluate 满意度评价 + // bad 不满意 + // good 基本满意 + // perfect 非常满意 + // created 立项 + String PROJECT_RETURN="return"; } 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 78f9be78e9..3d7371fb56 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,12 +18,12 @@ package com.epmet.dao.evaluationindex.extract; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.extract.FactOriginProjectLogDailyDTO; 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; /** @@ -298,4 +298,22 @@ public interface FactOriginProjectLogDailyDao extends BaseDao */ List selectGridSelfDaily(@Param("customerId") String customerId, @Param("dateId") String dateId); + + /** + * @return java.util.List + * @param projectId + * @author yinzuomei + * @description 根据项目id, 查询处理明细 + * @Date 2021/5/27 12:58 + **/ + List selectListByProjectId(String projectId); + + /** + * @return com.epmet.dto.extract.FactOriginProjectLogDailyDTO + * @param projectId + * @author yinzuomei + * @description 查询某一个项目的结案操作明细 + * @Date 2021/5/27 12:58 + **/ + FactOriginProjectLogDailyDTO selectClosedLog(String projectId); } 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 d5042bbb7b..fe5a0e2584 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 @@ -29,6 +29,7 @@ import com.epmet.dto.screen.form.ProjectSourceMapFormDTO; import com.epmet.entity.evaluationindex.extract.FactOriginProjectMainDailyEntity; import com.epmet.entity.evaluationindex.extract.FactOriginProjectOrgPeriodDailyEntity; import com.epmet.entity.evaluationindex.extract.GovernGridTotalCommonDTO; +import com.epmet.entity.evaluationindex.extract.GovernProjectInfoDTO; import com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -477,4 +478,22 @@ public interface FactOriginProjectMainDailyDao extends BaseDao selectAgencyClosedProjectCount(@Param("customerId") String customerId, @Param("dateId") String dateId, @Param( "closedStatus") String closedStatus, @Param("origin") String origin); + + /** + * 当前网格内已结案的项目 + * + * @author zhaoqifeng + * @date 2021/5/26 15:09 + * @param customerId + * @param gridId + * @param projectStatus 状态:待处理 pending,结案closed + * @param origin 项目来源 来源:议题issue 组织agency + * @param isResolved unresolved,resolved + * @return com.epmet.entity.evaluationindex.extract.GovernProjectInfoDTO + */ + List getGridClosedProjectList(@Param("customerId")String customerId, + @Param("gridId") String gridId, + @Param("projectStatus")String projectStatus, + @Param("origin") String origin, + @Param("isResolved")String isResolved); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/StatsCustomerAgencyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/StatsCustomerAgencyDao.java index aa0f78f087..6a20ae9f7f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/StatsCustomerAgencyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/StatsCustomerAgencyDao.java @@ -35,4 +35,12 @@ public interface StatsCustomerAgencyDao extends BaseDao { CustomerAgencyEntity getRootAgencyInfo(String customerId); List queryAgencyListByCustomerId(String customerId); + + /** + * 查询部门所属组织信息 + * + * @param deptId + * @return com.epmet.entity.evaluationindex.screen.ScreenCustomerAgencyEntity + */ + CustomerAgencyEntity selectByDeptId(String deptId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/GovernProjectInfoDTO.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/GovernProjectInfoDTO.java new file mode 100644 index 0000000000..b4dfa42239 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/GovernProjectInfoDTO.java @@ -0,0 +1,20 @@ +package com.epmet.entity.evaluationindex.extract; + +import com.epmet.dto.extract.FactOriginProjectLogDailyDTO; +import com.epmet.dto.extract.FactOriginProjectMainDailyDTO; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 描述一下 + * + * @author yinzuomei@elink-cn.com + * @date 2021/5/26 18:00 + */ +@Data +public class GovernProjectInfoDTO extends FactOriginProjectMainDailyDTO implements Serializable { + private FactOriginProjectLogDailyDTO closeLogDTO; + private List projectLogDTOList; +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/ProjectInfoDTO.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/ProjectInfoDTO.java deleted file mode 100644 index 0b1eb1af59..0000000000 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/ProjectInfoDTO.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.epmet.entity.evaluationindex.extract; - -import lombok.Data; - -import java.io.Serializable; - -/** - * 描述一下 - * - * @author yinzuomei@elink-cn.com - * @date 2021/5/26 18:00 - */ -@Data -public class ProjectInfoDTO implements Serializable { -} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java index 9445559627..32c027b605 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java @@ -30,6 +30,7 @@ import com.epmet.dto.screen.form.ScreenCentralZoneDataFormDTO; import com.epmet.entity.evaluationindex.extract.FactOriginProjectMainDailyEntity; import com.epmet.entity.evaluationindex.extract.FactOriginProjectOrgPeriodDailyEntity; import com.epmet.entity.evaluationindex.extract.GovernGridTotalCommonDTO; +import com.epmet.entity.evaluationindex.extract.GovernProjectInfoDTO; import com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity; import java.util.List; @@ -448,4 +449,22 @@ public interface FactOriginProjectMainDailyService extends BaseService */ Map getAgencyClosedProjectCount(String customerId, String dateId, String closedStatus, String origin); + + /** + * 当前网格内已结案的项目 + * + * @author zhaoqifeng + * @date 2021/5/26 15:09 + * @param customerId + * @param gridId + * @param projectStatus 状态:待处理 pending,结案closed + * @param origin 项目来源 来源:议题issue 组织agency + * @param isResolved unresolved,resolved + * @return com.epmet.entity.evaluationindex.extract.GovernProjectInfoDTO + */ + List getGridClosedProjectList(String customerId, + String gridId, + String projectStatus, + String origin, + String isResolved); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactGridGovernDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactGridGovernDailyServiceImpl.java index 84c4addeea..24136c028f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactGridGovernDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactGridGovernDailyServiceImpl.java @@ -19,17 +19,22 @@ package com.epmet.service.evaluationindex.extract.todata.impl; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.constant.DimObjectActionConstant; import com.epmet.constant.DimObjectStatusConstant; import com.epmet.constant.ProjectConstant; import com.epmet.dao.evaluationindex.extract.FactGridGovernDailyDao; +import com.epmet.dto.extract.FactOriginProjectLogDailyDTO; import com.epmet.dto.org.GridInfoDTO; import com.epmet.entity.evaluationindex.extract.FactGridGovernDailyEntity; import com.epmet.entity.evaluationindex.extract.GovernGridClosedTotalCommonDTO; import com.epmet.entity.evaluationindex.extract.GovernGridTotalCommonDTO; +import com.epmet.entity.evaluationindex.extract.GovernProjectInfoDTO; +import com.epmet.entity.org.CustomerAgencyEntity; import com.epmet.service.evaluationindex.extract.todata.FactGridGovernDailyService; import com.epmet.service.evaluationindex.extract.todata.FactOriginIssueMainDailyService; import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectMainDailyService; import com.epmet.service.evaluationindex.extract.todata.FactOriginTopicMainDailyService; +import com.epmet.service.org.CustomerAgencyService; import com.epmet.service.org.CustomerGridService; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; @@ -39,10 +44,7 @@ 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; +import java.util.*; import java.util.stream.Collectors; /** @@ -62,7 +64,8 @@ public class FactGridGovernDailyServiceImpl extends BaseServiceImpl getGovernGridClosedTotalCommonDTOMap(String customerId, List gridIds) { - Map resultMap=new HashMap<>(); - for(String gridId:gridIds){ + Map resultMap = new HashMap<>(); + for (String gridId : gridIds) { + + GovernGridClosedTotalCommonDTO governGridClosedTotalCommonDTO = new GovernGridClosedTotalCommonDTO(); + governGridClosedTotalCommonDTO.setGridId(gridId); + + // 11、来源于议题的项目,未出网格结案并且已解决的项目数 + int fromIssueResolvedInGridCount = NumConstant.ZERO; + // 12、来源于议题的项目,未出网格结案并且无需解决的项目数 + int fromIssueUnResolvedInGridCount = NumConstant.ZERO; + // 13、来源于项目立项的项目,未出网格结案,并且已解决的项目数;因现在网格不能立项,所以此列默认为0 + int fromAgencyResolvedInGridCount = NumConstant.ZERO; + // 14、来源于项目立项的项目,未出网格结案,并且无需解决的项目数;因现在网格不能立项,所以此列默认为0 + int fromAgencyUnResolvedInGridCount = NumConstant.ZERO; + // 当前网格内出来的项目:由社区结案(已解决+未解决)的项目总数 + int communityClosedCount= NumConstant.ZERO; + // 当前网格内出来的项目:由街道结案(已解决+未解决)的项目总数 + int streetClosedCount=NumConstant.ZERO;; + // 当前网格内出来的项目:由街道结案(已解决+未解决)的项目总数 + int districtDeptClosedCount=NumConstant.ZERO; + + //当前网格内已结案的项目 + List currentGridClosedProjectList = factOriginProjectMainDailyService.getGridClosedProjectList(customerId, gridId, + ProjectConstant.CLOSED,null,null); + for (GovernProjectInfoDTO governProjectInfoDTO : currentGridClosedProjectList) { + // 1、先判断当前项目是否出了网格 + // 举例:A社区下有A1、A2两个网格;A1网格下的一个项目,流转给了A2网格的某人,他结案了。 只要项目流转部门未出grid ;就算是网格自治。 + boolean inGridClosed = checkIsInGridClosed(governProjectInfoDTO.getGridId(), + governProjectInfoDTO.getProjectLogDTOList()); + if (inGridClosed) { + // 2、在网格内流转结案的,计算以下下值 + if (ProjectConstant.PROJECT_ORIGIN_ISSUE.equals(governProjectInfoDTO.getOrigin())) { + if (ProjectConstant.RESOLVED.equals(governProjectInfoDTO.getIsResolved())) { + // 11、来源于议题的项目,未出网格(在网格内流转的)结案并且已解决的项目数 + fromIssueResolvedInGridCount += 1; + } else if (ProjectConstant.UNRESOLVED.equals(governProjectInfoDTO.getIsResolved())) { + // 12、来源于议题的项目,未出网格(在网格内流转的)结案并且无需解决的项目数 + fromIssueUnResolvedInGridCount += 1; + } + } else if (ProjectConstant.PROJECT_ORIGIN_AGENCY.equals(governProjectInfoDTO.getOrigin())) { + if (ProjectConstant.RESOLVED.equals(governProjectInfoDTO.getIsResolved())) { + // 13、来源于项目立项的项目,未出网格(在网格内流转的)结案,并且已解决的项目数;因现在网格不能立项,所以此列默认为0 + fromAgencyResolvedInGridCount += 1; + } else if (ProjectConstant.UNRESOLVED.equals(governProjectInfoDTO.getIsResolved())) { + // 14、来源于项目立项的项目,未出网格(在网格内流转的)结案,并且无需解决的项目数;因现在网格不能立项,所以此列默认为0 + fromAgencyUnResolvedInGridCount += 1; + } + } + } else { + // 3、出了网格的判断是由谁解决的? + String resolveOrgType=getProjectResolveOrgType(governProjectInfoDTO.getProjectLogDTOList()); + if("community".equals(resolveOrgType)){ + // 当前网格内出来的项目:由社区结案(已解决+未解决)的项目总数 + communityClosedCount+=1; + }else if("street".equals(resolveOrgType)){ + // 当前网格内出来的项目:由街道结案(已解决+未解决)的项目总数 + streetClosedCount+=1; + }else if("districtdept".equals(resolveOrgType)){ + // 当前网格内出来的项目:由街道结案(已解决+未解决)的项目总数 + districtDeptClosedCount+=1; + } + // todo 可能是 市级解决、省级解决呢??? + } + } + governGridClosedTotalCommonDTO.setFromIssueResolvedInGridCount(fromIssueResolvedInGridCount); + governGridClosedTotalCommonDTO.setFromIssueUnResolvedInGridCount(fromIssueUnResolvedInGridCount); + governGridClosedTotalCommonDTO.setFromAgencyResolvedInGridCount(fromAgencyResolvedInGridCount); + governGridClosedTotalCommonDTO.setFromAgencyUnResolvedInGridCount(fromAgencyUnResolvedInGridCount); + governGridClosedTotalCommonDTO.setCommunityClosedCount(communityClosedCount); + governGridClosedTotalCommonDTO.setStreetClosedCount(streetClosedCount); + governGridClosedTotalCommonDTO.setDistrictDeptClosedCount(districtDeptClosedCount); + resultMap.put(gridId, governGridClosedTotalCommonDTO); } return resultMap; } + /** + * 已经出网格的项目,到底归谁解决呢? + * + * @param projectLogDTOList 当前项目所有的处理明细 + * @return String 社区解决:community;街道解决:street;区直部门解决:districtdept + */ + private String getProjectResolveOrgType(List projectLogDTOList) { + List handleLevelList=new ArrayList<>(); + for (FactOriginProjectLogDailyDTO logDailyDTO : projectLogDTOList) { + if(logDailyDTO.getActionCode().equals(DimObjectActionConstant.PROJECT_RETURN)){ + //当前操作如果是退回,不参与比较 + continue; + } + + /** + * 机关级别(社区级:community, + 乡(镇、街道)级:street, + 区县级: district, + 市级: city + 省级:province) + */ + // orgType: 网格grid,部门department,组织:agency + if ("grid".equals(logDailyDTO.getOrgType())) { + handleLevelList.add(NumConstant.ONE); + } else if ("agency".equals(logDailyDTO.getOrgType())) { + CustomerAgencyEntity agencyEntity=customerAgencyService.getAgencyById(logDailyDTO.getOrgId()); + if("community".equals(agencyEntity.getLevel())){ + handleLevelList.add(NumConstant.TWO); + }else if("street".equals(agencyEntity.getLevel())){ + handleLevelList.add(NumConstant.THREE); + }else if("district".equals(agencyEntity.getLevel())){ + handleLevelList.add(NumConstant.FOUR); + }else if("city".equals(agencyEntity.getLevel())){ + handleLevelList.add(NumConstant.FIVE); + }else if("province".equals(agencyEntity.getLevel())){ + handleLevelList.add(NumConstant.SIX); + } + } else if ("department".equals(logDailyDTO.getOrgType())) { + CustomerAgencyEntity deptAgencyEntity=customerAgencyService.getAgencyByDeptId(logDailyDTO.getOrgId()); + if("district".equals(deptAgencyEntity.getLevel())){ + // 区直部门直接返回 + return "districtdept"; + }else if("community".equals(deptAgencyEntity.getLevel())){ + handleLevelList.add(NumConstant.TWO); + }else if("street".equals(deptAgencyEntity.getLevel())){ + handleLevelList.add(NumConstant.THREE); + }else if("city".equals(deptAgencyEntity.getLevel())){ + handleLevelList.add(NumConstant.FIVE); + }else if("province".equals(deptAgencyEntity.getLevel())){ + handleLevelList.add(NumConstant.SIX); + } + } + } + //网格:1 grid + //社区:2 community + //街道:3 street + //区县:4 district + //市级:5 city + //省:6 province + //区直部门:7 districtdept + //求出最高的处理部门级别 + String result = ""; + int max = Collections.max(handleLevelList); + switch (max) { + case NumConstant.ONE: + return "grid"; + case NumConstant.TWO: + result = "community"; + break; + case NumConstant.THREE: + result = "street"; + break; + case NumConstant.FOUR: + result = "district"; + break; + case NumConstant.FIVE: + result = "city"; + break; + case NumConstant.SIX: + result = "province"; + break; + case NumConstant.SEVEN: + result = "districtdept"; + } + return result; + } + + /** + * 根据项目处理的明细,判断当前项目是否在网格内自己解决的 + * + * @param gridId 当前项目所属网格 + * @param projectLogDTOList + * @return boolean + */ + private boolean checkIsInGridClosed(String gridId, List projectLogDTOList) { + boolean flag = true; + for (FactOriginProjectLogDailyDTO detail : projectLogDTOList) { + if(detail.getActionCode().equals(DimObjectActionConstant.PROJECT_RETURN)){ + //当前操作如果是退回,不参与比较 + continue; + } + //只要出了网格,就不算自治 + if (!"grid".equals(detail.getOrgType())) { + flag = false; + break; + } + } + return flag; + } + /** * 构造要插入的数据,每个网格一天一条数据,初始赋值0 * diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java index e31ea6fbaf..40d9738a7d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java @@ -40,6 +40,7 @@ import com.epmet.dto.screen.form.ScreenCentralZoneDataFormDTO; import com.epmet.entity.evaluationindex.extract.FactOriginProjectMainDailyEntity; import com.epmet.entity.evaluationindex.extract.FactOriginProjectOrgPeriodDailyEntity; import com.epmet.entity.evaluationindex.extract.GovernGridTotalCommonDTO; +import com.epmet.entity.evaluationindex.extract.GovernProjectInfoDTO; import com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity; import com.epmet.feign.EpmetCommonServiceOpenFeignClient; import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectMainDailyService; @@ -678,5 +679,27 @@ public class FactOriginProjectMainDailyServiceImpl extends BaseServiceImpl getGridClosedProjectList(String customerId, + String gridId, + String projectStatus, + String origin, + String isResolved) { + List resultList=baseDao.getGridClosedProjectList(customerId,gridId,projectStatus,origin,isResolved); + return resultList; + } + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/CustomerAgencyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/CustomerAgencyService.java index fd611edf23..176167685c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/CustomerAgencyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/CustomerAgencyService.java @@ -23,4 +23,20 @@ public interface CustomerAgencyService { List queryAgencyListByCustomerId(String customerId); + + /** + * 根据组织id查询基本信息 + * + * @param agencyId + * @return com.epmet.entity.evaluationindex.screen.ScreenCustomerAgencyEntity + */ + CustomerAgencyEntity getAgencyById(String agencyId); + + /** + * 查询部门所属组织信息 + * + * @param deptId + * @return com.epmet.entity.evaluationindex.screen.ScreenCustomerAgencyEntity + */ + CustomerAgencyEntity getAgencyByDeptId(String deptId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerAgencyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerAgencyServiceImpl.java index 5c6b5175b0..b61066f7a7 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerAgencyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerAgencyServiceImpl.java @@ -55,4 +55,26 @@ public class CustomerAgencyServiceImpl implements CustomerAgencyService { public List queryAgencyListByCustomerId(String customerId) { return customerAgencyDao.queryAgencyListByCustomerId(customerId); } + + /** + * 根据组织id查询基本信息 + * + * @param agencyId + * @return com.epmet.entity.evaluationindex.screen.ScreenCustomerAgencyEntity + */ + @Override + public CustomerAgencyEntity getAgencyById(String agencyId) { + return customerAgencyDao.selectById(agencyId); + } + + /** + * 查询部门所属组织信息 + * + * @param deptId + * @return com.epmet.entity.evaluationindex.screen.ScreenCustomerAgencyEntity + */ + @Override + public CustomerAgencyEntity getAgencyByDeptId(String deptId) { + return customerAgencyDao.selectByDeptId(deptId); + } } 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 411d959a57..c1b12a7da5 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 @@ -664,4 +664,27 @@ GROUP BY GRID_ID + + + + + + \ 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 f17dc573ef..633160b178 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 @@ -963,4 +963,63 @@ GROUP BY AGENCY_ID + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/StatsCustomerAgencyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/StatsCustomerAgencyDao.xml index a7b6c09ae2..771a60ba32 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/StatsCustomerAgencyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/StatsCustomerAgencyDao.xml @@ -132,4 +132,22 @@ where ca.del_flag='0' and ca.CUSTOMER_ID=#{customerId} + + \ No newline at end of file From 566c160ad4a2fe6d03dc10cc9dae86d93fbcfcd4 Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Thu, 27 May 2021 17:38:23 +0800 Subject: [PATCH 100/128] =?UTF-8?q?=E5=9F=BA=E5=B1=82=E6=B2=BB=E7=90=86-?= =?UTF-8?q?=E7=BB=84=E7=BB=87=E7=9A=84=E6=B2=BB=E7=90=86=E6=8C=87=E6=95=B0?= =?UTF-8?q?=EF=BC=8C=E6=8C=89=E5=A4=A9=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../FactAgencyGovernDailyServiceImpl.java | 61 ++++++++++++++++++- 1 file changed, 60 insertions(+), 1 deletion(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactAgencyGovernDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactAgencyGovernDailyServiceImpl.java index 5603dfde68..ba1ee9853d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactAgencyGovernDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactAgencyGovernDailyServiceImpl.java @@ -18,11 +18,25 @@ package com.epmet.service.evaluationindex.extract.todata.impl; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.NumConstant; import com.epmet.dao.evaluationindex.extract.FactAgencyGovernDailyDao; +import com.epmet.dto.extract.result.OrgStatisticsResultDTO; +import com.epmet.dto.stats.DimAgencyDTO; import com.epmet.entity.evaluationindex.extract.FactAgencyGovernDailyEntity; import com.epmet.service.evaluationindex.extract.todata.FactAgencyGovernDailyService; +import com.epmet.service.evaluationindex.extract.todata.FactOriginIssueMainDailyService; +import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectMainDailyService; +import com.epmet.service.evaluationindex.extract.todata.FactOriginTopicMainDailyService; +import com.epmet.service.stats.DimAgencyService; +import com.epmet.util.DimIdGenerator; import org.springframework.stereotype.Service; +import javax.annotation.Resource; +import java.math.BigDecimal; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + /** * 组织的治理指数,按天统计 * @@ -32,6 +46,14 @@ import org.springframework.stereotype.Service; @Service public class FactAgencyGovernDailyServiceImpl extends BaseServiceImpl implements FactAgencyGovernDailyService { + @Resource + private DimAgencyService dimAgencyService; + @Resource + private FactOriginTopicMainDailyService factOriginTopicMainDailyService; + @Resource + private FactOriginIssueMainDailyService factOriginIssueMainDailyService; + @Resource + private FactOriginProjectMainDailyService factOriginProjectMainDailyService; /** * 治理指数-组织相关 @@ -44,8 +66,14 @@ public class FactAgencyGovernDailyServiceImpl extends BaseServiceImpl agencyList = dimAgencyService.getAgencyInfoByCustomerId(customerId); + List agencyGovernDailyList = agencyList.stream().map(agency -> { + FactAgencyGovernDailyEntity entity = initEntity(agency, dateId); + return entity; + }).collect(Collectors.toList()); // 问题解决总数:当前组织下,话题关闭(已解决+无需解决)总数、议题关闭(已解决+无需解决)总数和项目结案(议题转为项目的结案数+项目立项结案数)总数之和 - + Map topicTotal = factOriginTopicMainDailyService.getAgencyClosedTopicCount(customerId, dateId, null, + null); // 党群自治占比:当前组织下,所有小组内关闭(已解决+无需解决)的话题数与问题解决总数之比(未出小组:未转议题的) // 网格自治占比:当前组织下,所有网格内结案项目数与问题解决总数之比(未出网格) // 参考:fact_index_govrn_ablity_grid_monthly的SELF_SOLVE_PROJECT_COUNT计算 @@ -61,4 +89,35 @@ public class FactAgencyGovernDailyServiceImpl extends BaseServiceImpl Date: Fri, 28 May 2021 09:39:04 +0800 Subject: [PATCH 101/128] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../db/migration/V0.0.17__inxdex_explain.sql | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.17__inxdex_explain.sql b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.17__inxdex_explain.sql index f7306c991d..15cca09546 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.17__inxdex_explain.sql +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.17__inxdex_explain.sql @@ -18,6 +18,42 @@ CREATE TABLE `index_explain` ( PRIMARY KEY (`ID`) USING BTREE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='指标说明文案'; +#插入指标结束 +BEGIN; +INSERT INTO `index_explain` VALUES ('1', 'default', '党建指数', '', '自然月周期内,党建指数得分=本级党建指数得分+下级党建指数得分', 'grid', '0', 1, 0, 'none', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); +INSERT INTO `index_explain` VALUES ('10', 'default', '1/2下级党建指数得分', 'shequxiangguan:dangjiannengli', '下级党建指数得分=下级所有网格党建指数的平均值*相关权重', 'community', '8', 2, 1, 'xiaji', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); +INSERT INTO `index_explain` VALUES ('11', 'default', '治理指数', '', '含义:自然月周期内,治理指数得分=本级治理指数得分+下级治理指数得分', 'community', '0', 4, 0, 'none', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); +INSERT INTO `index_explain` VALUES ('12', 'default', '2/1本级治理指数得分', 'shequxiangguan:zhilinengli', '本级治理指数得分=网格各项治理指数指标数据得分*相关权重之和', 'community', '11', 1, 1, 'zishen', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); +INSERT INTO `index_explain` VALUES ('13', 'default', '2/2下级治理指数得分', 'shequxiangguan:zhilinengli', '下级治理指数得分=组织内党员的参与议事指数考评分(平均值)*相关权重', 'community', '11', 2, 1, 'xiaji', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); +INSERT INTO `index_explain` VALUES ('14', 'default', '服务指数', '', '含义:自然月周期内,服务指数得分=本级服务指数得分+下级服务指数得分', 'community', '0', 3, 0, 'none', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); +INSERT INTO `index_explain` VALUES ('15', 'default', '3/1本级服务指数得分', 'shequxiangguan:fuwunengli', '本级服务指数得分=社区活动组织次数得分*相关权重', 'community', '14', 1, 1, 'zishen', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); +INSERT INTO `index_explain` VALUES ('16', 'default', '3/2下级服务指数得分', 'shequxiangguan:fuwunengli', '下级服务指数得分=社区下级所有网格服务指数得分(平均值)*相关权重', 'community', '14', 2, 1, 'xiaji', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); +INSERT INTO `index_explain` VALUES ('17', 'default', '党建指数', '', '自然月周期内,党建指数得分=本级党建指数得分+下级党建指数得分', 'street', '0', 5, 0, 'none', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); +INSERT INTO `index_explain` VALUES ('18', 'default', '1/1本级党建指数得分', 'jiedaoxiangguan:dangjiannengli', '本级党建指数得分=社区名义发文数量得分*相关权重', 'street', '17', 1, 1, 'zishen', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); +INSERT INTO `index_explain` VALUES ('19', 'default', '1/2下级党建指数得分', 'jiedaoxiangguan:dangjiannengli', '下级党建指数得分=下级所有网格党建指数的平均值*相关权重', 'street', '17', 2, 1, 'xiaji', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); +INSERT INTO `index_explain` VALUES ('2', 'default', '1/1本级党建指数得分', 'wanggexiangguan:dangjiannengli', '本级党建指数得分=网格各项党建指数指标数据得分*相关权重之和', 'grid', '1', 1, 1, 'zishen', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); +INSERT INTO `index_explain` VALUES ('20', 'default', '治理指数', '', '含义:自然月周期内,治理指数得分=本级治理指数得分+下级治理指数得分', 'street', '0', 6, 0, 'none', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); +INSERT INTO `index_explain` VALUES ('21', 'default', '2/1本级治理指数得分', 'jiedaoxiangguan:zhilinengli', '本级治理指数得分=网格各项治理指数指标数据得分*相关权重之和', 'street', '20', 1, 1, 'zishen', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); +INSERT INTO `index_explain` VALUES ('22', 'default', '2/2下级治理指数得分', 'jiedaoxiangguan:zhilinengli', '下级治理指数得分=组织内党员的参与议事指数考评分(平均值)*相关权重', 'street', '20', 2, 1, 'xiaji', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); +INSERT INTO `index_explain` VALUES ('23', 'default', '服务指数', '', '含义:自然月周期内,服务指数得分=本级服务指数得分+下级服务指数得分', 'street', '0', 7, 0, 'none', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); +INSERT INTO `index_explain` VALUES ('24', 'default', '3/1本级服务指数得分', 'jiedaoxiangguan:fuwunengli', '本级服务指数得分=社区活动组织次数得分*相关权重', 'street', '23', 1, 1, 'zishen', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); +INSERT INTO `index_explain` VALUES ('25', 'default', '3/2下级服务指数得分', 'jiedaoxiangguan:fuwunengli', '下级服务指数得分=社区下级所有网格服务指数得分(平均值)*相关权重', 'street', '23', 2, 1, 'xiaji', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); +INSERT INTO `index_explain` VALUES ('26', 'default', '党建指数', '', '含义:自然月周期内,党建指数得分=本级党建指数得分+下级党建指数得分', 'district', '0', 1, 0, 'none', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); +INSERT INTO `index_explain` VALUES ('27', 'default', '1/1本级党建指数得分', 'quanquxiangguan:dangjiannengli', '本级党建指数得分=区名义发文数量得分*相关权重', 'district', '26', 1, 1, 'zishen', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); +INSERT INTO `index_explain` VALUES ('28', 'default', '1/2下级党建指数得分', 'quanquxiangguan:dangjiannengli', '下级党建指数得分=区下级街道党建指数汇总(平均值)*相关权重', 'district', '26', 2, 1, 'xiaji', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); +INSERT INTO `index_explain` VALUES ('29', 'default', '治理指数', '', '含义:自然月周期内,治理指数得分=所有街道治理指数(平均值)*相关权重(d%)+所有直属部门治理指数(平均值)*相关权重(d%)', 'district', '0', 2, 0, 'none', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); +INSERT INTO `index_explain` VALUES ('3', 'default', '1/2下级党建指数得分', 'dangyuanxiangguan:lianxiqunzhong', '下级党建指数得分=组织内党员的联系群众指数考评分(平均值)*相关权重', 'grid', '1', 2, 1, 'xiaji', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); +INSERT INTO `index_explain` VALUES ('30', 'default', '2/1所有街道治理指数(平均值)', 'quanquxiangguan:zhilinengli', '所有街道治理指数(平均值)得分=区下级所有街道治理指数得分总和/街道总数', 'district', '29', 1, 1, 'xiaji', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); +INSERT INTO `index_explain` VALUES ('31', 'default', '2/2所有直属部门治理指数(平均值)', 'quzhibumen:zhilinengli', '所有指数部门治理指数(平均值)得分=区直部门各项治理指数指标数据平均分*相关权重之和', 'district', '29', 2, 1, 'xiaji', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); +INSERT INTO `index_explain` VALUES ('32', 'default', '服务指数', 'quanquxiangguan:fuwunengli', '含义:自然月周期内,服务指数得分=区下属街道服务指数汇总(平均值)=区下属所有街道服务指数得分之和/街道总数', 'district', '0', 3, 1, 'xiaji', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); +INSERT INTO `index_explain` VALUES ('4', 'default', '治理指数', '', '含义:自然月周期内,治理指数得分=本级治理指数得分+下级治理指数得分', 'grid', '0', 2, 0, 'none', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); +INSERT INTO `index_explain` VALUES ('5', 'default', '2/1本级治理指数得分', 'wanggexiangguan:zhilinengli', '本级治理指数得分=网格各项治理指数指标数据得分*相关权重之和', 'grid', '4', 1, 1, 'zishen', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); +INSERT INTO `index_explain` VALUES ('6', 'default', '2/2下级治理指数得分', 'dangyuanxiangguan:canyuyishi', '下级治理指数得分=组织内党员的参与议事指数考评分(平均值)*相关权重', 'grid', '4', 2, 1, 'xiaji', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); +INSERT INTO `index_explain` VALUES ('7', 'default', '服务指数', 'wanggexiangguan:fuwunengli', '含义:自然月周期内,服务指数得分=活动组织次数得分*相关权重+志愿者占比得分*相关权重+党员志愿者率得分*相关权重', 'grid', '0', 3, 1, 'zishen', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); +INSERT INTO `index_explain` VALUES ('8', 'default', '党建指数', '', '自然月周期内,党建指数得分=本级党建指数得分+下级党建指数得分', 'community', '0', 1, 0, 'none', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); +INSERT INTO `index_explain` VALUES ('9', 'default', '1/1本级党建指数得分', 'shequxiangguan:dangjiannengli', '本级党建指数得分=社区名义发文数量得分*相关权重', 'community', '8', 1, 1, 'zishen', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); +COMMIT; + #更新含义 update index_dict SET INDEX_DESC='自然月周期内,网格内注册群众用户数。' WHERE INDEX_CODE = 'wanggequnzhongyhs'; update index_dict SET INDEX_DESC='自然月周期内,网格内注册党员用户数。' WHERE INDEX_CODE = 'wanggedangyuanyhs'; From 7a48624a2f3d19d632be740add5e186577ffc7a5 Mon Sep 17 00:00:00 2001 From: jianjun Date: Fri, 28 May 2021 10:35:21 +0800 Subject: [PATCH 102/128] =?UTF-8?q?=E6=95=B0=E6=8D=AE3.0=20=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E4=BF=AE=E6=94=B9=E6=9D=83=E9=87=8D=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../V0.0.18__modify_index_weight_for_3.0.sql | 22 ++++++++++++++++++ ...系算法需求-备注3.0版新权重.xlsx | Bin 0 -> 64848 bytes 2 files changed, 22 insertions(+) create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.18__modify_index_weight_for_3.0.sql create mode 100644 epmet-module/data-statistical/data-statistical-server/src/test/java/resources/评价指标体系算法需求-备注3.0版新权重.xlsx diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.18__modify_index_weight_for_3.0.sql b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.18__modify_index_weight_for_3.0.sql new file mode 100644 index 0000000000..1bbb8b6e4c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.18__modify_index_weight_for_3.0.sql @@ -0,0 +1,22 @@ +#修改党员相关 三会一课权重 +UPDATE index_group_detail_template SET WEIGHT = 0.1 WHERE INDEX_CODE = 'dangwuhuodong'; +UPDATE index_group_detail_template SET WEIGHT = 0.45 WHERE INDEX_CODE = 'canyuyishi'; +UPDATE index_group_detail_template SET WEIGHT = 0.45 WHERE INDEX_CODE = 'lianxiqunzhong'; +UPDATE index_group_detail_template SET WEIGHT = 1 WHERE INDEX_CODE = 'canjiasanhykcs'; + +UPDATE index_group_detail_template SET WEIGHT = 0.26 WHERE INDEX_CODE = 'zuzhineidangydlxqznlkpfpjz'; +UPDATE index_group_detail_template SET WEIGHT = 0.26 WHERE INDEX_CODE = 'wanggedifawsl'; +UPDATE index_group_detail_template SET WEIGHT = 0.04 WHERE INDEX_CODE = 'zuzhisanhykcs'; +UPDATE index_group_detail_template SET WEIGHT = 0.04 WHERE INDEX_CODE = 'dangyuancanjiashykrc'; + +#开发和测试的 对应的客户已经修改执行完了 +#修改生产的 先给党群e事通和亿联员工互助会设置一下权重。再加上我们自己的 微笑崂山 +UPDATE index_group_detail SET WEIGHT = 0.1 WHERE CUSTOMER_ID IN ('7ae84f0ceb36397f5078187d72de3403','04c0d396e298f13e57aa5904a657eaa6','3fdd0380deff5b30f45376cdf995d1c1') AND INDEX_CODE = 'dangwuhuodong'; +UPDATE index_group_detail SET WEIGHT = 0.45 WHERE CUSTOMER_ID IN ('7ae84f0ceb36397f5078187d72de3403','04c0d396e298f13e57aa5904a657eaa6','3fdd0380deff5b30f45376cdf995d1c1') AND INDEX_CODE = 'canyuyishi'; +UPDATE index_group_detail SET WEIGHT = 0.45 WHERE CUSTOMER_ID IN ('7ae84f0ceb36397f5078187d72de3403','04c0d396e298f13e57aa5904a657eaa6','3fdd0380deff5b30f45376cdf995d1c1') AND INDEX_CODE = 'lianxiqunzhong'; +UPDATE index_group_detail SET WEIGHT = 1 WHERE CUSTOMER_ID IN ('7ae84f0ceb36397f5078187d72de3403','04c0d396e298f13e57aa5904a657eaa6','3fdd0380deff5b30f45376cdf995d1c1') AND INDEX_CODE = 'canjiasanhykcs'; + +UPDATE index_group_detail SET WEIGHT = 0.26 WHERE CUSTOMER_ID IN ('7ae84f0ceb36397f5078187d72de3403','04c0d396e298f13e57aa5904a657eaa6','3fdd0380deff5b30f45376cdf995d1c1') AND INDEX_CODE = 'zuzhineidangydlxqznlkpfpjz'; +UPDATE index_group_detail SET WEIGHT = 0.26 WHERE CUSTOMER_ID IN ('7ae84f0ceb36397f5078187d72de3403','04c0d396e298f13e57aa5904a657eaa6','3fdd0380deff5b30f45376cdf995d1c1') AND INDEX_CODE = 'wanggedifawsl'; +UPDATE index_group_detail SET WEIGHT = 0.04 WHERE CUSTOMER_ID IN ('7ae84f0ceb36397f5078187d72de3403','04c0d396e298f13e57aa5904a657eaa6','3fdd0380deff5b30f45376cdf995d1c1') AND INDEX_CODE = 'zuzhisanhykcs'; +UPDATE index_group_detail SET WEIGHT = 0.04 WHERE CUSTOMER_ID IN ('7ae84f0ceb36397f5078187d72de3403','04c0d396e298f13e57aa5904a657eaa6','3fdd0380deff5b30f45376cdf995d1c1') AND INDEX_CODE = 'dangyuancanjiashykrc'; diff --git a/epmet-module/data-statistical/data-statistical-server/src/test/java/resources/评价指标体系算法需求-备注3.0版新权重.xlsx b/epmet-module/data-statistical/data-statistical-server/src/test/java/resources/评价指标体系算法需求-备注3.0版新权重.xlsx new file mode 100644 index 0000000000000000000000000000000000000000..cb442ccfe9cb70a87b2de2a9b0dab96057ecca73 GIT binary patch literal 64848 zcmafZ1ymH=7A{>%2#6>x!;n%E0wRqJIgE6-fP}P!l!zdLbPOU$4lOASN~fgKsD#oA zBGT{7p#J{%-uIsC%)-SS_Sy06Z|@Uu6Yt?1KY#xt2LG{gwuHMn-*w}I zgK5;@7ett8*1pQ4TG&`v{y11z6n{@Mzk8SWo})urY@;%+4E00b*Is(L8c?arls2M7 zTp|`Nwo(JLY6PCQ6H``W^(K^fc-E>0Wh*Zna{AGU?$Zuz$WDhP%+$J(J=$z}c?=0} zJo_ZUU@v>d;T(DV;0rC*bb2zcOLT1&UD{oi#Vzc&US=~DmAniZ;-rl?lhl1tq|p&( z_Y}e15q)>cz1mehTkXwInvJ{%H4NL(;29(%+S8!egMRZuuk8O!I zi6xrH2I*GQN+pA17s^&RJf0Z{$sD_$eDmM-*zH1X7rsKg%ksGLKG^BvT?;WiYAyN! zJt)2Mlh+$Jah<-Be{f=`u|nPDezv#h;4g8|;NSl?ed#v2#~{9ILU$?e)~nA_xP+Ei z4)2TErcDFCf1byi`*#GOelrPjKGKFEK&0`W3_2~&xkSf5I*He84MsSeaOKXZdsUq^BM#Idw4cB8(Dho9kn zC7ajnd!7EnGt_#Wm1f$-EH`hywAD8!s$As^og&rED&(tRpsxzOL#UlCQM!F^-Ze^QEhSxdO3WO%8F}I z7Kig5X7NXE8M;t)wwbbTY3eR{4zCGa+?k5#BORv{9Va`#?pYo-`THyvh9bP`KLtKk zz1u^|ubcYjXXJ)-QqaumS&a~<@beW;>${B!%o|VJ)8Gh|RaMcHk8=d%8@^}VDS|W< zA2HruymJ5EbP+rzIwS-_I-jccY(=!<$Mn}cV|aT21NHdJ>aLn+DzCdPu%S22%({% zIIqMjS&0~#ju8lFJB)U;%_=xC$@=cH=^|V>w3ayKB^LD1kiD|NjQ$)^jfD@ziq`A* zt&G+b*X9aeq*s1A-*A`k)y}%wo=iIHAdj*1U;GTnSC_$ z{3YYf*Z1-!cxtzjDP12;tTiNd9j<&B)8#pC?vbge8eky5K;^o+W$2Hc_1yyX;bu~` zaZ)VxknwD0avNz++#zGk6NenRIezpqQ?%ahNcv7}u&l!O4>E7dp;OT48B&Qm z#U@oG1}}Ul$}Y%!%_VHqD?I6_^x5L8u^SHdGS^?~zdoDlt&=|>o2AHx7d*w0el

zmb)QP*Riru`?-lU0mmCjN)mNPcWLZ|XWs;R&p**DX&JcOMPiK- z(Z=dHR3fAmdrY?-tnBp_R*{gMsnI!JPo8T+_K?b<%fr%%__~}M#$G;8chl1z{ap6D z?cptXvHnJk^i^4Z8Hj@iWT(;ca(2DrW@~Nj{-1R~ZmL2}^bQu*;4lsr?SIY1{0Sz2IgQ2@ zbng?a5Bym-0^na8*%&|giSu~TwqVOVbNleP#P{Gv1*FF&9#R0SGuki>xNU=TXI=7r zS9Y)Q3y$u#4?SsDJ7-gBu^|2@b0^zL>CJn><{r0uCRo9Q|CLnX4>K`X(edtyU`EShy~+0Z1?$iz4a|q)8YN;8Qp-NN3x`F>O=WpcEkv6?!i>tk(o{Q1#tz`^w4u4t>~!K{D#t z+<35aBpPt?ey$S#;@6c_K47>1$w<=rL3)5r`&gm#?9tc7)_{hS3+8jp`>&pwHu)V| z-@E_)Q^fI?JPoFk-2>B3$EK6L#_^}kWK+#x3Av+VK6U&&QiqZaXRVch$a$udN5@-U z0{cIj`FzWn()N=y<_>=z=XnJj?e+ece|s|bh^hH-@j#b+uBpj5e|qoX$+vILk9L`k z50lKBb>>XSu6)Ns%9E`wOy4(Ea^9azCp*1OK>v5u+1c6jX3^w&pEc+EdN;PC z10y?+qxJiSD@?`N2@cZ|;1|m;p27qVEiH#%T;yJ!OA;u4yL4oUUsBl@bw2c@CVo(+ zUQ$IAwfmH8iHrVSz_UAGZ8vjMV;;uidBp1RRN>CPIg+%{mtiR2E)!p3a57NC$>)P&r}*cDID6EN%8_H$a@-apvX?6AX&uK zYOt-pnyMb4+kDHsn5VTcfL;};b5}EP*OX?)u z@C$MA7I&?UR6Ei(pZ?7Cb>Yv1RFG!FI&zphe(cB4POVA`@Z$4xry>X~j2@dINFc=P1$_evF-vp=h+E@ z*lsYRdnk%<zm3yUOzXFz`B*q+~K*3*Eg;Ff_saNGxW@l z=r`Br-1*cIwB@9bI8Fq`Jc7c~w~@Ug>J6RQp%O!w3uiEl)8YNopoNn9fWNirgT0vQ z%o*vt>va(^9y9s33`-Bj@Uq5PDzIQhd0{iI0Ivc+=R?vxTBVKs$)4-jw|Iquz*3gq zo&}~z+(&JfLD~mbNI4y@rf#&uNaU)6tOONEEO_xB5?V3bvKU!^}|ajd3ks^QO2cnGS#)Xq<)U6zNv%MgLikG zV(H_$(+odjrzFw@`ynM+t>*n@x;pM(Muq1m$wx-Z#Fl6yS9=F-oggn4y)F63k0QA( ztGlgao3fEU>8fPKb6s`J1 zQgXsF;kXH5L|o^vwOB8Atw{~GtO`9=7Kk*8Wu@uCb$za=iGsB(OCqcZk3tkT zKg>KTtZAlaEti}c@3j}YQ@lJiG-ZWksF0NiE^+MkfqW^Dr)C}KH%=XQMh#anOtoIT z6lK!j;p&JRkUB^a?HTYhPvb+f>aDJ*6DpZSlR)OD%MZave$Z(CgYs@%L~Ps95=Z#@ zgw4-Y7Wjxqk z^ryfGi>!1nIa49ipq*C8w5x3CL|e(viMNtXhzeqP*ay>{+)IricD(wZbo`#QP)-`{ z@I5^fuF$9krP@lHJGUTlq7=P(_&j4p>4`+Ads#h7vV+)h?Ur1jwiqrFK|(~$K?&(c;OadzES5n zwnKYJUAJud{Bn6O(os<5T)QV_0UB30C`G)%NaH9*+YcU>6mp&^Lc3!~gb5d}M`psI zAE1)A*nUL@PIZefd}BQ+S95y*=}4EwbWvRr`^_~Vv;at#m%j$QV*9fl z_56Uq%mT>-dv@x2EZkS*aq2gL%pyT2`-&A4puvt$sw!FM(fBzn*2l%d32R|%WwDV5 zq%xwOmn12)@-&}t=EaaMD?LP>Vthg@HTtbqx1|qDmzwyw(d1E;Ou7XHSSFKzvW1va z2k+g6bRn2UlJJz((ysr_=*=TmnWkOeU}U4z+pO_o`jJS67+meTva8)wAp@}-A=gVI z4JDv)hV|vi&ne1TK>o`4$aJ+yvczxKCoN3dUOFKYLh1}vUt}wjao$h54GE`Ilh?6L zdPrFi3ul`;kksMgCe|v5rLelW;ONB5R(5MxAZ5CC>!V_@-|PE|U7_EDqubqOZPh7v z=t2{$bYkvmk*g9(0!gAyN+zAAgj5=67v{F^(~QJ5y>)Tqr^<8@XT|HYWiBi=J?T5K=SIMyj| z{SlhMMeI=W+zCe+wwCReU7YZ?_S}MiB&!xAoW(lPU+0E-ju>npGIt^YVj!3W(O>lY zIEfL}pWM4l0RC9IY4_k;Z@|1Y!l}e0PCAE+SjJO+c4-MgIaO;ZC3o^A&AVsw$ z%kOfRrH^8l$S(M8@ZdAZXOpQSh;c=~)Q?(yFTS@*l&XpgzRkU|#M&@a?D`QS_ulfU zY0sR>5y}>F;?OvW&*{CVVo*vr^FM0c-zdAqqPnZx)ykuwZs&B!E4^JD$ z9Axu)T|@MSWLAQ$>N9IeK2;gVrlRQJL_ zLMV?6FUam333&dZPO{4N{a>3-Q(hjJ&5hArHGgd^No z*74m;ZyW?VERwR<2>8wy&38x7Gq_-AzPqFHA&5&GmWfbC=){`2-tl0=Mk(V&13~jY zlGXA0l{1_AG9g2+Ku*p4|MbEk|D{)XEMA;pAvdu!u#&7>r{$CeD`HXJ6&x@jFGbiI zj!VUc$#aN63}8U{rd^5P0!Ud^Zmgq|MnVAuzWgq+1sBu-`JDK+Q1@(E54LdG{(*_; zQw!kZ%z<5WGDjA1Ht@OP8hiIU(-weZf{`!QK4g)h|at7AK?x1@pN zG?#h8WnWHZ199mPW^|&WiXZ~n(_&ATLlTyBD1~Ped5uc51Vl?9)d#8Dz3aQk!v}4k z{0mHp*Ri6M1xa%cM34X+01+98gb?Ob9A`H-Iq6nW&+kvuoiYZi7$)<0;sv}DPZP~s zl|6W=>AidLyLo^SBt2VMeOv$6_ebuQ=N#j@8+SR&S-W z_lt;?XSy5TCQ?<4MsHad=m@^;{?W=o$+tj@ElAl*P1hiX zb*4lG+{6w}KisoAramo0FS%tw@+WIGh8wTLEb_9~JusCa3eY)dlCXYh)*_&f<4o0) z(3blHjbXpLk)YqY$TBs3MwVuT_{DT>iH7TTLe%P4ACr{*_okwslj`qK_JT@{W@1*5 z2GJTZk}?XEAQ6c6gkiD|AbwtPs!(_daNc_ehA}aLEP*)}=P?6OwD-Cr1dELg9g6Fu_!EBG+<5V|{#AX0$PtglJfVZSBDr!&5 zo8}byo(|@~=s3XV#T{-9S}sfs|DmAnN<-t$9A(*Pwyz?huU^JVzxWfxBzgo@O@9uR zOa*s%of~lcu2WY_b9__nvdMEDO1c4&6q`Oz^+^n$feH~CpIR7;HN3%|; zs*J*O2Mp-UGPu?K!yiLO`O30zeHhLqO4?Fbj~l6-(jp9j2hdWTNPJI~PpkX$FyQb6 z`TI>E?a8kxTX==1rfw|SvB4NRB{D!ku+)y_h({BN4i{)`L8(Rq#Id9VqRE*HGX`x% zTH$-hDMFg@p@4on8c*2}`DL;so*ChPe0Z7%kAJg?mQHLS4Vu8G z(F9(Cmc|!v4Kk#^1Oft~JSeOkgi~9-F#{H?L$~cw_Lz@SB zW^ZXs^NpsVU)_+Isy1a{0R%e-;yLfy#&Yrdf7&HHO8{GHdhJCQS?j`9ChY3wU+dWG zn`8^JJOG{LO}n50oZTcYh*hm0yRQYRMs&c=nxm5wk?sCqOj`WYZY!K7u$eo&v7GYH zKG*PAXQsA20aE7$3REPR;3_bvpaBS##Tr zo6D!tQSTCq3{4t2=N#j>4>pa%9m^Herw1az1*`(exv?6oMOySh%8^P(LWn{XWYkal zXUQG5nMGG&VXFhs5vv}fQ!k}lBG_IY%twH88Jo>cm*&^~`Z>6=)|c9sTrcV40G?(N z3%J~+<^x5kXVDJ(sj?Tv<8HEP7NV4fRkKRs7EFVtrakyHqLRx&yTWqeW+q&A>|CH9 z>BPuV0V{l&MWgDz>`GjG$fVuqj^^PRv();HMb67p2k3r$qcbYwk|z2DWoxr6mZ4gd zXd?edAUs7;AorPKVhbqtrbg&(%|B}kiAIjHbH)mdpzdV-+-(-|0v$AK;wMmZx@hL3 zz)=AZrbUm9QfCbm+W(p9C-rocjpJO^Hfr_qJ#HVj_l?)BtscyRqZs{e4iYx4t2iiL zVXUzySi|J?Hx=h$tJ16i{P?rbc&hHp*PwB}x;KuM;Au+yU&Ujvww|e1)=u<_uT%(8 z<=?6JnM8wG9a3AA&bJ!e4PyU$2Z{?eMAl_F%KcRA`{CKC{q5n@UMCNrv*9ynPhFg- zYXS!*%{J6v`+E_4A$ZNs&Ev8rTY!5nwn{=cb&l(0eY~4oT8v_f(VxGog5?FW&yKi> zo9EPC9j@&koRJr$;@s%G33G^b*r-do2|K){hIW0@mn~vP+UMQmgO}h)9 zAqDQ*!Y>fV_akt}3Xt;oqiurM5G*J08o%$b*Y!yLWR&Ur_ zaJMft`FamSl71`?vw{Ah=@X@vFuI?748_w{i!P_?2~yOaRZ`^;E;|c0YF$Te78>9S zvk%%-fh+bngGEq#NgjL3;&4r>RJPQEjYSw$J#rcvcMgyUQ30~;9a33=D!2fuG-3Ba zI_odJvj1Bzaq0-9JfY=in@u-HsWzI&AXAb_C(r$*QrMQtTinP3d&(RH)l?&>#(7KN zqztHRP4Gvhl@_291M)AG$bd=`OX%Luo)R1ao>v39Q7q~{C%mLR22sv|Cccg#*~@DO z1fKDn7^oe+^gvuQM_+9;SAP^Tc`XYnq9U>j5D)d7uI?7HtOiGe1<>Eyvk#Ps%El97 zJJMAJP)#o3G8u;aXeqIia1a@XD_2oS(1TM2+6ZgX*=xqx-ikzy^Gr;8@o6B(Jw5Gs-WX% zap$5Im_@!KpPG8mwb1C}0$g9}G}`vV;p*YeT2mzQ=jV1nu2KJl(Pra0m$9}QDn0j*4G5ywXZ%tAJV^1eFui>Ia{OKpww3q z!2ni!kO@{TA@iPi2?}i?*eS5A2#(88?C5VnXtpxImd8HRe`eTzi{hw(1^1-rGuZA8 zx0T?&`n@-XqM4RqQc}C1koZ=$9%C2?8VW(x`$6g9p`{c!_<+Afo2j%dlZF}wAZ@<_ zKw5`E#3Kwy0U}18)D}TCIbIYHOW%O~sHv?(!Z}ZNQva1cUq(PL1%gAMEsWjuKzwKk z#Ie~)Gw#c0OdPMfqvJRRXz;H%<`t#Ot(JSS;{5MKba3-6z)O0mWp5p^7-WB{*aLAuHq_In-m-xUgO(eLg^41N_4Y4W zQxE^8SS&+~q&5zK)ydlAZ&?@VK?1pKg#&!1py|!-28v1>W28*n2Cjeq=X@rNt(|CM zwXGb6#AxV)V@=7EC+~rNRJ8YgLH|xu z-OPQTb(y2O_A$u5HzvzlP2X-zpbH3y7;u>Mw zV?NS^H+s~a1U(#w=i)V#yv^P!oxdHu)uOJ{Zn7+r=mUB-2O zJKWI*k(JL^jO&dWqeADXANDiaSq3&O%w11*-LG-LwblWW!V$0_5ovFd;ZTl%>K}9+ zhtDoMW*F4Ib3~1HIF)3R#&5AxD4$BBw#AJnggOQy-zy$9T03T9UsEuzxH(D7Z)>?u zTP%W|LjmMrlT>2&+=>>F4-yI4dz-C9*CL&ofuM_!oy3dR{5ih_OkhktorN1GBHe!{ zOJ}xRWN0-t^W_Aq<5}9uG6^y}D!9!er_!kz_;zyCwsOhoRym|*8EWwSNCg&0oF0yz z2hV`RvPnmA90Som;oFm_6H(g{NmO3#>vx~K_V3W8N)C4f%Fxy0#)x2JZ2hC#-o!0- z&Nc`3e~UcCWit3B40su>Wr6n_O|RzrI|ju~z}^d|_Nq$X;32E}uXxB5+2bZRpWCaR zSc*U=@D4h{ z)I6fn-e$uDC~wD6exs(E@TgDJ58Ig?&)$=~?p4~XmUL=*B3MYhGm0B+;`~xYxUvyzzD2L4A8#JB#?vA+l zlUtNDs7e8|!H$hr0B#YJ6!?=AHaC>$GW{6hMND7sSC$OS4AqJnmJl%4XBEt9WT;_> z)~r>QJ7(n6xEhjb&&w9IJ=BVf5SZ%4-H=YR*5|pMV(qek5IJPeUg7B_wXyI>Jg0s8 zqGmX@Q8oS_E(q7P{ zxL{rlYgeFdQ_$O%E?>61qep6^Pu;6;gFC`=2G#wBuUxpFsDiW5j(}SAYQ_gEg3-fn zRj&bsXP!ufRI4p$-fA+cVL51suD&E*6kAwdp9pCKpb;|hF$N8h5aG9~)poh5C$Wi9 zGfe(cx!*bq3%`)5x=h^Q0(#7sbMv;JAG9!%moW+%s|gFPA*!!#9PK{KpKK$uC{)2C z)Q@9d{7w-5!F{G7#)1gwmQ_cwsHvxoDbh1X7NU?tXXW4 z=kRAKbQ)Pm8d%oEcZYLRoO~WtE-}`-dz|-bzhxxC(>{i4Y2?|RQ-fphB!VL>f}bu) zhb{9^x461W6e(@F5uOa_nP!t=A=bXLBd4qL_lMa(XRug8;l6ZG zuOx!H@!U!o!OarO!H0>EE%26jjNG>iAB;@C3M+tS7M~h(#`z}9? zj}r^gw-O}e;0NOoO5aV#^q^=Ot8zC#ae1jHaEN|2(18vG>$Mmc(C+WPBGUd?Oi9~~ zqP}}-fBU?Ud6jOu7Sd9m-ka};eJY){qU(7~!O}v_5|xDcl}2;g^=AKm{ruYUnx(VS zmQl^DP&Xelp-$dPYjx@VK{wU;k1=BML1H1=ZeciXMBD6*Om}U~)Tve6c+R9y!Q&q8 z-nJ$)r%CCzg;GmEJba)ghjA~m$0NqBgl^Se{|x%T;}aI%3vVEK6x`v%yTkPOp+gI z`ABmKZ#3Ilpo>1Uh5n60oG&lI61?m$t>}`0(%o<9-U&Y9k5FC0!bcAZVdp3V>)s`K zK1ab$!32yXQ8V{k)zB4l5Xy_q`PF3Ot44UKTGYO6n92eJzGD5GW! z^POuP)P-o+-FSQez8;AA<3hpY;c{9lGEFlwbI+nGv}VjUXCC%ppY0>&>ifonb|%d+ zN+LxrSpn)6h=U$sNYR`3TdmzP%dVwZ-c&+sroPO=j&asAjxjh8CBlmi<%8ra)c=9i zPEFu}m~Q%v7Wxdoh?UQ1f9;0?e_6T+cG_h1fy}3`#~wifMp4%mVddc zJz3F&ag!bpZ=MEGK47WEp9J3%{>T4$ju=6n{|@CC2DFFl(pF?< zf5YO@YB&8G9>Ek`>SQqFMjOOd=y+49BHO#^B^-O7G1B&zwQ~H8iRy023%G8mbLj2+pSb@MNA)R8Hm)hk{GCE;Sly>uJ(B$ot!{q(Z>`9do-n1Ktk0Cz z(KhWH9}G=-pn>bK_Akjfr@%e67D-4PmGo1P@a2AYN%k;(uk4aEXJZ7#EB+*3?l(_j z#iWDKL%u&XtLftw@-LhFzR~fgPz`4OO=G5MF=ByZga&Nqm+sLB5-KknhgguAk701z zLZ7+RuQ_)YP!Es#()hVpOqSoj^+(1;jeGTFOeDh;|IIrAHt7R8fGYn-BK>C|Peouj zUoQDXB=WcWf2HL34RlK8R-FHXexr2Xu8Q|!xPzWJ>y?eQf`Fu*TB=FWX}OjR2%RR? zqMbh10smg>)c5p4F=n08Xtz{A7%pvymAU;1t~%q+q&PTCrtPl zIDSl+kWl1Ls-JCbZsf(35l=V%Fdq1nJa zNky;4_d|Nm`pQPCPnkm#T@mf{&kABnh&>siS}m=ZqJrUfYU(JX1!|^02~8$7U6K|! zEtpFwW}elEKLHizb%RQqe!r2IQ}3#x@(02Ve17N_Q(=r)*v^RR5_5tV z$-G0nSjZkExfg%eSLM~oIq*yFu;`?C#dCmT~Gi&ZS z9p;*O-hr*BiO3R<0m212G=V*Pc?t!K`&)v9`St_4{3*Q_z6_~<%9B|L9}qh9g#=3M)IsA&`ai?9Ku6k$aLG4 z#Pc4L;WRUq-SmdaR_f$Wmd4KqVwwhvK`^sVrYQMAJOlHUp%CF_@llP+)KZT#gc<95 z<3B`n37)vLwErl~{nxM!gT zaG<~$wMsOr#`q&`LsHC(J7p@AnjvjH*|KYV%%1cT{BBLplu=$lhzO<)5p6RW z{8`>10%;4H?VoZ-LPJDXTZM+gg2NT{(ro4XHH3t5AB(TcN7%f!iZVXm18PLyx0?^p z`Ca+f+7m7SQT^3JPVOfX*~0!;o*C@o4wk4?KgAfoR+;y!Ge$43d7OInaRk4!yL~1$ z0o4^$vhA@01;+daw!Cn~QKp#Y6T4JcU#~hmjS8sMB5R!6T5-yDrXYE~)U$sJXmc--$OsGqml)J{A5x^DAzkWgkPg>^zSoFBGnrl`YwgS*|VwjunXO^NeBo7tw+Hv>I3SG$gNrnL+(G zJwI7&ub|W_YgVQene0?s)8m*ue9W{udBd{N9s3n6v<(mRm@ zD5I@-<4_G_$XpuJOtsZd`@*WWGX91OBaDE}0|%{Mw77hbc-T&RHpUo#Y@Yv@EGxt# zl()y|RYM(iq5uG$T`C!W=?kNNLFU80`ndkbhW>WssS1pIm=7ihXvJm2tJjI51Bt3EpsbBO{)JbjKShR zgkAhgn9dlBy-r$vsYe`P#xnE(mkQ0>E8~n#bRg4F47aq?rY&yuxsJP)6_A}b6xIlk z@`@uaT!AF4jGHien;l0tvv(AYUj_5%$Nj9>c|}U2E`>!D4j8-Bb_yMa6aVG0voo%z zu-z+o&@RouQN1;H@%o2B=`@bS6+IdRdVd(ulMXy~IS%9f2?y}=Z!_r#Fjy1e0J!}( zbzoI*Ig2SXv`D9AAQ*aOL3pe_KHZBG2itSBV;}L;0Wz{TVGyQB8Ve_z&yJemSNbOh z{!5nWrTD)Yt@};-HoFJd^PFZIpbn6kxGwP9KU{>oFah|b*}H6X-2W?@`7-(7)NW*_ z`UOTgY0ep|-T9<{l$*-d`6bf(Z|z3Eb#8&^(~M!#^QlQvH^5|I@gZ(IfZ0hw20-oT zH#BO&PBB|5UrtXOZR*PcGEKlkK{Z9{?zHS44qyL@K$~?=B^pAf%#H1^$i$KOZ$meY za?s2T^Z_JP@IT#un(Cj*f2F0uFYw=a@V~(SE0n(zY4J|l7k>4X@gLb3+QyFo^#T-> zQ&^n$2sGH+Bx-u?Sb}6fZ?Z2AC*_TM@Qc3V9!jlgtbjc%CfVMs!B-3j^NmCfyaqN$ ze-npi>tBqkW|a7g*ig9C`45sw)e8Tnwep&)t)NJW@M0>9o;G2=n8(K3nS}|7B5d2b zZZFT)m!Or`>ilsRoUj@xt|u3)pgZ}*R>p`RaV>{MscZLI?6uQ)647~37VqTbvjdKB zEZ(YWd$^iy$E4NhZD;rTkJakpy6Ab>q&JCTMT#G1GyO%Dp-y5-Xy3K%f5{<(a|axb zq+aZMr<0F6_7{pZ(_e&w695ksEvRVyBKZ%roJK|g_CQtOkFxuj^I|k5(C_fM)4&y8 zbW-R>*)?SR@#bX@3c!XoOhmp@Yb_Ls&mZIjtYN_zxU>TnzCQ7I`)1oYM>#ED@8&Wx zhkV|e090ArcAI8VztZE6Ks# z;Ewe`fgNS!?tnRJiI8Y@Z@SzEP3>dpxm|*8ra9fBdmJY-vyMMz46MC>xsml6(5S8( zA`kcbP+#FzpBPZOV^QjDt^y%P^GdXsJlH}Ia-8V%r4@&j8^?>vkDX^nRfv+jfg&4- zQN(XVIKbICp|LVurbAC>#LYcR|AF0r||P&*!O7&y$( zHmNWj(2@=klGi7RCE$oA;5fN|3x*pXFs_%EpMkhEr2u9Te58vPl3#3KnvWHd*R~5Q zuYr(iRt%$V*E9^v-*SoV2<5dCH;e7ajmicm^1%r}PAG?p%rMrXR8dw!CMyNWhrxOd! zfEIF*!kI}mMR>sSN^r1_bX?SecV!}y3z(i z@(8KR!A7v-ghX61e*4Er{5y%JHqW!$M=G*v*F3+z(nmfkLR zf9v}jp4YJ)U%mCb>o$f9q~$u|3hSS@E7wA3U&?lf@SV+M+b7^Wc^!|7&_>ehDqFUS zTjcLg-Ow)}ev`O)yJ*p+k>7e=TtJvRvMx9xFYl2pU6kg%JlL>%%QGQtYmyz=YbtDu zoYzI@9MB;cq$&KR#+-;DeJp}vzmu#oI|#vj;cK`+s#Q6`W86i!54gHK&^UaQVJPSpuNzFto%QWpHG>N;;N zetaj}t3aGrfd+R~jw-ERWquT?wSHycT8O(eO~S#7|0;0nxA)=jOr((5Z3*LlEV zk4_f@>*2f#R(`eiy}*Mz<7}osM-cc^dyI&uDo)t=PS{l+66@R^7*=c&O3EKNx%Ljn z8Zz*I){(x*S#v4|qt^!-_y-zIk#6_K^P|zD)bb`vQS9cm=Rqp5zjzqI&z&m)Lc`aM zAOD%HHqd^noSU=ibAj->w$JxX=$*A68t(u)gt3Lq^-1btaloyXFt}_4@rFL^O`wLG zk!p@1Gb|LgK2LWc0|mqG)CWfkNxy!K2YhB1xCN3Oew=!_PMOf&Tmf;xd7{{MTg}P3 z!shyQ;6CW9HH3**Ahvb(4f4fP2lliAHw76=kIfaf7%W~1%zks_Bn4KxL+${_n7ruH z4cvr|Nq~W_6SnYbq89V3lB{}u9JP_%*QreeFAYg6KhPi;-?4%ZWBw-^MEjNO!(EkG zk4QyCw1M5~ zey46Wf&H6uYELC#HB>Ra>N>tYu2$R|_i8zkq96k^HMm`58l|a|xvbNva+wqfn7!;!-=E4=rbvsDqVS&Ir`J+9aKDP zgu1*sm4*&iFBPELG&u)cdM0A7W=Se#dY(j!1m%c`2%|6Ep7!(QL}r3(VD!B*u^nza zJBwo=xOg=fRGjH4Q1i8>TJM9=MQBaZwt#Eim|$?BtT#-+L9SAWzOY7AKOKg?z%4k`u2{RehWTr`+TISec%mN-DQ)~v}@GUstP{OBUY4J}&JDz4CwPD#ki zu*T!ikhy_2ln`y`ZKmusg5|(=BvTt*L^qNn@!j}Eop*SnkdK;5bl^4wTtK6*mND0& zQ2r6c{#I~#TYt^kTv3S*m%y>;Hish)Iws)K7=2-lzO9xP<}?B}=Z5~iP_F@It5Gge zkv-7|x2uoQvN*_9C$YxxY$j3OdX?Q8*S^$R9OaY{v)nmLTU6G2MIT)>9x~qv+@i1o zjtnlsE+GDBL5lE3UE%g6p`w!EA%xtzpSfIEZv*T^0w>{XsgYcI+? zxN2=Jz`+g7FUrd*!ZGM0;pqA`^1r`$yRvepu^8Jnl_IfKk^I&Q_QS=ux|1S<2t9qS z{7W>N!aSMwda5ZDg!KN#brs`phST61^98&!VG{*APv*B;OfYW@go9E61|5!QP_Z%HN*hklDT#_P|0s|_oBBf)RP@QbRPg}3?v&|GT4MYmrK#Y^Ju?zg} zV&^|R4~tCvq~k_abi2Ot{oFC+TK*VrmO*tuT{H;?)kAz@4)__4x61a|RR$9?t#lp8 z%@-5$TE6B2MYd9^+k@Y4=}Gd3TE}UdgX>}%I0a@<)0p?af5F2eOiR=Hn4pbXXIA~` zwu$*p3vHrD)!(&E!Tj7izs;^Uh(|!)7im@ViSu=Dzy&zZh{oUY7JDA;(QPg+C8e9+SNXz^h^2Kf@-}Q@8&BHvKt*dIj?Mz!`LttO?L_ft3 z92xd-sjz8RTrRLt(CR12Uuv~VOmKoGH5jz_FMUZ6Rg2dqM^EhG%20jroFqKBD1*id zpV~@6Yg?70SNWA>gnql@P<(>1Dt93xZAE!S#lJHl6B+uaW2%Bz}d8bMyN?vNoLdw%pj| zj?jel``PkBLdANAj|s-0`Y|T1;gGE1Jl0`*BN!@hWkMl-_o>wdGc#SdU6KMzJ$Nj$ z@~Am%tHtWVC{BGK81|L5;}5ku>^+yGTqjCu7N4z^*PovNkTv$Si2qyS+GQTgnsJ5r z02^aZYywaG1W$eHa_$W1;{+J0J%ZnGJ?8>E6fWmXt;&>^$(&5pn|iqU?bL6? za&0uTH*P6=UY8yQ8aJ*TayH`F3s$|%#{5bq+hDTr-pZW`WXl3bc_U}*IE;|_+I1^+nSAw_26@q5pI|iPBBSB1g)pmA$pjPYy zd#Lw~Ab+2i)O;*8dzdcbQ<#MQ#$8aX+rSO}>_UxT*$S!V_AF{0p>eza%Cz{tpe0Se zFV*Lrj=&*0iO=1ss94t0ysMclbOopH8+y`X{9C>~5Y^;qEaO-JMS+^zFmVBhr^{%; zjHO1+GxigyUo_Qb#|Nuszk_I}^`R%~=_s#a9@5->o@t?W_VYG1;{7|%7}1w%U!kb) z9huSKEr;g4W|dhAn{c~E^qU_r3W)m#ZrOKU@ufPd>!wRB1FtR=oq4=Y(ZlQ>(Z}Tu}j%=#ns#fL`{q zbXB&6qH2XMKlhMJbv54X+phP)>7rp)Z;A2+V8x^$%I^&&} zRu|xA7vNSG%>74DBNxp@tA8l-wMds{AozM^eel6Sk{8=n1izcMKQ=yQ8$X*j(WiN@TP#fXIniy84|5Z9M2rT_a1vA?skBk1poSKQHHu@!c3 z9ZcHUO<#|D`gq}W@99bZ>6LMc9Bs1Pcw}+W?;ASI6BK=+^ql(Szg`Fg8t~sFZ3iy| z=D`br3%-~;Tb_I9M;z!&ee~t$WpJT={uVoTCNljKBY9RE_SrUKuJ$qx2slNe?k7CM z_Xz+6MxP;#8Aub^fVcifRkK@ImG1|=hv~fTVlsm4ZFLaxCC@_!#8~RI*{#AKMCU4k z8qsKR(3fP^Y3x?Z6|HV(O&pfgGE#Zg*lo~nVqo!B4}hSmKvcfpH!JkhCm%NkhE9Pq zC)Z*z&yISHXYqv6Pw}EmRZ8yvv>i#?(aP$K8jrkEutmWC7oLTft~K71)7v57_=+AV zD8HfeDBS1=R6Ht9RK(pI4VlDx^npRIayKS_y6E0G{OG02bW)Y|#{C=2Nb)(829`d` z5g%OYd+0IRAZpLS>r2JZ*-ckp8!sx!?_*ip3vmCE2j3er#~ZzJ{;*+3jDFdx{+}b@ z+2QOUO)B|iQ?#HsQRyJez*t!>I^^=Kq0CSP==4DJm>90QpXL{m+!`&ZgAJ32AQzFliVW@6&Y6qXye%)>#U!i42`2d!PgA<**5D#3 ze3mOgM1E!x$ps#bDZqNw;I|#W*Y5d%td0w5);}2?wdX&hIw>tczJ||9z80cIm25nV z(!6GS_269T>KBOmouN4hXUQS-jhc+uJA$_IAtCVMHw0*z-vZ-n-~$9 zha$7I@9ojDBfx@%zn+AmUkd`kc3HgUL%DnQJs$4o*#8e-Zvhq6x;_rikP?E@NQn~C zAsvDeN=pwtNVkA=gMfsHbc0BTbf=^e(ntsh2uPPm3g0_}9`CvL_y5)!&pPXzcR%~- ze%)5qiSfLmoZ3cZy-B`FMXYFAhzk363afC1)apfjKl)g?ih(s(;rC<(tx4IpMeguE zW`4d1nacnhN&Fc6Y+AMnNDOQ0!eOvAbhaSkrc5T*29L*xv?i9K;WVR=a;%KfneldL(`CzMHE zeeV(Ju2ox9NQPl_)+@ z&bLTs*Y=JnHYRuHMNDq#L+r{o_Q&nvS-;mwH{XJtzC(NUf#VliTo$OE2tNH;bKQKE zso?mjCFJJ^k*Qi|#WkiSczl>lHH|^FnFvXVykh z)u@}d$zbFu3pmzU*O2u`gp0%b1mR#*;}1pmhpH1q!=GzCA;8V=kmo!wD1i5y5!xtY3+kf@gS_1=&=&>9?(^{LP9gm5Vv1Wp(kcRUCtD``2K+MJW zpU_~9{*O<7@1J}G6r0hCg~>=W+bQu)3< z<#or&lW$82msk+CpfA#(oL zHCkT2m}uJc!ws;6!ya2C#6}r{{@9VrI};B}Woq}QsMm*o}9)H7w(_g8RfDwWz=&g;}pW<5(j4ia-Ef`ZBs5XLp z*0r~;nI?Xu%4ns^kTrG)E@j|$e8|>i;*yCeSZ8$j)&Y!6T{botUH%tfCso^)4L*3m zSH;Jx5wTIi2n-M3E#UzSzd*6SKmmp>ml%RAU&f?JfZ@YS3>B>%z`T&X_x=_{Y73&_ zA1VBNvOJ%HD|5>RGwb)9Cl)bU)jHxYL5{RWq1dBPARH$k9Cyd9=JBUsWzojmB`Y}= z`c|;6YJW@-Z0(S=11AnPC_63N$+;*dDZVVP&6c7*8B6(MoMe=Z*jj|Uw+mXCkR3SQ zltixHUhCaW7F^?Ee<$cN^qjKY{9Y)JEG<&lPbT;VJ#o1iW$BU5ZNjMPbz{s0if= z@1tck8$5mxTwPaR1NN*QBNj*d%T&0LW7K`n{RX?Sh(#-;vqZSyQ6sPf33w>zoXdp7 zPtgK#7_lD{g0?i+S_KPJvUp(cQHR?pP<}Mvs)E&Trvn@aknyNp{Y}$OV>}{M zN8ddT_D7T%NlLd81T3l8!w8!?WhfiEV+2GwLydwTE+89E;J_ow)<=Nn#stB6nC*0U z@SBQ{nScrkAfb)Zf;l5_8VeBg1qd$(VpDbjtauSH#=q-L1-*xb2`q*Gg0#UYOPML+ z9)e2tf>13KjO`JNcuCt&Ue&GXN`VQUz3<*o%T4qJ@nSdoQ660q#`@4`0q5X+VqhNj z8=egI$ZjDW-eZ6Z9iE|r*bj$TiHU$szdywTQnKO8VXLIT9rpd%zJ0vu(z$7zoih(M z0o1`JfR6m-gi$&g=ssA;Q^CBWg2@SX2f$z$a~k!}B0x4`YE0Ju`3DD>4<^b`Wr!nx z%VTvH+Bj~IB$9HUdzK*8SL^;{0g7L+s_gv8PpGalC!wb5C#=}QDwULqby<Y>S060ohEB{p_HdSdR8qNx&o6$Xp0!@p;0^S#;%y^IK%Sc%r1?XpyJdPnTC5(@wT+WFK)+|JJex#kN__s{l~K{%mTU``V`P*Sn0@ZAXpQ8^bW}j{` zvMRB?JtRPQzz#%ZCLrD)y8m=5)@fkM`qQuWb(`+?cYb^1_sk2&%m=GiYnHig1O13SXdph-IO2{^QG`>~{9@?wu;(!>Z%1dV5VQ0p$zm8!Kt#0m_ zG_+qewF4)~Qx?kUc!-6?Uv;+J09Kt>$2sn) z)7ducHF#}&qn`LsMiu7#KD$&1j@?TT3#K5rms0@nPcR60c>q+<4$J{g)0v7yv~fJA;;iyYX3O|0I&*0CQRereJAY?WjSYJ6&AC& z;oM3TM_*8iq78=OSCBvKuu^quYaBVvvM?M^-6ciCN#5N51KN4h-QsQWVokRqHWs~3 zJgws37WDL~p{q7N#j$2%y*wLW4FB)<19Fzu+XYUR!v!&RtKVQ0KT{}m-)ymW1XH9o z{-ft=j#VPIJLF8S*3rSA=W6>`&-9ZDOTP5smaO!LTb`nu;mdzYfaz2zbEtC{xGRgt z1n<145_vAFGDbeNP+zxHR@Cgk;YfT)y7*-DN5sH>A!bey>thpQb&?7c?DF3~%ch>C z_vOP*XTw@s%({Qix)$Bwj>4~xDBMfw1ziOJ_L6jinC zBUX@0nEyF55id@zF=GW>h%ZW-t)1etA;~_?Efo?sTxF;WLbN|5mz?GV)~n#ig@kw| zHS0~9V$rXBzY0-6kZ#<)6LB?0x#(BS@$&?Z-GN7Sh_Uh$#;mChdCD2EiA`7|GQ!#` zH{8261C18oBj)Wz>8TV60xN)&c}ra1h`KW)1)wHG z>&rnNlnEWsK0@GS{RG6_o&dMY$3^(i#ie(lV{?v9Q9s?FW7SuNQh0&@>AWKaB(>Oz z!AV@i$)GTS=f#`ma=+t0MRNz3RKWQAgTn-T5wPxD!vyz6L2zUMeofIuE2Wk=t)uKz zCAB~ZPS71k4}xgU64xWjOjfrL)R^v@_P&-zwJ#(lrmC3`#_um{&x#GsNSE2(;3Bn$ z?00}f>n7ggG=Oq}LSM(w)w6PeA<~47k6}CZ`1FdH@(UB?boL1PF+wC_s3iXlG@|-H z`=;cb^%k;v{|D`Ck@r)!Zr9d7IcwkUraF3iZt7#7;zCDi|6e#4Tyo(~Z8XHPsXBno z4uWduFKfq&1zL9uLww)aXCcdemwikTPB+kBgO&8JeL+pKp~Mp(LEGccMfPZLp8Dz7}Y8z#2NQ=42+RV|#9 z8964;-{V!z5-BBAsVHubz40I{Hy>(Vxm%hA_KKz^qUdZ;dWgg+G7FFwxH0lf_rjyK zryx~7jl9H*-tlR%YEsB8yvUxiU2?1XsJ##HAoJF<0h1tbZQ2s0VobWJ3{1w|_>A8y z%sS{hwPq<;yk!9GMU7-|WlbH7`q4qlFuF~OB4hmgqoV~XnK_}FrIE}d#1wzJYg3A% z)idqyWpiY6k#8Pc=6;w0ZgHy>^HFhHstWgDnZS_u%&)3f{hhT#0Xyj*OhGWF(1@p8 z35FRmzI0aydktZ5BBt!hV<}&Ffh&siZ8x5)@xG-6|dN;~>QS@J#D~ zS75JVILH!QFN#93+@$#w#pmnCcR!o2TFL?;q3V5(DIlT0NP-*jme<*>2t_+&C>n%g z`KWH%{Fs!+kppWBKs;a*;RIc@YlB&LR-9{w{l^Lnq@_N(N(&H;IkQJ=tcqT}QVZft zdXYa-N2Ivm)QQOC2IMzDQ%NWfuEh6;Ff4#O0fW6McnN)F(TRN^rXxzEwgN%%DnZ>( zYR~nOPe6wP=J4l^qiNaC8a`uCGT|v#OSiz;I591&LJ|cn3Bb@nuLBGnN@4`5I1`N| z;sv25+8~tv2RKmpnHB#jLJ*gr5<92nroqJ?H)Czb7v%~)$h%onpyAj+qg=MrD3pd1$An4jy;{5^F&i0>I6alr)Z-0Zkyz*s9xZbao zp4?Tj&5J8O{i{N*@8!L!VH5<4(|iceu@Q;l=n$sW=Qv?hwk$o*iZ`ZxT5|;-RumfD zsX_?`eAzwI6iP4LzxiuInl^t2s; zwalM&I;6BRt?XG)$NzJ;z=Xug;11|>Q74j6 zWjvw+>(H`P8B-tRsSa?!f_u(sKtf9qTZr&phbbLhBD#D!)mZiZaIf%*S`l;)V`>vkJY1HbR5F3{6chvmr)Bwfx zH$d3BX`s9On6W0I^Q@z(`-u&nnN!}xNms-nv{2ot90o2fP?n8O&3$)$(0AKI8haFZ zL#FMCjd4zdc2Il4-P7iFryoS!>fK@$x15CFDwo$}1fLDuUxP@k-CQojBet?7VP6(6 zK6v@}exovIfpLfKDFy@cCIsy$FlLRF3J&EBNfcNk$6E+z6x4Oh%ohkTiho6ri^^bc zE&nIm0Jivo7^DSHYJuStxRp=6kfChbpx&^NxT>}46-?ne2bDV}p~tf>yGM)8)I#eu z|HL`6@>?r|*_=zQ#>mrMAu~u)bgV&-4AL6IXhXmx4`Ja5sGy;sJvYHkYYzzk`^vf? z*(gS2MN6r8A*cyTydcdP3YCBnW9Bh%>DZ6*g6_{$=t!thd;}874V6crQ~_>H8_@%} z#)9ktXdyttatJUvul-H4mWmMo89@sJ^a?6cM?vuuoe=W2dLCpinkgM+I1fWcpl=0c zZR5e~fgeZI#P^GU;u5w?QD%(uSIb|PM-M1pJwQ}PF^58+-Gs=3LOW=S{u|o5G=K)0 zRJ4CGAylG}0N8av1xVM#i|wovBL#es9Tt*6M80;%&KZD5lvqR|zo{jBsL*~tWw-xT zt$_Xte|O2-LLi%5pOCvy_v#)9Zc8-EwkX|bmXnocJU62yy+-;-cuZ#og+pFdbJgMz z1E*6fQTvKL<9JQ>)r7HTVV`{c&uwLaz3DPxdu9$9XNeK6$9MJGs(nm@W!foL4xjS9 zZzrN^T;J``)I>)i)Xw-}iN)K3VD>r&#mE$dl{kx~Y(MjCDqo!0vsc zZ`515PcwrwOLuc5@Wv-VaYm`J^%y za}0Z1@Hn2BMn(w0n>l-+8Sp5j7==9%pG1+hpRB!vn;A0HIO==y;*3h{OpAJ93~u5! z;F1P|Ae;{W^7o`VJqnXEk})r)TUI8`cZz2th0g6-#US|qH}N0S-%Y*6(6{jseRN|; z%DpPL4!bcVZP55t2(1Uh&CPrSqaZsG(OEolFeP>l!Bst zPx1MCdz2!wLR9pLsTS)@)IeCMm*8XH_pJD9BE9Q@FC$FE6>fMRWVFjA@Z&z~fU?NF zrMubpQ>DT)(>iYD;ML??zTR@tq2R;~u3shtXwQC5G{%TRdEMNuB`rPo6ZL(K_`T42 zm$dBbCwf0ylrP>`2|#oS`bga-!ZV3VHi-(uQaF)^l_)u?^R4dBth6-xT$mhg^)`r| zozEDwcz*FYI_^DHn)7tO7&$CCcRgqjyJ`|NwzF6w=6$p`55B$RJ?nG!qql(reBtP1 z#qQok$!ibcFBLD2SAEV7Ru1Ppk5BCo-)CAh@Hsth$KP&lyhz{nK3_i_0H1K$74vaF zT|6v##&|lNi%%owb+qT=bUbdfd2uq=Kz%;zB9K?|%IQGqrMg%!=eHdL>O$`uUoYTA zi&`fwjs3|!wt0)M&vR9%rrxzsXh!-l++sRWk}7<~c|jxTu`lfAajI1J^l;$ip|?eC zOVjE8X}nAN`PuyEfw{A@bH)6%e zb+)&($Ps^W5P!Js?RjBwWKeH@wz~MRe{0p}PQ79B#mRXuplZ3srKRcOM+wb&jp@4+ zwWPFdpI>{n3ESXvN}G$h9O<)ON8GsH%+)l7xI-7!_Jm#aI|K!s5wc#>8Rb z(*!J~r@Cj}U!-epJa6xi*YrrS#fSmD7fPBpnbNZ}MQ8mGJZHGCV!2oSTxnTP6Rhm7N=CADp%zTUIG-io79lvQuVAdStcbSw{f@mVP!-(mQ%gP`D&keth(N%HLD#4@Ge&j~kBOW*X+6-Ko&vOgV1W z&BEQNgD8EnD#EOLK{R=X2G?B9z_Ufnd7$V(z^2`Wu0K}#_$uZv%sjWjE& zA)eLrE~<2fQFMls42CznaqZfstwnp5!rjDnVRY1cewxdHmNu{5%|mi`3?x(wM|xYY zU(gU;e)sS1S3-@rXF6DvA&{p>(Er!h;kXf>_lr&KccATBe8j}^-j%t1v4n;&>n=Cq=p%=IN0Swy~wDyH;=Q&Tj+ z&C-7C9DP~rCQJ<3zStD=Iyw5racI!u<$841J~CDjovXAZ*5cuMF~46TCi3gm#r#-H zo#)B7>BX6qLl+vFdvg~%KkN?Y($1%8E)H5w&P(tOF6O804i8@`!RNvE;L^^29vv+; ztPB8Gv3Wi+Q)7m2uqC$G$ANDkHY2(q)^dJwHXUDb=(3GZ3SRE%<=}9BHZl`DpcEFk z-5fFDdbAXezrAH3(s=r7tttZy}c&bfI7X&*1j=}BL&?R?X}k|=yTM>x z%f-%a`{EqljMvHHA?EXot@UVwd!C++7w)G!)P7o`UgwL4+hV>wL_LfK+djwhtLYkZ zzZxe~<+@#ge_t#r22Pwbng>Ek3SC!5`19U_yzWA`_{)bsmRD^Bjj#zudioJWsj< zz-PhcCmmhbE*k2O*CNHfub-Y8YomA!76g@pn(mJ+ zX1UQrF8DNt(2LV=BbeU~PFACpTrQp+9e;K>SU#KVJnmeY>|A>$`fGcHaohXi=h4o` za2oTIC5i@0vCX})$%>JRivEeE6=y;3sipOUim~G{H;a>Jw?s!y0`(%&osU;LE5=M6 zot{$i!CjUe$i#k7i52d%RC=p;c!%ou>o%h#wI7U#75GJ)2?&$6G3-q_ksZ2R#0(#G7zR(wHl;6ejt~H*K)xYvFC$^F3YHD?qW?PRI zOC2B9-e)gCJNl9^v@G4Sx>{>qkL)^2Uc2YZQQw=?Z?w4-@^ox7nzv2&iXT!A9TK&| z6T)~Em0s)8w8<-4Z+^>35fRjyznDJX(j|CT^kNfd1pc_TfdzX=&SWLiW<7TJarirh zfc#rinPfBKi;Vp7F-j%$p-q!b%q=r^w$8qMY&6O zo(cgp5wRAHYR&@9vhBOP3WNqX-tkYq_U2Ryn=c zxU&XkPLg2smMqNY<(?hQY)eZzHiP82<{Hy;lk7CUx_cQRedCJDzR|`jQQtL4pN@R{ zHC|_xm78(jIpBwGTT@kZ-GfcijSV%@0U#lfT!LDRXNJXTSzOK`1J!B$ z0r5NygJ`|%Kh$|BPMLd>KM{8x#1hz;_qysyDg3ZVwigZ&Il+2X@j&U&i&>WUKw%|- z#$*sYc=o6QN5OSuzru9+IMF;U{o28q{OHbGw-r-|FUJR}Hx&!@Y&UJG#Ps?tQ8=`j zs_hm%ZBtVkQq{I}v27EHlPkJ|uNO>DPQ;(o&E{lKFi)>W%*EVbI${~#ctAM&^F6=B z{`fs3leix+Iobsc}vC*9gm zq}lTP=~~NWYuf&DpKDZ;XV)(Gw1UzW0W)>A-6m+ceY2QePOmmF55FcP>FEfa&t1W^ zHU-ty^`u40tta(ZHB>@3Y{k;2*V|HOR@+ktsPXxa#-DPqMMdU(Pz|-UkFF0Bv2cD9 z;(hR%U*c%Kw4p#ld+pXXdtmmxJqF8LO1ItY`jHFDv=CxjZp8B|T=&BIom^b(Qit?+^lH}V=Y!DAek$Epwd@658H(1H+ z&tThJ3Fa%oINr9OY~N*$@k!_9T7^Gxj7Bk1uSXA({^e|v>j+0mVj8mxw;!`hM=q|u zku>ujCxa!5gz5o;W5f-~j!g|rImzS$cw^+RR1S-;@BP9nuB>@^+oEz(F~@#C)P2{{ zk;~g`jqq7A=1t{&xCQfb9)&<2E;~)bBwt5%HU>*b)p^nhX0>5!-38ZD zRj$3WavXFYRAP!hWYCVEt~p{W9T7S56i$6rXoO{>_4XExiC)h|eSBue#Ji1WrV3;( zZ)DP5f0rWeulPCMrZS-Y!hIYyv*{RZ{2-@&^O-q02lls6{+!BM^(tn1R}zPLhi&Phwr{xRY z9Z-AWp7Y?Dbl6n?w`kOjZW6`9WZLm)p5CVX;0V0jYu_-izHMeX_^62E&!6WDdQ?7W z%Nbp4;z_yra=tPrd|ELsXGHJ^R}lWa%?Htx+Yju5mL;}}1G8=Oqxy%`e2OK_zKzUE z_CNK<4D}XHiA<_!$66s&?Wtw6<#Lg?5S$KVsFOHv$;))hK?o%gTUjjS`S-@p6np2@qEgmjc+PKfiLFVK zzH7D!CDNWfozjykVm)}{65pmm<4!B|*2KxKpBFqE|GlOi3*EkxLb&CQsUhdx?C@!z z(xI7%XGdkQKZP;(+&h%-PfQUIRiy>k43TGV1HNFwaC1XcF2q9*(4hGqJNyTOyYp&a zEPfLHDyh8zSYzX4*_0i)u(G_+uZ~u(fJxNFOBE-rlRsF@08@Qn``KB@MB0T$jOTqF zjg6`Ky}ON7rK4s+*A5bCCCw@yZ1mf67IQVH;<=S)eXVp=UXNI)LTUUWrLAg30-=K)T9UJR`YvA{Ah6$^s5%PXA4?uNv4tsfKp*0s2tuaU>QdgSeP zWrbd6xUsO#XSxBQMuwzr7R0;qx>+Pwcs72H*I{tH)9DC{x0T*i9IhOBbHBPccmJFC z{ysa;$GcrRQWdU+=FaLGnRq1xsnJRvgeHw6Z%i8VHZdw(jH(JvI24qo-2pYnZh#tc zrzK!Si@avbyV%OFG+%tOnAq&kMZBOZY{7=8L_G<8J18f2vkPY^!NbCPHju$>e4bb0 zk_-jBf;#Gw(r1e8wsvth8f$IIIoiZRNrw|CkFGavb}6oGT)spr_%m+*;sG#J@CNtB z2gnB^_>qJ^dqTvKg~g#fX}j^POYV{e?jM<<%e(GYhWUVGQGHsWT*Dgv^c#(nEk>ua zS1qGM`3w4veziTj$CWK;p`&D$!^5=wfRL_UJ2SL=KrdEHO3=%wEk_PG*oLy{sYDszw>4 zt4n21AExb0wu{($5DkclBu{!(Q$rGW;)(tK<7MDyGD48v?T?-!l~ zf^Xln4q39?6=tapT!?S@oVeD^c0C^)t)fsfazj69r-q^gAC-g6v|*5LAdiKk zz?`}S5CLR>&_Nsr&rAKgH9N9f?;Mr$(J!tCI5kF0ZDHUk)3|1tlRAMuMF$W#xyF9? zr<_Z^vzUsvqbp23$vJB_>-2p|XnIqf?1ymbcD!A`avO^URnfNxvO|097-xO=N!(`Dk4YY?5aRQOO?}S6CMG(lWAWOKZTlEZB>wN^sYB-Mm&=0=m-g%@)^i(emhg zR#l6x*sT^4(ud9|#>bF-Hh8zW@EEe@e5M}rYb_MyL-}8VM@3&Ovzu2nYQ*trRu;_3 z7t|%Jt<75VbFtm)?-)g|dvA+t=5vy;T+!XlY1uZJ5Z6Z3LjDf=C2i`>k1Z=oY@gGF zDW`odr$s}HrZ=ulDw_xQiF5cg(RNL_WBp~>nz}3mxk#rK9&bKQ{IrvwNG265b5JbU zv;!AkRH7N}nl3cYq{_P^Y4w;?_DHqR$tGRGsSN~0M;_X#KnC%j?`xcw1MD)7p=^>~ z8-Xuc4lDV)lfCeMtKl8Vhr8OvR<0J(lWFcu8`F=@iF<&zsj$W3`Rxk^;*lyPw`T#= z7irls3{{R{n`%mbst-6yUcJGp~`U5!0+&%Xr0yKBqay-x*(>QeID^|4%w>E1A>3oFp#vjjiIHUWP zk4g~7@tx&$IPu1k=JgX_{g^DXgnL?mmpf)UWWCb=L{yFaT5>1z2USIbF$LyBMjK5$ znH^O}K21pQh*(W-$rDeWODxHJ=>u^ z#F{UrzmC2eYx$1Gq>aGGaK*Iz+b8RHdD|uS+Bp(jGg$#tLhh>Fox-0r%oL8}ujq@3RI=zsl(GuWv^DGHhh86MTw!Y~5ZX1d z1iI9P)pb)9slkSA@2{1(?z=x zOnCnop4o`<^Y|v~F5}?4SS697Lk3yUfC7{Je#xy+-F>>UGr& z%qA(x^{W14dPy*yxm=NKba;1w>+UBEw;P0*0X|7t77>|WKpubZ1)rA}L6YyJi8yh; zDfshAS+=9az4l$E$kI;nMpMWh8OR@{=}!77og&&ih)TwO@;w~7GpiVvG;?o9qfLGfR{qO*$x2#%o~5)ydR{WUx307b(WnaP(~iO*7+}A@EHwTzhRYHyof$s)lDv3TU$-Wl zG?lCq$D&Qnqh+%$^^+?TTEpOTGg1A!&uO;2YfhL!gmPg5DNO7O%U?~rpTG8>Q>A+3 z+VH#k<=%{|o?FS*uZ(|oEIJNC&n|)@nP1uD-=v654m}!|r9L7kFAgYz8);Ez3DhAh1ktHZ@N}hPdVjqx-~}#B*a4$t#zl6^>GF z)(D?mkiKp1VVir`AQVa00LV@D5$Z4ia+BrkhxY^M zwc=XH%q3DE4xcnWOU^3u`U<}IbpWVvDR%(^6>3)J=>^{IGe48i8`1tMjiKR2esv5H zDs7B#0%K0U+!luf$Vhz)2)%Ij*$0Ga2fiTkwlXAP7Ddpf;x44SfbFIPB**i8?CiZ$#*Ib0xjV< zo=}S(_zeqSb!MFChNMY5MVQu`eW-lby2G zpgA&@!dgj+X01fe^~_P^@F#HRAC}&h!%~gAtPl+mFD8cp1@8+NiYzZ)pr#o@@2Y$RB8BK z9{dSJ$_1y_9_sNZPSM^?spMBjC0mY%zP&+?ZcY3Onse)k$2|IL)U9UNH6+u5mZ2UX zm;Ei9C8JB(-1^$PD{C9o#qK}1IXgaLL0Xn`6SNo7oO}z-NuClfrK(`ULWNqjrFy$( z)yQ{1P0LyE`aN!QWoS2d0!y8{5bCllLgVo#rV=r&Gu?hmy7O-myf9dl@nHq##}moxSK+#~xMWP6*kr>zQiJ0@9u~Qd82=9*{e1zyG*lu9 zGQwQiR5?QakBS8Cw9l+a{mMqlE(*v(Wp}R(A-c(Sqrfiug4fEe8oLuj_X}H{%O$h9 zTdvoF`neXd}H%4f$$6yFNK$e^6)Qf)!`ni=*oTX5z6&n0{4xzQ~<2f zwSz3SfxmlIS{ka;Y2<4`JfZJ?|NoNT8kB|DXVm?Vp{U&kD#gz1dkn4L%#K%pCis_v zzSLhkLDk4akYZN+kBa=^uT%%%?=8$PP5Ko7Bkt^lzv3?ZEpCI|8HBjs&)u0p_+g0V z5bIaw9^q`fQX(hcY$Or?DerQGyfyrQZ-hG1|Fyy)5jZ^{VJs=`)jvx95-53SH$?S% zS<{~XZ(~9z2yQR8SAfCU$AK!1jj&pU>uQqLB^%E^!4dZN zACKU}LV#^_R!sll>-VlZ@JEF3ci%u821EWnGLk@(L8X7#@IXRq4cZ|0Q3W5Ce}szS zVO0uE5f#xe*L`y%5uK7FNPZa7IB!s3z3%3duhqzNE$O?1(!`CPKouoeh`EV-cGC0? zX=O?5+K=Z1-%VBAT2JGX>`yp(hfxzvg*%sCG9BA?Pc!$+nSmi>mIJ?vT5s5`{>d|M zoqdLOV&<&L45fgq#yi|Hj)NA%bL0Dh-)DNP_{vwj20>j_f9+r!J5cGq<%n0he7>U6 zoq(S?vbznbc==Ze|nKdNSw#JDn?@_uL8*hO@X4kKJwH|0%_0;3EmOSwJo>^UPDX5n^8?Re4 z?UNGhS-(|5E?ip4E7;e~;1k&Op5k(d@w^J-*&i^{X6h z2eO4i1xDr50oJ}O%x~U{bnc(I@h*z_mK$IHlUu5rb)kuPaVKwjH)|-#Hndcs3|M; zv}!+*rC92NCTXBcXyM15cHtqLhRU+ELhC5w&r@VRVko*5a``dleC4h|yZBE7`RudR z&@_e9>!J?7u4SSXO=H)xx;%KQ-jyd)q$5ker~dJ1z`~!!n0jqdS6Lc&rEpA?uSJE~ zzc6(`*CHO}9Xs~6T62=MUm^FnqdN0@^^b}cYT!7kZkZOvvSnbnJ^jV|u}^02DpULs zly;68M}rPN70^l5=GObXyxB$ z-ND)Hm&mgmUY_Zl`0)XMK?6!vQloI!<6@M5`mz}J>T3FA%qCTq*}mB^-(IlMRF5RA zW~qHZw1riw&WB%Jus56ApcHu~tMC(^&2@fde)Ihl1Qvt;7OSB=G>eXv`4wJKJnQSS z%Kn++g4iG_@YTR_^wQZU52W*tWcis|nT^gqa`*;XLs-{>4NEnm)JkK*Kfp?~P*{ue zAnTb=l}w60l7Lg9uxtW&Y`EA@^wP+yzETUg0fBr<=rQ3CD}NEjORrNd!JP8jx*_1|u{st;|6w3TqQZA2&XlZ~7jFYEgt)m_!7R z-3TAXgjdKt3=1HZeF5-@9nJTRx(;u$4$1d*$0}u)?dYJiD*u85)gXV%z}3wh3n?@< zi@68EN$frmfQ?>jhZnQv!6!DJg&jvc|L$nD?D{5=?C91~;ZZhil8a+pEC2E54aDAo70piSry|Cu1 z0P}juu3=krxE>GwC6Vk#CebKG++79~D6kJ0t(oCu7*??|=yEz{z6Znft;n-PTlwKY zAz>zf>1rrNQM+bA5R!6eDVZc-ANM8u(A=0aX0Ti9?|e~(D^x=?$k*Q^nSDkILg;$j`!2)`{SH+dg5>t%p|7rPmuB;2nK>`U+54!S$e94$or zm>Z=io*f!j?f1Vrxsd`C1fi1%{$M9u3U(d{7UO>ei=g>!Is|7DSjhFiG|Q1<_Lk5> z{)+XF$|yFW{fn6&uK>oQO}yK~2HMq{RE#hr?(qP1W~j!;Px`D?EYj42V~$I%~P zgx~Ugk-(oS`TbS}7Ije=)7w4>g3`8K)QQ!V;KS{0G1R?3&GWG@+PSQMu5p#}=*?=e#K}tgxiP&wu)&~} zX$!7WPhPxET|G05tj0&%m^mvGt620uc?hw<-{Zq-dw(uk5YR^@uipEn`ZQnE>xa@- z5#Ni!4bI;8H4X)R1{B`pWbJ)u=iITb%C|x?J(zjFXha?4zft?eNmy`oTRD>afpZT( z^=tA-!J~7j`qjoy;ZLaf)7AvsRFgaO##af>{08|_BXOOt|K!eBSnz$5?nUr1Qi;Z^ z7*84YDCpTXe7Gy6VP2N{Biug)cT}{GkUexO-}o`NzpvYayipNaV~R3`Yvrom7DV4@ z_dn3>ZAyHgAhI6eOt$6ClHp&TkRP{ftyjo!qc(1O6mEkuHhUA{I$!gWGe~WtcM}-L zmU$;I>5vjJ;NG#^z?&ZNlpaM7RrVqcun!z?9?~WXt)5E4)KPaUnfzR< zJ?2LhHA5}L2_b2i7z!7y@-H`KH6d?Jx*3pNj`GLfWS8;9l|=AN2B>$jTYP}B8l%FM zORol0-6-{^AApR9btGV$2crH}${Xvgvcz>hK!x!cpsYn#eLHX70JLZLEqRoH2$E99 z!}ix$v&-;`)DA#Qhzg?o8$tTZ&Q?i%dGBM$u~7bYPeC-ZVcredFP-2f(V{T=hAdjl z(#h<%)5Rke7uW+2w|eBKaO1}5|2}km-347e&V#m9)`$w0zxJMalK!foZ(yI17bR;C z!p|pyu!DhxB$gNtuJ^}bS`?uotmN_yz}0l-*j)Pgs{}~kTYp0W68YC=u*R5w&^PJe zgcZs&!*0+4Qqkh`zL~AbA5tMW&wAzODctQ9KiR!*M_RTABLg8N}hsr;OSr2i(nrz9cVE` zrUOW6#)kMUZRbFWu=do%{}B<0AVBt)5#&$;`cDM0h*-kU1!uWo+VhZcsrfV%EAF!$ z{U7N5eB*xV3fLfCOC>@P(nN0~|1FyEY$q&u(=(6}Xb6D#ersG){~uu@u-ORZMupSv z!)P%7#9`ndQ{518_`h@!iH~Ls`M)B8h2DcMWYE4m3}PAyQctq$Gb0VG2HxeNLU62r zo=f8fRP|)}XHQ}RWb8}N?oj=WmY1}$7+am6qyI~uNnVg~xp>I5x;`z!#4D;G<2rp^ zLWtx6dosz#0<$!dEkN`FHTH8>e*;RA7qHMr4gTjZ>#rds8rvUGT+oQR#=?PAT5#UQ zbwd^DJ$wbuhGq<{Y>Ef^8H zOi=!pF)YUGgliBa@&V=uEysv!kwYzI_@D~?tpb0w5v3@y_?TlH1!4anfrpuoQ1;Gc zLy?JI+aE1QBzib#Hb8qpq8Di0Z_t4`u`xV^GEaG_?3P{5v7e2tZ>7H<#>PZsdM7=F zJq{dbFr>mGU-5STccS+vYFlVOM99kV|I$kEin#}v|HN%{d2~4hwSk0x)ZnjV2@v=w z1)?JT*B`kel?=#L4fFq!Yc|!tpoVypVa@_oPRz03^-TTj}4^5S~;z+;k&Qoq^ZLLJtMTp?Ay3B5<1iZ^psb zMNZ)zXxZQLvLP<5`1l|aRC18t{!6X2k{yanm5?^_L*HJT@9JW*;DgM-3`#zg}DmJY}Z; zqVYje_6{-IQAw16p_SwP>+jDv!c!fRKV11h+30GIx8fvCwBH}*n6qS{eiKW+F$Qgt z^flV?k6qGb_Qw(Z4DWeFr@EaPY&PEUHHO_MNVv%eoe^t|S<8H`(ueb)3ktH9e7E~# z)4GodZsR=Ph;gKHWHwGi5Ai&0`+~k!W>~JVFxDCR^W^3_?^oIuMa55wN2ij=AkU`3 z&>Q{YCdwb=<4=+hiNCW5yjJy!YK`$XY&h)SNM;LPsSh+8T63K9%x5ReiHy z=LW~V#{5Z~uE6}Y&q|O8Tfy?8q}AFj^9M_|G*lPy2`%yFib)B|_WU&p0c`q1EdKJ* z4z4SiZb^pBDccsz>Pi&_4q>7Ss=Pd!dbWxM&?Ixq*9<&~4F4Z(Zy6R=uWbwCE-h{? z?(U_b}zI-zR@GPqeHYhBCVmpN6VUl7+8ObP7@um3GoWezPr` zQo#?fWRj*dk*p#o8+Hz4tb|ua8@;7&n6M)p%*^Siw=)q;#EItX77zUG4@LN}uw~>4 z!Q;GCG~y;KbBYY6i!^`ZNYND(KK)t{HuA`IloG#Ky)9-Y!f$J#>cnxt+VwDN6~|Nx zzmwH2gg<}Y>hqe?WEXhB2e;% ziRM-)Lm(;Nf&A_4s-nx!*r9iOR^K@GvfdLZS(ok4EUe^>J!{VOlfQrI-~A(Gq~5BX ztCbqnIj70`yhFET?T6=`>hR7RxK&|YQgDI;i+)vUk9dn-4egv=F_P!SmMZ|i6b)|a zp71eA_=k3R<7T72<1MOmz&d2JC!W|&Tykh3rh!CT3Mo{7_+M2|9pw|&1lKchVBwIgmWpFL7P#Zyb5exlKs6~o(qPGg)ukf%laj6ANv5D^RWlJ#I-F9y zhfDNu;05>lcr&?37!EQ==mEW6!=#E}&;$0vZ7RWKfhnj50LV>L#3jtiVfo^XL&PB3 zZsj_P+tkusaqowVy^Z7tS|`n4nHnY)%anB1X5>-ybyv9(d=_K9a+*aC?~==xAoRf$@(U3hVZ2md4*Yl_r;RY zvNMucqb+2^A25qo6&(1pF{pgi>L_H=N(CiQ^g^hZ3@hc z9X;b+aiCZ>1})rdp_#1wXHdtO`eIuP5LO!HSvPP{zBS%=pU+tNwnip={Hj7QZd*#u zG|tee{(2FPCw1?A<$+?=Y>HO0HEgOQ zsVH#eVdaJq`eEg^+D^$=d}$b{&rRF&kSVN|`_6R3T&LH9m8q+KVu}Mxip_nQ^&@KY z@iGroBjv~gP%1sX-EIA8OJhIA*4-h@Q4Qwnw4uyVH-(#ox!g8OA?Me0exj5MhOJr` zwDn=IB8q3z^{dTFYU@>47n-+4JweMPrA`*T%Y~UG8!R^MM3^NrTRD_%E%Es&NoYk4 zE$~ltW{M#Wh|FcTRr1GVXNx<{l*+g$v^K5eQzm_@V41X+Nc{g-gaDj#IM~~)t6sC$ z6keJktF>lqUGztxYdw8rf%W6>gytGtDXP1qbf3KbGxgBt62rOGSq;r)atX&TD@3JY zn<`I;a=L*f2fT$!HVVP~L?CleN(j`@0CcjUQ>-%1hSCK7xwerA^fO{b3w)AE%Vg({ zzC&H(vJS?{0oO(~=&0)ke$bvd%76C=6gxwwh3hCZyOTrGE#}*!d9btoTotUwn6>4X zV>A$n%!;|gW_nB9u}IE1d-0od7RmN0g-$vON#4sxVl1jJ2gdSaXgs6{I%>YcX3~zvP)+7QG3Hw=`q@ z*$_MawEp}GEHnAzB(qTKUw&0;PTHLjZB@a6h_q7#J1p-PLnEv6N|OPvuUZR$NYmfMz) zkK4{u#0Fn3!5s{zu7JD_4iYePRN87M`6<|#1u;^UFfvGU`TFvbZ+u#qsv|hSaLQ}L zGqOZCH~cUAFjRmUB|xV_!LQy#4j8o~EoES%FNv&lA9NyGER!8e&=|iV&5?VrLHygW z|K+g4STI*j16p%DTph%bp7NYAbK+*ud9uNBQHXgmHJ}%{sDAZwu=Ba1-Af9$n=A8= zj)K*6wTX@$d$%4DvBt@)b=^39<`3ySz>B2jx(4e^IBB|(2X=2c1o2rDtq-y zXw2@GLACi$d*>YEIOr1$=G2|Tcz)|q4sWKxxLW3}*w!H1{{Q=r0e<)vPY`nj&Ytp$ z>eBKd#GQZQ^FR9k*z(7$?%V%Vqx{kT=XJC9pQv^o`(> zUNXNS@3m*D^Z$hdynp)vjSKKY!>b>v+4zhkiK>Aa>+Q`Q_wAoB{e8@kGj->c)K#_Y6=CMdM9Lr5`IP^U5Xh2G(|JSMpqpvH#e7#dIbJcmOOnaT6uUKDPg44>;bgI&qN60{o zkH~mQDPT>e4o$my>Y|R#`rve~zCTp>5X*1T>1ZW|?+Fgly3P{~ri3+*M!+coin@bF z@LsM<0G<+9F~$)=28iYRn8@b)lq{iTd<74u^r?wr^?KrYtlo$P~V_1&C8hN0N z*_0E-e75#``AlhR4N;3!^Z$$&T&Q2Y3@~N|`<8&AU0TezL1160H{R#UwE?U}^4Q~O z+mCSa3pg6j1reM27q-EXAg^ptR93a(d~ShFUv!+0fCv~WEs1X$+!hgRfEbCdNzMAM zQs)w0wirGKi2ipDn;lRW=Jh=v(+AN;m$qc^#Uz$-%fq=AH%>^IedHpaRjFc1UYBSv zvO!8-qI{na47n~zNShcieo{H!ItsZi1xvU|M3{UK14>Afz5W(;ZUkvT=)wcN4oT3N zYf7E1wyk1E_O~dEBOA=f`79%Ur;JY0Y#ou6_cV%joKUZvI?D==@=J1H)_Scd?80IDW6dX`?CV%BOPfJfKaY zJ_X;sq%KkV-0x>5&uOb^$RWP)h|P^a@ucVOcz26BXM}(Gt8U)OyJxdPT?NPRS3R6% zhRNmcZD}QI8)gHxKd$kMT$s3qZ8<`}BscO9a*D8_^F{?+<4Y!6D}EKgw9AD|hOr5T z=$A@ZdGdYeO7@fREn*B*2NbtsD@jOkNwD(u@f5ql@RE}~K6F}NN5CLZC4h8_+hv1P zk+0V&0cbNoZ&5hu(HUt6bEmTy1L$s8yZ&iQM1%4WJ95STmWp42Ag_XyN!+S1mr*GO zaJQ@up*oa%D6H|TMCM4h-v3iitHAw3GF;2&#!!qdCDqJ#?f}K@Us1ba1dyF-)w90K zU+JN{aw~MJCylCSNdOAh*g|<$N%kav@F$fz$RVu|3Sq&L<4eMq#AP&{F%|e%{cmx2 z%5#LW0l7y4dlj;QjttqQft8m4R)M}T_f82tIyqziZa=p$)Q%ior4haT zolb(7538z`ybr75n?bKKRt__uPnNW-=8}QVLtxX4Ie)?2m7=P)qIM&EB~k$uv=GGn zUrxdWfv0|L8~e=?6qV;bmabF^XSx4`VG1Zr^=M;b{`?cOYwvOZlm0Jz45@*vFhX4Ybbf3B8Q(la3XLKifq5=z?W_HRR0#ysO9}>(z{ge} zeE<&IV4@llpY)6A3{7heS)+@30SuFBDX|ls8Ub!YE+&_1$-$5k;GXD;+C-YGjq6E& z&{`9VWSY7Z8dlg^vO$BAXb@G@&EQt@`6{Y3`i^|DXmrbK_SmwTHw=B>7cN?4RzLxi zzE34_{|YZqMFrIm;9wik9|ed1ny(`{=U0FPkm{KzfGiUWNT+>(bov%t6)KW{x#tg{ zQ366=9c5Q)DWv$n_|*SLWq%9f{_2-E znILRgJlq3+Z4NP{@rHxdk&Nz^BLsb=nC7-f4ZvR2Z?ci@qp+$2Rj5WOX(K$Z9GGf` zy^Sb;K|(+>6$2#G)~v>LtkQRvcvns}lcNbTb2lGn6+E zeR%T_nhGK6+aLsF@&CN6&|V?KR-#iP`X=u()%5K!hm~h(C_L?rMpz#z)7pPY?S8n8U{d^*Y8NzbN^HNDtta7m)wL%@Uxi zqZ=rl;r4ckw6pw#SuR!Q>f7lQsKLND4k_li;}-_jJPb*Q`qpHC*m1kWeDpTCd<;Ug zVC^@9PZ#eE4_(p_3Wicbx?ee?blvxZ+#$+lsh0!zg*?I$9O;Nk4f7V+yu`Q?(cgW= zBnX)Ir{0#kCiB-8;&5TQXP z0<6cEeXUt_Se3Dvbr_eMhsJ?mY4#g@FD{vZmIpwuuDkXMuF}6>PfDhfg1^ANtM2;( zBN#0zpVB6td!`(Xq)vD!O06iZR&vi&QK~k%^D@@$4Nc2t%s`B3z`P#b;#RIfgt7Au z0)Id8a(*O*G=O?uT*blno z(lN*j{AQ38d*$Zrmrstz&S~%kL)*;N-D*qetlS|QCK^)gQ>M9HW8W4vM3~P4S0PK7 z8FcySk_qwzPU_7XI9L z&>dY1?TShImBFSTrnsb03UoW#^E=aMk*E`*YP9#sz*h3lVe-z^BvLCrV(ByNY0P1z zF`d)%On=68=_e7W^g3ui$oC3|ba56z+#kIxG|!IwM>N`=bDZT3YW z?1qR|bqK~0tH3h72V){hp@w9eFOO}Q zSQ++o6z3((Q-)Kw1imn1(!NmPl;{By%}~cTg`pxv;DRIy`a(;*77kB(Zp(eWn?z&O z)+ohGKPa4w9}pb$CSk#CHnKmcjZg_uT?rM4=mW%#;>wIA_0GO8iy)|^Nrn^O%#V7c zVHF zn>sp_^h#onuxwV&2t9P{DtK(W6us``pb>I_z3Z|7BN*=;P z5gLrERV)jin5uRz^QqM7t_~HjmiJDg@n_er?;H5%_XFjw zTyqpWwSe6NCK`}O_>zf9iE+&75t8=tyT(jLg=kvyYl0oDM_Wc%=@$V|3wu6Bw-}2+ z37ad7xYC!^4l{WV?!sZFMR~djYotmJRYugF@D-$#yX~x`8u+`4-bVEP>9aH(n*q5& zWcRGB!P7DoLP}B_W#dnzM@TXmew6SrC|<;-{C-tg1f(XJ{WA8lO;vLIuM$y$2rTLL zzJJwfJsT;7dJIbS-j1Re8gHHbqVnY!34(f{;sd<30iUfaBYZ7A5&XsPZG6m@bU0&& z-)GPZv!|S7e3^(u8A!i_CNV*|^;sQ_?|~0t5jD^rZ|QUOnBGx&c{~;$5n_j&?GG|(9I;)buYwZf94JYF2Z$1v}7u= zQT*aU?WE<_Dcwl{#^XJUZ_%^Ad$1L) zi}tDzh~`V+zV%_T?p)?MD6d2*234Qh(CxPL-+e8vPK23va{a1ybwMQ0RB#)eUl6M$ z-T!X>kqJmO`4_39kgsgwiU7_ejbKLgxp?K)VTYl)EF3tWpf2lY`O+%vJO=2+!auFT$>*Kw7YzfG`qziY3xsDo%4BP~C)9mm^ zolrP14G2je(-I*c&3F$od6huGD=NhTK5swnAI8tbtviP2EIp2sPaE%VTZmMOZ~57P zQz7nMfSbg-p29`bFvuzs8eQTp2u%1TzXWQcklwV)1eeHMm zN;9@|;mPNi1W%)vZhekVyl#kN%PZXdP#l)cCy5K0?Ig>46oylPQXEL@t5ytQma|lD zDhKjL-2MbHn@#K~7H2&~#flKlrt=F2WO>+GI0RaylwATYE1q%!bxMw0$0#bM=w z5&Gc8vOf{?=nC@l3LQVbJ>iDR=QWBS|0$fnORIqU{D8>|5DsQ|xV#ayRv3;;&YB6e z?}`uc9UxZi5F8E}yZ-2J^1c}J=Z9(qxKLV#M0rr@>z$Sw6q(~>R22#BE}19ccb@BF zUR1<4*5isdHWorDj9PflrE`0^AHwZ!+enDt{q6}SlYnS~(YxK?Hss;o6w|T~VCRx*5{j2aA=jNy6R`GTXX zbAbo)Y5;1E&hpfN77j3Wv8Bee03|3xIWN|bqXGI4ffgSPQ2tYDs+Zp&4v9=uW-2jV zkAd8(YNgV@;4e_2#`ac3{>%7-m&=YLey4-X|6aHWIWIU_T^NX74y5tG&Wp``$Dry~ zD@HRXU6!fz`8!ZzShddaj65d`@9txR78>Ai=Ic&Z0i}JRW}eE3R`G**$w5P%T>YX< z=}{R?9`|cR?5r3n*vSj<{?rwwV7&#=og~|7ipH$qKo}7Wy*{?u?uX@h);Y5yp^9 zMfm^JGdL`$BbA|6uPfFTS5HGk6nhgaKC$`W%#AY~$c=EAg?^I3h`CB>gVUDBnta_^A7ZyZrLj z7&67Dc6`b&yJ<&*hMP;2>jYk0L$mE!Zg*4eJaomK0Xd>KmM9Qu&&~|cDWOKq(6gD` zZpbjm-t-9NO;yg5drxE$)&fgq+-W`4sCms`InJ^U(t%oo0>1*q!fA32*l(u4Bk~{x z4<1gK%#O@NyKfIfLbo26mS0Zor3lO#_4@8O{k7M zq#rQRKFW7vFuk|PLFvYzLbo9OQee@}<8T>H3O(2l(e^8}cS>R<~i6&-4>lZ|QjM6;^z-x=j zz_09ekq8u@+pF6La{U)dJp3#|`Kj`@`1)@9mW>ocS@(ej=IaAYzd`|7^EYV9z}hlU z%mxq;6^q%5Sk|Jeq7iKbUD-zK5Wr2xpB};F2J&aw)wX+J4+D=(%1?>F(V^MrR?%M|ij{P(X3OZF{l3u*P=6f^tU>hlNAH1Tg6ycsFFK3x%czq*+r0jIxag$smmE~Md{AMM z^qSm*3#^p<6-&KveWy=qMj(gi@&+{M^lyoEzUWLq zWFb^?+60n72?xVLXl;<0)( z#M^f?DABv;;HmbP)^lNil&GebivNQ7zZ*vH1sab3^ww}GY11?}=G_4>IBn6H0IdGS zp_#o<2Jq=dVzX8GUaC@afqFt5+nh#v=&~ewJUeNjG*Xx`2mr+j6Abql3E(B2h3!FU z$fZ2DvzJcfb=+^qZ*^N{)(E|5TRqYFE+$Eu!+ydLO>3PsPM&d2qa`*+LfXRRX(FoW%%K^)05jK2{YTgBOd`E!TV$pg-qz}V>B{*w%b$LN3qpQx;cU&* zkj ztLN*J!zz4kZ}*GyXH1f{q3@Sv)RQGI!5@|uE}&U^QwDBrrN_&s?NjYckLDhh^L^wOY=~-*?6jLKMjr+#FPD4B zp1s4>;DM5fzMp0O=#TpY589_|Pse==t({WIonAMf*&Q8T+V^)0!BsCd$#Y(RPXztX z0gK%nYXly!ARt8aApf@m7MWiUSd2(rx8D*%8Cb8PdI2ve+9C8Y5&~-umk-lDsNAy? z-K|YB#(+;#<3*}I9P{>G#UXaQG08vbS(G(_=>%b`~ zv}>x)bu2v*wzGYDJ>bgJqQPENG?w!@A#A7WBKGmm*(%S;dgUfT-yysRWKb{;CK3;LUHhC}g zFl?+ujPF{-c!->8FiP_le|>JGU#Hu-nW}eta&B(rP7LlLQY{*SF+P`9^z0w>=AwBwgM^o-824&n`!|`rq5O#b3E%FOa%k3 ziQ}mbLnaTqb`_DQ_0u;b9j@1FcwQas6Vo**Ww;?!EveF+0;|h&do8X_Jj&L@Dmn}S zNehT{FMsGHbwJjaHBnF7Lz_ju0OgX4>#H zgjy+GA=6nKE*@RuhJ1HJ?tz3w7^@N5#t(fO%c?-Y6o*z)?CbJwHiLxn4ZE<6uyZYa zVm>mA*j?D$EhhyQ17`*%52ADR*qH9!pizmw2G!Sp@28SY@;fN7w2X}pZmdlSLM7oc zWrQuN=o3pBEkzu%BTEtp4hS$Ugwq7>x6rY)tyQO#XqY-OgOcmfNE0ex%5!{JYyDh^ zc2Z26F)nz*I;{7LiNk>=P(f2-*TE(4cdkBrw8BXsTH1Ndh(LH>ve9k9fgV*+kGl}& zhjz?gs;zp5r1erYDcPvhGkOx@$5I2s{gK4YXyW zxQbd==MYUD_EQZLZ9fY!`9eil2_BMW2Yh5pBh%KReuf^i6gw(AW*8%4#+x0#{%AVP zb|;{0*S_4cI}{h7IE}*bT`1 zi3F`me!SC*sKw&DQ`1$2D``m{{ylmB^v7st)3oA;x?f7DY6I46WKF!L!XCu2rY~wh zgLUB#uZr9b{6RV@d$6t*koJ!5OxPGv8E2i*{Lyw z*P^lWGk4`KGe)Fxn@38r3v92JqxyJWM+UN+uwj^1^Or#5Qhq^?;}AWZ@}Oyhy{w5Q zD=&skd#em)GrU%F<}@UF0eWz=I=8>3MurUSAm7z(uz>gomg8F$)$ zn3-9Lg&-d1GC})ZEx?1dfWV5WN@CW)@vwysr9)gB(8K-$4f&a>G!s#=gSZ4d2JB02 zQttz0MtXMqoP#>$#g;~=e^c?OXtoeg)K0>HvJATz$%!EW@y;MJ&WH3m)XAV|J51YduuwBqJS|nUvqcatzL%- zsQ*}dw_I%YTe(5&g|}csrMdeTkbEd8?k+qA2d@f%T0CbJ(dz1MTJ71U$A7texHEgQuy5Czy%ff7uEfcpq=uK{rG2g%myVct6F}c zGqY>`E@IQTsj=6BA3-%RU_MI29-guBvXE+K3Wmuq&(<=uQ%-rU4Wt+52chEmsAH&F zOR>a8rjLH!Ij=K}x!JQYW-my0aH{9zXrM829KZIBpLl0=f=eDL$EAb6G0HH`$FS_; zdULiO#p8|4>KA;{n4|gzHcHbfms(3DF>t%%s*2vGt1SSvX~s6O@Y2-j0s6AKtkk>_ zA~@Xhi+b=z^WL7rL(dE7|NRViVBrShVnOdP^N$aia=}|B54D6BNR?9@`E%=j8Is3gFUAp!me3M?4775y&!B;I|oh- zh`V>^?e-P2^o!dq>EpxlC6*?fuN>tpFR!b%U{_*Jf6#U)|F;wq`I8SsOBaM1gOO0T zzJItv0|IbqJIi^zOdrHxEq8?!Dr;De-0tI+ccC_2z7Fh6Rl}%N%$Hte{OE*|X%0PP zYq_#&KPv*IfYB+$##}bm&(j>MfueXgI9oM!V57!ZJL_!z;aXJqOw$Hs_*_PPt5t=l zT6cyMziCc=yJThGsQ<8#ji9aF%|84k!>s3`ijR@>w+p0ZP&E-yRr<@?vaPcXFqQkZ5J+@p?LS zMsD}^dU_sdBc{Rmj!#`0zhwLZLyeo!%dW7sj;+HN*6-A4Uy&oFbI zJ$X^Qn5uygNKT#b6Q&c1E=Tl{!84syp_2^{vn?xPhhL$qLM4hDCk|j>Vj6VIj14Ah zxfBT$KPVG3TL${Ez8E=2y`!#zCfSgvj`?%)-Wv10u^5zr32lDh)JM^5I%Z5hiu!~! z|JF6Syh>H)vz&;40WewUJJ3QUoT{7>fsm115YkzRTkhDJFaz&?aMT5K6sixp!);dI z0&Nyob{Mqtel75QT`}az{@yEOC)!V!_3(`mby0WQDLgg=ewp0VLXQVsUnO_2wJ#su ztLundK=bPdnU;nXXV`{e&)Rn@pm!{kv>4x7n0F)9w0cI>I-jsV5SA-K&90&x2jr7e zxnOK=)h~BH>M1NA{~Uf8`TqL~iF~}s$Xc{uVe>h7X@zg*4@S^{Zauqa^d9o`QRmHc z+lgw23!jz=!{GNNNTUbK_6MnXs}A9S>5g>SHu^u$>b(1~?hM68f9_B*gKI<)wCCaw zKxs63V;ass#bu#l-{`aWw!8N!OA*DiMh39!f{ll}{rs)I`J079N7reuTw(T(2^HCQ zN3TtTx_`5cfZ3tF=94h`3G1>*mh(PD{IRMCR<{L88WKvxUA9;(x8~PrJd!`7bOC}h z-CMPGJoIyL@YzZVkPSi~EsE8=D&WX;AcDyRY>N-#6Wp{kHAlnB|FjsW0at*YvR|NA z7dyz?YJTBjZM7)L$eqT3)o)%TaWHZ~MrDMv?f5+R%hV*jett|)l-7+3-IWdjCt}1} z-*!#Sf3=ova#jH@)lHbTvqRON6g69P1iyRnLkAhE$`^i1)Atb@Tq*>v*Iik{s$?32 zNGP_6Hng8pa7YC7PGn>2JXoJ{5m@GMa+?*|c;Bt5+DS$yI7i^2tgAmU z{qZA}cXBdSITmjj7GhNmS5F^#%$|I>gw5nVW|90M^K`#*EVmZ=aT5XBfB)c7r?JgU z*MwzV`9R`uondqx^XD1&H(}_t9jOwu6ke0bYw!O#K_syeoCyGzfNU6nfFS;zAnYAn zEe!2nr-nJrP3z@;^cQZO7x3=vhj*ii0vyEb6&26#=hkLwhOL*b;YU>}wKDe{ksMm@~i>|S+pZ*Y4Ol(_Qa>7(-ruN*& zBwqHs@}`$=M_wo}UvGD+Xw#xwPtZd5c!;aNJ#E*TZ_{SC-jeEYR*n_#@G57TGc_#C z*G?+z)g(V4JJL=$(YCNCFW92zVBU@>m!Reg@2w~f+@YvlM>#*4H=6heA*E!tVd!9F zZhu?oAl>NWjSk^7&|o2K=PR^f=wXz7gLoQxS#+At;~i4(hQH3yuiwrZR_Dq-l-iws=XyG3cn?VWbWf)DtuVK_+ zlUn3FXb}2Fz%M#&zW3}KR+W+Pbd?2L`-1QZ7sQwtTN}eSZs;)}jh`4bg&c2%A{~KV z)P;Sy-py$90|s<~CaI;Z`*}^aVRTonfKi;9-iq>EshTG^BXN7qK={D-%A70*L7`1i zk;=a6pnz<`8pamVsOI}XCw1V8E4HNY?HHk0q%7U?f^Jv5OyV) zJrpyJ%L7kgo=V=|=}p~}4Wo3^dYuu6X5MWB^>hbDQ69QTE&VZ|>}t48iFAx`Qje`1Pq5pSR5>@MsXn9*npq#29j|)W zj8UF5=A;5=@Z3=1JQ^TS#yFM*c`+pl{y@nTpmXHapPsgREUjN2OP71c>7zw8-^4rW zrC>Zdx=;`>eT&5D&YS{DyADc<*L;UTzX|F|d4ZiuE65$kk;HGmr$nNC_x!E6{?HX2 zd-PXlyh_=`7p(0sI!%FV-!teWM8yo)-Wdfx+N-A}PT6l-jq@RcZ8nFpjqeWdpODDzfnfPE!J48ik->ffKabti;# z+EPGCW5wkT)`jfBr z^u{f=*d&oFex*q6<>TB)FWtn@Z8BzghxI8>Fg?Ox(vPuPUuE8sMdhhj7@EHxw)v!Z zfaa_3?q?HCaNu4!?jPU=7gM;8ZT=OKt4uf0p86nVqzD77UrZ_lp^*@w_p9@?a;?e; z{En5Uk&!F5@x$-kgYq^FxmDmjoN$phyU%I0{WoTDBad-DVA69^`Rh_r!onMemKX${ z%b+JBqsxm!R@@PC%6$s{%7MLowt`pg^RX`=@|<2`5=~Up`geK~`3BP94gJ2>r>>JZ zf-DHWQc!fiJdeCoM63c8-3VS1S7*mFgIm~3Xu&P=X&TOO%0S6j8s;$c-|s~#{aUF5 z1yKaUvY4sQAegbd5;@3fNdi(Fgs6EEFmqVSKm^cQ^+?aZsrZ6X*x2M`2Lv~w4gc5^ z3ZN>%r_Q!v%rOvwy@&eDpFJ?!grkgLsD4iM%M#j8zrH$Nz!|0^kzyL0r2C3d#3=lO z8%NJRK~k0MxJIg)$*;4yEfwf}{rKq%gAZ=U0R#gjSW&oDTi3NGPrA82x;kyccT^!P z>W~_WJ1>eIHJf&m)7aU$0(Evax%?jJgK#HT-GW!Ap(WvUsk;0~bt-92sm=IrKTc;(ike+5-D_)L< z4*_2yf?+?F6;oAC@`XPjIY0@d-*BUM8eHZgCdp461CI#xYivfSJ>pkcc6OZsl%SmQ zDR@Q?y7E|ay$i7WW7;6$xxbuTDx3X+>M8dTMjVfhH{8xVh=?4yX; zmV_W*{+%DR&Y5u{7;*p^>QaTNa05}=C5P`z z2S#h+&Vo8xcjNSQsSRYCXt%joKc3Ad!APcHRIA7k$VN=#_PVMQ@~hUxvSZ22ejEm$PU@}kOgWdlA2~@FW12bKUxf)>t9zUe^8Gvydfnp*#%^yH`t)Jz z{Ngq{r)f1wTO+-_&BMd#xqBJ&#nt6*Eo|si+7y~IFM#iWP*DAh(+@okOp{o$klXK= zPxU}Ka8-lz>ERan^a9V9dNIgg{jp?P;^iKC5?I6*k*k~&RCC5= z5KQ2zmwLFB!nVFQP)c3TM%YlmLiaUA#CbJ|UMjf4126clOI}{Lr;nIW;4k=pO8~80$Y# zwN2~l!@X0=KI+~O)@m};ZQPdB!p_v~7qSqfL;aX26uB7dUEiu{eR5{er4*(bZq=%X)H?2nHEyZx3vG=19Ja>)vk3^l=N!rm)qmX$*XR6eP=Q|aCY(+Rz}v?hvjAu_1i=QD{He(sSq zV>l=cvd;P?AocWAmWnqmMq)~^^-4X`d3zs`eZp*u$M-(Fbg@DMt!)BjmQI7dmoVXh zfm_05J2ntDU8-qk;#pC4G%7%xKNjedXX`XoQ`ZuXn5{2WAh*P zYk-PPTyXUaN%$gb-g-0gS({5HgjeO(N$M$~^E62OdqAx4g#S#1R&%AF-bms?ppd6) zmNb<|L0{QSCuX5)d%xPinec3CNa}}M{}-hwEhX+O6F36;S+132zN@?$cAb(%B#5Tp zw`PH-7AcCtwi`p)4^tadfUG;Hm$gi@v&A-&bn-(xB+bXR$`;RxO;mp}V~W1YGJon1 z+|mA-1^p*g<}XNgsCGCMyzf%5DBs(`eg2?U5x*X6<)BaphIGJZ{9X?0*^x4dK|cdC z3y%5>znN4{@XnA|#RDGTa!JX11S=%u!2})dWmyP%W(+&r_2{tlEDf`iBTYxZS5UPLCaaPKt`slM1R+r$rKD_#*~BlLpb^ z5)zk`T9eE_qeeNyU+6&bERJ@aE>$PTe3H;)!EG03xhxQ0&BALT3{@xyvt@%0d_;jc zS&cql995VtU!RlL^h6ircl@{5K#g-A(cl>4eRGdJPO5m7l4*5SAI6V3zGDfLU0uo6 zb3Z-&n}mMB+c6-29+|pBjTwXG>A0?GbVFKT!D>?g1s^*HL!eCcX=heCerFF^8G{;A zXCZ?5T!|-X{q7>4u@?j}=DUEw899n>_OC^vO%l|Y^go~hvl8TvHVNo9HVLAlm6fgn zH(8b+r#yG^`z^k*GR)Z&sqMd)lwuoX4+jqlWX;p z?BEp}so>4@|JT@6z%|vq|G@x-(IKN`G$=@ScS$3nbc1wvNKFus?gj&Ck?xXBkOm3q z5(H@#LHTds`>Oc<{QS@7v)#Mxe4jk$dG0;;xx3LuT&&%&F>Z=sUao`3_jOiVmN-@E zMG|A<+;yEf6rs4P8CC9??vkeQAfAXF4moRSQ?#mG=EWC@so*EC{dP~WixWYsz{yu%7;|?--!9IIqZl>8Ep_gekiaDkW^wsd%gf$r;wScRwIJ&^+{j2N2?r?B3c8wsQ z0j->@%`^kX-is~K{l*rfLP6&)@jCs>qkKgQE5IFiB5{bKhYOutS@vXX3>hQ|<8Bc* zpsd~sP^cv(H*V71PEREyV832N2I1}C1TwoB1z zWryRIs;7FxSge-{M<&12^X}ip^>9{qJaEENgFWWlEFb`S8aB@3^;Tm&6nGWwU05S`TA~%#e~=VtzsKODi+dj zF#)D4lNCesibvy=l-EEF@*R4mN%K)YO`>{{hGJ$_P-A?}PU@!Vd2aVTW;7o_wo;x^ zr>B9A_nYTE&4dEF!eRt3N#`FFCa2C2)o2d|bRWBJp?`9K4v@6r#vKo1ig@jzWpq>A zc|YZW^Mv!+v&&txZY1=k!$js!zyxx%!wt%qh1Fj8;65c6VU3vGiEp72GIu}RC$TBT zCmuHBW~Sr(n&!WxVR>0pcAE}_htdcG>#@+bUG0Vg(`Z`1VS#Bz$_ojMlS^R)`h(Lg z7I>~8+=To|nIknB&K%ZmyPLkL_21!{`c&5lqMKET1HQ2`k~>Ef;}Oh=^Y||9Px(`0 z@@{USfnbj#vpACQY%=shQ6iYox7dP%>-EsW+-ffi50BF_7naJZgXJIQ8h^ZEBER_D zyK^G0=87ckR>q@X!MkWU4sK&;2IYUgI{5neLO%+_n;~81iN{ZjTfzCd0_k|@jr4aM<;6H&NFD{1PrMlB zvwHa4j)F|O`~f_ZvH(E7MS?>kRFt;d65cCX=vsG2hqFp+pj5JMqT-eu5>9|cf8e}+Z)&Sp6Ps8m1-CoIm zs>~12-l*7%$s%272W2qDY%kuO$ii&2*#Fo$jlKB=-*98T)aPd6&eHzCq$WuG}d+{WG_K>Ggm^|FgZ&%Rh$V-xqN_9Lxu5Xm3 zsI3v@ON05TLLxi1V}Mm$I4MZcsTA`*+u=1#Nt&5Bn%J_?T;ngVil6E}3RPG(SG%mu zE^ST_D@a4AyBdl=21~f)flDSE#hx zqzFhNhY~DwzJgyGbsO4JRfP&&{S=Q!*d`q}z;sK8Z8wa6$2e##C2yu9V`07VR3M=( zHVlg8lw@6UMYh7M$CM#|-Y(;9dM*{V5k&Cb=6=tm=IR@<3q%Gj-zcfC*q|l^WAWdg zR|av(b7#fXrV%^NMzkwx@>1}EjT;Bn#`O|O64bO+Vzu8#Z^83xv(iU17`UsB6!^@m zr*pj;zvu$ptRr`Vx`{z7HkXVXD<6|KyO8w@6vZr0%X&F$e7og0-c=Xw=u>?8fRNpK zfMkWeux)yBw+c?RHN-UMLz3kv7ybNoa=Fd6=H3`y_=3O<<^4r+Nek4BtF!PE?Fp;jwuyS>U?ae!4<1=+H72PkaRZ58LKT?;>6hx zhq>G!S$csmrpl`3MV6*3ud{QWe+^aZ2bg&Ya|nfm0o`^E^TdI@sqL&yusRSR8pm&E zq3J;_+GJpH^A=UhA%?uQ0(!~Fj{Jl_IqwqbIFZLgAsn6BI^SSTMOYxah<4b*C7v#Z z=mlXm_+$Oes6wF--J>c>UD(o#cj+iJI~s(WW3hNo%3~=%>c39$U2*j_O`38QaH3K8=ND0E-*d0$S4?zChdArK0pb z7~xB4$6)n$!RfHU%SLHiIYNm+ z?&3DZIyasZ?<_`C;9U9#_qPSBR}lxi{T|-8;ruI2O%(oKO4zK`WB5;IEa_O<##&F- zGxD}W`1Eh}bvT;1vVC8k9vrOAtvWKZe@5~IT9QQP7{=L^h4?2&wAMiXj(d&aPtqE2 zUwn@LP>2VpsN&_wU?orCQ+Xk7Z-iH&B`otef=z^l#b(ypspl5cp;Fk(_AdU1>v-9c zpE}<5m+cjCOQ*=CagZ%F0dkfjDbmE)ncbZH@u-Ji%i)kZr->)51ProkstV^weSG(U zzop^RSasaPd7KVUQu)(Mzh4oGDh#)Pp#T6XKmY*m{1na8(Z$x((a{!pc9x{2rZ&w% z+^RO^$)QtbI~=Z4a4)!qljjDuO&dx5uCm#}MBG;V#~P3+l*(hR!=BoBm`6;#vAoiX zR4J&}!)4ajr!~-nvGL*Eco2tA`%P!Y>fopV3}w&# z6n4f^zBR4V0ZdfpjG@={mXtj;&vGqmo>Hg_uv8bNbq@ELPJ@l#=>W=-cOi;$&Tm5V zZ9^-MNU;r)^MgbU`fSx5a7-n*pnLWVBkYa@Sc=K8Z%7As` zV~2%2&cd#~j9OP3=Y|AEAo&_af;!@xSA`aokscOEJ@kFs$zwRik> zWvjfuKevh~%FR>E+gxUb!}tnCIL`wdI&D}UF;?B99cTBaU+rja%?MAE4&R?Ni&05K z&#`Ma&)vn~h*omK{q8?>5;0WzUS*V8p1QzIAiayKMSl5I8rq*dR0?cZ5{eq;@$MM2 zkbBD9D!|o6y?|9y3kCW?!gRXdf&ILGMZ0`_F9on$3nOl0D!74N+7rYGz`R! zk&A_$>xEhpUjdJ%Q^ap`r~m-y-##~xJxk*Ul)5@+cP3b& zq9=Suh~J} z;q{)}tDLLqDk9yp*Bi&KdyDZJDY)#h6?^_~TmC4``7d)qzI-G*MwoFFG0(^mTf|bxdADC@ z+nIHn6MFA;a^TB;4*MRG>d!W9BaInX#S&&WeE~W{s+vn`qqh3~!2vhay#Epz_GAi!byg7OL*K!t4a2b9Qg|R~1ogg45)Rcdbj=5UU^wpK z-MYio0ry8dk&96oJA;?3#a}=x8b;LfST;WSCZ96LdbG(fL+bJ?j+E4cO?Jz_jM5*g zM@VD2T3cASx&E-;@4?K5TCsZoVca@IK%+Z1@*jvZI2SUuosZ>M_&p#ew!}8V+C!q_ zH*xb4y<9NE^rgR|bd0mQH5u32?0t4;4#P(CS=X2zNvLUjm@}4Eb(0fp?GB6#iFUvW zx&L`&dILR?7%OHKJkgef?lH4J@(ISBBt*ZID052*A85w1PNK01%a-Zs%G3FpDw;&T zib6DrM-G0gQq}G^5aiIVeaQ+!{f>NeJ$+-fb+U4ssrT4gTok%zjGq0iY2e`2qhjsX zKvLk{f@3(`pn0sCbf;45I7gN5YepGsR6s&$*=eKA{NmgU|L^wbh+f!uh_J;s#3V=7 zgXu{-I=ERlxEX1CJ6X6IoGrg4O{;cD;D>Lk_(3flaSYnJz|sp+2bzjqmvlWZO;tSI zWPMuedAALX7OK>2GwiT-`aRHc_!GwUf&_Fl*337$O!if1C2r3vMxy*tgtodPmy+jE+EM}3cQO%w#*FWNU=H(v}Uh;!&n^rf*f#cG;%5O-R) zL!;2E95wzni_d6UX14btzlVYeRB&gn$-7*};-*(Qh=rDH1yqa+VdGCDCQM9ll^$jp z!wb>X#C{csjy9gr8H9WK(2+v&+ei4-AO z#qjsQ%VB~NJVG<;ANiJR9f+>F5=i)WNfbxo=uM1>tc@ChKz&f4ap4I%pJ|tT^yZ|N#=Kc7QRZO+K3?h7x|(Dx8%f-^?{NLz&X_FtxEjxHAe1^=i97Wj^U1t2;j=LfQ#GiOAE>7Q_S zS2sudp9KEf!U)8VhScL0+F6YM|6A#J@0X--QO}Fn1Ig%IP}==pV1MM2i*)!c)-;U} z$};?6ZI5$#%^dCR5dp&WtXA}I!Xt`^el(=Ena*cYn7f#GBG>i*@N!bnBBv^XrzV06 z#Sh%M{I4z`J?!md&Z%(TKE=F{BeEZB87`3P(LX=8#|})Z$Z@G z^#6T`8zZvLFEzQp5Almtxj#8Ve}(<5(Y+}0#bflJ1RA!_`2OnmzX^?tM4mOI(}0Mq zfDrnZ4EZ-KG6SEtv*CSk5&O?U&+ocl%*aRz=l+8J4+=oPgkk%+X4WC!>DKX zuKgs){)akeq<$I6NEOaQs~Oi!*L4j5!08Lh1u80T7Zv*{&_!7;-beRSma^{uq;hsw Yow_nQLQ>?NcVNI8qF7t&GxF2_0Zk}rR{#J2 literal 0 HcmV?d00001 From 5250204b5c3989bea949361b4c81b2fb83af42d2 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Fri, 28 May 2021 12:38:12 +0800 Subject: [PATCH 103/128] =?UTF-8?q?=E6=B2=BB=E7=90=86=E6=8C=87=E6=95=B0-?= =?UTF-8?q?=E7=BD=91=E6=A0=BC=E8=B0=83=E8=AF=951?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ExtractFactGridGovernDailyFromDTO.java | 22 +++++++++ .../com/epmet/controller/DemoController.java | 20 +++++++- .../todata/FactGridGovernDailyService.java | 6 +-- .../impl/FactGridGovernDailyServiceImpl.java | 49 ++++++++++--------- .../resources/mapper/org/CustomerGridDao.xml | 3 +- 5 files changed, 71 insertions(+), 29 deletions(-) create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/ExtractFactGridGovernDailyFromDTO.java diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/ExtractFactGridGovernDailyFromDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/ExtractFactGridGovernDailyFromDTO.java new file mode 100644 index 0000000000..6b1ec0810f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/ExtractFactGridGovernDailyFromDTO.java @@ -0,0 +1,22 @@ +package com.epmet.dto.extract.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.List; + +/** + * 治理指数网格-计算入参。 + * + * @author yinzuomei@elink-cn.com + * @date 2021/5/27 17:28 + */ +@Data +public class ExtractFactGridGovernDailyFromDTO implements Serializable { + private static final long serialVersionUID = -4511693100253244749L; + @NotBlank(message = "customer") + private String customerId; + private String dateId; + private List gridIds; +} 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 bf2a5ae63f..a8baf89b38 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 @@ -19,6 +19,7 @@ import com.epmet.dao.stats.DimDateDao; import com.epmet.dao.stats.DimMonthDao; import com.epmet.dto.AgencySubTreeDto; import com.epmet.dto.StatsFormDTO; +import com.epmet.dto.extract.form.ExtractFactGridGovernDailyFromDTO; import com.epmet.dto.extract.form.ExtractOriginFormDTO; import com.epmet.dto.extract.form.ExtractScreenFormDTO; import com.epmet.dto.indexcal.CalculateCommonFormDTO; @@ -534,6 +535,14 @@ public class DemoController { } + /** + * @return com.epmet.commons.tools.utils.Result + * @param customerId + * @param dateId + * @author yinzuomei + * @description 话题原始表抽取方法 + * @Date 2021/5/28 10:23 + **/ @PostMapping("inserttopicorigin") public Result topicDataCleaning(@RequestParam("customerId") String customerId, @RequestParam("dateId")String dateId) { if (StringUtils.isNotBlank(customerId) && StringUtils.isNotBlank(dateId)) { @@ -903,9 +912,16 @@ public class DemoController { return new Result(); } + /** + * @return com.epmet.commons.tools.utils.Result + * @param fromDTO + * @author yinzuomei + * @description + * @Date 2021/5/27 17:28 + **/ @PostMapping("extractgridgoverndaily") - public Result extractFactGridGovernDaily(@RequestParam("customerId") String customerId,@RequestParam("dateId")String dateId){ - factGridGovernDailyService.extractFactGridGovernDaily(customerId,dateId); + public Result extractFactGridGovernDaily(@RequestBody ExtractFactGridGovernDailyFromDTO fromDTO){ + factGridGovernDailyService.extractFactGridGovernDaily(fromDTO); return new Result(); } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactGridGovernDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactGridGovernDailyService.java index 95185f2134..15447342ab 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactGridGovernDailyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactGridGovernDailyService.java @@ -18,6 +18,7 @@ package com.epmet.service.evaluationindex.extract.todata; import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.dto.extract.form.ExtractFactGridGovernDailyFromDTO; import com.epmet.entity.evaluationindex.extract.FactGridGovernDailyEntity; /** @@ -35,10 +36,9 @@ public interface FactGridGovernDailyService extends BaseService Date: Fri, 28 May 2021 13:50:43 +0800 Subject: [PATCH 104/128] =?UTF-8?q?=E6=B2=BB=E7=90=86=E6=8C=87=E6=95=B0bug?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dataaggre/service/datastats/impl/DataStatsServiceImpl.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java index c636d2fe11..25aa4c60c5 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java @@ -1224,6 +1224,9 @@ public class DataStatsServiceImpl implements DataStatsService { dto.setProblemResolvedCount(re.getProblemResolvedCount()); dto.setGroupSelfGovernRatio(re.getGroupSelfGovernRatio()); dto.setGridSelfGovernRatio(re.getGridSelfGovernRatio()); + dto.setCommunityResolvedRatio(re.getCommunityResolvedRatio()); + dto.setDistrictDeptResolvedRatio(re.getDistrictDeptResolvedRatio()); + dto.setStreetResolvedRatio(re.getStreetResolvedRatio()); } } resultList.add(dto); From 6bf696d540e2fd87d8cec9a8ef34fbf07727725d Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Fri, 28 May 2021 17:17:10 +0800 Subject: [PATCH 105/128] =?UTF-8?q?=E5=9F=BA=E5=B1=82=E6=B2=BB=E7=90=86-?= =?UTF-8?q?=E7=BB=84=E7=BB=87=E7=9A=84=E6=B2=BB=E7=90=86=E6=8C=87=E6=95=B0?= =?UTF-8?q?=EF=BC=8C=E6=8C=89=E5=A4=A9=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/constant/IssueConstant.java | 3 + .../extract/FactOriginProjectLogDailyDao.java | 10 + .../FactOriginProjectLogDailyService.java | 10 + .../FactAgencyGovernDailyServiceImpl.java | 249 ++++++++++++++++-- .../FactOriginProjectLogDailyServiceImpl.java | 19 ++ .../extract/FactOriginProjectLogDailyDao.xml | 40 +++ 6 files changed, 308 insertions(+), 23 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/IssueConstant.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/IssueConstant.java index c611d4b97e..891f6ef091 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/IssueConstant.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/IssueConstant.java @@ -26,4 +26,7 @@ public interface IssueConstant { *未解决 */ String UNRESOLVED = "unresolved"; + + String CLOSED_RESOLVED = "closed_resolved"; + String CLOSED_UNRESOLVED = "closed_unresolved"; } 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 3d7371fb56..3bdbc200bd 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 @@ -299,6 +299,16 @@ public interface FactOriginProjectLogDailyDao extends BaseDao selectGridSelfDaily(@Param("customerId") String customerId, @Param("dateId") String dateId); + /** + * 组织网格自治率统计--按天 + * @author zhaoqifeng + * @date 2021/5/24 17:53 + * @param customerId + * @param dateId + * @return java.util.List + */ + List selectAgencyGridSelfDaily(@Param("customerId") String customerId, @Param("dateId") String dateId); + /** * @return java.util.List * @param projectId diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectLogDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectLogDailyService.java index 141a8dc7b8..b925cc31e4 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectLogDailyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectLogDailyService.java @@ -320,4 +320,14 @@ public interface FactOriginProjectLogDailyService extends BaseService */ List getGridSelfDaily(String customerId, String dateId); + + /** + * 组织网格自制率统计-按天 + * @author zhaoqifeng + * @date 2021/5/24 17:52 + * @param customerId + * @param dateId + * @return java.util.List + */ + Map getAgencyGridSelfDaily(String customerId, String dateId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactAgencyGovernDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactAgencyGovernDailyServiceImpl.java index ba1ee9853d..82e599ff4b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactAgencyGovernDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactAgencyGovernDailyServiceImpl.java @@ -19,22 +19,23 @@ package com.epmet.service.evaluationindex.extract.todata.impl; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.constant.*; import com.epmet.dao.evaluationindex.extract.FactAgencyGovernDailyDao; import com.epmet.dto.extract.result.OrgStatisticsResultDTO; import com.epmet.dto.stats.DimAgencyDTO; import com.epmet.entity.evaluationindex.extract.FactAgencyGovernDailyEntity; -import com.epmet.service.evaluationindex.extract.todata.FactAgencyGovernDailyService; -import com.epmet.service.evaluationindex.extract.todata.FactOriginIssueMainDailyService; -import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectMainDailyService; -import com.epmet.service.evaluationindex.extract.todata.FactOriginTopicMainDailyService; +import com.epmet.service.evaluationindex.extract.todata.*; import com.epmet.service.stats.DimAgencyService; import com.epmet.util.DimIdGenerator; +import org.apache.commons.collections4.CollectionUtils; import org.springframework.stereotype.Service; import javax.annotation.Resource; import java.math.BigDecimal; +import java.math.RoundingMode; import java.util.List; import java.util.Map; +import java.util.function.Function; import java.util.stream.Collectors; /** @@ -54,6 +55,8 @@ public class FactAgencyGovernDailyServiceImpl extends BaseServiceImpl agencyList = dimAgencyService.getAgencyInfoByCustomerId(customerId); - List agencyGovernDailyList = agencyList.stream().map(agency -> { - FactAgencyGovernDailyEntity entity = initEntity(agency, dateId); - return entity; - }).collect(Collectors.toList()); - // 问题解决总数:当前组织下,话题关闭(已解决+无需解决)总数、议题关闭(已解决+无需解决)总数和项目结案(议题转为项目的结案数+项目立项结案数)总数之和 + List agencyGovernDailyList = agencyList.stream().map(agency -> initEntity(agency, dateId)).collect(Collectors.toList()); + // 1.问题解决总数:当前组织下,话题关闭(已解决+无需解决)总数、议题关闭(已解决+无需解决)总数和项目结案(议题转为项目的结案数+项目立项结案数)总数之和 + // 话题总数 Map topicTotal = factOriginTopicMainDailyService.getAgencyClosedTopicCount(customerId, dateId, null, null); - // 党群自治占比:当前组织下,所有小组内关闭(已解决+无需解决)的话题数与问题解决总数之比(未出小组:未转议题的) - // 网格自治占比:当前组织下,所有网格内结案项目数与问题解决总数之比(未出网格) - // 参考:fact_index_govrn_ablity_grid_monthly的SELF_SOLVE_PROJECT_COUNT计算 - // 社区解决占比:当前组织下,由社区结案的项目数与问题解决总数之比 - // 区直部门解决占比:当前组织下,由区级部门结案的项目数与问题解决总数之比 - // 街道解决占比:当前组织下,由街道结案的项目数与问题解决总数之比 - // 自下而上的项目解决:结案时操作人所代表的的处理部门(可以是网格、街道、组织) - // 自上而下的项目解决:向下吹哨,谁立项谁解决(后期在讨论哪样更合理) - // - // 究竟是谁解决!!: - // A社区→A街道→B社区(结案)——A街道解决(自下而上吹(饱含立项往上吹/从话题来的项目),看往上吹的最高层级) - // A社区→B社区→C社区(结案)——C社区解决(平级协助解决,看最后结案) - // A街道→A社区→B社区(结案)——A街道解决(自上而下吹,谁立项谁解决) - // 注:A社区→A街道→(退回)A社区→B社区(结案),A街道不算处理项目,仍是平级协助解决,看最后谁结案 + if (!topicTotal.isEmpty()) { + agencyGovernDailyList.forEach(item -> { + OrgStatisticsResultDTO dto = topicTotal.get(item.getAgencyId()); + if (null != dto) { + item.setProblemResolvedCount(dto.getSum()); + } + }); + //当前组织内,话题关闭已解决数 + Map topicResolvedCount = factOriginTopicMainDailyService.getAgencyClosedTopicCount(customerId, dateId, + ProjectConstant.RESOLVED, + null); + if (!topicResolvedCount.isEmpty()) { + agencyGovernDailyList.forEach(item -> { + OrgStatisticsResultDTO dto = topicResolvedCount.get(item.getAgencyId()); + if (null != dto) { + item.setTopicResolvedCount(dto.getSum()); + } + }); + } + //当前组织内,话题关闭未解决数 + Map topicUnResolvedCount = factOriginTopicMainDailyService.getAgencyClosedTopicCount(customerId, dateId, + ProjectConstant.UNRESOLVED, + null); + if (!topicUnResolvedCount.isEmpty()) { + agencyGovernDailyList.forEach(item -> { + OrgStatisticsResultDTO dto = topicUnResolvedCount.get(item.getAgencyId()); + if (null != dto) { + item.setTopicUnResolvedCount(dto.getSum()); + } + }); + } + //当前组织内,话题关闭已解决数 + Map topicSelfResolvedCount = factOriginTopicMainDailyService.getAgencyClosedTopicCount(customerId, dateId, + ProjectConstant.RESOLVED, + NumConstant.ZERO); + if (!topicSelfResolvedCount.isEmpty()) { + agencyGovernDailyList.forEach(item -> { + OrgStatisticsResultDTO dto = topicSelfResolvedCount.get(item.getAgencyId()); + if (null != dto) { + item.setInGroupTopicResolvedCount(dto.getSum()); + } + }); + } + //当前组织内,话题关闭未解决数 + Map topicSelfUnResolvedCount = factOriginTopicMainDailyService.getAgencyClosedTopicCount(customerId, + dateId, + ProjectConstant.UNRESOLVED, + NumConstant.ZERO); + if (!topicSelfUnResolvedCount.isEmpty()) { + agencyGovernDailyList.forEach(item -> { + OrgStatisticsResultDTO dto = topicSelfUnResolvedCount.get(item.getAgencyId()); + if (null != dto) { + item.setInGroupTopicUnResolvedCount(dto.getSum()); + } + }); + } + } + //议题总数 + Map issueTotal = factOriginIssueMainDailyService.getAgencyClosedIssueCount(customerId, dateId, null); + if (!issueTotal.isEmpty()) { + agencyGovernDailyList.forEach(item -> { + OrgStatisticsResultDTO dto = issueTotal.get(item.getAgencyId()); + if (null != dto) { + item.setProblemResolvedCount(item.getProblemResolvedCount() + dto.getSum()); + } + }); + // 当前组织内,议题关闭已解决数 + Map issueResolvedTotal = factOriginIssueMainDailyService.getAgencyClosedIssueCount(customerId, dateId, + IssueConstant.CLOSED_RESOLVED); + if (!issueResolvedTotal.isEmpty()) { + agencyGovernDailyList.forEach(item -> { + OrgStatisticsResultDTO dto = issueResolvedTotal.get(item.getAgencyId()); + if (null != dto) { + item.setIssueResolvedCount(dto.getSum()); + } + }); + } + // 当前组织内,议题关闭未解决数 + Map issueUnResolvedTotal = factOriginIssueMainDailyService.getAgencyClosedIssueCount(customerId, dateId, + IssueConstant.CLOSED_UNRESOLVED); + if (!issueUnResolvedTotal.isEmpty()) { + agencyGovernDailyList.forEach(item -> { + OrgStatisticsResultDTO dto = issueUnResolvedTotal.get(item.getAgencyId()); + if (null != dto) { + item.setIssueUnResolvedCount(dto.getSum()); + } + }); + } + } + //项目总数 + Map projectTotal = factOriginProjectMainDailyService.getAgencyClosedProjectCount(customerId, dateId, null, + null); + if (!projectTotal.isEmpty()) { + agencyGovernDailyList.forEach(item -> { + OrgStatisticsResultDTO dto = projectTotal.get(item.getAgencyId()); + if (null != dto) { + item.setProblemResolvedCount(item.getProblemResolvedCount() + dto.getSum()); + } + }); + // 当前组织内:来源于议题的项目:结案已解决数 + Map issueProjectResolvedTotal = factOriginProjectMainDailyService.getAgencyClosedProjectCount(customerId, + dateId, ProjectConstant.RESOLVED, + "issue"); + if (!issueProjectResolvedTotal.isEmpty()) { + agencyGovernDailyList.forEach(item -> { + OrgStatisticsResultDTO dto = issueProjectResolvedTotal.get(item.getAgencyId()); + if (null != dto) { + item.setIssueProjectResolvedCount(dto.getSum()); + } + }); + } + // 当前组织内:来源于议题的项目:结案无需解决数 + Map issueProjectUnResolvedTotal = factOriginProjectMainDailyService.getAgencyClosedProjectCount(customerId, + dateId, ProjectConstant.UNRESOLVED, + "issue"); + if (!issueProjectUnResolvedTotal.isEmpty()) { + agencyGovernDailyList.forEach(item -> { + OrgStatisticsResultDTO dto = issueProjectUnResolvedTotal.get(item.getAgencyId()); + if (null != dto) { + item.setIssueProjectUnResolvedCount(dto.getSum()); + } + }); + } + + // 当前组织内:来源于议题的项目:结案已解决数 + Map projectResolvedTotal = factOriginProjectMainDailyService.getAgencyClosedProjectCount(customerId, + dateId, ProjectConstant.RESOLVED, + OrgTypeConstant.AGENCY); + if (!projectResolvedTotal.isEmpty()) { + agencyGovernDailyList.forEach(item -> { + OrgStatisticsResultDTO dto = projectResolvedTotal.get(item.getAgencyId()); + if (null != dto) { + item.setApprovalProjectResolvedCount(dto.getSum()); + } + }); + } + // 当前组织内:来源于议题的项目:结案无需解决数 + Map projectUnResolvedTotal = factOriginProjectMainDailyService.getAgencyClosedProjectCount(customerId, + dateId, ProjectConstant.UNRESOLVED, + OrgTypeConstant.AGENCY); + if (!projectUnResolvedTotal.isEmpty()) { + agencyGovernDailyList.forEach(item -> { + OrgStatisticsResultDTO dto = projectUnResolvedTotal.get(item.getAgencyId()); + if (null != dto) { + item.setApprovalProjectUnResolvedCount(dto.getSum()); + } + }); + } + } + // 2.党群自治占比:当前组织下,所有小组内关闭(已解决+无需解决)的话题数与问题解决总数之比(未出小组:未转议题的) + agencyGovernDailyList.forEach(item -> { + int count = item.getInGroupTopicResolvedCount() + item.getInGroupTopicUnResolvedCount(); + int sum = item.getProblemResolvedCount(); + if (sum != NumConstant.ZERO) { + BigDecimal resolveCount = new BigDecimal(sum); + BigDecimal selfCount = new BigDecimal(count); + item.setGroupSelfGovernRatio(selfCount.divide(resolveCount, NumConstant.SIX, RoundingMode.HALF_UP)); + } + }); + // 3.网格自治占比:当前组织下,所有网格内结案项目数与问题解决总数之比(未出网格) + Map gridSelfCount = factOriginProjectLogDailyService.getAgencyGridSelfDaily(customerId, dateId); + if (!gridSelfCount.isEmpty()) { + agencyGovernDailyList.forEach(item -> { + OrgStatisticsResultDTO dto = gridSelfCount.get(item.getAgencyId()); + if (null != dto) { + int count = dto.getCount(); + int sum = item.getProblemResolvedCount(); + if (sum != NumConstant.ZERO) { + BigDecimal resolveCount = new BigDecimal(sum); + BigDecimal selfCount = new BigDecimal(count); + item.setGridSelfGovernRatio(selfCount.divide(resolveCount, NumConstant.SIX, RoundingMode.HALF_UP)); + } + } + }); + } + // 4.社区解决占比:当前组织下,由社区结案的项目数与问题解决总数之比 + // 5.区直部门解决占比:当前组织下,由区级部门结案的项目数与问题解决总数之比 + // 6.街道解决占比:当前组织下,由街道结案的项目数与问题解决总数之比 + Map> projectCount = factOriginProjectMainDailyService.getAgencyClosedProjectStatic(customerId, dateId); + if (!gridSelfCount.isEmpty()) { + agencyGovernDailyList.forEach(item -> { + List list = projectCount.get(item.getAgencyId()); + if (CollectionUtils.isNotEmpty(list)) { + Map map = list.stream().collect(Collectors.toMap(OrgStatisticsResultDTO::getLevel, + Function.identity())); + int sum = item.getProblemResolvedCount(); + BigDecimal resolveCount = new BigDecimal(sum); + if (sum != NumConstant.ZERO) { + // 社区解决占比 + OrgStatisticsResultDTO community = map.get(ScreenConstant.COMMUNITY); + if (null != community) { + int count = community.getCount(); + BigDecimal selfCount = new BigDecimal(count); + item.setCommunityClosedRatio(selfCount.divide(resolveCount, NumConstant.SIX, RoundingMode.HALF_UP)); + item.setCommunityClosedCount(count); + } + // 街道解决占比 + OrgStatisticsResultDTO street = map.get(ScreenConstant.STREET); + if (null != street) { + int count = street.getCount(); + BigDecimal selfCount = new BigDecimal(count); + item.setStreetClosedRatio(selfCount.divide(resolveCount, NumConstant.SIX, RoundingMode.HALF_UP)); + item.setStreetClosedCount(count); + } + // 区直部门解决占比 + OrgStatisticsResultDTO districtDept = map.get(ScreenConstant.DISTRICT); + if (null != districtDept) { + int count = districtDept.getCount(); + BigDecimal selfCount = new BigDecimal(count); + item.setDistrictDeptClosedRatio(selfCount.divide(resolveCount, NumConstant.SIX, RoundingMode.HALF_UP)); + item.setDistrictDeptClosedCount(count); + } + } + } + }); + } } private FactAgencyGovernDailyEntity initEntity(DimAgencyDTO agency, String dateId) { diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectLogDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectLogDailyServiceImpl.java index 3dde0b0032..73de4eb905 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectLogDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectLogDailyServiceImpl.java @@ -41,6 +41,7 @@ import org.springframework.util.CollectionUtils; import java.math.BigDecimal; import java.math.RoundingMode; import java.util.*; +import java.util.function.Function; import java.util.stream.Collectors; /** @@ -414,5 +415,23 @@ public class FactOriginProjectLogDailyServiceImpl extends BaseServiceImpl + * @author zhaoqifeng + * @date 2021/5/24 17:52 + */ + @Override + public Map getAgencyGridSelfDaily(String customerId, String dateId) { + List list = baseDao.selectAgencyGridSelfDaily(customerId, dateId); + if (CollectionUtils.isEmpty(list)) { + return Collections.emptyMap(); + } + return list.stream().collect(Collectors.toMap(OrgStatisticsResultDTO::getAgencyId, Function.identity())); + } + } \ 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 c1b12a7da5..a281843411 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 @@ -687,4 +687,44 @@ and m.ACTION_CODE='close' AND m.PROJECT_ID = #{projectId} + \ No newline at end of file From 4d623d98cd30e605503b89ccd484bc047c8ca24a Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Fri, 28 May 2021 18:42:57 +0800 Subject: [PATCH 106/128] =?UTF-8?q?=E6=B2=BB=E7=90=86=E6=8C=87=E6=95=B0-?= =?UTF-8?q?=E7=BD=91=E6=A0=BC=E7=9B=B8=E5=85=B3=E6=95=B0=E6=8D=AE=E6=A0=A1?= =?UTF-8?q?=E9=AA=8Cv1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../todata/impl/FactGridGovernDailyServiceImpl.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactGridGovernDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactGridGovernDailyServiceImpl.java index 46c55d8574..2a9b0e4120 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactGridGovernDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactGridGovernDailyServiceImpl.java @@ -108,8 +108,8 @@ public class FactGridGovernDailyServiceImpl extends BaseServiceImpl issueProjectUnResolvedMap=getGridProjectMap(customerId,null,ProjectConstant.CLOSED,ProjectConstant.PROJECT_ORIGIN_ISSUE,DimObjectStatusConstant.UNRESOLVED); Map approvalProjectResolvedMap=getGridProjectMap(customerId,null,ProjectConstant.CLOSED,ProjectConstant.PROJECT_ORIGIN_AGENCY,DimObjectStatusConstant.RESOLVED); Map approvalProjectUnResolvedMap=getGridProjectMap(customerId,null,ProjectConstant.CLOSED,ProjectConstant.PROJECT_ORIGIN_AGENCY,DimObjectStatusConstant.UNRESOLVED); - Map inGroupTopicResolvedMap=getTopicMap(customerId, null,ProjectConstant.CLOSED, DimObjectStatusConstant.RESOLVED,NumConstant.ONE_STR); - Map inGroupTopicUnResolvedMap=getTopicMap(customerId, null,ProjectConstant.CLOSED, DimObjectStatusConstant.UNRESOLVED,NumConstant.ONE_STR); + Map inGroupTopicResolvedMap=getTopicMap(customerId, null,ProjectConstant.CLOSED, DimObjectStatusConstant.RESOLVED,NumConstant.ZERO_STR); + Map inGroupTopicUnResolvedMap=getTopicMap(customerId, null,ProjectConstant.CLOSED, DimObjectStatusConstant.UNRESOLVED,NumConstant.ZERO_STR); Map dtoMap=getGovernGridClosedTotalCommonDTOMap(customerId,gridIds); for(FactGridGovernDailyEntity insertEntity:insertEntityList){ @@ -278,6 +278,7 @@ public class FactGridGovernDailyServiceImpl extends BaseServiceImpl projectLogDTOList) { List handleLevelList=new ArrayList<>(); for (FactOriginProjectLogDailyDTO logDailyDTO : projectLogDTOList) { - if(logDailyDTO.getActionCode().equals(DimObjectActionConstant.PROJECT_RETURN)){ + if(logDailyDTO.getActionCode().equals(DimObjectActionConstant.PROJECT_RETURN)||NumConstant.ZERO==logDailyDTO.getIsActive()){ //当前操作如果是退回,不参与比较 continue; } @@ -422,7 +426,8 @@ public class FactGridGovernDailyServiceImpl extends BaseServiceImpl projectLogDTOList) { boolean flag = true; for (FactOriginProjectLogDailyDTO detail : projectLogDTOList) { - if(detail.getActionCode().equals(DimObjectActionConstant.PROJECT_RETURN)){ + if(detail.getActionCode().equals(DimObjectActionConstant.PROJECT_RETURN) + || NumConstant.ZERO==detail.getIsActive()){ //当前操作如果是退回,不参与比较 continue; } From 8d041bcbdb7d192fce249e80552406e629f16dd1 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Fri, 28 May 2021 18:48:08 +0800 Subject: [PATCH 107/128] =?UTF-8?q?=E6=B2=BB=E7=90=86=E6=8C=87=E6=95=B0-?= =?UTF-8?q?=E7=BD=91=E6=A0=BC=E6=B7=BB=E5=8A=A0=E5=88=B0=E5=AE=9A=E6=97=B6?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../toscreen/impl/ScreenExtractServiceImpl.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java index b69cb0e595..b480c39761 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java @@ -5,10 +5,12 @@ import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.enums.EnvEnum; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.commons.tools.utils.HttpClientManager; +import com.epmet.dto.extract.form.ExtractFactGridGovernDailyFromDTO; import com.epmet.dto.extract.form.ExtractOriginFormDTO; import com.epmet.dto.extract.form.ExtractScreenFormDTO; import com.epmet.dto.indexcal.CalculateCommonFormDTO; import com.epmet.dto.screen.form.ScreenCentralZoneDataFormDTO; +import com.epmet.service.evaluationindex.extract.todata.FactGridGovernDailyService; import com.epmet.service.evaluationindex.extract.toscreen.*; import com.epmet.service.evaluationindex.indexcal.IndexCalculateService; import com.epmet.service.evaluationindex.screen.*; @@ -69,6 +71,8 @@ public class ScreenExtractServiceImpl implements ScreenExtractService { private ScreenProjectCategoryGridDailyService projectCategoryGridDailyService; @Autowired private ScreenProjectCategoryOrgDailyService projectCategoryOrgDailyService; + @Autowired + private FactGridGovernDailyService factGridGovernDailyService; /** * @param extractOriginFormDTO @@ -243,6 +247,14 @@ public class ScreenExtractServiceImpl implements ScreenExtractService { log.error("治理能力排行【全区】抽取到大屏失败,customerId为:" + customerId + "dateId为:" + dateId, e); } + try{ + ExtractFactGridGovernDailyFromDTO extractFactGridGovernDailyFromDTO=new ExtractFactGridGovernDailyFromDTO(); + extractFactGridGovernDailyFromDTO.setCustomerId(customerId); + extractFactGridGovernDailyFromDTO.setDateId(dateId); + factGridGovernDailyService.extractFactGridGovernDaily(extractFactGridGovernDailyFromDTO); + }catch(Exception e){ + log.error("治理指数-网格fact_grid_govern_daily抽取失败,customerId为:" + customerId + "dateId为:" + dateId, e); + } extractPartData(customerId, dateId); log.info("===== extractDaily method end ======"); } From 5352aca32b259decdb5ee0653ada6ce4641df073 Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Mon, 31 May 2021 09:26:28 +0800 Subject: [PATCH 108/128] =?UTF-8?q?=E5=85=9A=E5=91=98=E5=85=88=E9=94=8Bsql?= =?UTF-8?q?=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../db/migration/V0.0.19__add_vanguard.sql | 77 +++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.19__add_vanguard.sql diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.19__add_vanguard.sql b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.19__add_vanguard.sql new file mode 100644 index 0000000000..b847790598 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.19__add_vanguard.sql @@ -0,0 +1,77 @@ +CREATE TABLE `fact_party_member_vanguard_agency_daily` +( + `ID` varchar(64) NOT NULL COMMENT '唯一标识', + `CUSTOMER_ID` varchar(32) NOT NULL COMMENT '客户ID', + `AGENCY_ID` varchar(64) NOT NULL COMMENT '机构ID', + `PID` varchar(64) DEFAULT NULL COMMENT '父级机关ID', + `DATE_ID` varchar(32) NOT NULL COMMENT '统计日期 关联日期dim表', + `WEEK_ID` varchar(32) NOT NULL COMMENT '周ID', + `MONTH_ID` varchar(32) NOT NULL COMMENT '月ID', + `QUARTER_ID` varchar(32) NOT NULL COMMENT '季ID', + `YEAR_ID` varchar(32) NOT NULL COMMENT '年ID', + `GROUP_COUNT` int(11) DEFAULT '0' COMMENT '党员建组数', + `GROUP_RATIO` decimal(11, 6) DEFAULT '0.000000' COMMENT '党员建组数占比', + `GROUP_TOTAL` int(11) DEFAULT NULL COMMENT '小组总数', + `GROUP_MEMBER_COUNT` int(11) DEFAULT '0' COMMENT '组内党员人数', + `GROUP_MEMBER_RATIO` decimal(11, 6) DEFAULT '0.000000' COMMENT '组内党员人数占比', + `GROUP_MEMBER_TOTAL` int(11) DEFAULT NULL COMMENT '小组成员总数', + `TOPIC_COUNT` int(11) DEFAULT '0' COMMENT '党员发布话题数', + `TOPIC_RATIO` decimal(11, 6) DEFAULT '0.000000' COMMENT '党员发布话题数占比', + `TOPIC_TOTAL` int(11) DEFAULT NULL COMMENT '话题总数', + `ISSUE_COUNT` int(11) DEFAULT '0' COMMENT '党员发布话题转议题数', + `ISSUE_RATIO` decimal(11, 6) DEFAULT '0.000000' COMMENT '党员发布话题转议题数占比', + `ISSUE_TOTAL` int(11) DEFAULT NULL COMMENT '议题总数', + `PROJECT_COUNT` int(11) DEFAULT '0' COMMENT '党员发布话题转项目数', + `PROJECT_RATIO` decimal(11, 6) DEFAULT '0.000000' COMMENT '党员发布话题转项目数占比', + `PROJECT_TOTAL` int(11) DEFAULT NULL COMMENT '项目总数', + `PROJECT_CLOSED_COUNT` int(11) DEFAULT '0' COMMENT '党员发布话题转项目结案数', + `PROJECT_CLOSED_RATIO` decimal(11, 6) DEFAULT '0.000000' COMMENT '党员发布话题转项目结案数占比', + `PROJECT_CLOSED_TOTAL` int(11) DEFAULT NULL COMMENT '结案项目总数', + `DEL_FLAG` char(1) NOT NULL DEFAULT '0' COMMENT '删除标识 未删除:0,已删除:1', + `REVISION` int(11) NOT NULL DEFAULT '0' COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) +) ENGINE = InnoDB + DEFAULT CHARSET = utf8mb4 COMMENT ='党员先锋-机关日统计数据'; + +CREATE TABLE `fact_party_member_vanguard_grid_daily` +( + `ID` varchar(64) NOT NULL COMMENT '唯一标识', + `CUSTOMER_ID` varchar(32) NOT NULL COMMENT '客户ID', + `AGENCY_ID` varchar(64) NOT NULL COMMENT '机构ID', + `GRID_ID` varchar(64) NOT NULL COMMENT '网格ID', + `DATE_ID` varchar(32) NOT NULL COMMENT '统计日期 关联日期dim表', + `WEEK_ID` varchar(32) NOT NULL COMMENT '周ID', + `MONTH_ID` varchar(32) NOT NULL COMMENT '月ID', + `QUARTER_ID` varchar(32) NOT NULL COMMENT '季ID', + `YEAR_ID` varchar(32) NOT NULL COMMENT '年ID', + `GROUP_COUNT` int(11) DEFAULT '0' COMMENT '党员建组数', + `GROUP_RATIO` decimal(11, 6) DEFAULT '0.000000' COMMENT '党员建组数占比', + `GROUP_TOTAL` int(11) DEFAULT NULL COMMENT '小组成员总数', + `GROUP_MEMBER_COUNT` int(11) DEFAULT '0' COMMENT '组内党员人数', + `GROUP_MEMBER_RATIO` decimal(11, 6) DEFAULT '0.000000' COMMENT '组内党员人数占比', + `GROUP_MEMBER_TOTAL` int(11) DEFAULT NULL COMMENT '小组成员总数', + `TOPIC_COUNT` int(11) DEFAULT '0' COMMENT '党员发布话题数', + `TOPIC_RATIO` decimal(11, 6) DEFAULT '0.000000' COMMENT '党员发布话题数占比', + `TOPIC_TOTAL` int(11) DEFAULT NULL COMMENT '话题总数', + `ISSUE_COUNT` int(11) DEFAULT '0' COMMENT '党员发布话题转议题数', + `ISSUE_RATIO` decimal(11, 6) DEFAULT '0.000000' COMMENT '党员发布话题转议题数占比', + `ISSUE_TOTAL` int(11) DEFAULT NULL COMMENT '议题总数', + `PROJECT_COUNT` int(11) DEFAULT '0' COMMENT '党员发布话题转项目数', + `PROJECT_RATIO` decimal(11, 6) DEFAULT '0.000000' COMMENT '党员发布话题转项目数占比', + `PROJECT_TOTAL` int(11) DEFAULT NULL COMMENT '项目总数', + `PROJECT_CLOSED_COUNT` int(11) DEFAULT '0' COMMENT '党员发布话题转项目结案数', + `PROJECT_CLOSED_RATIO` decimal(11, 6) DEFAULT '0.000000' COMMENT '党员发布话题转项目结案数占比', + `PROJECT_CLOSED_TOTAL` int(11) DEFAULT NULL COMMENT '结案项目总数', + `DEL_FLAG` char(1) NOT NULL DEFAULT '0' COMMENT '删除标识 未删除:0,已删除:1', + `REVISION` int(11) NOT NULL DEFAULT '0' COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) +) ENGINE = InnoDB + DEFAULT CHARSET = utf8mb4 COMMENT ='党员先锋-网格日统计数据'; \ No newline at end of file From cb2b13b3206282b5e1c941e950580b0c50c2e32a Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Mon, 31 May 2021 09:55:32 +0800 Subject: [PATCH 109/128] =?UTF-8?q?=E7=BB=84=E7=BB=87=E3=80=81=E7=BD=91?= =?UTF-8?q?=E6=A0=BC=E6=B2=BB=E7=90=86=E6=8C=87=E6=95=B0=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=EF=BC=8C=E7=99=BE=E5=88=86=E6=95=B0=E6=94=B9=E6=88=90=E5=B8=A6?= =?UTF-8?q?%=E7=9A=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../result/AgencyGovrnResultDTO.java | 10 +++++----- .../datastats/result/GridGovrnResultDTO.java | 10 +++++----- .../mapper/datastats/DatsStatsDao.xml | 20 +++++++++---------- 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/AgencyGovrnResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/AgencyGovrnResultDTO.java index b15017ea33..bb5448e7da 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/AgencyGovrnResultDTO.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/AgencyGovrnResultDTO.java @@ -24,14 +24,14 @@ public class AgencyGovrnResultDTO implements Serializable { //问题解决总数 private Integer problemResolvedCount = 0; //党群自治占比 - private BigDecimal groupSelfGovernRatio = bi; + private String groupSelfGovernRatio = "0%"; //网格自治占比 - private BigDecimal gridSelfGovernRatio = bi; + private String gridSelfGovernRatio = "0%"; //社区解决占比 - private BigDecimal communityResolvedRatio = bi; + private String communityResolvedRatio = "0%"; //区直部门解决占比 - private BigDecimal districtDeptResolvedRatio = bi; + private String districtDeptResolvedRatio = "0%"; //街道解决占比 - private BigDecimal streetResolvedRatio = bi; + private String streetResolvedRatio = "0%"; } diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/GridGovrnResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/GridGovrnResultDTO.java index cd88c5b0e4..a7c71f1b69 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/GridGovrnResultDTO.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/GridGovrnResultDTO.java @@ -22,14 +22,14 @@ public class GridGovrnResultDTO implements Serializable { //问题解决总数 private Integer problemResolvedCount = 0; //党群自治占比 - private BigDecimal groupSelfGovernRatio = bi; + private String groupSelfGovernRatio = "0%"; //网格自治占比 - private BigDecimal gridSelfGovernRatio = bi; + private String gridSelfGovernRatio = "0%"; //社区解决占比 - private BigDecimal communityResolvedRatio = bi; + private String communityResolvedRatio = "0%"; //区直部门解决占比 - private BigDecimal districtDeptResolvedRatio = bi; + private String districtDeptResolvedRatio = "0%"; //街道解决占比 - private BigDecimal streetResolvedRatio = bi; + private String streetResolvedRatio = "0%"; } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml index 6fec43461f..463788def8 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml @@ -618,11 +618,11 @@ agency_id AS agencyId, `level` AS level, problem_resolved_count AS problemResolvedCount, - ROUND(group_self_govern_ratio, 3) AS groupSelfGovernRatio, - ROUND(grid_self_govern_ratio, 3) AS gridSelfGovernRatio, - ROUND(community_closed_ratio, 3) AS communityResolvedRatio, - ROUND(street_closed_ratio, 3) AS streetResolvedRatio, - ROUND(district_dept_closed_ratio, 3) AS districtDeptResolvedRatio + concat(ROUND(group_self_govern_ratio*100, 1),'%') AS groupSelfGovernRatio, + concat(ROUND(grid_self_govern_ratio*100, 1),'%') AS gridSelfGovernRatio, + concat(ROUND(community_closed_ratio*100, 1),'%') AS communityResolvedRatio, + concat(ROUND(street_closed_ratio*100, 1),'%') AS streetResolvedRatio, + concat(ROUND(district_dept_closed_ratio*100, 1),'%') AS districtDeptResolvedRatio FROM fact_agency_govern_daily WHERE @@ -638,11 +638,11 @@ SELECT grid_id AS gridId, problem_resolved_count AS problemResolvedCount, - ROUND(group_self_govern_ratio, 3) AS groupSelfGovernRatio, - ROUND(grid_self_govern_ratio, 3) AS gridSelfGovernRatio, - ROUND(community_closed_ratio, 3) AS communityResolvedRatio, - ROUND(street_closed_ratio, 3) AS streetResolvedRatio, - ROUND(district_dept_closed_ratio, 3) AS districtDeptResolvedRatio + concat(ROUND(group_self_govern_ratio*100, 1),'%') AS groupSelfGovernRatio, + concat(ROUND(grid_self_govern_ratio*100, 1),'%') AS gridSelfGovernRatio, + concat(ROUND(community_closed_ratio*100, 1),'%') AS communityResolvedRatio, + concat(ROUND(street_closed_ratio*100, 1),'%') AS streetResolvedRatio, + concat(ROUND(district_dept_closed_ratio*100, 1),'%') AS districtDeptResolvedRatio FROM fact_grid_govern_daily WHERE From a7501bd1884ad716f660738bdcacec15861fc424 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Mon, 31 May 2021 13:42:44 +0800 Subject: [PATCH 110/128] =?UTF-8?q?=E9=81=97=E6=BC=8F=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dataaggre/dto/datastats/form/AgencyGovrnFormDTO.java | 2 +- .../dataaggre/dto/datastats/form/GridGovrnFormDTO.java | 3 +++ .../service/datastats/impl/DataStatsServiceImpl.java | 6 ++++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/AgencyGovrnFormDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/AgencyGovrnFormDTO.java index ad33559d5b..82315c125f 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/AgencyGovrnFormDTO.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/AgencyGovrnFormDTO.java @@ -29,7 +29,7 @@ public class AgencyGovrnFormDTO implements Serializable { * 党群自治占比:party * 网格自治占比:grid * 社区解决占比:community - * 区直部门解决占比:dept + * 区直部门解决占比:department * 街道解决占比:street */ private String type; diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/GridGovrnFormDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/GridGovrnFormDTO.java index 45eaa572c5..aaa2828173 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/GridGovrnFormDTO.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/GridGovrnFormDTO.java @@ -33,6 +33,9 @@ public class GridGovrnFormDTO implements Serializable { * 问题解决总数:problem * 党群自治占比:party * 网格自治占比:grid + * 社区解决占比:community + * 区直部门解决占比:department + * 街道解决占比:street */ private String type; public interface Agency extends CustomerClientShowGroup {} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java index 25aa4c60c5..fc2b115b2b 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java @@ -1240,6 +1240,12 @@ public class DataStatsServiceImpl implements DataStatsService { return o2.getGroupSelfGovernRatio().compareTo(o1.getGroupSelfGovernRatio()); } else if ("grid".equals(formDTO.getType())) { return o2.getGridSelfGovernRatio().compareTo(o1.getGridSelfGovernRatio()); + } else if ("community".equals(formDTO.getType())) { + return o2.getCommunityResolvedRatio().compareTo(o1.getCommunityResolvedRatio()); + } else if ("department".equals(formDTO.getType())) { + return o2.getDistrictDeptResolvedRatio().compareTo(o1.getDistrictDeptResolvedRatio()); + } else if ("street".equals(formDTO.getType())) { + return o2.getStreetResolvedRatio().compareTo(o1.getStreetResolvedRatio()); } else { return o2.getProblemResolvedCount().compareTo(o1.getProblemResolvedCount()); } From 4b0c913729030b2395c79f78edbe90fb00705d56 Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Mon, 31 May 2021 14:55:13 +0800 Subject: [PATCH 111/128] =?UTF-8?q?=E5=9F=BA=E5=B1=82=E6=B2=BB=E7=90=86-?= =?UTF-8?q?=E7=BB=84=E7=BB=87=E7=9A=84=E6=B2=BB=E7=90=86=E6=8C=87=E6=95=B0?= =?UTF-8?q?=EF=BC=8C=E6=8C=89=E5=A4=A9=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/controller/DemoController.java | 13 +++++++++---- .../extract/FactAgencyGovernDailyDao.java | 10 ++++++++++ .../impl/FactAgencyGovernDailyServiceImpl.java | 8 ++++++++ .../extract/FactAgencyGovernDailyDao.xml | 7 ++++++- 4 files changed, 33 insertions(+), 5 deletions(-) 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 a8baf89b38..108f82d575 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 @@ -38,10 +38,7 @@ import com.epmet.entity.stats.DimMonthEntity; import com.epmet.service.StatsDemoService; import com.epmet.service.StatsPartyMemberVanguardService; import com.epmet.service.evaluationindex.extract.dataToIndex.*; -import com.epmet.service.evaluationindex.extract.todata.FactGridGovernDailyService; -import com.epmet.service.evaluationindex.extract.todata.FactGroupActDailyService; -import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectCategoryDailyService; -import com.epmet.service.evaluationindex.extract.todata.FactOriginTopicMainDailyService; +import com.epmet.service.evaluationindex.extract.todata.*; import com.epmet.service.evaluationindex.extract.toscreen.*; import com.epmet.service.evaluationindex.indexcal.*; import com.epmet.service.evaluationindex.screen.*; @@ -120,6 +117,8 @@ public class DemoController { private FactGroupActDailyService factGroupActDailyService; @Autowired private FactGridGovernDailyService factGridGovernDailyService; + @Autowired + private FactAgencyGovernDailyService factAgencyGovernDailyService; @GetMapping("testAlarm") public void testAlarm() { @@ -924,4 +923,10 @@ public class DemoController { factGridGovernDailyService.extractFactGridGovernDaily(fromDTO); return new Result(); } + @PostMapping("extractFactAgencyGovernDaily") + public Result extractFactAgencyGovernDaily(@RequestBody ExtractFactGridGovernDailyFromDTO fromDTO){ + factAgencyGovernDailyService.extractFactAgencyGovernDaily(fromDTO.getCustomerId(), fromDTO.getDateId()); + return new Result(); + } + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactAgencyGovernDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactAgencyGovernDailyDao.java index b88d897543..2671d89c4e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactAgencyGovernDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactAgencyGovernDailyDao.java @@ -20,6 +20,7 @@ package com.epmet.dao.evaluationindex.extract; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.entity.evaluationindex.extract.FactAgencyGovernDailyEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; /** * 组织的治理指数,按天统计 @@ -29,5 +30,14 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface FactAgencyGovernDailyDao extends BaseDao { + /** + * 删除数据 + * @author zhaoqifeng + * @date 2021/5/31 14:47 + * @param customerId + * @param dateId + * @return int + */ + int deleteAgencyGovernDailyData(@Param("customerId") String customerId, @Param("dateId") String dateId, @Param("deleteSize") Integer deleteSize); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactAgencyGovernDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactAgencyGovernDailyServiceImpl.java index 82e599ff4b..1fbabc764b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactAgencyGovernDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactAgencyGovernDailyServiceImpl.java @@ -291,6 +291,14 @@ public class FactAgencyGovernDailyServiceImpl extends BaseServiceImpl - + + delete from fact_agency_govern_daily + where CUSTOMER_ID = #{customerId} + AND DATE_ID = #{dateId} + limit #{deleteSize} + \ No newline at end of file From 8745b52bf07bea40b70d8f4a871fab020aa9c088 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 1 Jun 2021 09:17:11 +0800 Subject: [PATCH 112/128] =?UTF-8?q?=E7=BB=84=E7=BB=87=E5=B1=82=E7=BA=A7?= =?UTF-8?q?=E6=B2=BB=E7=90=86=E6=8C=87=E6=95=B0table=E8=AF=AD=E5=8F=A5?= =?UTF-8?q?=EF=BC=8C=E5=8F=96=E6=B6=88=E6=B3=A8=E9=87=8A=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../db/migration/V0.0.15__govern.sql | 96 +++++++------------ 1 file changed, 37 insertions(+), 59 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.15__govern.sql b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.15__govern.sql index 59975cc83f..e83d7f5313 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.15__govern.sql +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.15__govern.sql @@ -1,64 +1,42 @@ -- epmet_data_statistical新增两张表,治理指数网格按天统计,治理指数按组织按天统计 --- /* --- Navicat Premium Data Transfer --- --- Source Server : 192.168.1.130 --- Source Server Type : MySQL --- Source Server Version : 50728 --- Source Host : 192.168.1.130:3306 --- Source Schema : epmet_data_statistical --- --- Target Server Type : MySQL --- Target Server Version : 50728 --- File Encoding : 65001 --- --- Date: 25/05/2021 09:31:39 --- */ --- --- SET NAMES utf8mb4; --- SET FOREIGN_KEY_CHECKS = 0; --- --- -- ---------------------------- --- -- Table structure for fact_agency_govern_daily --- -- ---------------------------- --- CREATE TABLE `fact_agency_govern_daily` ( --- `ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '主键,customer_id+AGENCY_ID+date_id只有一条记录', --- `CUSTOMER_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '客户id', --- `DATE_ID` varchar(8) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '数据更新至:yyyyMMdd; ', --- `AGENCY_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '组织id', --- `LEVEL` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'agency_id所属的机关级别(社区级:community,\r\n乡(镇、街道)级:street,\r\n区县级: district,\r\n市级: city\r\n省级:province)', --- `PID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '组织i所属的组织id', --- `PIDS` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '组织i所有上级id', --- `PROBLEM_RESOLVED_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '界面展示:问题解决总数=1+2+3+4+5+6+7+8', --- `GROUP_SELF_GOVERN_RATIO` decimal(10, 6) NOT NULL COMMENT '界面展示:党群自治占比=(9+10)/PROBLEM_RESOLVED_COUNT; 此列存储的是小数', --- `GRID_SELF_GOVERN_RATIO` decimal(10, 6) NOT NULL COMMENT '界面展示:网格自治占比=GRID_SELF_GOVERN_PROJECT_TOTAL/PROBLEM_RESOLVED_COUNT;此列存储的是小数', --- `COMMUNITY_CLOSED_RATIO` decimal(10, 6) NOT NULL COMMENT '界面展示:社区解决占比=COMMUNITY_CLOSED_COUNT/PROBLEM_RESOLVED_COUNT;此列存储的是小数', --- `STREET_CLOSED_RATIO` decimal(10, 6) NOT NULL COMMENT '界面展示:街道解决占比=STREET_CLOSED_COUNT/PROBLEM_RESOLVED_COUNT;此列存储的是小数', --- `DISTRICT_DEPT_CLOSED_RATIO` decimal(10, 6) NOT NULL COMMENT '界面展示:区直部门解决占比=DISTRICT_DEPT_CLOSED_COUNT/PROBLEM_RESOLVED_COUNT;此列存储的是小数', --- `TOPIC_RESOLVED_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '1、当前组织内,话题关闭已解决数', --- `TOPIC_UN_RESOLVED_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '2、当前组织内,话题关闭无需解决数', --- `ISSUE_RESOLVED_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '3、当前组织内,议题关闭已解决数', --- `ISSUE_UN_RESOLVED_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '4、当前组织内,议题关闭无需解决数', --- `ISSUE_PROJECT_RESOLVED_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '5、当前组织内:来源于议题的项目:结案已解决数', --- `ISSUE_PROJECT_UN_RESOLVED_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '6、当前组织内:来源于议题的项目:结案无需解决数', --- `APPROVAL_PROJECT_RESOLVED_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '7、当前组织内:项目立项,结案已解决数;默认为0,', --- `APPROVAL_PROJECT_UN_RESOLVED_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '8、当前组织内:项目立项,结案无需解决数;默认为0,', --- `IN_GROUP_TOPIC_RESOLVED_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '9、当前组织内,未出小组即未转议题的:话题关闭已解决数', --- `IN_GROUP_TOPIC_UN_RESOLVED_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '10、当前组织内,未出小组即未转议题的:话题关闭无需解决数', --- `GRID_SELF_GOVERN_PROJECT_TOTAL` int(11) NOT NULL DEFAULT 0 COMMENT '11、未出当前网格的,结案项目数', --- `COMMUNITY_CLOSED_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '当前组织内结案的项目中:由社区结案的项目总数', --- `STREET_CLOSED_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '当前组织内结案的项目中:由街道结案的项目总数', --- `DISTRICT_DEPT_CLOSED_COUNT` int(11) NOT NULL DEFAULT 0 COMMENT '当前组织内结案的项目中:由区直部门结案的项目总数', --- `DEL_FLAG` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除、1已删除', --- `REVISION` int(11) NOT NULL DEFAULT 0 COMMENT '乐观锁', --- `CREATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '创建人', --- `CREATED_TIME` datetime(0) NOT NULL COMMENT '创建时间:第一次提交审核的时间,注意和历史表的第一条记录时间一致', --- `UPDATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '更新人', --- `UPDATED_TIME` datetime(0) NOT NULL COMMENT '更新时间', --- PRIMARY KEY (`ID`) USING BTREE --- ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '组织的治理指数,按天统计' ROW_FORMAT = Dynamic; --- +CREATE TABLE `fact_agency_govern_daily` ( + `ID` varchar(64) NOT NULL COMMENT '主键,customer_id+AGENCY_ID+date_id只有一条记录', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户id', + `DATE_ID` varchar(8) NOT NULL COMMENT '数据更新至:yyyyMMdd; ', + `AGENCY_ID` varchar(64) NOT NULL COMMENT '组织id', + `LEVEL` varchar(30) NOT NULL COMMENT 'agency_id所属的机关级别(社区级:community,\r\n乡(镇、街道)级:street,\r\n区县级: district,\r\n市级: city\r\n省级:province)', + `PID` varchar(64) NOT NULL COMMENT '组织i所属的组织id', + `PIDS` varchar(255) NOT NULL COMMENT '组织i所有上级id', + `PROBLEM_RESOLVED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '界面展示:问题解决总数=1+2+3+4+5+6+7+8', + `GROUP_SELF_GOVERN_RATIO` decimal(10,6) NOT NULL COMMENT '界面展示:党群自治占比=(9+10)/PROBLEM_RESOLVED_COUNT; 此列存储的是小数', + `GRID_SELF_GOVERN_RATIO` decimal(10,6) NOT NULL COMMENT '界面展示:网格自治占比=GRID_SELF_GOVERN_PROJECT_TOTAL/PROBLEM_RESOLVED_COUNT;此列存储的是小数', + `COMMUNITY_CLOSED_RATIO` decimal(10,6) NOT NULL COMMENT '界面展示:社区解决占比=COMMUNITY_CLOSED_COUNT/PROBLEM_RESOLVED_COUNT;此列存储的是小数', + `STREET_CLOSED_RATIO` decimal(10,6) NOT NULL COMMENT '界面展示:街道解决占比=STREET_CLOSED_COUNT/PROBLEM_RESOLVED_COUNT;此列存储的是小数', + `DISTRICT_DEPT_CLOSED_RATIO` decimal(10,6) NOT NULL COMMENT '界面展示:区直部门解决占比=DISTRICT_DEPT_CLOSED_COUNT/PROBLEM_RESOLVED_COUNT;此列存储的是小数', + `TOPIC_RESOLVED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '1、当前组织内,话题关闭已解决数', + `TOPIC_UN_RESOLVED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '2、当前组织内,话题关闭无需解决数', + `ISSUE_RESOLVED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '3、当前组织内,议题关闭已解决数', + `ISSUE_UN_RESOLVED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '4、当前组织内,议题关闭无需解决数', + `ISSUE_PROJECT_RESOLVED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '5、当前组织内:来源于议题的项目:结案已解决数', + `ISSUE_PROJECT_UN_RESOLVED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '6、当前组织内:来源于议题的项目:结案无需解决数', + `APPROVAL_PROJECT_RESOLVED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '7、当前组织内:项目立项,结案已解决数;默认为0,', + `APPROVAL_PROJECT_UN_RESOLVED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '8、当前组织内:项目立项,结案无需解决数;默认为0,', + `IN_GROUP_TOPIC_RESOLVED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '9、当前组织内,未出小组即未转议题的:话题关闭已解决数', + `IN_GROUP_TOPIC_UN_RESOLVED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '10、当前组织内,未出小组即未转议题的:话题关闭无需解决数', + `GRID_SELF_GOVERN_PROJECT_TOTAL` int(11) NOT NULL DEFAULT '0' COMMENT '11、未出当前网格的,结案项目数', + `COMMUNITY_CLOSED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '当前组织内结案的项目中:由社区结案的项目总数', + `STREET_CLOSED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '当前组织内结案的项目中:由街道结案的项目总数', + `DISTRICT_DEPT_CLOSED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '当前组织内结案的项目中:由区直部门结案的项目总数', + `DEL_FLAG` varchar(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除、1已删除', + `REVISION` int(11) NOT NULL DEFAULT '0' COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间:第一次提交审核的时间,注意和历史表的第一条记录时间一致', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='组织的治理指数,按天统计'; + CREATE TABLE `fact_grid_govern_daily` ( `ID` varchar(64) NOT NULL COMMENT '主键,customer_id+grid_id+date_id只有一条记录', `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户id', From fd6989e4ff355fedad9bc36b3183799d607f49d7 Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Tue, 1 Jun 2021 10:00:40 +0800 Subject: [PATCH 113/128] =?UTF-8?q?=E5=9F=BA=E5=B1=82=E6=B2=BB=E7=90=86-?= =?UTF-8?q?=E7=BB=84=E7=BB=87=E7=9A=84=E6=B2=BB=E7=90=86=E6=8C=87=E6=95=B0?= =?UTF-8?q?=EF=BC=8C=E6=8C=89=E5=A4=A9=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../extract/toscreen/impl/ScreenExtractServiceImpl.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java index b480c39761..51f6e97426 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java @@ -10,6 +10,7 @@ import com.epmet.dto.extract.form.ExtractOriginFormDTO; import com.epmet.dto.extract.form.ExtractScreenFormDTO; import com.epmet.dto.indexcal.CalculateCommonFormDTO; import com.epmet.dto.screen.form.ScreenCentralZoneDataFormDTO; +import com.epmet.service.evaluationindex.extract.todata.FactAgencyGovernDailyService; import com.epmet.service.evaluationindex.extract.todata.FactGridGovernDailyService; import com.epmet.service.evaluationindex.extract.toscreen.*; import com.epmet.service.evaluationindex.indexcal.IndexCalculateService; @@ -73,6 +74,8 @@ public class ScreenExtractServiceImpl implements ScreenExtractService { private ScreenProjectCategoryOrgDailyService projectCategoryOrgDailyService; @Autowired private FactGridGovernDailyService factGridGovernDailyService; + @Autowired + private FactAgencyGovernDailyService factAgencyGovernDailyService; /** * @param extractOriginFormDTO @@ -255,6 +258,12 @@ public class ScreenExtractServiceImpl implements ScreenExtractService { }catch(Exception e){ log.error("治理指数-网格fact_grid_govern_daily抽取失败,customerId为:" + customerId + "dateId为:" + dateId, e); } + + try{ + factAgencyGovernDailyService.extractFactAgencyGovernDaily(customerId, dateId); + }catch(Exception e){ + log.error("治理指数-组织fact_agency_govern_daily抽取失败,customerId为:" + customerId + "dateId为:" + dateId, e); + } extractPartData(customerId, dateId); log.info("===== extractDaily method end ======"); } From ea1945336dc05e2d6dc5765edfef86ed0079959a Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Tue, 1 Jun 2021 14:36:52 +0800 Subject: [PATCH 114/128] =?UTF-8?q?bug=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/datastats/DatsStatsDao.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml index 463788def8..fafc989776 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml @@ -95,7 +95,7 @@ fact_agency_project_daily WHERE del_flag = '0' - AND agency_id = '8631fa4b22e88fdc259b3f51b5de2be2' + AND agency_id = #{agencyId} AND date_id = #{dateId} LIMIT 1 From 6e5b67eff9df9f1bdc77648bee208828d3077b1b Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Tue, 1 Jun 2021 16:08:51 +0800 Subject: [PATCH 115/128] =?UTF-8?q?=E5=9F=BA=E5=B1=82=E6=B2=BB=E7=90=86-?= =?UTF-8?q?=E7=BB=84=E7=BB=87=E7=9A=84=E6=B2=BB=E7=90=86=E6=8C=87=E6=95=B0?= =?UTF-8?q?=EF=BC=8C=E6=8C=89=E5=A4=A9=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../datastats/impl/DataStatsServiceImpl.java | 12 ++- .../FactAgencyGovernDailyServiceImpl.java | 4 +- .../extract/FactOriginIssueMainDailyDao.xml | 21 +++-- .../extract/FactOriginProjectLogDailyDao.xml | 76 ++++++++++--------- .../extract/FactOriginProjectMainDailyDao.xml | 62 +++++++++------ .../extract/FactOriginTopicMainDailyDao.xml | 23 +++--- 6 files changed, 122 insertions(+), 76 deletions(-) diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java index fc2b115b2b..a916acf6cc 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java @@ -1,4 +1,4 @@ -package com.epmet.dataaggre.service.datastats.impl; + package com.epmet.dataaggre.service.datastats.impl; import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.tools.constant.NumConstant; @@ -980,6 +980,16 @@ public class DataStatsServiceImpl implements DataStatsService { } else { result = dataStatsDao.selectGridVanguardDetail(formDTO.getOrgId()); } + if (null == result) { + result = new PartyMemberVanguardDetailResultDTO(); + result.setGroupRatio(transform(new BigDecimal(NumConstant.ZERO))); + result.setGroupMemberRatio(transform(new BigDecimal(NumConstant.ZERO))); + result.setTopicRatio(transform(new BigDecimal(NumConstant.ZERO))); + result.setIssueRatio(transform(new BigDecimal(NumConstant.ZERO))); + result.setProjectRatio(transform(new BigDecimal(NumConstant.ZERO))); + result.setProjectClosedRatio(transform(new BigDecimal(NumConstant.ZERO))); + return result; + } result.setGroupRatio(transform(result.getGroupRatio())); result.setGroupMemberRatio(transform(result.getGroupMemberRatio())); result.setTopicRatio(transform(result.getTopicRatio())); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactAgencyGovernDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactAgencyGovernDailyServiceImpl.java index 1fbabc764b..6629836e02 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactAgencyGovernDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactAgencyGovernDailyServiceImpl.java @@ -266,7 +266,7 @@ public class FactAgencyGovernDailyServiceImpl extends BaseServiceImpl \ 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 a281843411..bd57a4df1e 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 @@ -688,43 +688,51 @@ AND m.PROJECT_ID = #{projectId} \ 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 3e0b110fd6..9213e3c855 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 @@ -949,38 +949,56 @@ 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 ebf9f0a4f5..59bc2006c0 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 @@ -243,18 +243,23 @@ \ No newline at end of file From d21fc7bf3f04a3faa1c3e69f6645a71c310c4712 Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 1 Jun 2021 16:37:45 +0800 Subject: [PATCH 116/128] =?UTF-8?q?=E4=BF=9D=E7=95=99=E5=B0=8F=E6=95=B0?= =?UTF-8?q?=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fact/FactIndexCommunitySubScoreDao.xml | 4 ++- .../mapper/fact/FactIndexCpcSubScoreDao.xml | 22 ++++++++-------- .../mapper/fact/FactIndexDeptSubScoreDao.xml | 25 +++++++++++-------- 3 files changed, 29 insertions(+), 22 deletions(-) diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCommunitySubScoreDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCommunitySubScoreDao.xml index 784ab0ccc7..37290ed60a 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCommunitySubScoreDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCommunitySubScoreDao.xml @@ -47,9 +47,11 @@ IF(fact.origin_value='',0,IFNULL(fact.origin_value,0)) AS origin_value, IF(fact.SAMPLE_COUNT='',0,IFNULL(fact.SAMPLE_COUNT,0)) AS quantity, round(fact.score,1) AS score, - round(fact.WEIGHT,2) AS weight + round(fact.WEIGHT,2) AS weight, + dict.VALUE_TYPE FROM fact_index_community_sub_score fact + LEFT JOIN index_dict dict ON fact.index_code = dict.index_code WHERE fact.del_flag = '0' AND fact.all_parent_index_code = #{allParentIndexCode} diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCpcSubScoreDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCpcSubScoreDao.xml index 4e7171912d..fcdbebc6d1 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCpcSubScoreDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCpcSubScoreDao.xml @@ -28,17 +28,19 @@ diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexDeptSubScoreDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexDeptSubScoreDao.xml index 8da2f52516..c72adacb3b 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexDeptSubScoreDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexDeptSubScoreDao.xml @@ -7,19 +7,22 @@ From bb440a72e8aeea5e16fea0fdc359866f54682e54 Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 1 Jun 2021 17:25:48 +0800 Subject: [PATCH 117/128] =?UTF-8?q?=E6=9C=AC=E7=BA=A7=E5=8F=8A=E4=B8=8B?= =?UTF-8?q?=E7=BA=A7=E5=88=86=E6=95=B0=E4=BF=9D=E7=95=99=E4=B8=80=E4=BD=8D?= =?UTF-8?q?=E5=B0=8F=E6=95=B0=E8=BF=94=E5=9B=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/resources/mapper/fact/FactIndexCommunityScoreDao.xml | 4 ++-- .../src/main/resources/mapper/fact/FactIndexGridScoreDao.xml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCommunityScoreDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCommunityScoreDao.xml index c48ba651ac..bd45c22bc4 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCommunityScoreDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCommunityScoreDao.xml @@ -28,10 +28,10 @@ ROUND(fact.score,1) AS "indexTotalOriginScore", fact.WEIGHT AS "indexTotalSupWeight", ROUND(self.self_score*fact.WEIGHT, 1) AS "agencyScore", - self.self_score AS selfOriginScore, + ROUND(self.self_score, 1) AS selfOriginScore, self.SELF_WEIGHT AS agencyWeight, ROUND(self.sub_score*fact.WEIGHT, 1) AS "subAgencyScore", - self.sub_score AS subOriginScore, + ROUND(self.sub_score, 1) AS subOriginScore, self.SUB_WEIGHT AS subAgencyWeight FROM fact_index_community_score fact diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexGridScoreDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexGridScoreDao.xml index a731e9c1db..0458665057 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexGridScoreDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexGridScoreDao.xml @@ -28,10 +28,10 @@ ROUND(fact.score,1) AS "indexTotalOriginScore", fact.WEIGHT AS "indexTotalSupWeight", ROUND(self.self_score*fact.WEIGHT, 1) AS "agencyScore", - self.self_score AS selfOriginScore, + ROUND(self.self_score, 1) AS selfOriginScore, self.SELF_WEIGHT AS agencyWeight, ROUND(self.sub_score*fact.WEIGHT, 1) AS "subAgencyScore", - self.sub_score AS subOriginScore, + ROUND(self.sub_score, 1) AS subOriginScore, self.SUB_WEIGHT AS subAgencyWeight FROM fact_index_grid_score fact From 1de35ecc5c11102e589cc2431247f75422b9fbf7 Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 1 Jun 2021 17:31:53 +0800 Subject: [PATCH 118/128] =?UTF-8?q?=E7=BD=91=E6=A0=BC=E7=BA=A7=E7=9A=84?= =?UTF-8?q?=E4=BF=9D=E7=95=99=E5=B0=8F=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/resources/mapper/fact/FactIndexGridSubScoreDao.xml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexGridSubScoreDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexGridSubScoreDao.xml index 5bbc687e50..1fda25b3ac 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexGridSubScoreDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexGridSubScoreDao.xml @@ -46,9 +46,11 @@ fact.index_code, IF(fact.origin_value='',0,IFNULL(fact.origin_value,0)) AS origin_value, round(fact.score,1) AS score, - round(fact.WEIGHT,2) AS weight + round(fact.WEIGHT,2) AS weight, + dict.VALUE_TYPE FROM fact_index_grid_sub_score fact + LEFT JOIN index_dict dict ON fact.index_code = dict.index_code WHERE fact.del_flag = '0' AND fact.all_parent_index_code = #{allParentIndexCode} From 49c461ecee96546dadf331d409a62910bf4fa888 Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 2 Jun 2021 09:58:47 +0800 Subject: [PATCH 119/128] =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E4=B8=8B=E7=BA=A7?= =?UTF-8?q?=E7=AD=89=E7=BA=A7=E6=8C=87=E6=A0=87=E5=88=86=E6=95=B0=E5=85=B3?= =?UTF-8?q?=E8=81=94=E7=BB=84=E7=BB=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/GovProjectServiceImpl.java | 4 +- .../screen/ScreenIndexDataMonthlyDao.xml | 44 ++++++++++++------- 2 files changed, 31 insertions(+), 17 deletions(-) diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govproject/impl/GovProjectServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govproject/impl/GovProjectServiceImpl.java index abc34e5c5c..d48c31f2d7 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govproject/impl/GovProjectServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govproject/impl/GovProjectServiceImpl.java @@ -116,10 +116,10 @@ public class GovProjectServiceImpl implements GovProjectService { List resultDTOList = new ArrayList<>(); List issueInfoDTOList = govIssueService.selectShiftProjectIssueList(formDTO.getCustomerId(), formDTO.getGridId(),formDTO.getPageNo(),formDTO.getPageSize()); if (CollectionUtils.isNotEmpty(issueInfoDTOList)) { - List topicIds = issueInfoDTOList.stream().map(data -> data.getTopicId()).collect(Collectors.toList()); + List topicIds = issueInfoDTOList.stream().map(IssueInfoDTO::getTopicId).collect(Collectors.toList()); // log.info("话题id集合:" + JSON.toJSONString(topicIds, true)); List topicInfoDTOList = resiGroupService.selectTopicInfoByIds(topicIds); - List issueIds = issueInfoDTOList.stream().map(data -> data.getIssueId()).collect(Collectors.toList()); + List issueIds = issueInfoDTOList.stream().map(IssueInfoDTO::getIssueId).collect(Collectors.toList()); // log.info("议题id集合:" + JSON.toJSONString(issueIds, true)); resultDTOList = projectDao.selectList(formDTO.getCustomerId(),issueIds); for (ProjectDistributionResultDTO project : resultDTOList) { diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml index 1dcde880e4..3440e5ab5c 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml @@ -230,46 +230,60 @@ SELECT - org_name AS `NAME`, - service_ablity * SERVICE_ABLITY_WEIGHT AS serviceAbility, - party_dev_ablity * PARTY_DEV_WEIGHT AS partyDevAbility, - govern_ablity * GOVERN_ABLITY_WEIGHT AS governAbility, - PARTY_DEV_WEIGHT AS partyWeight, - GOVERN_ABLITY_WEIGHT AS governWeight, - SERVICE_ABLITY_WEIGHT AS serviceWeight, - ORG_ID orgId, - ORG_TYPE orgType + score.org_name AS `NAME`, + score.service_ablity * score.SERVICE_ABLITY_WEIGHT AS serviceAbility, + score.party_dev_ablity * score.PARTY_DEV_WEIGHT AS partyDevAbility, + score.govern_ablity * score.GOVERN_ABLITY_WEIGHT AS governAbility, + score.PARTY_DEV_WEIGHT AS partyWeight, + score.GOVERN_ABLITY_WEIGHT AS governWeight, + score.SERVICE_ABLITY_WEIGHT AS serviceWeight, + score.ORG_ID orgId, + score.ORG_TYPE orgType FROM - screen_index_data_monthly + screen_index_data_monthly score + + + + INNER JOIN screen_customer_grid org ON org.CUSTOMER_ID = score.CUSTOMER_ID AND org.GRID_ID = score.ORG_ID AND org.DEL_FLAG = '0' + + + INNER JOIN screen_customer_agency org ON org.CUSTOMER_ID = score.CUSTOMER_ID AND org.GRID_ID = score.ORG_ID AND org.DEL_FLAG = '0' + + + INNER JOIN screen_customer_dept org ON org.CUSTOMER_ID = score.CUSTOMER_ID AND org.GRID_ID = score.ORG_ID AND org.DEL_FLAG = '0' + + + WHERE - del_flag = '0' - AND parent_id = #{agencyId} - AND month_id = #{monthId,jdbcType=VARCHAR} + score.del_flag = '0' + AND score.parent_id = #{agencyId} + AND score.month_id = #{monthId,jdbcType=VARCHAR} - AND CUSTOMER_ID = #{customerId} + AND score.CUSTOMER_ID = #{customerId} - AND ORG_TYPE = #{orgType,jdbcType=VARCHAR} + AND score.ORG_TYPE = #{orgType,jdbcType=VARCHAR} - AND ORG_TYPE != 'department' + AND score.ORG_TYPE != 'department' - - ORDER BY index_total ASC - - - ORDER BY index_total DESC - + ORDER BY score.index_total ${sort} LIMIT #{topNum} diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataYearlyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataYearlyDao.xml index 301954275f..7ce435c140 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataYearlyDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataYearlyDao.xml @@ -23,35 +23,43 @@ From 93c9d33072c701e787bda65eab873890170bb128 Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 2 Jun 2021 11:04:49 +0800 Subject: [PATCH 122/128] =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E4=B8=8B=E7=BA=A7?= =?UTF-8?q?=E7=AD=89=E7=BA=A7=E6=8C=87=E6=A0=87=E5=88=86=E6=95=B0=E5=85=B3?= =?UTF-8?q?=E8=81=94=E7=BB=84=E7=BB=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/mapper/screen/ScreenIndexDataMonthlyDao.xml | 4 ++-- .../main/resources/mapper/screen/ScreenIndexDataYearlyDao.xml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml index ea9a06365e..922bb971d1 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml @@ -89,10 +89,10 @@ INNER JOIN screen_customer_grid org ON org.CUSTOMER_ID = score.CUSTOMER_ID AND org.GRID_ID = score.ORG_ID AND org.DEL_FLAG = '0' - INNER JOIN screen_customer_agency org ON org.CUSTOMER_ID = score.CUSTOMER_ID AND org.GRID_ID = score.ORG_ID AND org.DEL_FLAG = '0' + INNER JOIN screen_customer_agency org ON org.CUSTOMER_ID = score.CUSTOMER_ID AND org.AGENCY_ID = score.ORG_ID AND org.DEL_FLAG = '0' - INNER JOIN screen_customer_dept org ON org.CUSTOMER_ID = score.CUSTOMER_ID AND org.GRID_ID = score.ORG_ID AND org.DEL_FLAG = '0' + INNER JOIN screen_customer_dept org ON org.CUSTOMER_ID = score.CUSTOMER_ID AND org.DEPT_ID = score.ORG_ID AND org.DEL_FLAG = '0' diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataYearlyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataYearlyDao.xml index 7ce435c140..4184ecd513 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataYearlyDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataYearlyDao.xml @@ -37,10 +37,10 @@ INNER JOIN screen_customer_grid org ON org.CUSTOMER_ID = score.CUSTOMER_ID AND org.GRID_ID = score.ORG_ID AND org.DEL_FLAG = '0' - INNER JOIN screen_customer_agency org ON org.CUSTOMER_ID = score.CUSTOMER_ID AND org.GRID_ID = score.ORG_ID AND org.DEL_FLAG = '0' + INNER JOIN screen_customer_agency org ON org.CUSTOMER_ID = score.CUSTOMER_ID AND org.AGENCY_ID = score.ORG_ID AND org.DEL_FLAG = '0' - INNER JOIN screen_customer_dept org ON org.CUSTOMER_ID = score.CUSTOMER_ID AND org.GRID_ID = score.ORG_ID AND org.DEL_FLAG = '0' + INNER JOIN screen_customer_dept org ON org.CUSTOMER_ID = score.CUSTOMER_ID AND org.DEPT_ID = score.ORG_ID AND org.DEL_FLAG = '0' From f605590fa86c48a3bd9b8ff14c7be8125a76b566 Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 2 Jun 2021 16:26:43 +0800 Subject: [PATCH 123/128] =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E5=85=88=E8=BF=9B?= =?UTF-8?q?=E6=8E=92=E8=A1=8C=E5=85=B3=E8=81=94=E7=BB=84=E7=BB=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../screen/ScreenIndexDataMonthlyDao.xml | 45 ++++++++++++------- 1 file changed, 29 insertions(+), 16 deletions(-) diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml index 922bb971d1..fdea53df9f 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml @@ -185,28 +185,41 @@ SELECT - org_id AS "agencyId", - org_name AS "agencyName", - grid_id AS "gridId", - grid_name AS "gridName", - user_id AS "userId", - user_name AS "userName", - point_total AS "pointTotal" + u.org_id AS "agencyId", + u.org_name AS "agencyName", + u.grid_id AS "gridId", + u.grid_name AS "gridName", + u.user_id AS "userId", + u.user_name AS "userName", + u.point_total AS "pointTotal" FROM - screen_party_user_rank_data + screen_party_user_rank_data u + + + + INNER JOIN screen_customer_grid org ON org.CUSTOMER_ID = u.CUSTOMER_ID AND org.GRID_ID = u.ORG_ID AND org.DEL_FLAG = '0' + + + INNER JOIN screen_customer_agency org ON org.CUSTOMER_ID = u.CUSTOMER_ID AND org.AGENCY_ID = u.ORG_ID AND org.DEL_FLAG = '0' + + + INNER JOIN screen_customer_dept org ON org.CUSTOMER_ID = u.CUSTOMER_ID AND org.DEPT_ID = u.ORG_ID AND org.DEL_FLAG = '0' + + + WHERE - del_flag = '0' + u.del_flag = '0' AND PARTY_FLAG = 0 - AND all_parent_ids LIKE CONCAT('%',#{orgId},'%') + AND u.all_parent_ids LIKE CONCAT('%',#{orgId},'%') - AND grid_id = #{orgId} + AND u.grid_id = #{orgId} ORDER BY - point_total DESC + u.point_total DESC LIMIT #{topNum} - \ No newline at end of file + From 3d7acb2ac7a8675515c044c55fb7f100c1095c98 Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Fri, 4 Jun 2021 14:52:18 +0800 Subject: [PATCH 127/128] =?UTF-8?q?=E5=85=9A=E5=91=98=E5=85=88=E9=94=8B?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../datastats/impl/DataStatsServiceImpl.java | 3 ++ .../extract/FactOriginGroupMainDailyDao.xml | 19 ++++++---- .../extract/FactOriginGroupMemberDailyDao.xml | 38 +++++++++++-------- .../extract/FactOriginIssueMainDailyDao.xml | 19 ++++++---- .../extract/FactOriginProjectMainDailyDao.xml | 38 ++++++++++++------- .../extract/FactOriginTopicMainDailyDao.xml | 19 ++++++---- 6 files changed, 85 insertions(+), 51 deletions(-) diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java index 72a5501eb8..0bf1504b81 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java @@ -1011,6 +1011,9 @@ public class DataStatsServiceImpl implements DataStatsService { public PartyMemberVanguardRankResultDTO vanguardRank(PartyMemberVanguardFormDTO formDTO) { //获取组织级别 DimAgencyEntity agency = dataStatsDao.getAgencyInfo(formDTO.getAgencyId()); + if (null == agency) { + return new PartyMemberVanguardRankResultDTO(); + } //组织排行 List agencyRank = dataStatsDao.selectAgencyVanguardRank(formDTO.getAgencyId()); //网格排行 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 index eeec0fa8e5..21df7f9a68 100644 --- 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 @@ -352,16 +352,19 @@ SELECT - a.AGENCY_ID, + da.ID AS AGENCY_ID, COUNT( DISTINCT MEMBER_ID ) AS "sum", IFNULL( b.partyCount, 0 ) AS "count" FROM - fact_origin_group_member_daily a - LEFT JOIN - (SELECT - AGENCY_ID, - COUNT( DISTINCT MEMBER_ID ) AS partyCount - FROM fact_origin_group_member_daily - WHERE IS_PARTY = 1 - AND CUSTOMER_ID = #{customerId} - AND DATE_ID <= #{dateId} - GROUP BY AGENCY_ID - ) b ON a.AGENCY_ID = b.AGENCY_ID - WHERE a.CUSTOMER_ID = #{customerId} - AND a.DATE_ID <= #{dateId} + dim_agency da + INNER JOIN fact_origin_group_member_daily a ON a.PIDS LIKE CONCAT( '%', da.ID, '%' ) + AND a.CUSTOMER_ID = #{customerId} + AND a.DATE_ID <= #{dateId} + LEFT JOIN ( + SELECT + agency.ID AS AGENCY_ID, + COUNT( DISTINCT MEMBER_ID ) AS partyCount + FROM + dim_agency agency + INNER JOIN fact_origin_group_member_daily member ON member.PIDS LIKE CONCAT( '%', agency.ID, '%' ) + AND member.IS_PARTY = 1 + AND member.CUSTOMER_ID = #{customerId} + AND member.DATE_ID <= #{dateId} + WHERE + agency.CUSTOMER_ID = #{customerId} + GROUP BY + agency.ID + ) b ON da.ID = b.AGENCY_ID + WHERE + da.CUSTOMER_ID = #{customerId} GROUP BY - a.AGENCY_ID + da.ID