From 1c688d7b43339cb47598c3a928119adfe032d758 Mon Sep 17 00:00:00 2001 From: wangchao Date: Thu, 17 Sep 2020 16:33:05 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E5=8E=86=E6=97=B6?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E7=9B=B8=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../extract/FactOriginGroupMainDailyDTO.java | 149 ++++++++++++++++++ .../FactOriginProjectOrgPeriodDailyDTO.java | 128 +++++++++++++++ .../result/ProjectOrgPeriodResultDTO.java | 83 ++++++++++ ...ojectOrgRelationWhenResponseResultDTO.java | 49 ++++++ .../extract/FactOriginGroupMainDailyDao.java | 33 ++++ .../FactOriginProjectOrgPeriodDailyDao.java | 51 ++++++ .../epmet/dao/project/ProjectProcessDao.java | 12 ++ .../FactOriginGroupMainDailyEntity.java | 119 ++++++++++++++ ...FactOriginProjectOrgPeriodDailyEntity.java | 98 ++++++++++++ .../extract/GroupExtractService.java | 9 ++ .../extract/ProjectPeriodExtractService.java | 21 +++ .../extract/impl/GroupExtractServiceImpl.java | 17 ++ .../impl/ProjectPeriodExtractServiceImpl.java | 51 ++++++ .../extract/FactOriginGroupMainDailyDao.xml | 33 ++++ .../FactOriginProjectOrgPeriodDailyDao.xml | 43 +++++ .../mapper/project/ProjectProcessDao.xml | 61 +++++++ 16 files changed, 957 insertions(+) create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactOriginGroupMainDailyDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactOriginProjectOrgPeriodDailyDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/result/ProjectOrgPeriodResultDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/result/ProjectOrgRelationWhenResponseResultDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginGroupMainDailyDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectOrgPeriodDailyDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginGroupMainDailyEntity.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginProjectOrgPeriodDailyEntity.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/GroupExtractService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/ProjectPeriodExtractService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/GroupExtractServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/ProjectPeriodExtractServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginGroupMainDailyDao.xml create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectOrgPeriodDailyDao.xml diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactOriginGroupMainDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactOriginGroupMainDailyDTO.java new file mode 100644 index 0000000000..7fbeb1ca84 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactOriginGroupMainDailyDTO.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.dto.extract; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 业务数据抽取-小组相关 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-16 + */ +@Data +public class FactOriginGroupMainDailyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 组的Id + */ + private String id; + + private String customerId; + + /** + * 状态:(审核通过 - approved 、 审核中 - under_auditting、 审核未通过 - rejected 、 已屏蔽 - hidden、 已关闭 - closed) +Ps: 如果一个小组被拒绝,当前小组的状态将永久停留在“审核未通过” + */ + private String groupState; + + /** + * 小组所在网格Id + */ + private String gridId; + + /** + * 小组所在机关Id + */ + private String agencyId; + + /** + * 小组所在组织的父机关Id + */ + private String parentId; + + /** + * 小组所在组织所有父类Id集合 + */ + private String pids; + + /** + * 建群申请审核通过的时期 + */ + private String dateId; + + /** + * 建群申请审核通过的周期 + */ + private String weekId; + + /** + * 建群申请审核通过的月份 + */ + private String monthId; + + /** + * 建群申请审核通过的季度 + */ + private String quarterId; + + /** + * 建群申请审核通过的年 + */ + private String yearId; + + /** + * 群众人数 + */ + private Integer resiMemberCount; + + /** + * 组内总人数 + */ + private Integer memberTotal; + + /** + * 群主ID + */ + private String groupOwnerId; + + /** + * 群主是否热心居民 可以update + */ + private Integer isOwnerHearted; + + /** + * 群主是否党员 可以update + */ + private Integer isOwnerParty; + + /** + * 删除标识 默认为0 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * + */ + private String createdBy; + + /** + * + */ + private Date createdTime; + + /** + * + */ + private String updatedBy; + + /** + * + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactOriginProjectOrgPeriodDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactOriginProjectOrgPeriodDailyDTO.java new file mode 100644 index 0000000000..e9bb3e944e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactOriginProjectOrgPeriodDailyDTO.java @@ -0,0 +1,128 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.extract; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 业务数据抽取-机关项目响应时间 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-16 + */ +@Data +public class FactOriginProjectOrgPeriodDailyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * + */ + private String id; + + private String customerId; + + /** + * 项目ID + */ + private String projectId; + + /** + * + */ + private String orgId; + + /** + * grid agenct dept + */ + private String orgType; + + /** + * 如果是机关,则为父级机关(若已是顶级机关则为0);如果是网格和部门,则为所属机关 + */ + private String pid; + + /** + * 最后一个节点是PID,若无则为空 + */ + private String pids; + + /** + * 流转到的日期 + */ + private Date informedDate; + + /** + * 流转走或结案的日期 + */ + private Date handledDate; + + /** + * 响应时长,从流转到自己到流转走共耗时/小时(不算法定节假日和周末) + */ + private Integer totalPeriod; + + /** + * 截至第一次响应时长,从流转到第一次处理(响应、结案、流转)耗时,大于等于上一项值 + */ + private Integer periodTillReplyFirstly; + + /** + * resloved 、 unresolved + */ + private String isResolved; + + /** + * 办结的操作,return(回退)、transfer(流转)、closed(结案),但是不包括response(响应)! + * */ + private String operation; + + /** + * 删除标识 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * + */ + private Date createdTime; + + /** + * + */ + private String createdBy; + + /** + * + */ + private Date updatedTime; + + /** + * + */ + private String updatedBy; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/result/ProjectOrgPeriodResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/result/ProjectOrgPeriodResultDTO.java new file mode 100644 index 0000000000..9ce79b4fc5 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/result/ProjectOrgPeriodResultDTO.java @@ -0,0 +1,83 @@ +package com.epmet.dto.project.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * @Description 从数据库中查询出的 项目 - 机关(网格、部门、机关)的响应时长 + * FIXME 注:查询的全都是已经结案的项目!!!!!!!!!!!!如果查询流转中的项目,需要修改逻辑(较为复杂) + * @ClassName ProjectOrgPeriodResultDTO + * @Auth wangc + * @Date 2020-09-16 15:28 + */ +@Data +public class ProjectOrgPeriodResultDTO implements Serializable { + private static final long serialVersionUID = 6216112710806237600L; + + /** + * 节点Id + * */ + private String processId; + + /** + * 项目Id + * */ + private String projectId; + + /** + * 是这个节点的操作,相当于上一个人的操作,而不是对于这个节点的处理 + * created transfer close return response + * */ + private String operation; + + /** + * 对这个节点的处理,如果未处理则为null + * created transfer close return response(查不出response,因为response类型的节点不会与process_staff产生关联,需要另取) + * */ + private String selfAction; + + /** + * 节点所属的机关,即上个节点推到这个节点的负责部门 + * */ + private String departmentName; + + /** + * 当前节点所属的Agency,如果负责的是部门或者网格则是其所属的机关 + * */ + private String orgId; + + /** + * 如果是部门处理,则有值,否则null + * */ + private String departmentId; + + /** + * 如果是网格处理,则有值,否则null + * */ + private String gridId; + + /** + * 当前所属的机关的所有Pid集合以及当前的机关Id,所以此项不会未null,至少也是它的所属Agency + * */ + private String orgIdPath; + + /** + * 从节点流入到节点流出,且当前负责单位确实解决(包括退回)了的情况下,所耗费的时间(以分钟为单位) + * 如果未当前负责单位一直停留在unresolved状态,即使做出response、或者项目被其他单位结案,该项依旧是0,不参与办结的计时 + * 如果负责单位只是做出回应,但未处理(即没有让节点流走),需要查出其相应的第一次响应时间,另取 + * */ + private Integer totalPeriod; + + /** + * 节点流入时间 + * */ + private Date informedDate; + + /** + * 节点流出时间,如果未解决则未null + * */ + private Date handledDate; + +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/result/ProjectOrgRelationWhenResponseResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/result/ProjectOrgRelationWhenResponseResultDTO.java new file mode 100644 index 0000000000..892e173491 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/result/ProjectOrgRelationWhenResponseResultDTO.java @@ -0,0 +1,49 @@ +package com.epmet.dto.project.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * @Description 查询机关在项目节点上响应的结果 + * 查询的是存在“响应”的所有相关工作人员节点,如果同一个人对同一个项目已经做过一次处理(并未做出响应)而在第二次流转到自己时 + * 做出了响应,也会连带查询出其第一次未响应过的数据 + * @ClassName ProjectOrgRelationWhenResponseResultDTO + * @Auth wangc + * @Date 2020-09-16 17:27 + */ +@Data +public class ProjectOrgRelationWhenResponseResultDTO implements Serializable { + private static final long serialVersionUID = 1962332392048752037L; + + /** + * 项目Id + * */ + private String projectId; + + /** + * 节点Id + * */ + private String processId; + + /** + * 节点动作的发起人 + * */ + private String staffId; + + /** + * 负责人所属的单位名称:xx机关-xx部门 、 xx机关-xx网格 、 xx机关 + * */ + private String departmentName; + + /** + * 动作分类 + * */ + private String operation; + + /** + * 节点创建时间,动作发起时间 + * */ + private Date createdTime; +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginGroupMainDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginGroupMainDailyDao.java new file mode 100644 index 0000000000..3a8aa67089 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginGroupMainDailyDao.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.FactOriginGroupMainDailyEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 业务数据抽取-小组相关 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-16 + */ +@Mapper +public interface FactOriginGroupMainDailyDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectOrgPeriodDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectOrgPeriodDailyDao.java new file mode 100644 index 0000000000..8bae057bc8 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectOrgPeriodDailyDao.java @@ -0,0 +1,51 @@ +/** + * 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.FactOriginProjectOrgPeriodDailyEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + * 业务数据抽取-机关项目响应时间 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-16 + */ +@Mapper +public interface FactOriginProjectOrgPeriodDailyDao extends BaseDao { + + /** + * @Description 查询是否存在数据,如果没有则视为第一次扫描该表,需要根据业务查询全部数据 + * @param + * @return + * @author wangc + * @date 2020.09.17 13:43 + **/ + int selectIfExisted(@Param("customerId") String customerId); + + /** + * @Description 在插入之前,先删除所有与这个项目相关的历时信息 + * @param projectId + * @return + * @author wangc + * @date 2020.09.17 14:43 + **/ + void deleteByProjectId(@Param("projectId") String projectId); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectProcessDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectProcessDao.java index ad0c1ca057..27118a560a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectProcessDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectProcessDao.java @@ -18,6 +18,7 @@ package com.epmet.dao.project; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.project.result.ProjectOrgPeriodResultDTO; import com.epmet.entity.project.ProjectEntity; import com.epmet.entity.project.ProjectProcessEntity; import org.apache.ibatis.annotations.Mapper; @@ -41,4 +42,15 @@ public interface ProjectProcessDao extends BaseDao { **/ List selectProcessList(ProjectEntity projectEntity); + /** + * @Description 查询项目-机关各个节点历时详情 + * @param customerId + * @param projectStatus 项目状态 pending closed 如果是null则全查 + * @param dateId + * @return + * @author wangc + * @date 2020.09.17 09:43 + **/ + List selectProjectOrgPeriod(@Param("customerId") String customerId,@Param("projectStatus")String projectStatus,@Param("dateId") String dateId); + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginGroupMainDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginGroupMainDailyEntity.java new file mode 100644 index 0000000000..8bb0ba12a1 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginGroupMainDailyEntity.java @@ -0,0 +1,119 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.evaluationindex.extract; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 业务数据抽取-小组相关 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-16 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_origin_group_main_daily") +public class FactOriginGroupMainDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + private String customerId; + + /** + * 状态:(审核通过 - approved 、 审核中 - under_auditting、 审核未通过 - rejected 、 已屏蔽 - hidden、 已关闭 - closed) +Ps: 如果一个小组被拒绝,当前小组的状态将永久停留在“审核未通过” + */ + private String groupState; + + /** + * 小组所在网格Id + */ + private String gridId; + + /** + * 小组所在机关Id + */ + private String agencyId; + + /** + * 小组所在组织的父机关Id + */ + private String parentId; + + /** + * 小组所在组织所有父类Id集合 + */ + private String pids; + + /** + * 建群申请审核通过的时期 + */ + private String dateId; + + /** + * 建群申请审核通过的周期 + */ + private String weekId; + + /** + * 建群申请审核通过的月份 + */ + private String monthId; + + /** + * 建群申请审核通过的季度 + */ + private String quarterId; + + /** + * 建群申请审核通过的年 + */ + private String yearId; + + /** + * 群众人数 + */ + private Integer resiMemberCount; + + /** + * 组内总人数 + */ + private Integer memberTotal; + + /** + * 群主ID + */ + private String groupOwnerId; + + /** + * 建组时群主是否热心居民,不更新 + */ + private Integer isOwnerHearted; + + /** + * 建组时群主是否党员,不更新 + */ + private Integer isOwnerParty; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginProjectOrgPeriodDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginProjectOrgPeriodDailyEntity.java new file mode 100644 index 0000000000..c6dc080aea --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginProjectOrgPeriodDailyEntity.java @@ -0,0 +1,98 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.evaluationindex.extract; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 业务数据抽取-机关项目响应时间 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-16 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_origin_project_org_period_daily") +public class FactOriginProjectOrgPeriodDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + private String customerId; + + /** + * 项目ID + */ + private String projectId; + + /** + * + */ + private String orgId; + + /** + * grid agenct dept + */ + private String orgType; + + /** + * 如果是机关,则为父级机关(若已是顶级机关则为0);如果是网格和部门,则为所属机关 + */ + private String pid; + + /** + * 最后一个节点是PID,若无则为空 + */ + private String pids; + + /** + * 流转到的日期 + */ + private Date informedDate; + + /** + * 流转走或结案的日期 + */ + private Date handledDate; + + /** + * 响应时长,从流转到自己到流转走共耗时/小时(不算法定节假日和周末) + */ + private Integer totalPeriod; + + /** + * 截至第一次响应时长,从流转到第一次处理(响应、结案、流转)耗时,大于等于上一项值 + */ + private Integer periodTillReplyFirstly; + + /** + * resloved 、 unresolved + */ + private String isResolved; + + /** + * 办结的操作,return(回退)、transfer(流转)、closed(结案),但是不包括response(响应)! + * */ + private String operation; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/GroupExtractService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/GroupExtractService.java new file mode 100644 index 0000000000..33a2d6c7fa --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/GroupExtractService.java @@ -0,0 +1,9 @@ +package com.epmet.service.evaluationindex.extract; + +/** + * @Desc 业务数据抽取 - 组相关 + * @Author wangc + * @DateTime 2020/9/14 5:07 下午 + */ +public interface GroupExtractService { +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/ProjectPeriodExtractService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/ProjectPeriodExtractService.java new file mode 100644 index 0000000000..30c06fdd24 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/ProjectPeriodExtractService.java @@ -0,0 +1,21 @@ +package com.epmet.service.evaluationindex.extract; + +import com.epmet.dto.extract.form.ExtractFormDTO; + +/** + * @Desc 业务数据抽取 - 项目节点历时 + * @Author wangc + * @DateTime 2020/9/14 5:07 下午 + */ +public interface ProjectPeriodExtractService { + + /** + * @Description 抽取项目节点历时逻辑 + * @param param + * @return + * @author wangc + * @date 2020.09.17 14:05 + **/ + void extractProjectPeriodData(ExtractFormDTO param); + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/GroupExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/GroupExtractServiceImpl.java new file mode 100644 index 0000000000..039fda6047 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/GroupExtractServiceImpl.java @@ -0,0 +1,17 @@ +package com.epmet.service.evaluationindex.extract.impl; + +import com.epmet.service.evaluationindex.extract.GroupExtractService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +/** + * @Description 业务数据抽取 - 组相关 + * @ClassName GroupExtractServiceImpl + * @Auth wangc + * @Date 2020-09-16 14:47 + */ +@Service +@Slf4j +public class GroupExtractServiceImpl implements GroupExtractService { + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/ProjectPeriodExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/ProjectPeriodExtractServiceImpl.java new file mode 100644 index 0000000000..885a2cc271 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/ProjectPeriodExtractServiceImpl.java @@ -0,0 +1,51 @@ +package com.epmet.service.evaluationindex.extract.impl; + +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.dao.evaluationindex.extract.FactOriginProjectOrgPeriodDailyDao; +import com.epmet.dto.extract.form.ExtractFormDTO; +import com.epmet.dto.project.result.ProjectOrgPeriodResultDTO; +import com.epmet.dto.project.result.ProjectOrgRelationWhenResponseResultDTO; +import com.epmet.service.evaluationindex.extract.ProjectPeriodExtractService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * @Description 业务数据抽取 - 项目节点历时 + * @ClassName ProjectPeriodExtractServiceImpl + * @Auth wangc + * @Date 2020-09-17 13:52 + */ +@Service +@Slf4j +public class ProjectPeriodExtractServiceImpl implements ProjectPeriodExtractService { + + @Autowired + private FactOriginProjectOrgPeriodDailyDao factOriginProjectOrgPeriodDailyDao; + + + /** + * @Description 抽取项目节点历时逻辑 + * @param param + * @return + * @author wangc + * @date 2020.09.17 14:05 + **/ + @Override + public void extractProjectPeriodData(ExtractFormDTO param) { + int trace = factOriginProjectOrgPeriodDailyDao.selectIfExisted(param.getCustomerId()); + + List periods; + List responseList; + + if(trace <= NumConstant.ZERO){ + //数据初始化 + + }else{ + //日常统计 + + } + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginGroupMainDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginGroupMainDailyDao.xml new file mode 100644 index 0000000000..0d7753a090 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginGroupMainDailyDao.xml @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectOrgPeriodDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectOrgPeriodDailyDao.xml new file mode 100644 index 0000000000..d1b01b9e1a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectOrgPeriodDailyDao.xml @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + DELETE FROM + fact_origin_project_org_period_daily + WHERE PROJECT_ID = #{projectId} + + + \ 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 5f6816ff3b..d88cdff3a0 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 @@ -20,4 +20,65 @@ ORDER BY pro.project_id,pro.CREATED_TIME ASC + + + + + + \ No newline at end of file From 68f66ce42de6885826e91f259209c21f2ba5305b Mon Sep 17 00:00:00 2001 From: wangchao Date: Fri, 18 Sep 2020 09:49:51 +0800 Subject: [PATCH 2/5] project-period --- .../java/com/epmet/dao/project/ProjectProcessDao.java | 9 +++++++++ .../main/resources/mapper/project/ProjectProcessDao.xml | 6 ++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectProcessDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectProcessDao.java index 5cb1149973..fce4b95879 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectProcessDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectProcessDao.java @@ -20,6 +20,7 @@ package com.epmet.dao.project; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.project.ProcessInfoDTO; import com.epmet.dto.project.result.ProjectOrgPeriodResultDTO; +import com.epmet.dto.project.result.ProjectOrgRelationWhenResponseResultDTO; import com.epmet.entity.project.ProjectEntity; import com.epmet.entity.project.ProjectProcessEntity; import org.apache.ibatis.annotations.Mapper; @@ -93,4 +94,12 @@ public interface ProjectProcessDao extends BaseDao { **/ List selectProjectOrgPeriod(@Param("customerId") String customerId,@Param("projectStatus")String projectStatus,@Param("dateId") String dateId); + /** + * @Description 查询项目-机关各个节点的响应列表 + * @param projects + * @return + * @author wangc + * @date 2020.09.17 17:56 + **/ + List selectResponseTrace(@Param("projects") List projects); } \ 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 bac3326cfa..dfcba705cb 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 @@ -128,10 +128,12 @@ WHERE process.DEL_FLAG = '0' AND - process.PROJECT_ID = '9400300725bdf49f8958f585555929af' + + process.PROJECT_ID = #{id} + AND EXISTS( - SELECT * FROM PROJECT_PROCESS WHERE DEL_FLAG = '0' AND PROJECT_ID = '9400300725bdf49f8958f585555929af' AND OPERATION = 'response' + SELECT * FROM PROJECT_PROCESS WHERE DEL_FLAG = '0' AND PROJECT_ID = process.PROJECT_ID AND OPERATION = 'response' AND STAFF_ID = process.STAFF_ID AND DEPARTMENT_NAME = process.DEPARTMENT_NAME ) ORDER BY process.STAFF_ID , process.CREATED_TIME ASC From 4ab1ac20537d8c5e69ded7327a0a38d7cb7e8764 Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Fri, 18 Sep 2020 10:58:31 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E6=B2=BB=E7=90=86=E8=83=BD=E5=8A=9B?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../indexcoll/IndexCollCommunityService.java | 10 ++++++++++ .../IndexCollDistrictDepartmentService.java | 10 ++++++++++ .../indexcoll/IndexCollDistrictService.java | 10 ++++++++++ .../indexcoll/IndexCollStreetService.java | 10 ++++++++++ .../impl/IndexCollCommunityServiceImpl.java | 18 ++++++++++++++++++ ...IndexCollDistrictDepartmentServiceImpl.java | 18 ++++++++++++++++++ .../impl/IndexCollDistrictServiceImpl.java | 18 ++++++++++++++++++ .../impl/IndexCollStreetServiceImpl.java | 18 ++++++++++++++++++ 8 files changed, 112 insertions(+) create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/IndexCollCommunityService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/IndexCollDistrictDepartmentService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/IndexCollDistrictService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/IndexCollStreetService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/IndexCollCommunityServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/IndexCollDistrictDepartmentServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/IndexCollDistrictServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/IndexCollStreetServiceImpl.java diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/IndexCollCommunityService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/IndexCollCommunityService.java new file mode 100644 index 0000000000..e891e5a748 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/IndexCollCommunityService.java @@ -0,0 +1,10 @@ +package com.epmet.service.evaluationindex.indexcoll; + +/** + * 社区相关统计 + * + * @author zhaoqifeng + * @date 2020/9/18 10:33 + */ +public interface IndexCollCommunityService { +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/IndexCollDistrictDepartmentService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/IndexCollDistrictDepartmentService.java new file mode 100644 index 0000000000..8416ac208c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/IndexCollDistrictDepartmentService.java @@ -0,0 +1,10 @@ +package com.epmet.service.evaluationindex.indexcoll; + +/** + * 区直部门相关统计 + * + * @author zhaoqifeng + * @date 2020/9/18 10:43 + */ +public interface IndexCollDistrictDepartmentService { +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/IndexCollDistrictService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/IndexCollDistrictService.java new file mode 100644 index 0000000000..d6863f651e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/IndexCollDistrictService.java @@ -0,0 +1,10 @@ +package com.epmet.service.evaluationindex.indexcoll; + +/** + * 全区相关统计 + * + * @author zhaoqifeng + * @date 2020/9/18 10:44 + */ +public interface IndexCollDistrictService { +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/IndexCollStreetService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/IndexCollStreetService.java new file mode 100644 index 0000000000..2266a52369 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/IndexCollStreetService.java @@ -0,0 +1,10 @@ +package com.epmet.service.evaluationindex.indexcoll; + +/** + * 街道相关统计 + * + * @author zhaoqifeng + * @date 2020/9/18 10:35 + */ +public interface IndexCollStreetService { +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/IndexCollCommunityServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/IndexCollCommunityServiceImpl.java new file mode 100644 index 0000000000..28c504dbaa --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/IndexCollCommunityServiceImpl.java @@ -0,0 +1,18 @@ +package com.epmet.service.evaluationindex.indexcoll.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.constant.DataSourceConstant; +import com.epmet.service.evaluationindex.indexcoll.IndexCollCommunityService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/9/18 10:34 + */ +@Service +@Slf4j +@DataSource(DataSourceConstant.EVALUATION_INDEX) +public class IndexCollCommunityServiceImpl implements IndexCollCommunityService { +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/IndexCollDistrictDepartmentServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/IndexCollDistrictDepartmentServiceImpl.java new file mode 100644 index 0000000000..c5f62d4072 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/IndexCollDistrictDepartmentServiceImpl.java @@ -0,0 +1,18 @@ +package com.epmet.service.evaluationindex.indexcoll.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.constant.DataSourceConstant; +import com.epmet.service.evaluationindex.indexcoll.IndexCollDistrictDepartmentService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/9/18 10:43 + */ +@Service +@Slf4j +@DataSource(DataSourceConstant.EVALUATION_INDEX) +public class IndexCollDistrictDepartmentServiceImpl implements IndexCollDistrictDepartmentService { +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/IndexCollDistrictServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/IndexCollDistrictServiceImpl.java new file mode 100644 index 0000000000..64d47690b6 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/IndexCollDistrictServiceImpl.java @@ -0,0 +1,18 @@ +package com.epmet.service.evaluationindex.indexcoll.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.constant.DataSourceConstant; +import com.epmet.service.evaluationindex.indexcoll.IndexCollDistrictService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/9/18 10:45 + */ +@Service +@Slf4j +@DataSource(DataSourceConstant.EVALUATION_INDEX) +public class IndexCollDistrictServiceImpl implements IndexCollDistrictService { +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/IndexCollStreetServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/IndexCollStreetServiceImpl.java new file mode 100644 index 0000000000..09ceaf6188 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/IndexCollStreetServiceImpl.java @@ -0,0 +1,18 @@ +package com.epmet.service.evaluationindex.indexcoll.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.constant.DataSourceConstant; +import com.epmet.service.evaluationindex.indexcoll.IndexCollStreetService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/9/18 10:35 + */ +@Service +@Slf4j +@DataSource(DataSourceConstant.EVALUATION_INDEX) +public class IndexCollStreetServiceImpl implements IndexCollStreetService { +} From 2422ea3549e949cae9ed72f16163783a31771514 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Fri, 18 Sep 2020 13:58:26 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E7=BD=91=E6=A0=BC=20=E6=B2=BB=E7=90=86?= =?UTF-8?q?=E8=83=BD=E5=8A=9B=20=E7=9B=B8=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/constant/ExtractConstant.java | 2 + .../form/GovernAbilityGridMonthlyFormDTO.java | 148 ++++++++++++++++++ .../extract/form/GridIssueCountResultDTO.java | 45 ++++++ .../result/GridProjectCountResultDTO.java | 31 ++++ .../extract/FactOriginIssueMainDailyDao.java | 21 +++ .../FactIndexGovrnAblityGridMonthlyDao.java | 9 ++ .../extract/IssueExtractService.java | 23 +++ .../extract/impl/CalGridIndexServiceImpl.java | 93 ++++++++++- .../extract/impl/IssueExtractServiceImpl.java | 32 +++- .../extract/FactOriginIssueMainDailyDao.xml | 35 +++++ .../FactIndexGovrnAblityGridMonthlyDao.xml | 13 ++ 11 files changed, 446 insertions(+), 6 deletions(-) create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/GovernAbilityGridMonthlyFormDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/GridIssueCountResultDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/GridProjectCountResultDTO.java diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/ExtractConstant.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/ExtractConstant.java index 7bf337367d..8e01f5ee46 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/ExtractConstant.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/ExtractConstant.java @@ -18,4 +18,6 @@ public interface ExtractConstant { String ISSUE_PROCESS = "查询查询议题process集合为空"; + String SHIFT_PROJECT = "shift_project"; + } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/GovernAbilityGridMonthlyFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/GovernAbilityGridMonthlyFormDTO.java new file mode 100644 index 0000000000..890e663083 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/GovernAbilityGridMonthlyFormDTO.java @@ -0,0 +1,148 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.extract.form; + +import java.io.Serializable; +import java.util.Date; + +import com.epmet.commons.tools.constant.NumConstant; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 治理能力-网格相关事实表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-18 + */ +@Data +public class GovernAbilityGridMonthlyFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID 主键 + */ + private String id; + + /** + * 客户Id + */ + private String customerId; + + /** + * 网格所属机关Id + */ + private String agencyId; + + /** + * 网格Id + */ + private String gridId; + + /** + * 月维度Id:yyyyMM + */ + private String monthId; + + /** + * 季度Id:yyyyQ1,yyyyQ2,yyyyQ3,yyyyQ4 + */ + private String quarterId; + + /** + * 年Id:yyyy + */ + private String yearId; + + /** + * 网格总议题数 + */ + private Integer issueTotal; + + /** + * 网格人均议题数目 + */ + private Integer avgIssueCount; + + /** + * 网格议题转项目率 + */ + private BigDecimal issueToProjectRatio; + + /** + * 网格总项目数 + */ + private Integer projectTotal; + + /** + * 网格自治项目数 统计期网格自身内办结的项目数目 + */ + private Integer selfSolveProjectCount; + + /** + * 网格办结项目数 统计期内办结的项目数目 + */ + private Integer resolveProjectCount; + + /** + * 网格吹哨部门准确率 + */ + private BigDecimal transferRightRatio; + + /** + * 网格内解决的项目的满意度 + */ + private BigDecimal satisfactionRatio; + + /** + * 删除标识 0未删除;1已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 更新人 + */ + private String updatedBy; + + public GovernAbilityGridMonthlyFormDTO() { + this.issueTotal = NumConstant.ZERO; + this.avgIssueCount = NumConstant.ZERO; + this.issueToProjectRatio = new BigDecimal(NumConstant.ZERO); + this.projectTotal = NumConstant.ZERO; + this.selfSolveProjectCount = NumConstant.ZERO; + this.resolveProjectCount = NumConstant.ZERO; + this.transferRightRatio = new BigDecimal(NumConstant.ZERO); + this.satisfactionRatio = new BigDecimal(NumConstant.ZERO); + this.delFlag = NumConstant.ZERO_STR; + this.revision = NumConstant.ZERO; + this.createdBy = "APP_USER"; + this.updatedBy = "APP_USER"; + } +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/GridIssueCountResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/GridIssueCountResultDTO.java new file mode 100644 index 0000000000..6237f49117 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/GridIssueCountResultDTO.java @@ -0,0 +1,45 @@ +package com.epmet.dto.extract.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/9/18 10:12 上午 + */ +@Data +public class GridIssueCountResultDTO implements Serializable { + + private static final long serialVersionUID = -1222149631076688225L; + + /** + * 网格总议题数目 + */ + private Integer issueTotal; + + /** + * 网格人均议题数目 + */ + private Integer avgIssueCount; + + /** + * 网格ID + */ + private String gridId; + + /** + * 月份ID + */ + private String monthId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 年度ID + */ + private String yearId; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/GridProjectCountResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/GridProjectCountResultDTO.java new file mode 100644 index 0000000000..6d0a8cf1d7 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/GridProjectCountResultDTO.java @@ -0,0 +1,31 @@ +package com.epmet.dto.extract.result; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * @Author zxc + * @DateTime 2020/9/18 1:22 下午 + */ +@Data +public class GridProjectCountResultDTO implements Serializable { + + private static final long serialVersionUID = -1348707512443965601L; + + /** + * 网格总项目数 + */ + private Integer projectTotal; + + /** + * 网格ID + */ + private String gridId; + + /** + * 网格议题转项目率 + */ + private BigDecimal issueToProjectRatio; +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueMainDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueMainDailyDao.java index 1866a593a5..f2e32ca442 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueMainDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueMainDailyDao.java @@ -18,7 +18,9 @@ package com.epmet.dao.evaluationindex.extract; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.extract.form.GridIssueCountResultDTO; import com.epmet.dto.extract.form.IssueMainDailyFormDTO; +import com.epmet.dto.extract.result.GridProjectCountResultDTO; import com.epmet.entity.evaluationindex.extract.FactOriginIssueMainDailyEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -50,4 +52,23 @@ public interface FactOriginIssueMainDailyDao extends BaseDao selectIssueTotal(@Param("customerId") String customerId,@Param("monthId") String monthId); + + /** + * @Description 网格总项目数 + * @param customerId + * @param monthId + * @param status + * @author zxc + * @date 2020/9/18 1:21 下午 + */ + List selectGridProjectCount(@Param("customerId") String customerId,@Param("monthId") String monthId, @Param("status") String status); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.java index 5e0c308c5f..520ce244e2 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.java @@ -18,6 +18,7 @@ package com.epmet.dao.evaluationindex.indexcoll; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.extract.form.GovernAbilityGridMonthlyFormDTO; import com.epmet.dto.indexcal.CalculateCommonFormDTO; import com.epmet.dto.indexcal.PageQueryGridFormDTO; import com.epmet.dto.indexcollect.form.GridGovrnAbilityFormDTO; @@ -101,4 +102,12 @@ public interface FactIndexGovrnAblityGridMonthlyDao extends BaseDao selectAllGridInfo(String customerId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/IssueExtractService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/IssueExtractService.java index 4d05ba19d7..5e8eeda1ce 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/IssueExtractService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/IssueExtractService.java @@ -1,6 +1,10 @@ package com.epmet.service.evaluationindex.extract; import com.epmet.dto.extract.form.ExtractFormDTO; +import com.epmet.dto.extract.form.GridIssueCountResultDTO; +import com.epmet.dto.extract.result.GridProjectCountResultDTO; + +import java.util.List; /** * @Author zxc @@ -23,4 +27,23 @@ public interface IssueExtractService { * @date 2020/9/16 9:41 上午 */ Boolean issueExtractLog(ExtractFormDTO extractFormDTO); + + /** + * @Description 查询网格议题总数,网格人均议题数目 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/9/18 10:20 上午 + */ + List selectIssueTotal(String customerId, String monthId); + + /** + * @Description 网格总项目数 + * @param customerId + * @param monthId + * @param status + * @author zxc + * @date 2020/9/18 1:21 下午 + */ + List selectGridProjectCount(String customerId, String monthId,String status); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/CalGridIndexServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/CalGridIndexServiceImpl.java index 0392931d9a..4ab4360397 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/CalGridIndexServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/CalGridIndexServiceImpl.java @@ -1,10 +1,24 @@ package com.epmet.service.evaluationindex.extract.impl; import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.exception.RenException; import com.epmet.constant.DataSourceConstant; +import com.epmet.constant.ExtractConstant; +import com.epmet.dao.evaluationindex.indexcoll.FactIndexGovrnAblityGridMonthlyDao; +import com.epmet.dto.extract.form.GovernAbilityGridMonthlyFormDTO; +import com.epmet.dto.extract.form.GridIssueCountResultDTO; +import com.epmet.dto.extract.result.GridProjectCountResultDTO; import com.epmet.service.evaluationindex.extract.CalGridIndexService; +import com.epmet.service.evaluationindex.extract.IssueExtractService; import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +import java.math.BigDecimal; +import java.util.List; /** * @Author zxc @@ -15,6 +29,11 @@ import org.springframework.stereotype.Service; @DataSource(DataSourceConstant.EVALUATION_INDEX) public class CalGridIndexServiceImpl implements CalGridIndexService { + @Autowired + private IssueExtractService issueExtractService; + @Autowired + private FactIndexGovrnAblityGridMonthlyDao governAbilityDao; + /** * @Description 计算网格指标党建能力 * @param customerId @@ -36,7 +55,69 @@ public class CalGridIndexServiceImpl implements CalGridIndexService { */ @Override public Boolean calGridIndexGovernAbility(String customerId, String monthId) { - return null; + + List result = governAbilityDao.selectAllGridInfo(customerId); + if (CollectionUtils.isEmpty(result)){ + throw new RenException("客户【"+customerId+"】未查出网格信息"); + } + //网格总议题数目,网格人均议题数目 + List gridIssueTotalList = issueExtractService.selectIssueTotal(customerId, monthId); + //网格总项目数 + List gridProjectTotalList = issueExtractService.selectGridProjectCount(customerId, monthId, ExtractConstant.SHIFT_PROJECT); + //网格议题转项目率 + gridProjectTotalList.forEach(project -> { + gridIssueTotalList.forEach(issue ->{ + if (project.getGridId().equals(issue.getGridId())){ + project.setIssueToProjectRatio(getRound(new BigDecimal(project.getProjectTotal()/issue.getIssueTotal()))); + } + }); + }); + //网格自治项目数 + + //网格办结项目数 + + //网格吹哨部门准确率 + + //网格内解决的项目的满意度 + + //组织内党员的参与议事能力考评分(平均值) + + result.forEach(r -> { + // 1. 网格总议题数目,网格人均议题数目 + if (!CollectionUtils.isEmpty(gridIssueTotalList)) { + gridIssueTotalList.forEach(total -> { + if (r.getGridId().equals(total.getGridId())) { + BeanUtils.copyProperties(total, r); + } + }); + } + // 2. 网格总项目数,网格议题转项目率 + if (!CollectionUtils.isEmpty(gridIssueTotalList)){ + gridProjectTotalList.forEach(projectTotal -> { + if (r.getGridId().equals(projectTotal.getGridId())){ + r.setProjectTotal(projectTotal.getProjectTotal()); + r.setIssueToProjectRatio(projectTotal.getIssueToProjectRatio()); + } + }); + } + }); + + + + + + // + + + + + + + + + + + return true; } /** @@ -50,4 +131,14 @@ public class CalGridIndexServiceImpl implements CalGridIndexService { public Boolean calGridIndexServiceAbility(String customerId, String monthId) { return null; } + + /** + * @Description 小数四舍五入 + * @param d + * @author zxc + * @date 2020/9/18 2:01 下午 + */ + public BigDecimal getRound(BigDecimal d){ + return d.setScale(NumConstant.SIX, BigDecimal.ROUND_HALF_UP); + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/IssueExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/IssueExtractServiceImpl.java index d277675b03..d5598650a0 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/IssueExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/IssueExtractServiceImpl.java @@ -9,13 +9,10 @@ import com.epmet.dao.evaluationindex.extract.FactOriginIssueLogDailyDao; import com.epmet.dao.evaluationindex.extract.FactOriginIssueMainDailyDao; import com.epmet.dao.stats.DimAgencyDao; import com.epmet.dto.extract.form.ExtractFormDTO; +import com.epmet.dto.extract.form.GridIssueCountResultDTO; import com.epmet.dto.extract.form.IssueLogDailyFormDTO; import com.epmet.dto.extract.form.IssueMainDailyFormDTO; -import com.epmet.dto.extract.result.SatisfactionInfoResultDTO; -import com.epmet.dto.extract.result.AgencyInfoResultDTO; -import com.epmet.dto.extract.result.IssueInfoResultDTO; -import com.epmet.dto.extract.result.IssueProcessInfoResultDTO; -import com.epmet.dto.extract.result.TopicInfoResultDTO; +import com.epmet.dto.extract.result.*; import com.epmet.service.Issue.IssueService; import com.epmet.service.evaluationindex.extract.IssueExtractService; import com.epmet.service.topic.TopicService; @@ -226,6 +223,31 @@ public class IssueExtractServiceImpl implements IssueExtractService { return true; } + /** + * @Description 查询网格议题总数,网格人均议题数目 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/9/18 10:20 上午 + */ + @Override + public List selectIssueTotal(String customerId, String monthId) { + return issueMainDailyDao.selectIssueTotal(customerId, monthId); + } + + /** + * @Description 网格总项目数 + * @param customerId + * @param monthId + * @param status + * @author zxc + * @date 2020/9/18 1:21 下午 + */ + @Override + public List selectGridProjectCount(String customerId, String monthId, String status) { + return issueMainDailyDao.selectGridProjectCount(customerId, monthId, status); + } + /** * @Description 议题附表删除插入 * @param customerId diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueMainDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueMainDailyDao.xml index 9d3ad44198..01da6c5f0b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueMainDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueMainDailyDao.xml @@ -66,4 +66,39 @@ CUSTOMER_ID = #{customerId} AND DATE_ID = #{dateId} + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.xml index a84dff6a5c..5f4a53ed15 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.xml @@ -161,4 +161,17 @@ AND m.CUSTOMER_ID =#{customerId} AND m.MONTH_ID =#{monthId} + + + From ef098bf94cd0814b6e485fc83dc6e138530462e3 Mon Sep 17 00:00:00 2001 From: wangchao Date: Fri, 18 Sep 2020 15:22:22 +0800 Subject: [PATCH 5/5] project-period --- .../result/ProjectOrgPeriodResultDTO.java | 5 +++ .../impl/ProjectPeriodExtractServiceImpl.java | 11 +---- .../project/ProjectProcessService.java | 12 ++++++ .../impl/ProjectProcessServiceImpl.java | 40 +++++++++++++++++++ 4 files changed, 58 insertions(+), 10 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/result/ProjectOrgPeriodResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/result/ProjectOrgPeriodResultDTO.java index 9ce79b4fc5..fc4867d647 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/result/ProjectOrgPeriodResultDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/result/ProjectOrgPeriodResultDTO.java @@ -80,4 +80,9 @@ public class ProjectOrgPeriodResultDTO implements Serializable { * */ private Date handledDate; + /** + * 第一次响应时间 + * */ + private Date firstResponseDate; + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/ProjectPeriodExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/ProjectPeriodExtractServiceImpl.java index 885a2cc271..f5fa2cf898 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/ProjectPeriodExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/ProjectPeriodExtractServiceImpl.java @@ -36,16 +36,7 @@ public class ProjectPeriodExtractServiceImpl implements ProjectPeriodExtractServ @Override public void extractProjectPeriodData(ExtractFormDTO param) { int trace = factOriginProjectOrgPeriodDailyDao.selectIfExisted(param.getCustomerId()); + Boolean isFirst = trace <= NumConstant.ZERO ? true : false; - List periods; - List responseList; - - if(trace <= NumConstant.ZERO){ - //数据初始化 - - }else{ - //日常统计 - - } } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectProcessService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectProcessService.java index c60ff6c8cc..42def9affd 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectProcessService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectProcessService.java @@ -19,6 +19,7 @@ package com.epmet.service.project; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.dto.project.ProcessInfoDTO; +import com.epmet.dto.project.result.ProjectOrgPeriodResultDTO; import com.epmet.entity.project.ProjectEntity; import com.epmet.entity.project.ProjectProcessEntity; @@ -78,4 +79,15 @@ public interface ProjectProcessService extends BaseService * @return java.util.List */ List getClosedProjectList(String customerId, String date); + + /** + * @Description 查询各机关项目节点历时 + * @param isFirst 是否首次 + * @param customerId + * @param date + * @return + * @author wangc + * @date 2020.09.18 13:38 + **/ + List getProjectPeriod(Boolean isFirst,String customerId,String date); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectProcessServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectProcessServiceImpl.java index 8bfa1c998c..fe319c224c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectProcessServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectProcessServiceImpl.java @@ -22,12 +22,17 @@ import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.constant.DataSourceConstant; import com.epmet.dao.project.ProjectProcessDao; import com.epmet.dto.project.ProcessInfoDTO; +import com.epmet.dto.project.result.ProjectOrgPeriodResultDTO; +import com.epmet.dto.project.result.ProjectOrgRelationWhenResponseResultDTO; import com.epmet.entity.project.ProjectEntity; import com.epmet.entity.project.ProjectProcessEntity; import com.epmet.service.project.ProjectProcessService; import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; /** * 项目处理进展表 @@ -68,4 +73,39 @@ public class ProjectProcessServiceImpl extends BaseServiceImpl getClosedProjectList(String customerId, String date) { return baseDao.selectClosedProjectList(customerId, date); } + + /** + * @Description 查询各机关项目节点历时 + * @param isFirst 是否首次 + * @param customerId + * @param date + * @return + * @author wangc + * @date 2020.09.18 13:38 + **/ + @Override + public List getProjectPeriod(Boolean isFirst,String customerId, String date) { + List projectNodePeriodPerOrgList; + if(isFirst){ + projectNodePeriodPerOrgList = baseDao.selectProjectOrgPeriod(customerId,null,null); + }else{ + projectNodePeriodPerOrgList = baseDao.selectProjectOrgPeriod(customerId,null,date); + } + + if(!CollectionUtils.isEmpty(projectNodePeriodPerOrgList)){ + List projects = + projectNodePeriodPerOrgList.stream().map(ProjectOrgPeriodResultDTO::getProjectId).distinct().collect(Collectors.toList()); + if(!projects.isEmpty()){ + List responseList = baseDao.selectResponseTrace(projects); + Map> sorted = + responseList.stream().collect(Collectors.groupingBy(ProjectOrgRelationWhenResponseResultDTO::getProjectId)); + + } + } + + return null; + } + + + } \ No newline at end of file