imgUrlList ;
+ imgUrlList = projectDao.getDifficultyImgList(result.get(i).getProjectId()) ;
+
+ result.get(i).setImgUrlList(imgUrlList);
+ }
+ if(null == result) return new ArrayList<>();
+ return result;
+ }
+
}
diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/project/ProjectDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/project/ProjectDao.xml
index 21b472e4de..2b9fba6e2d 100644
--- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/project/ProjectDao.xml
+++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/project/ProjectDao.xml
@@ -234,4 +234,45 @@
)a ORDER BY a.month_id DESC,a.type ASC
+
+
+ SELECT
+ diff.EVENT_ID AS projectId,
+ diff.EVENT_CONTENT AS title,
+ diff.EVENT_STATUS_CODE AS statusCode,
+ diff.EVENT_SOURCE AS gridName,
+ diff.EVENT_IMG_URL AS imgUrl,
+ floor(diff.EVENT_COST_TIME/60) AS totalHours,
+ diff.EVENT_RE_ORG AS reOrg,
+ diff.EVENT_HANDLED_COUNT AS handledCount
+ FROM
+ screen_difficulty_data diff
+ WHERE
+ diff.DEL_FLAG = '0'
+
+
+ AND diff.ORG_ID = #{agencyId,jdbcType=VARCHAR}
+
+
+ AND diff.ALL_PARENT_IDS LIKE CONCAT('%',#{agencyId},'%')
+
+
+
+ AND diff.EVENT_STATUS_CODE = #{status}
+
+ ORDER BY
+ CASE #{type} WHEN 'timelongest' THEN diff.EVENT_COST_TIME
+ WHEN 'mosthandled' THEN diff.EVENT_HANDLED_COUNT
+ ELSE diff.EVENT_RE_ORG END
+ DESC
+
+
+
+
+ select EVENT_IMG_URL
+ FROM
+ screen_difficulty_img_data
+ WHERE EVENT_ID = #{eventId}
+ ORDER BY SORT
+
\ No newline at end of file
diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenDifficultyDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenDifficultyDataDao.xml
index 9c1325f591..a342420f2d 100644
--- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenDifficultyDataDao.xml
+++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenDifficultyDataDao.xml
@@ -10,7 +10,6 @@
diff.EVENT_CONTENT AS title,
diff.EVENT_STATUS_CODE AS STATUS,
ROUND(diff.EVENT_COST_TIME/60,0) AS totalHours,
- DATE_FORMAT( eve.EVENT_CREATE_TIME, '%Y-%m-%d %H:%i' ) AS createDateTime,
diff.EVENT_SOURCE AS gridName,
diff.EVENT_IMG_URL AS imgUrl,
diff.EVENT_CATEGORY_NAME AS categoryName,
@@ -18,8 +17,6 @@
diff.EVENT_RE_ORG AS handleCount
FROM
screen_difficulty_data diff
- LEFT JOIN screen_event_data eve ON diff.EVENT_ID = eve.EVENT_ID
- AND eve.DEL_FLAG = '0'
WHERE
diff.DEL_FLAG = '0'
AND diff.ALL_PARENT_IDS LIKE CONCAT('%',#{agencyId},'%')
diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/OrgResponseTimeResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/OrgResponseTimeResultDTO.java
deleted file mode 100644
index 88735859d3..0000000000
--- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/OrgResponseTimeResultDTO.java
+++ /dev/null
@@ -1,25 +0,0 @@
-package com.epmet.dto.extract.result;
-
-import lombok.Data;
-
-import java.io.Serializable;
-import java.math.BigDecimal;
-
-/**
- * @Description 各机关响应时间
- * @ClassName OrgResponseTimeResultDTO
- * @Auth wangc
- * @Date 2020-09-21 02:03
- */
-@Data
-public class OrgResponseTimeResultDTO implements Serializable {
- private static final long serialVersionUID = 6017440139236985959L;
-
- private String agencyId;
-
- private BigDecimal responseTime;
-
- private BigDecimal projectTotal;
-
- private BigDecimal distinctProjectTotal;
-}
diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/ProjectOrgRelationDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/ProjectOrgRelationDTO.java
new file mode 100644
index 0000000000..208112c9ab
--- /dev/null
+++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/ProjectOrgRelationDTO.java
@@ -0,0 +1,114 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.epmet.dto.project;
+
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+
+/**
+ * 项目机关历时关系表
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2020-10-19
+ */
+@Data
+public class ProjectOrgRelationDTO implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ *
+ */
+ private String id;
+
+ /**
+ * 关联PROJECT_STAFF,由此ID可以关联出PROJECT_ID、CUSTOMER_ID、PROCESS_ID
+ */
+ private String projectStaffId;
+
+ /**
+ * 流转到的日期 同CREATED_TIME
+ */
+ private Date informedDate;
+
+ /**
+ * 流转走或结案的日期
+ */
+ private Date handledDate;
+
+ /**
+ * 节点耗时,从流转到自己到流转走共耗时,单位:分钟,如果项目还没有结案且该项目在这个组织下一直滞留,这一项为空
+ * 8*60的倍数
+ */
+ private Integer totalPeriod;
+
+ /**
+ * 第一次响应时间
+ */
+ private Date firstDealtDate;
+
+ /**
+ * 首次响应时长,单位:分钟
+ * 8*60的倍数
+ */
+ private Integer firstReplyPeriod;
+
+ /**
+ * 来源动作,return(回退)、transfer(流转)、closed(结案)、response(响应)、created(立项时第一个流转到的)
+ */
+ private String sourceOperation;
+
+ /**
+ * 处理动作,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
index b3e101295d..9bbd942efe 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
@@ -7,7 +7,6 @@ import java.util.Date;
/**
* @Description 从数据库中查询出的 项目 - 机关(网格、部门、机关)的响应时长
- * FIXME 注:查询的全都是已经结案的项目!!!!!!!!!!!!如果查询流转中的项目,需要修改逻辑(较为复杂)
* @ClassName ProjectOrgPeriodResultDTO
* @Auth wangc
* @Date 2020-09-16 15:28
@@ -92,4 +91,6 @@ public class ProjectOrgPeriodResultDTO implements Serializable {
private String isResolved;
+ private String projectStaffId;
+
}
diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/DifficultyIfExistedResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/DifficultyIfExistedResultDTO.java
deleted file mode 100644
index fe9004f8bf..0000000000
--- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/DifficultyIfExistedResultDTO.java
+++ /dev/null
@@ -1,27 +0,0 @@
-package com.epmet.dto.screen.result;
-
-import lombok.Data;
-
-import java.io.Serializable;
-import java.util.List;
-
-/**
- * @Description 判断难点赌点是否有数据的返回DTO
- * @ClassName DifficultyIfExistedResultDTO
- * @Auth wangc
- * @Date 2020-09-28 10:45
- */
-@Data
-public class DifficultyIfExistedResultDTO implements Serializable {
- private static final long serialVersionUID = -2278401165059196896L;
-
- /**
- * 是否有数据 true false
- */
- private boolean ifExisted = false;
-
- /**
- * 已经结案的项目Id集合
- */
- private List closedIds;
-}
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 a7d6eda645..37d715980c 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
@@ -7,7 +7,6 @@ import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.constant.DataSourceConstant;
import com.epmet.constant.IndexCalConstant;
-import com.epmet.dao.evaluationindex.indexcal.GridScoreDao;
import com.epmet.dao.evaluationindex.indexcoll.FactIndexGovrnAblityGridMonthlyDao;
import com.epmet.dao.evaluationindex.indexcoll.FactIndexPartyAblityGridMonthlyDao;
import com.epmet.dao.evaluationindex.indexcoll.FactIndexServiceAblityGridMonthlyDao;
@@ -21,6 +20,7 @@ import com.epmet.dto.AgencySubTreeDto;
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.dto.stats.form.CustomerIdAndDateIdFormDTO;
import com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityGridMonthlyEntity;
import com.epmet.entity.evaluationindex.indexcoll.FactIndexPartyAblityGridMonthlyEntity;
@@ -34,7 +34,6 @@ 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.FactOriginProjectLogDailyService;
import com.epmet.service.evaluationindex.extract.todata.FactOriginTopicMainDailyService;
import com.epmet.service.evaluationindex.extract.toscreen.*;
import com.epmet.service.evaluationindex.indexcal.*;
@@ -742,4 +741,12 @@ public class DemoController {
return new Result();
}
+ @Autowired
+ private ScreenGrassrootsGovernDataAbsorptionService wc;
+
+ @PostMapping("wc")
+ public Result wc(@RequestBody ScreenCentralZoneDataFormDTO param){
+ wc.difficultyDataHub(param);
+ return new Result();
+ }
}
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
index 0007237a2f..d107e0e2fe 100644
--- 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
@@ -18,12 +18,10 @@
package com.epmet.dao.evaluationindex.extract;
import com.epmet.commons.mybatis.dao.BaseDao;
-import com.epmet.dto.extract.result.OrgResponseTimeResultDTO;
import com.epmet.dto.extract.result.OrgStatisticsResultDTO;
import com.epmet.entity.evaluationindex.extract.FactOriginProjectOrgPeriodDailyEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
-import org.springframework.web.bind.annotation.PostMapping;
import java.util.List;
@@ -45,15 +43,6 @@ public interface FactOriginProjectOrgPeriodDailyDao extends BaseDao list);
- /**
- * @Description 查找网格、部门对项目的办结系数
- * @param customerId
- * @return
- * @author wangc
- * @date 2020.09.21 02:13
- **/
- List selectSubOrgResponseCoefficient(@Param("customerId") String customerId,@Param("dimId") String dimId, @Param("dateType") String dateType);
-
- /**
- * @Description 查找机关对项目的办结系数
- * @param customerId
- * @return
- * @author wangc
- * @date 2020.09.21 02:13
- **/
- List selectAgencyResponseCoefficient(@Param("customerId") String customerId,@Param("dimId") String dimId, @Param("dateType") String dateType);
-
/**
* 部门处理效率统计
* @author zhaoqifeng
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 df6da92b0b..2e15e2aea1 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
@@ -21,7 +21,6 @@ import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.ProjectDTO;
import com.epmet.dto.project.ProjectAgencyDTO;
import com.epmet.dto.project.ProjectGridDTO;
-import com.epmet.dto.project.ProjectInfoDTO;
import com.epmet.entity.project.ProjectEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@@ -103,4 +102,15 @@ public interface ProjectDao extends BaseDao {
* @return java.lang.String
*/
String selectParameterValueByKey(@Param("customerId") String customerId);
+
+ /**
+ * @Description 得到超过阈值滞留的项目Id集合
+ * 规定只要项目的任何一个负责人(被流转到的,自始至终不管有没有处理)超过了自定义或默认的滞留时间就算难点赌点
+ * @param customerId
+ * @param exclude
+ * @return java.util.List
+ * @author wangc
+ * @date 2020.11.06 14:14
+ */
+ List selectOvertimeProjectIds(@Param("customerId") String customerId,@Param("exclude") List exclude,@Param("value") Integer value);
}
\ 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 5242a1e4a8..79e2f51b48 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.FinishOrgDTO;
import com.epmet.dto.project.ProcessInfoDTO;
+import com.epmet.dto.project.ProjectOrgRelationDTO;
import com.epmet.dto.project.result.ProjectLatestOperationResultDTO;
import com.epmet.dto.project.result.ProjectOrgPeriodResultDTO;
import com.epmet.dto.project.result.ProjectOrgRelationWhenResponseResultDTO;
@@ -28,6 +29,7 @@ import com.epmet.entity.project.ProjectProcessEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
+
import java.util.List;
/**
@@ -106,6 +108,15 @@ public interface ProjectProcessDao extends BaseDao {
**/
List selectProjectOrgPeriod(@Param("customerId") String customerId,@Param("projectStatus")String projectStatus,@Param("dateId") String dateId);
+ /**
+ * @Description 根据项目业务改造,在数据抽取时,直接查询出项目节点的耗时
+ * @param
+ * @return java.util.List
+ * @author wangc
+ * @date 2020.10.23 11:13
+ */
+ List selectProjectOrgPeriodDirectly(@Param("customerId") String customerId,@Param("projectStatus")String projectStatus,@Param("dateId") String dateId);
+
/**
* @Description 查询项目-机关各个节点的响应列表
* @param projects
@@ -115,6 +126,15 @@ public interface ProjectProcessDao extends BaseDao {
**/
List selectResponseTrace(@Param("projects") List projects);
+ /**
+ * @Description 查询项目的节点
+ * @param projects
+ * @return java.util.List
+ * @author wangc
+ * @date 2020.10.23 17:02
+ */
+ List selectProjectProcess(@Param("projects") List projects);
+
/**
* 获取办结组织
* @author zhaoqifeng
@@ -132,5 +152,16 @@ public interface ProjectProcessDao extends BaseDao {
* @author wangc
* @date 2020.09.28 14:45
*/
- List selectLatestOperation(@Param("list") List list);
+ List selectLatestOperation(@Param("list") List list,@Param("customerId") String customerId);
+
+ /**
+ * @Description 查找项目标题
+ * @param list
+ * @return java.util.List
+ * @author wangc
+ * @date 2020.09.28 14:45
+ */
+ List selectProjectTitle(@Param("list") List list,@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/entity/evaluationindex/screen/ScreenDifficultyDataEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenDifficultyDataEntity.java
index 35f4ca3ee4..f8f7595adf 100644
--- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenDifficultyDataEntity.java
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenDifficultyDataEntity.java
@@ -80,6 +80,11 @@ public class ScreenDifficultyDataEntity extends BaseEpmetEntity {
*/
private String eventContent;
+ /**
+ * 事件标题
+ */
+ private String eventTitle;
+
/**
* 事件耗时 单位:分钟
*/
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexCollCommunityServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexCollCommunityServiceImpl.java
index 062990b4ed..13a3103e83 100644
--- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexCollCommunityServiceImpl.java
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexCollCommunityServiceImpl.java
@@ -135,14 +135,14 @@ public class IndexCollCommunityServiceImpl implements IndexCollCommunityService
}
- List agencies = agencyList.stream().map(DimAgencyDTO :: getId).distinct().collect(Collectors.toList());
+ List agencies = agencyList.stream().map(DimAgencyDTO::getId).distinct().collect(Collectors.toList());
//办结数
- Map agencyHandleCount = factOriginProjectLogDailyService.getProjectHandledAgency(agencies,customerId,dimId.getMonthId(),"month");
+ Map agencyHandleCount = factOriginProjectLogDailyService.getProjectHandledAgency(agencies, customerId, dimId.getMonthId());
//办结率
- Map handlingRatioMap = factOriginProjectLogDailyService.getHandlingRatio(agencies,customerId,dimId.getMonthId(),"month");
+ Map handlingRatioMap = factOriginProjectLogDailyService.getHandlingRatio(agencies, customerId, dimId.getMonthId());
//处理效率
- Map efficiencyMap = factOriginProjectLogDailyService.getAgencyWorkPieceRatio(customerId,dimId.getMonthId(),"month");
- list.forEach(entity ->{
+ Map efficiencyMap = factOriginProjectLogDailyService.getAgencyWorkPieceRatio(customerId, dimId.getMonthId());
+ list.forEach(entity -> {
//办结数
entity.setClosedProjectCount(Optional.ofNullable(agencyHandleCount.get(entity.getAgencyId())).orElse(NumConstant.ZERO));
//办结率
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexCollDistrictServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexCollDistrictServiceImpl.java
index aeaa04000c..494f8f51c1 100644
--- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexCollDistrictServiceImpl.java
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexCollDistrictServiceImpl.java
@@ -128,16 +128,16 @@ public class IndexCollDistrictServiceImpl implements IndexCollDistrictService {
}));
}
- List agencies = agencyList.stream().map(DimAgencyDTO :: getId).distinct().collect(Collectors.toList());
+ List agencies = agencyList.stream().map(DimAgencyDTO::getId).distinct().collect(Collectors.toList());
//办结数
- Map agencyHandleCount = factOriginProjectLogDailyService.getProjectHandledAgency(agencies,customerId,dimId.getMonthId(),"month");
+ Map agencyHandleCount = factOriginProjectLogDailyService.getProjectHandledAgency(agencies, customerId, dimId.getMonthId());
//办结率
- Map handlingRatioMap = factOriginProjectLogDailyService.getHandlingRatio(agencies,customerId,dimId.getMonthId(),"month");
+ Map handlingRatioMap = factOriginProjectLogDailyService.getHandlingRatio(agencies, customerId, dimId.getMonthId());
//处理效率
- Map efficiencyMap = factOriginProjectLogDailyService.getAgencyWorkPieceRatio(customerId,dimId.getMonthId(),"month");
- list.forEach(entity ->{
+ Map efficiencyMap = factOriginProjectLogDailyService.getAgencyWorkPieceRatio(customerId, dimId.getMonthId());
+ list.forEach(entity -> {
//办结数
- entity.setClosedProjectCount(agencyHandleCount.get(entity.getAgencyId()) == null? NumConstant.ZERO : agencyHandleCount.get(entity.getAgencyId()));
+ entity.setClosedProjectCount(agencyHandleCount.get(entity.getAgencyId()) == null ? NumConstant.ZERO : agencyHandleCount.get(entity.getAgencyId()));
//办结率
entity.setClosedProjectRatio(Optional.ofNullable(handlingRatioMap.get(entity.getAgencyId())).orElse(BigDecimal.ZERO));
//办结效率
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexCollStreetServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexCollStreetServiceImpl.java
index 8331905d41..4d21057556 100644
--- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexCollStreetServiceImpl.java
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexCollStreetServiceImpl.java
@@ -126,16 +126,16 @@ public class IndexCollStreetServiceImpl implements IndexCollStreetService {
}));
}
- List agencies = agencyList.stream().map(DimAgencyDTO :: getId).distinct().collect(Collectors.toList());
+ List agencies = agencyList.stream().map(DimAgencyDTO::getId).distinct().collect(Collectors.toList());
//办结数
- Map agencyHandleCount = factOriginProjectLogDailyService.getProjectHandledAgency(agencies,customerId,dimId.getMonthId(),"month");
+ Map agencyHandleCount = factOriginProjectLogDailyService.getProjectHandledAgency(agencies, customerId, dimId.getMonthId());
//办结率
- Map handlingRatioMap = factOriginProjectLogDailyService.getHandlingRatio(agencies,customerId,dimId.getMonthId(),"month");
+ Map handlingRatioMap = factOriginProjectLogDailyService.getHandlingRatio(agencies, customerId, dimId.getMonthId());
//处理效率
- Map efficiencyMap = factOriginProjectLogDailyService.getAgencyWorkPieceRatio(customerId,dimId.getMonthId(),"month");
- list.forEach(entity ->{
+ Map efficiencyMap = factOriginProjectLogDailyService.getAgencyWorkPieceRatio(customerId, dimId.getMonthId());
+ list.forEach(entity -> {
//办结数
- entity.setClosedProjectCount(agencyHandleCount.get(entity.getAgencyId()) == null? NumConstant.ZERO : agencyHandleCount.get(entity.getAgencyId()));
+ entity.setClosedProjectCount(agencyHandleCount.get(entity.getAgencyId()) == null ? NumConstant.ZERO : agencyHandleCount.get(entity.getAgencyId()));
//办结率
entity.setClosedProjectRatio(Optional.ofNullable(handlingRatioMap.get(entity.getAgencyId())).orElse(BigDecimal.ZERO));
//办结效率
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 77ac5f2fc7..80e087bc3f 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,11 +2,9 @@ package com.epmet.service.evaluationindex.extract.dataToIndex.impl;
import com.alibaba.fastjson.JSON;
import com.epmet.commons.tools.constant.NumConstant;
-import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.dto.extract.form.ExtractIndexFormDTO;
import com.epmet.service.evaluationindex.extract.dataToIndex.*;
import com.epmet.service.stats.DimCustomerService;
-import com.epmet.util.DimIdGenerator;
import com.google.common.util.concurrent.ThreadFactoryBuilder;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
@@ -16,7 +14,6 @@ import org.springframework.util.CollectionUtils;
import java.time.LocalDate;
import java.util.ArrayList;
-import java.util.Date;
import java.util.List;
import java.util.concurrent.*;
@@ -107,16 +104,19 @@ public class IndexOriginExtractServiceImpl implements IndexOriginExtractService
log.error("抽取【网格服务能力数据】发生异常,参数:" + JSON.toJSONString(param), e);
}
try{
+ //dimAgency
indexCollStreetService.saveStreetAbility(customerId, monthId);
}catch (Exception e){
log.error("抽取【街道治理能力-街道党建能力-服务能力】发生异常,参数:" + JSON.toJSONString(param), e);
}
try{
+ //dimAgency
indexCollCommunityService.saveCommunityAbility(customerId, monthId);
}catch (Exception e){
log.error("抽取【社区治理能力-社区党建能力-服务能力】发生异常,参数:" + JSON.toJSONString(param), e);
}
try{
+ //dimAgency
indexCollDistrictService.saveDistrictAbility(customerId, monthId);
}catch (Exception e){
log.error("抽取【全区治理能力-全区党建能力-服务能力】发生异常,参数:" + JSON.toJSONString(param), e);
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectLogDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectLogDailyService.java
index d473e0aabe..2a3c3ab304 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
@@ -168,13 +168,13 @@ public interface FactOriginProjectLogDailyService extends BaseService getDepTransferCount(String customerId, String monthId, String level);
/**
- * @Description 查询各机关办结(办结的含义指每个项目的结点中最高的机关)了多少项目
* @param agencies
* @return
+ * @Description 查询各机关办结(办结的含义指每个项目的结点中最高的机关)了多少项目
* @author wangc
* @date 2020.09.20 23:46
**/
- Map getProjectHandledAgency(List agencies, String customerId, String dimId,String dateType);
+ Map getProjectHandledAgency(List agencies, String customerId, String dimId);
/**
* @Description 办结率
@@ -184,8 +184,8 @@ public interface FactOriginProjectLogDailyService extends BaseService getHandlingRatio(List agencies, String customerId,String dimId,String dateType);
+ **/
+ Map getHandlingRatio(List agencies, String customerId, String dimId);
/**
* @Description 计算机关办结项目效率
@@ -193,8 +193,8 @@ public interface FactOriginProjectLogDailyService extends BaseService getAgencyWorkPieceRatio( String customerId,String dimId,String dateType);
+ **/
+ Map getAgencyWorkPieceRatio(String customerId, String dimId);
/**
* 网格项目响应度
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/ProjectExtractService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/ProjectExtractService.java
index 1011df61f6..9b7b5e35fe 100644
--- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/ProjectExtractService.java
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/ProjectExtractService.java
@@ -2,6 +2,9 @@ package com.epmet.service.evaluationindex.extract.todata;
import com.epmet.dto.extract.form.ExtractOriginFormDTO;
+import com.epmet.dto.project.result.ProjectOrgPeriodResultDTO;
+
+import java.util.List;
/**
* @author zhaoqifeng
@@ -29,4 +32,13 @@ public interface ProjectExtractService {
* @date 2020.09.17 14:05
**/
void extractProjectPeriodData(ExtractOriginFormDTO param);
+
+ /**
+ * @Description 项目节点耗时数据补齐
+ * @param
+ * @return java.util.List
+ * @author wangc
+ * @date 2020.10.26 10:18
+ */
+ void projectProcessCostTimeDataCompensation();
}
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 ec1429618d..7b3f127cd2 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
@@ -38,7 +38,6 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
-import javax.naming.LinkLoopException;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.*;
@@ -171,43 +170,43 @@ public class FactOriginProjectLogDailyServiceImpl extends BaseServiceImpl getProjectHandledAgency(List agencies, String customerId,String dimId, String dateType) {
+ public Map getProjectHandledAgency(List agencies, String customerId, String dimId) {
Map result = new HashMap<>();
- List countList = baseDao.selectAgencyHandledProjectCount(agencies,customerId,dimId);
- if(!CollectionUtils.isEmpty(countList)){
- result = countList.stream().collect(Collectors.toMap(ProjectParticipatedAgencyResultDTO::getAgencyId,ProjectParticipatedAgencyResultDTO::getCount));
+ List countList = baseDao.selectAgencyHandledProjectCount(agencies, customerId, dimId);
+ if (!CollectionUtils.isEmpty(countList)) {
+ result = countList.stream().collect(Collectors.toMap(ProjectParticipatedAgencyResultDTO::getAgencyId, ProjectParticipatedAgencyResultDTO::getCount));
}
return result;
}
/**
- * @Description 办结率
* @param agencies
* @param dimId
* @param dateType - 日期维度类型 month date week quarter year
* @return
+ * @Description 办结率
* @author wangc
* @date 2020.09.23 10:06
**/
@Override
- public Map getHandlingRatio(List agencies, String customerId,String dimId, String dateType) {
+ public Map getHandlingRatio(List agencies, String customerId, String dimId) {
//计算方式:“评价周期内被吹哨且办结(无论是哪一级办结)的项目数”/“评价周期内被吹哨的所有项目数”
- Map result = new HashMap<>();
- List projectAgencyCount = baseDao.selectWhistledAgencyClosedProjectCount(agencies,customerId,dimId);
- if(!CollectionUtils.isEmpty(projectAgencyCount)){
- Map whistledAndHandledProjectTotalMap = projectAgencyCount.stream().collect(Collectors.toMap(ProjectParticipatedAgencyResultDTO::getAgencyId,ProjectParticipatedAgencyResultDTO::getCount));
- List whistledProjectTotal = baseDao.selectAgencyWhistledCount(agencies,customerId,dimId);
- Map whistledProjectTotalMap = whistledProjectTotal.stream().collect(Collectors.toMap(ProjectParticipatedAgencyResultDTO::getAgencyId,ProjectParticipatedAgencyResultDTO::getCount));
- whistledAndHandledProjectTotalMap.forEach((agencyId,count) -> {
+ Map result = new HashMap<>();
+ List projectAgencyCount = baseDao.selectWhistledAgencyClosedProjectCount(agencies, customerId, dimId);
+ if (!CollectionUtils.isEmpty(projectAgencyCount)) {
+ Map whistledAndHandledProjectTotalMap = projectAgencyCount.stream().collect(Collectors.toMap(ProjectParticipatedAgencyResultDTO::getAgencyId, ProjectParticipatedAgencyResultDTO::getCount));
+ List whistledProjectTotal = baseDao.selectAgencyWhistledCount(agencies, customerId, dimId);
+ Map whistledProjectTotalMap = whistledProjectTotal.stream().collect(Collectors.toMap(ProjectParticipatedAgencyResultDTO::getAgencyId, ProjectParticipatedAgencyResultDTO::getCount));
+ whistledAndHandledProjectTotalMap.forEach((agencyId, count) -> {
//分母 被吹哨项目数
Integer denominator = whistledProjectTotalMap.get(agencyId);
if(null == denominator || NumConstant.ZERO == denominator){
@@ -222,22 +221,22 @@ public class FactOriginProjectLogDailyServiceImpl extends BaseServiceImpl getAgencyWorkPieceRatio(String customerId,String dimId, String dateType) {
+ public Map getAgencyWorkPieceRatio(String customerId, String dimId) {
//计算方法 : 评价周期内办结项目的平均处理时长的倒数
//1.评价周期内结案了的项目
- List projectsHandledByAgency = baseDao.selectProjectIdHandledByAgency(customerId,dimId);
- Map efficiencyMap = new HashMap<>();
- if(!CollectionUtils.isEmpty(projectsHandledByAgency)){
- Map> agencyProjectsMap = new HashMap<>();
+ List projectsHandledByAgency = baseDao.selectProjectIdHandledByAgency(customerId, dimId);
+ Map efficiencyMap = new HashMap<>();
+ if (!CollectionUtils.isEmpty(projectsHandledByAgency)) {
+ Map> agencyProjectsMap = new HashMap<>();
projectsHandledByAgency.forEach(o -> {
String agencyId = o.getAgencyId();
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 5ce0490463..21caf5f319 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
@@ -244,6 +244,7 @@ public class FactOriginProjectMainDailyServiceImpl extends BaseServiceImpl getDifficultyBaseInfo(String customerId, List list) {
+ if(CollectionUtils.isEmpty(list)) return null;
return baseDao.selectDifficultyBaseInfo(customerId,list);
}
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 66c59bf20f..5077794d49 100644
--- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/ProjectExtractServiceImpl.java
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/ProjectExtractServiceImpl.java
@@ -16,6 +16,7 @@ import com.epmet.dto.issue.IssueDTO;
import com.epmet.dto.party.PartyMemberDTO;
import com.epmet.dto.project.FinishOrgDTO;
import com.epmet.dto.project.ProcessInfoDTO;
+import com.epmet.dto.project.ProjectOrgRelationDTO;
import com.epmet.dto.project.result.ProjectOrgPeriodResultDTO;
import com.epmet.dto.result.WorkDayResultDTO;
import com.epmet.dto.topic.ResiTopicDTO;
@@ -31,6 +32,7 @@ import com.epmet.service.evaluationindex.extract.todata.ProjectExtractService;
import com.epmet.service.partymember.PartyMemberService;
import com.epmet.service.project.ProjectProcessService;
import com.epmet.service.project.ProjectService;
+import com.epmet.service.stats.DimCustomerService;
import com.epmet.service.topic.TopicService;
import com.epmet.util.DimIdGenerator;
import lombok.extern.slf4j.Slf4j;
@@ -40,10 +42,8 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.LinkedList;
-import java.util.List;
+import java.util.*;
+import java.util.stream.Collector;
import java.util.stream.Collectors;
/**
@@ -73,6 +73,8 @@ public class ProjectExtractServiceImpl implements ProjectExtractService {
private EpmetCommonServiceOpenFeignClient epmetCommonServiceOpenFeignClient;
@Autowired
private FactOriginProjectOrgPeriodDailyDao factOriginProjectOrgPeriodDailyDao;
+ @Autowired
+ private DimCustomerService dimCustomerService;
private final static String ONE_DAY = "<1";
@@ -398,7 +400,7 @@ public class ProjectExtractServiceImpl implements ProjectExtractService {
param.setDateId(DateUtils.getBeforeNDay(NumConstant.ONE));
}
List extractData =
- projectProcessService.getProjectPeriod(isFirst, param.getCustomerId(), param.getDateId());
+ projectProcessService.getProjectPeriodDirectly(isFirst, param.getCustomerId(), param.getDateId());
List formattingData = new LinkedList<>();
extractData.forEach(original -> {
FactOriginProjectOrgPeriodDailyEntity dest
@@ -447,6 +449,27 @@ public class ProjectExtractServiceImpl implements ProjectExtractService {
}
}
+ /**
+ * @Description 项目节点耗时数据补齐
+ * @param
+ * @return java.util.List
+ * @author wangc
+ * @date 2020.10.26 10:18
+ */
+ @Override
+ public void projectProcessCostTimeDataCompensation() {
+
+ List customers = dimCustomerService.getAllCustomerId();
+ if(CollectionUtils.isEmpty(customers)) return ;
+ customers.forEach(local -> {
+ // projectProcessService.getProjectPeriod(true, local,null);
+ });
+
+
+
+ System.out.println("-------------EndPointHere----------------");
+ }
+
/**
* 工作日计算
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenGrassrootsGovernDataAbsorptionServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenGrassrootsGovernDataAbsorptionServiceImpl.java
index 013838a959..d791fb239e 100644
--- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenGrassrootsGovernDataAbsorptionServiceImpl.java
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenGrassrootsGovernDataAbsorptionServiceImpl.java
@@ -6,7 +6,6 @@ import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.dto.org.GridInfoDTO;
import com.epmet.dto.screen.form.ProjectSourceMapFormDTO;
import com.epmet.dto.screen.form.ScreenCentralZoneDataFormDTO;
-import com.epmet.dto.screen.result.DifficultyIfExistedResultDTO;
import com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity;
import com.epmet.entity.evaluationindex.screen.ScreenDifficultyImgDataEntity;
import com.epmet.entity.evaluationindex.screen.ScreenPartyUserRankDataEntity;
@@ -18,6 +17,7 @@ import com.epmet.service.evaluationindex.screen.ScreenPartyUserRankDataService;
import com.epmet.service.org.CustomerGridService;
import com.epmet.service.point.UserPointService;
import com.epmet.service.project.ProjectProcessService;
+import com.epmet.service.project.ProjectService;
import com.epmet.service.topic.TopicService;
import com.epmet.service.user.UserService;
import lombok.extern.slf4j.Slf4j;
@@ -63,6 +63,8 @@ public class ScreenGrassrootsGovernDataAbsorptionServiceImpl implements ScreenGr
private ProjectProcessService projectProcessService;
@Autowired
private TopicService topicService;
+ @Autowired
+ private ProjectService projectService;
/**
* @Description 用户积分、党员分值数据中转站
* @param param
@@ -135,15 +137,20 @@ public class ScreenGrassrootsGovernDataAbsorptionServiceImpl implements ScreenGr
**/
@Override
public void difficultyDataHub(ScreenCentralZoneDataFormDTO param) {
- //验证是否存在
- DifficultyIfExistedResultDTO existedMap = screenDifficultyDataService.selectExistedInfo(param.getCustomerId());
+
+ //查询难点赌点中有无已结案的项目,若有则保留
+ List existed = screenDifficultyDataService.selectExistedInfo(param.getCustomerId());
+
//查询数据
- List difficulties = factOriginProjectMainDailyService.getDifficultyBaseInfo(param.getCustomerId(),existedMap.getClosedIds());
+ List difficulties = factOriginProjectMainDailyService.getDifficultyBaseInfo(param.getCustomerId(),projectService.getOvertimeProjectByParameter(param.getCustomerId(),existed));
if(CollectionUtils.isEmpty(difficulties)) return;
List projectIds = difficulties.stream().map(ScreenDifficultyDataEntity :: getEventId).distinct().collect(Collectors.toList());
//最近一次操作
- Map latestOperationMap = projectProcessService.selectLatestOperation(projectIds,param.getCustomerId());
+ Map latestOperationMap = projectProcessService.getLatestOperation(projectIds,param.getCustomerId());
+ //标题
+ Map titleMap = projectProcessService.getProjectTitle(projectIds,param.getCustomerId());
boolean isOperationNull = CollectionUtils.isEmpty(latestOperationMap) ? true : false;
+ boolean isTitleNull = CollectionUtils.isEmpty(titleMap) ? true : false;
//图片
List projectSourceMap = factOriginProjectMainDailyService.getNewProject(param.getCustomerId(),projectIds);
@@ -163,6 +170,9 @@ public class ScreenGrassrootsGovernDataAbsorptionServiceImpl implements ScreenGr
if(!isOperationNull){
diff.setLatestOperateDesc(latestOperationMap.get(diff.getEventId()));
}
+ if(!isTitleNull){
+ diff.setEventTitle(titleMap.get(diff.getEventId()));
+ }
diff.setDataEndTime(DateUtils.getBeforeNDay(NumConstant.ONE));
});
List imgList = new LinkedList<>();
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenDifficultyDataService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenDifficultyDataService.java
index 8f9d136d88..3c6dec0673 100644
--- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenDifficultyDataService.java
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenDifficultyDataService.java
@@ -18,7 +18,6 @@
package com.epmet.service.evaluationindex.screen;
import com.epmet.commons.mybatis.service.BaseService;
-import com.epmet.dto.screen.result.DifficultyIfExistedResultDTO;
import com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity;
import com.epmet.entity.evaluationindex.screen.ScreenDifficultyImgDataEntity;
@@ -39,7 +38,7 @@ public interface ScreenDifficultyDataService extends BaseService selectExistedInfo(String customerId);
/**
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenDifficultyDataServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenDifficultyDataServiceImpl.java
index bc772ba821..c539114666 100644
--- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenDifficultyDataServiceImpl.java
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenDifficultyDataServiceImpl.java
@@ -24,7 +24,6 @@ import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.constant.DataSourceConstant;
import com.epmet.dao.evaluationindex.screen.ScreenDifficultyDataDao;
-import com.epmet.dto.screen.result.DifficultyIfExistedResultDTO;
import com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity;
import com.epmet.entity.evaluationindex.screen.ScreenDifficultyImgDataEntity;
import com.epmet.service.evaluationindex.screen.ScreenDifficultyDataService;
@@ -47,16 +46,9 @@ public class ScreenDifficultyDataServiceImpl extends BaseServiceImpl selectExistedInfo(String customerId) {
+ if (baseDao.selectCountByCustomerId(customerId) > NumConstant.ZERO) return baseDao.selectClosedProjectId(customerId);
+ return null;
}
@Override
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 66dc3dfe10..49bd23a77b 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
@@ -93,16 +93,18 @@ public interface ProjectProcessService extends BaseService
*/
List getClosedProjectList(String customerId, String date);
+
+
/**
- * @Description 查询各机关项目节点历时
- * @param isFirst 是否首次
+ * @Description 直接从项目业务改造获取项目节点耗时信息
+ * @param isFirst
* @param customerId
* @param date
- * @return
+ * @return java.util.List
* @author wangc
- * @date 2020.09.18 13:38
- **/
- List getProjectPeriod(Boolean isFirst,String customerId,String date);
+ * @date 2020.10.23 09:10
+ */
+ List getProjectPeriodDirectly(Boolean isFirst,String customerId, String date);
/**
* 获取办结组织
@@ -122,6 +124,16 @@ public interface ProjectProcessService extends BaseService
* @author wangc
* @date 2020.09.28 14:44
*/
- Map selectLatestOperation(List list, String customerId);
+ Map getLatestOperation(List list, String customerId);
+
+ /**
+ * @Description 获取项目标题
+ * @param list
+ * @param customerId
+ * @return java.util.Map
+ * @author wangc
+ * @date 2020.10.27 14:34
+ */
+ Map getProjectTitle(Listlist ,String customerId);
}
\ 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 0b0692ba21..e707c0a64c 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
@@ -99,4 +99,15 @@ public interface ProjectService extends BaseService {
* @return java.lang.String
*/
String getParameterValueByKey(String customerId);
+
+ /**
+ * @Description 得到超过阈值滞留的项目Id集合
+ * 规定只要项目的任何一个负责人(被流转到的,自始至终不管有没有处理)超过了自定义或默认的滞留时间就算难点赌点
+ * @param customerId
+ * @param exclude
+ * @return java.util.List
+ * @author wangc
+ * @date 2020.11.06 14:14
+ */
+ List getOvertimeProjectByParameter(String customerId,List exclude);
}
\ 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 074bff1979..13552085b8 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
@@ -20,11 +20,13 @@ package com.epmet.service.project.impl;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.NumConstant;
+import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.constant.DataSourceConstant;
import com.epmet.dao.project.ProjectProcessDao;
import com.epmet.dto.form.CommonStaffIdFormDTO;
import com.epmet.dto.project.FinishOrgDTO;
import com.epmet.dto.project.ProcessInfoDTO;
+import com.epmet.dto.project.ProjectOrgRelationDTO;
import com.epmet.dto.project.result.ProjectLatestOperationResultDTO;
import com.epmet.dto.project.result.ProjectOrgPeriodResultDTO;
import com.epmet.dto.project.result.ProjectOrgRelationWhenResponseResultDTO;
@@ -86,43 +88,24 @@ public class ProjectProcessServiceImpl extends BaseServiceImpl
* @author wangc
- * @date 2020.09.18 13:38
- **/
+ * @date 2020.10.23 09:10
+ */
@Override
- public List getProjectPeriod(Boolean isFirst,String customerId, String date) {
- List projectNodePeriodPerOrgList;
+ public List getProjectPeriodDirectly(Boolean isFirst, String customerId, String date) {
if(isFirst){
- projectNodePeriodPerOrgList = baseDao.selectProjectOrgPeriod(customerId,null,null);
+ return baseDao.selectProjectOrgPeriodDirectly(customerId,null,null);
}else{
- projectNodePeriodPerOrgList = baseDao.selectProjectOrgPeriod(customerId,null,date);
- }
-
- if(!CollectionUtils.isEmpty(projectNodePeriodPerOrgList)){
-
- Map> processMap
- = projectNodePeriodPerOrgList.stream().collect(Collectors.groupingBy(ProjectOrgPeriodResultDTO :: getProcessId));
-
- List projects =
- projectNodePeriodPerOrgList.stream().map(ProjectOrgPeriodResultDTO::getProjectId).distinct().collect(Collectors.toList());
- if(!projects.isEmpty()){
- List responseList = baseDao.selectResponseTrace(projects);
- Map> sorted =
- responseList.stream().collect(Collectors.groupingBy(ProjectOrgRelationWhenResponseResultDTO::getProjectId));
- skipLevelGrouping(processMap,sorted);
- List result = new LinkedList<>();
- processMap.values().forEach(list -> {list.forEach(obj -> {result.add(obj);});});
- return result;
- }
+ return baseDao.selectProjectOrgPeriodDirectly(customerId,null,date);
}
- return new ArrayList<>();
}
@Override
@@ -139,74 +122,31 @@ public class ProjectProcessServiceImpl extends BaseServiceImpl selectLatestOperation(List list, String customerId) {
- List operations = baseDao.selectLatestOperation(list);
+ public Map getLatestOperation(List list, String customerId) {
+ List operations = baseDao.selectLatestOperation(list,customerId);
if(CollectionUtils.isEmpty(operations)){
return Collections.EMPTY_MAP;
}else{
return operations.stream().collect(Collectors.toMap(ProjectLatestOperationResultDTO :: getProjectId,ProjectLatestOperationResultDTO :: getOperationName));
}
-
}
/**
- * @Description 跨级分组 eg -> transfer ; response response transfer ; return ; response close.
- * @param dest - Map> 需要填充的数据
- * @param fillFactor - Map> 填充因子
- * @return
+ * @Description 获取项目标题
+ * @param list
+ * @param customerId
+ * @return java.util.Map
* @author wangc
- * @date 2020.09.18 15:27
- **/
- private void skipLevelGrouping(Map> dest,Map> fillFactor){
- for(String projectId : fillFactor.keySet()){
- List projectTraceUnit = fillFactor.get(projectId);
- if(!projectTraceUnit.isEmpty()){
- Map> staffResponseTrace =
- projectTraceUnit.stream().collect(Collectors.groupingBy(ProjectOrgRelationWhenResponseResultDTO::getStaffId));
- if(!CollectionUtils.isEmpty(staffResponseTrace)){
- staffResponseTrace.keySet().forEach( staffId -> {
-
- if(!CollectionUtils.isEmpty(staffResponseTrace.get(staffId))){
- List staffResponseTraceUnit
- = staffResponseTrace.get(staffId);
- int lastEndCount = NumConstant.ONE_NEG;
- for(int index = NumConstant.ZERO; index < staffResponseTraceUnit.size(); index ++){
-
- if(StringUtils.equalsAny(staffResponseTraceUnit.get(index).getOperation(),
- "transfer","return","close")){
-
- replaceFirstResponseDate(dest,index,staffResponseTraceUnit,true);
-
- lastEndCount = index;
- }else{
- if(lastEndCount == NumConstant.ONE_NEG) continue;
-
- if(index - NumConstant.ONE == lastEndCount){
- replaceFirstResponseDate(dest,index,staffResponseTraceUnit,false);
- }else{continue;}
- }
- }
- }
- });
- }
-
- }
- }
- }
-
- private void replaceFirstResponseDate(Map> dest, int index, List staffResponseTraceUnit, boolean ifResponsed){
- List processSingleList =
- dest.get(staffResponseTraceUnit.get(index).getProcessId());
- if(!CollectionUtils.isEmpty(processSingleList)){
- //ProjectOrgPeriodResultDTO element = processSingleList.get(NumConstant.ZERO);
- ProjectOrgPeriodResultDTO element = processSingleList.stream().filter(node ->
- StringUtils.equals(node.getStaffId(),staffResponseTraceUnit.get(index).getStaffId())).findFirst().get();
- if(!ifResponsed && null == element.getHandledDate()){
- log.warn("com.epmet.service.project.impl.ProjectProcessServiceImpl.skipLevelGrouping::已流出节点没有办结日期,节点ID{}",element.getProcessId() );
- }
- element.setPeriodTillReplyFirstly(ifResponsed ? staffResponseTraceUnit.get(index).getCreatedTime() :element.getHandledDate());
+ * @date 2020.10.27 14:34
+ */
+ @Override
+ public Map getProjectTitle(List list, String customerId) {
+ List titles = baseDao.selectProjectTitle(list,customerId);
+ if(CollectionUtils.isEmpty(titles)){
+ return Collections.EMPTY_MAP;
+ }else{
+ return titles.stream().collect(Collectors.toMap(ProjectLatestOperationResultDTO :: getProjectId,ProjectLatestOperationResultDTO :: getOperationName));
}
}
-
}
\ No newline at end of file
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 fa22e2090e..23461db970 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
@@ -19,15 +19,15 @@ package com.epmet.service.project.impl;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
+import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.constant.DataSourceConstant;
import com.epmet.dao.project.ProjectDao;
import com.epmet.dto.ProjectDTO;
import com.epmet.dto.project.ProjectAgencyDTO;
import com.epmet.dto.project.ProjectGridDTO;
-import com.epmet.dto.project.ProjectInfoDTO;
import com.epmet.entity.project.ProjectEntity;
import com.epmet.service.project.ProjectService;
-import org.springframework.beans.factory.annotation.Autowired;
+import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import java.util.List;
@@ -82,4 +82,20 @@ public class ProjectServiceImpl extends BaseServiceImpl
+ * @author wangc
+ * @date 2020.11.06 14:14
+ */
+ @Override
+ public List getOvertimeProjectByParameter(String customerId, List exclude) {
+ String parameter = baseDao.selectParameterValueByKey(customerId);
+ if(StringUtils.isBlank(parameter)) parameter = baseDao.selectParameterValueByKey("default");
+ return baseDao.selectOvertimeProjectIds(customerId, exclude, StringUtils.isBlank(parameter) ? NumConstant.FIVE : Integer.parseInt(parameter));
+ }
+
}
\ 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 ec08e185d4..baa6a83d25 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
@@ -406,8 +406,8 @@
project.DEL_FLAG = '0'
AND project.CUSTOMER_ID = #{customerId}
-
- project.ID ]]> #{projectId}
+
+ project.ID = #{projectId}
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
index d0b868f62f..a01747d444 100644
--- 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
@@ -119,69 +119,7 @@
-
-
-
- SELECT
- PID AS agencyId,
- SUM(timestampdiff(MINUTE , INFORMED_DATE ,IFNULL(HANDLED_DATE,NOW()))) AS responseTime,
- COUNT(ID) projectTotal,
- COUNT(DISTINCT PROJECT_ID) distinctProjectTotal
-
- FROM
- fact_origin_project_org_period_daily
- WHERE
- DEL_FLAG = '0'
- AND
- CUSTOMER_ID = #{customerId}
- AND
- (ORG_TYPE = 'grid' OR ORG_TYPE = 'dept')
- AND
- IS_RESOLVED = 'resolved'
-
-
-
- AND DATE_FORMAT(IFNULL(HANDLED_DATE,NOW()),'%Y%m') = #{dimId}
-
-
- AND DATE_FORMAT(IFNULL(HANDLED_DATE,NOW()),'%Y%m%d') = #{dimId}
-
-
-
- GROUP BY PID
-
-
-
- SELECT
- ORG_ID AS agencyId,
- SUM(timestampdiff(MINUTE , INFORMED_DATE ,IFNULL(HANDLED_DATE,NOW()))) AS responseTime,
- COUNT(ID) projectTotal,
- COUNT(PROJECT_ID) distinctProjectTotal
-
- FROM
- fact_origin_project_org_period_daily
- WHERE
- DEL_FLAG = '0'
- AND
- CUSTOMER_ID = #{customerId}
- AND
- ORG_TYPE = 'agency'
- AND
- IS_RESOLVED = 'resolved'
-
-
-
- AND DATE_FORMAT(IFNULL(HANDLED_DATE,NOW()),'%Y%m') = #{dimId}
-
-
- AND DATE_FORMAT(IFNULL(HANDLED_DATE,NOW()),'%Y%m%d') = #{dimId}
-
-
-
- GROUP BY ORG_ID
-
-
SELECT
fp.ORG_ID,
diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenDifficultyDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenDifficultyDataDao.xml
index 36536a08b9..c56a4e85ab 100644
--- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenDifficultyDataDao.xml
+++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenDifficultyDataDao.xml
@@ -137,6 +137,7 @@
EVENT_IMG_URL,
EVENT_SOURCE,
EVENT_CONTENT,
+ EVENT_TITLE,
EVENT_COST_TIME,
EVENT_RE_ORG,
EVENT_HANDLED_COUNT,
@@ -166,6 +167,7 @@
#{item.eventImgUrl},
#{item.eventSource},
#{item.eventContent},
+ #{item.eventTitle},
#{item.eventCostTime},
#{item.eventReOrg},
#{item.eventHandledCount},
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 08c8d78d5b..de792f46db 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
@@ -106,4 +106,45 @@
and PARAMETER_KEY ='detention_days'
+
+
+ SELECT
+ DISTINCT
+ project.ID
+ FROM
+ project project
+ WHERE
+ project.del_flag = '0'
+ AND project.customer_id = #{customerId}
+
+
+ project.ID ]]> #{id}
+
+
+ AND EXISTS (
+ SELECT
+ stff.ID
+ FROM
+ project_staff stff
+ LEFT JOIN project_org_relation period ON stff.ID = period.PROJECT_STAFF_ID
+ AND period.DEL_FLAG = '0'
+ WHERE
+ stff.DEL_FLAG = '0'
+ AND stff.CUSTOMER_ID = #{customerId}
+ AND project.ID = stff.PROJECT_ID
+ AND ABS(
+ TIMESTAMPDIFF(
+ DAY,
+ period.INFORMED_DATE,
+ IF
+ (
+ period.HANDLED_DATE IS NULL,
+ IF
+ ( project.`STATUS` = 'closed', project.UPDATED_TIME, NOW( ) ),
+ period.HANDLED_DATE
+ )
+ )
+ ) > #{value}
+ )
+
\ 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 a1a4a7f483..efa7b82bb4 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
@@ -98,6 +98,7 @@
SELECT
+ staff.ID AS projectStaffId,
project.CUSTOMER_ID,
process.ID AS processId,
process.PROJECT_ID,
@@ -107,7 +108,7 @@
staff.ORG_ID,
staff.DEPARTMENT_ID,
staff.GRID_ID,
- staff.CREATED_BY AS staffId,
+ staff.STAFF_ID AS staffId,
staff.ORG_ID_PATH,
IF(staff.IS_HANDLE='handle',timestampdiff(MINUTE , staff.CREATED_TIME , staff.UPDATED_TIME),0) AS TOTAL_PERIOD,
@@ -119,7 +120,9 @@
FROM PROJECT_STAFF staff
LEFT JOIN PROJECT project ON staff.PROJECT_ID = project.ID AND project.DEL_FLAG = '0'
LEFT JOIN PROJECT_PROCESS process ON staff.PROCESS_ID = process.ID AND process.DEL_FLAG = '0'
- LEFT JOIN PROJECT_PROCESS selfAction ON staff.PROJECT_ID = selfAction.PROJECT_ID AND selfAction.DEL_FLAG = '0' AND staff.UPDATED_TIME = selfAction.CREATED_TIME AND staff.STAFF_ID = selfAction.STAFF_ID
+ LEFT JOIN PROJECT_PROCESS selfAction ON staff.PROJECT_ID = selfAction.PROJECT_ID AND selfAction.DEL_FLAG = '0'
+ AND ABS(TIMESTAMPDIFF(SECOND,staff.UPDATED_TIME,selfAction.CREATED_TIME)) 30
+ AND staff.STAFF_ID = selfAction.STAFF_ID
WHERE staff.DEL_FLAG = '0'
AND project.CUSTOMER_ID = #{customerId}
@@ -137,6 +140,45 @@
ORDER BY process.PROJECT_ID,staff.CREATED_TIME ASC
+
+ SELECT
+ staff.CUSTOMER_ID,
+ staff.PROCESS_ID,
+ staff.PROJECT_ID,
+ relation.SOURCE_OPERATION AS lastAction,
+ relation.OPERATION,
+ staff.DEPARTMENT_NAME,
+ staff.ORG_ID,
+ staff.DEPARTMENT_ID,
+ staff.GRID_ID,
+ staff.ORG_ID_PATH,
+ staff.STAFF_ID,
+ relation.TOTAL_PERIOD,
+
+ relation.INFORMED_DATE,
+ IF(staff.IS_HANDLE='handle','resolved','unresolved') AS isResolved,
+ relation.HANDLED_DATE,
+ relation.FIRST_DEALT_DATE AS periodTillReplyFirstly
+
+ FROM PROJECT_STAFF staff
+ INNER JOIN PROJECT_ORG_RELATION relation ON staff.ID = relation.PROJECT_STAFF_ID AND relation.DEL_FLAG = '0'
+
+ WHERE staff.DEL_FLAG = '0'
+ AND staff.CUSTOMER_ID = #{customerId}
+
+
+ AND project.STATUS = #{projectStatus}
+
+
+
+ AND (
+ DATE_FORMAT(relation.UPDATED_TIME , '%Y%m%d') = #{dateId}
+ )
+
+
+ ORDER BY staff.PROJECT_ID,staff.CREATED_TIME ASC
+
+
SELECT
@@ -159,8 +201,32 @@
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
+ ORDER BY process.PROJECT_ID , process.STAFF_ID , process.CREATED_TIME ASC
+
+
+
+ SELECT
+ ID AS processId,
+ PROJECT_ID,
+ STAFF_ID,
+ OPERATION,
+ CREATED_TIME
+ FROM
+ PROJECT_PROCESS
+ WHERE
+ DEL_FLAG = '0'
+ AND
+ PROJECT_ID
+ IN(
+ SELECT DISTINCT ID
+ )
+
+ PROJECT_ID = #{id}
+
+ ORDER BY PROJECT_ID,STAFF_ID,CREATED_TIME ASC
+
+
SELECT
a.GRID_ID,
@@ -207,6 +273,7 @@
project_process process
WHERE
process.DEL_FLAG = '0'
+ AND process.CUSTOMER_ID = #{customerId}
process.PROJECT_ID = #{projectId}
@@ -239,4 +306,21 @@
AND DATE_FORMAT(pp.CREATED_TIME,'%Y%m%d') = #{date}
+
+
+
+ SELECT
+ ID AS projectId,
+ TITLE AS operationName
+ FROM
+ project
+ WHERE
+ DEL_FLAG = '0'
+ AND CUSTOMER_ID = #{customerId}
+
+
+ ID = #{projectId}
+
+
+
\ No newline at end of file
diff --git a/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/form/CostDayFormDTO.java b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/form/CostDayFormDTO.java
new file mode 100644
index 0000000000..487a596d09
--- /dev/null
+++ b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/form/CostDayFormDTO.java
@@ -0,0 +1,35 @@
+package com.epmet.dto.form;
+
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @author zhaoqifeng
+ * @dscription
+ * @date 2020/10/21 17:34
+ */
+@Data
+public class CostDayFormDTO implements Serializable {
+ private static final long serialVersionUID = -1002961480112906533L;
+ /**
+ * 项目ID
+ */
+ private String id;
+
+ /**
+ * 工作人员ID
+ */
+ private String staffId;
+
+ /**
+ * 起始日期
+ */
+ private Date startDate;
+
+ /**
+ * 终止日期
+ */
+ private Date endDate;
+}
diff --git a/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/form/TimestampIntervalFormDTO.java b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/form/TimestampIntervalFormDTO.java
new file mode 100644
index 0000000000..0a30dd2378
--- /dev/null
+++ b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/form/TimestampIntervalFormDTO.java
@@ -0,0 +1,41 @@
+package com.epmet.dto.form;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import javax.validation.constraints.NotNull;
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @Description 时间区间
+ * @ClassName TimestampIntervalFormDTO
+ * @Auth wangc
+ * @Date 2020-10-21 15:55
+ */
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class TimestampIntervalFormDTO implements Serializable {
+
+ private static final long serialVersionUID = 8404199047657424778L;
+
+ /***
+ * 可以是任意的标志Id,用来区分多组传参的返回值
+ */
+ @NotNull(message = "时间区间标识Id不能为空",groups = WorkMinuteFormDTO.WorkTimeGroup.class)
+ private String id;
+
+ /**
+ * 区间左段点
+ */
+ @NotNull(message = "开始时间不能为空",groups = WorkMinuteFormDTO.WorkTimeGroup.class)
+ private Date left;
+
+ /***
+ * 去边右段点
+ */
+ private Date right;
+
+}
diff --git a/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/form/WorkMinuteFormDTO.java b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/form/WorkMinuteFormDTO.java
new file mode 100644
index 0000000000..fe4ecd5868
--- /dev/null
+++ b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/form/WorkMinuteFormDTO.java
@@ -0,0 +1,47 @@
+package com.epmet.dto.form;
+
+import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
+import lombok.Data;
+
+import javax.validation.Valid;
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * @Description 计算经历的多少分钟(只计算工作日)
+ * @ClassName WorkMinuteFromDTO
+ * @Auth wangc
+ * @Date 2020-10-21 15:48
+ */
+@Data
+public class WorkMinuteFormDTO implements Serializable {
+
+ private static final long serialVersionUID = -7777345488803895645L;
+
+ public interface WorkTimeGroup extends CustomerClientShowGroup{}
+
+ /**
+ * 是否使用自定义起止时间 default - 24小时制计 custom - 使用自定义、但是一定要传递起止时间(目前只支持在同一天)
+ */
+ private String ifCustom;
+
+ /**
+ * 是否精准计算 默认不精准计算 Imprecise - 不精准 precise - 精准
+ */
+ private String ifPrecise;
+
+ /***
+ * 每天的计算起始时间
+ * HH:mm:ss
+ */
+ private String startTemplate;
+
+ /***
+ * 每天的计算截止时间
+ * HH:mm:ss
+ */
+ private String endTemplate;
+
+ @Valid
+ private List timeList;
+}
diff --git a/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/result/CostDayResultDTO.java b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/result/CostDayResultDTO.java
new file mode 100644
index 0000000000..7087768d4b
--- /dev/null
+++ b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/result/CostDayResultDTO.java
@@ -0,0 +1,37 @@
+package com.epmet.dto.result;
+
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @author zhaoqifeng
+ * @dscription
+ * @date 2020/10/21 17:53
+ */
+@Data
+public class CostDayResultDTO implements Serializable {
+ private static final long serialVersionUID = -1575208332115510050L;
+ /**
+ * 项目ID
+ */
+ private String id;
+
+ /**
+ * 工作人员ID
+ */
+ private String staffId;
+
+ /**
+ * 已滞留工作日
+ */
+ private Integer detentionDays;
+
+ /**
+ * 起始日期
+ */
+ private Date startDate;
+
+
+}
diff --git a/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/feign/EpmetCommonServiceOpenFeignClient.java b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/feign/EpmetCommonServiceOpenFeignClient.java
index c2471c0255..a29e1f5203 100644
--- a/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/feign/EpmetCommonServiceOpenFeignClient.java
+++ b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/feign/EpmetCommonServiceOpenFeignClient.java
@@ -2,9 +2,12 @@ package com.epmet.feign;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.utils.Result;
+import com.epmet.dto.form.CostDayFormDTO;
import com.epmet.dto.form.ExternalAppAuthFormDTO;
import com.epmet.dto.form.GetJwtAccessTokenFormDTO;
import com.epmet.dto.form.WorkDayFormDTO;
+import com.epmet.dto.result.CostDayResultDTO;
+import com.epmet.dto.form.WorkMinuteFormDTO;
import com.epmet.dto.result.AppIdInfoResultDTO;
import com.epmet.dto.result.ExternalAppAuthResultDTO;
import com.epmet.dto.result.WorkDayResultDTO;
@@ -14,6 +17,7 @@ import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import java.util.List;
+import java.util.Map;
/**
* 本服务对外开放的API,其他服务通过引用此client调用该服务
@@ -22,7 +26,7 @@ import java.util.List;
* @date 2020/6/4 10:28
*/
@FeignClient(name = ServiceConstant.EPMET_COMMON_SERVICE, fallback = EpmetCommonServiceOpenFeignClientFallback.class)
-//@FeignClient(name = ServiceConstant.EPMET_COMMON_SERVICE, fallback = EpmetCommonServiceOpenFeignClientFallback.class, url = "localhost:8103")
+//@FeignClient(name = ServiceConstant.EPMET_COMMON_SERVICE, fallback = EpmetCommonServiceOpenFeignClientFallback.class, url = "http://localhost:8103")
public interface EpmetCommonServiceOpenFeignClient {
/**
* @param formDTO
@@ -67,4 +71,34 @@ public interface EpmetCommonServiceOpenFeignClient {
@PostMapping("/commonservice/externalapp/appidinfo")
Result appIdInfo(@RequestBody String appId);
+
+ /**
+ * 工作日计算
+ * @author zhaoqifeng
+ * @date 2020/10/22 9:25
+ * @param formDTO
+ * @return com.epmet.commons.tools.utils.Result>
+ */
+ @PostMapping("commonservice/workday/workdays")
+ Result> costWorkDays(@RequestBody List formDTO);
+
+ /**
+ * 日历天计算
+ * @author zhaoqifeng
+ * @date 2020/10/22 9:25
+ * @param formDTO
+ * @return com.epmet.commons.tools.utils.Result>
+ */
+ @PostMapping("commonservice/workday/calendardays")
+ Result> costCalendarDays(@RequestBody List formDTO);
+
+ /**
+ * @Description 计算经历的多少分钟(只计算工作日)
+ * @param param
+ * @return com.epmet.commons.tools.utils.Result>
+ * @author wangc
+ * @date 2020.10.21 16:34
+ */
+ @PostMapping("commonservice/workday/workminutes")
+ Result> workMinutes(@RequestBody WorkMinuteFormDTO param);
}
diff --git a/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/feign/fallback/EpmetCommonServiceOpenFeignClientFallback.java b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/feign/fallback/EpmetCommonServiceOpenFeignClientFallback.java
index 198bd13203..bd397df1d0 100644
--- a/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/feign/fallback/EpmetCommonServiceOpenFeignClientFallback.java
+++ b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/feign/fallback/EpmetCommonServiceOpenFeignClientFallback.java
@@ -3,9 +3,12 @@ package com.epmet.feign.fallback;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.utils.ModuleUtils;
import com.epmet.commons.tools.utils.Result;
+import com.epmet.dto.form.CostDayFormDTO;
import com.epmet.dto.form.ExternalAppAuthFormDTO;
import com.epmet.dto.form.GetJwtAccessTokenFormDTO;
import com.epmet.dto.form.WorkDayFormDTO;
+import com.epmet.dto.form.WorkMinuteFormDTO;
+import com.epmet.dto.result.CostDayResultDTO;
import com.epmet.dto.result.AppIdInfoResultDTO;
import com.epmet.dto.result.ExternalAppAuthResultDTO;
import com.epmet.dto.result.WorkDayResultDTO;
@@ -13,6 +16,7 @@ import com.epmet.feign.EpmetCommonServiceOpenFeignClient;
import org.springframework.stereotype.Component;
import java.util.List;
+import java.util.Map;
/**
* 本服务对外开放的API,其他服务通过引用此client调用该服务
@@ -51,4 +55,35 @@ public class EpmetCommonServiceOpenFeignClientFallback implements EpmetCommonSer
public Result getAccessToken(GetJwtAccessTokenFormDTO form) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_COMMON_SERVICE, "getAccessToken", form);
}
+
+ /**
+ * 工作日计算
+ *
+ * @param formDTO
+ * @return com.epmet.commons.tools.utils.Result>
+ * @author zhaoqifeng
+ * @date 2020/10/22 9:25
+ */
+ @Override
+ public Result> costWorkDays(List formDTO) {
+ return ModuleUtils.feignConError(ServiceConstant.EPMET_COMMON_SERVICE, "costWorkDays", formDTO);
+ }
+
+ /**
+ * 日历天计算
+ *
+ * @param formDTO
+ * @return com.epmet.commons.tools.utils.Result>
+ * @author zhaoqifeng
+ * @date 2020/10/22 9:25
+ */
+ @Override
+ public Result> costCalendarDays(List formDTO) {
+ return ModuleUtils.feignConError(ServiceConstant.EPMET_COMMON_SERVICE, "costCalendarDays", formDTO);
+ }
+
+ @Override
+ public Result> workMinutes(WorkMinuteFormDTO param) {
+ return ModuleUtils.feignConError(ServiceConstant.EPMET_COMMON_SERVICE, "workMinutes", param);
+ }
}
diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/constant/ProjectConstant.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/constant/ProjectConstant.java
index 8aa3dc2fc1..bf40e30351 100644
--- a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/constant/ProjectConstant.java
+++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/constant/ProjectConstant.java
@@ -8,4 +8,33 @@ public interface ProjectConstant {
* 时间已存在
*/
+ /**
+ * 日期类型 工作日
+ */
+ String DAY_TYPE_WORK = "1";
+
+ /**
+ * 日期类型 周末
+ */
+ String DAY_TYPE_WEEKEND = "2";
+
+ /**
+ * 日期类型 假日
+ */
+ String DAY_TYPE_HOLIDAY = "3";
+
+ /***
+ * 计算方式 使用自定应
+ */
+ String CALCULATION_TYPE_CUSTOM = "custom";
+
+ /**
+ * 计算方式 使用默认24小时制
+ */
+ String CALCULATION_TYPE_DEFAULT = "default";
+
+ /**
+ * 精准计算
+ */
+ String PRECISE_CALCULATION = "precise";
}
diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/controller/WorkDayController.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/controller/WorkDayController.java
index 0d975a0c31..abfd449ef3 100644
--- a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/controller/WorkDayController.java
+++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/controller/WorkDayController.java
@@ -1,7 +1,10 @@
package com.epmet.controller;
import com.epmet.commons.tools.utils.Result;
+import com.epmet.dto.form.CostDayFormDTO;
import com.epmet.dto.form.WorkDayFormDTO;
+import com.epmet.dto.result.CostDayResultDTO;
+import com.epmet.dto.form.WorkMinuteFormDTO;
import com.epmet.dto.result.WorkDayResultDTO;
import com.epmet.service.WorkDayService;
import org.springframework.beans.factory.annotation.Autowired;
@@ -11,6 +14,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
+import java.util.Map;
/**
* @Description 工作日计算
@@ -36,5 +40,45 @@ public class WorkDayController {
List list = workDayService.detentionDays(formDTO);
return new Result>().ok(list);
}
+
+
+ /**
+ * 工作日计算
+ * @author zhaoqifeng
+ * @date 2020/10/22 9:23
+ * @param formDTO
+ * @return com.epmet.commons.tools.utils.Result>
+ */
+ @PostMapping("workdays")
+ public Result> costWorkDays(@RequestBody List formDTO) {
+ List list = workDayService.costWorkDays(formDTO);
+ return new Result>().ok(list);
+ }
+
+ /**
+ * 日历天计算
+ * @author zhaoqifeng
+ * @date 2020/10/22 9:23
+ * @param formDTO
+ * @return com.epmet.commons.tools.utils.Result>
+ */
+ @PostMapping("calendardays")
+ public Result> costCalendarDays(@RequestBody List formDTO) {
+ List list = workDayService.costCalendarDays(formDTO);
+ return new Result>().ok(list);
+ }
+
+
+ /**
+ * @Description 计算经历的多少分钟(只计算工作日)
+ * @param param
+ * @return com.epmet.commons.tools.utils.Result>
+ * @author wangc
+ * @date 2020.10.21 16:34
+ */
+ @PostMapping("workminutes")
+ public Result> workMinutes(@RequestBody WorkMinuteFormDTO param){
+ return new Result>().ok(workDayService.workMinutes(param));
+ }
}
diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/WorkDayService.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/WorkDayService.java
index 7433b154c1..8d4e4673cc 100644
--- a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/WorkDayService.java
+++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/WorkDayService.java
@@ -1,9 +1,14 @@
package com.epmet.service;
+import com.epmet.dto.form.CostDayFormDTO;
import com.epmet.dto.form.WorkDayFormDTO;
+import com.epmet.dto.result.CostDayResultDTO;
+import com.epmet.dto.form.WorkMinuteFormDTO;
import com.epmet.dto.result.WorkDayResultDTO;
+
import java.util.List;
+import java.util.Map;
import java.util.Set;
/**
@@ -13,4 +18,31 @@ import java.util.Set;
*/
public interface WorkDayService {
List detentionDays(List formDTO);
+
+ /**
+ * 工作日计算
+ * @author zhaoqifeng
+ * @date 2020/10/21 17:56
+ * @param formDTO
+ * @return java.util.List
+ */
+ List costWorkDays(List formDTO);
+
+ /**
+ * 日历日计算
+ * @author zhaoqifeng
+ * @date 2020/10/21 17:56
+ * @param formDTO
+ * @return java.util.List
+ */
+ List costCalendarDays(List formDTO);
+
+ /**
+ * @Description 计算经历的多少分钟(只计算工作日)
+ * @param param
+ * @return java.util.Map
+ * @author wangc
+ * @date 2020.10.21 16:14
+ */
+ Map workMinutes(WorkMinuteFormDTO param);
}
diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/WorkDayServiceImpl.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/WorkDayServiceImpl.java
index 25ede12e88..80241a5a2e 100644
--- a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/WorkDayServiceImpl.java
+++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/WorkDayServiceImpl.java
@@ -1,17 +1,30 @@
package com.epmet.service.impl;
+import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.exception.RenException;
+import com.epmet.commons.tools.utils.DateUtils;
+import com.epmet.commons.tools.utils.DateUtils;
+import com.epmet.constant.ProjectConstant;
import com.epmet.dao.CalenderDao;
+import com.epmet.dto.form.CostDayFormDTO;
+import com.epmet.dto.form.TimestampIntervalFormDTO;
import com.epmet.dto.form.WorkDayFormDTO;
+import com.epmet.dto.result.CostDayResultDTO;
+import com.epmet.dto.form.WorkMinuteFormDTO;
import com.epmet.dto.result.WorkDayResultDTO;
import com.epmet.entity.CalenderEntity;
import com.epmet.service.WorkDayService;
+import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
+import org.springframework.util.CollectionUtils;
import java.text.SimpleDateFormat;
+import java.time.LocalDateTime;
+import java.time.ZoneId;
+import java.time.temporal.ChronoUnit;
import java.util.*;
/**
@@ -25,6 +38,8 @@ public class WorkDayServiceImpl implements WorkDayService {
@Autowired
private CalenderDao calenderDao;
+ private static SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN);
+ private static SimpleDateFormat formatMinute = new SimpleDateFormat(DateUtils.DATE_TIME_PATTERN);
@Override
public List detentionDays(List workDayFormDTO) {
List list = new ArrayList<>();
@@ -44,6 +59,95 @@ public class WorkDayServiceImpl implements WorkDayService {
return list;
}
+ /**
+ * 工作日计算
+ *
+ * @param formDTO
+ * @return java.util.List
+ * @author zhaoqifeng
+ * @date 2020/10/21 17:56
+ */
+ @Override
+ public List costWorkDays(List formDTO) {
+ List list = new ArrayList<>();
+ if (formDTO.isEmpty()) {
+ throw new RenException("起始时间、终止时间不能为空");
+ }
+ for (CostDayFormDTO form : formDTO) {
+ CostDayResultDTO result = new CostDayResultDTO();
+ result.setId(form.getId());
+ result.setStaffId(form.getStaffId());
+ result.setDetentionDays(this.getWorkDays(form.getStartDate(), form.getEndDate()));
+ result.setStartDate(form.getStartDate());
+ list.add(result);
+ }
+ return list;
+ }
+
+ /**
+ * 日历日计算
+ *
+ * @param formDTO
+ * @return java.util.List
+ * @author zhaoqifeng
+ * @date 2020/10/21 17:56
+ */
+ @Override
+ public List costCalendarDays(List formDTO) {
+ List list = new ArrayList<>();
+ if (formDTO.isEmpty()) {
+ throw new RenException("起始时间、终止时间不能为空");
+ }
+ for (CostDayFormDTO form : formDTO) {
+ CostDayResultDTO result = new CostDayResultDTO();
+ result.setId(form.getId());
+ result.setStaffId(form.getStaffId());
+ result.setDetentionDays(this.getCalendarDays(form.getStartDate(), form.getEndDate()));
+ result.setStartDate(form.getStartDate());
+ list.add(result);
+ }
+ return list;
+ }
+
+ /**
+ * @Description 计算经历的多少分钟(只计算工作日)
+ * @param param
+ * @return java.util.Map
+ * @author wangc
+ * @date 2020.10.21 16:14
+ */
+ @Override
+ public Map workMinutes(WorkMinuteFormDTO param) {
+ List params = param.getTimeList();
+ if(CollectionUtils.isEmpty(params)) return null;
+ Map result = new LinkedHashMap<>();
+ //默认非精准计算
+ if(StringUtils.isBlank(param.getIfPrecise()) || !StringUtils.equals(ProjectConstant.PRECISE_CALCULATION,param.getIfPrecise())){
+ params.forEach(local -> {
+ result.put(local.getId(),calculateImpreciseDetentionMinutes(local.getLeft(),local.getRight()));
+ });
+ return result;
+ }
+ //精准计算
+ if(StringUtils.isBlank(param.getIfCustom()) || !StringUtils.equals(ProjectConstant.CALCULATION_TYPE_CUSTOM,param.getIfCustom())){
+ //默认
+ params.forEach(local -> {
+ result.put(local.getId(),calculateDetentionMinutes(local.getLeft(),local.getRight()));
+ });
+
+ }else{
+ //自定义
+ params.forEach(local -> {
+ try {
+ result.put(local.getId(), calculateDetentionMinutesWithStartEnd(local.getLeft(), local.getRight(), param.getStartTemplate(), param.getEndTemplate()));
+ }catch (Exception e){
+ throw new RenException(e.getMessage());
+ }
+ });
+ }
+ return result;
+ }
+
//公式: 当前日期 - 被吹日期 - 期间的节假日
private String caculateDetentionDays(String startDateStr, String endDateStr) {
if (startDateStr.equals(endDateStr)) {
@@ -77,6 +181,249 @@ public class WorkDayServiceImpl implements WorkDayService {
return "-1";
}
+ /***
+ * @Description 计算两个日期之间的非准确时间差(只包括工作日),单位:分钟 不足一天按照一天计算
+ * @param left
+ * @param right
+ * @return java.lang.Integer
+ * @author wangc
+ * @date 2020.10.21 17:09
+ */
+ private Integer calculateImpreciseDetentionMinutes(Date left, Date right){
+ if(null == left){ logger.error("计算工作日,传入的开始日期为空!");return null;}
+ //给右区间赋值,默认当前时间
+ if(null == right || right.compareTo(left) < NumConstant.ZERO) right = new Date();
+
+ List list = calenderDao.selectByStartAndEnd(format.format(left),format.format(right));
+ if(!CollectionUtils.isEmpty(list)){
+ //集合中只有一个元素,说明两个时间在同一天
+ if(list.size() == NumConstant.ONE){
+ return NumConstant.EIGHT * NumConstant.SIXTY;
+ }
+ //集合中有两个元素,说明两个时间是相连的
+ //集合中有两个元素以上,说明两个时间存在跨度
+ else{
+ int costMin = NumConstant.ZERO;
+ if(NumConstant.TWO == list.size()) return costMin;
+ for(int index = NumConstant.ZERO ; index < list.size() ; index++)
+ if(StringUtils.equals(ProjectConstant.DAY_TYPE_WORK,list.get(index).getType()))
+ costMin += NumConstant.TWENTY_FOUR * NumConstant.SIXTY;
+
+ return costMin;
+ }
+
+ }
+ logger.warn("计算工作日,没有找到开始日期和结束日期,可能数据库中没有存储对应时段的数据,开始时间:{},结束时间:{}",left,right);
+ return null;
+ }
+
+ /**
+ * @Description 计算两个日期之间的时间差(只包括工作日),单位:分钟
+ * @param left
+ * @param right
+ * @return java.lang.Integer
+ * @author wangc
+ * @date 2020.10.21 14:00
+ */
+ private Integer calculateDetentionMinutes(Date left ,Date right){
+ if(null == left){ logger.error("计算工作日,传入的开始日期为空!");return null;}
+ //给右区间赋值,默认当前时间
+ if(null == right || right.compareTo(left) < NumConstant.ZERO) right = new Date();
+
+ List list = calenderDao.selectByStartAndEnd(format.format(left),format.format(right));
+ if(!CollectionUtils.isEmpty(list)){
+ //集合中只有一个元素,说明两个时间在同一天
+ if(list.size() == NumConstant.ONE){
+ if(ProjectConstant.DAY_TYPE_WORK.equals(list.get(NumConstant.ZERO).getType()))
+ return (int)((right.getTime() - left.getTime())/NumConstant.ONE_THOUSAND/NumConstant.SIXTY);
+ else {
+ logger.warn("计算工作日,传入的起始时间都在同一天且是在节假日,开始时间:{},结束时间:{},节日类型:{}(1工作日、2周末、3、节假日)",left,right);
+ return NumConstant.ZERO;
+ }
+ }
+ //集合中有两个元素,说明两个时间是相连的
+ //集合中有两个元素以上,说明两个时间存在跨度
+ else{
+ String leftType = list.get(NumConstant.ZERO).getType();
+ String rightType = list.get(list.size() - NumConstant.ONE).getType();
+ int costMin = NumConstant.ZERO;
+ if(ProjectConstant.DAY_TYPE_WORK.equals(leftType)){
+ LocalDateTime localDateTime = LocalDateTime.ofInstant(left.toInstant(), ZoneId.systemDefault());
+ //获取第第二天零点时刻的实例
+ LocalDateTime tomorrowTime = LocalDateTime.ofInstant(left.toInstant(), ZoneId.systemDefault())
+ .plusDays(NumConstant.ONE).withHour(NumConstant.ZERO).withMinute(NumConstant.ZERO).withSecond(NumConstant.ZERO).withNano(NumConstant.ZERO);
+ //ChronoUnit日期枚举类,between方法计算两个时间对象之间的时间量
+ costMin += ChronoUnit.SECONDS.between(localDateTime, tomorrowTime)/NumConstant.SIXTY;
+ }
+ if(ProjectConstant.DAY_TYPE_WORK.equals(rightType)){
+ LocalDateTime localDateTime = LocalDateTime.ofInstant(right.toInstant(), ZoneId.systemDefault());
+ //获取第第二天零点时刻的实例
+ LocalDateTime initialTime = LocalDateTime.ofInstant(right.toInstant(), ZoneId.systemDefault())
+ .withHour(NumConstant.ZERO).withMinute(NumConstant.ZERO).withSecond(NumConstant.ZERO).withNano(NumConstant.ZERO);
+ //ChronoUnit日期枚举类,between方法计算两个时间对象之间的时间量
+ costMin += ChronoUnit.SECONDS.between(localDateTime, initialTime)/NumConstant.SIXTY;
+ }
+ if(NumConstant.TWO == list.size()) return costMin;
+ for(int index = NumConstant.ONE ; index < list.size() - NumConstant.ONE ; index++)
+ if(StringUtils.equals(ProjectConstant.DAY_TYPE_WORK,list.get(index).getType()))
+ costMin += NumConstant.TWENTY_FOUR * NumConstant.SIXTY;
+
+ return costMin;
+ }
+
+ }
+ logger.warn("计算工作日,没有找到开始日期和结束日期,可能数据库中没有存储对应时段的数据,开始时间:{},结束时间:{}",left,right);
+ return null;
+ }
+
+ /***
+ * @Description 根据可配置的工作起始时间计算两个日期之间的差
+ * @param left
+ * @param right
+ * @param start 格式为 HH:mm:ss
+ * @param end 格式为 HH:mm:ss
+ * @return java.lang.Integer
+ * @author wangc
+ * @date 2020.10.20 18:05
+ */
+ private Integer calculateDetentionMinutesWithStartEnd(Date left ,Date right, String start, String end)throws Exception{
+ if(null == left){ logger.error("计算工作日,传入的开始日期为空!");return null;}
+ if(null == start || null == end){start = "9:00:00"; end = "17:00:00";}
+ //给右区间赋值,默认当前时间
+ if(null == right || right.compareTo(left) < NumConstant.ZERO) right = new Date();
+ //自定义起始时间
+ String standardStartDateStr = format.format(left).concat(" ").concat(start);
+ //自定义截至时间
+ String standardEndDateStr = format.format(right).concat(" ").concat(end);
+ Date standardStartDate = formatMinute.parse(standardStartDateStr);
+ Date standardEndDate = formatMinute.parse(standardEndDateStr);
+ if(standardEndDate.compareTo(standardStartDate) < NumConstant.ZERO){ logger.error("计算工作日,自定义截止日期小于自定义起始日期!");return null;}
+ //单位时间内规定起止时间的时间差
+ Integer delta_T = (int)(standardEndDate.getTime() - formatMinute.parse(format.format(right).concat(" ").concat(start)).getTime())/NumConstant.ONE_THOUSAND/NumConstant.SIXTY;
+ List list = calenderDao.selectByStartAndEnd(format.format(left),format.format(right));
+ if(!CollectionUtils.isEmpty(list)){
+ //集合中只有一个元素,说明两个时间在同一天
+ if(list.size() == NumConstant.ONE){
+ if(ProjectConstant.DAY_TYPE_WORK.equals(list.get(NumConstant.ZERO).getType())){
+ //开始时间早于当天规定开始时间
+ if(left.before(standardStartDate)){
+ if(right.before(standardStartDate)){
+ //结束时间早于当天规定开始时间
+ logger.warn("计算工作日,开始时间与结数时间均早于当天规定的起止计算时间,开始时间:{},结束时间:{},当天开始时间:{}",left,right,standardStartDate);
+ return NumConstant.ZERO;
+ }else if(right.before(standardEndDate)){
+ return (int)(right.getTime() - standardStartDate.getTime())/NumConstant.ONE_THOUSAND/NumConstant.SIXTY;
+ }else{
+ //结束时间晚于当天规定截止时间
+ return delta_T;
+ }
+ }else if(left.before(standardEndDate)){
+ //开始时间在当天规定起止时间之间
+ if(right.before(standardEndDate)){
+ return (int)(right.getTime() - left.getTime())/NumConstant.ONE_THOUSAND/NumConstant.SIXTY;
+ }else{
+ return (int)(standardEndDate.getTime() - left.getTime())/NumConstant.ONE_THOUSAND/NumConstant.SIXTY;
+ }
+ }else{
+ logger.warn("计算工作日,开始时间与结数时间晚于当天规定的截止计算时间,开始时间:{},结束时间:{},当天截止时间:{}",left,right,standardEndDate);
+ return NumConstant.ZERO;
+ }
+
+ }else {
+ logger.warn("计算工作日,传入的起始时间都在同一天且是在节假日,开始时间:{},结束时间:{},节日类型:{}(1工作日、2周末、3、节假日)",left,right);
+ return NumConstant.ZERO;
+ }
+ }
+ //集合中有两个元素,说明两个时间是相连的
+ //集合中有两个元素以上,说明两个时间存在跨度
+ else{
+ String leftType = list.get(NumConstant.ZERO).getType();
+ String rightType = list.get(list.size() - NumConstant.ONE).getType();
+ int costMin = NumConstant.ZERO;
+ if(ProjectConstant.DAY_TYPE_WORK.equals(leftType)){
+ if(left.before(standardStartDate)){
+ costMin += delta_T;
+ }else if(left.before(standardEndDate)){
+ costMin += (formatMinute.parse(format.format(left).concat(" ").concat(end)).getTime() - left.getTime())/NumConstant.ONE_THOUSAND/NumConstant.SIXTY;
+ }else{
+
+ }
+ }
+ if(ProjectConstant.DAY_TYPE_WORK.equals(rightType)){
+ Date leftStandardStartDate = formatMinute.parse(format.format(right).concat(" ").concat(end));
+ if(right.before(leftStandardStartDate)){
+
+ }else if(right.before(standardEndDate)){
+ costMin += (left.getTime() - leftStandardStartDate.getTime())/NumConstant.ONE_THOUSAND/NumConstant.SIXTY;
+ }else{
+ costMin += delta_T;
+ }
+ }
+ if(NumConstant.TWO == list.size()) return costMin;
+ for(int index = NumConstant.ONE ; index < list.size() - NumConstant.ONE ; index++)
+ if(StringUtils.equals(ProjectConstant.DAY_TYPE_WORK,list.get(index).getType()))
+ costMin += delta_T * NumConstant.SIXTY;
+
+ return costMin;
+ }
+
+ }
+ logger.warn("计算工作日,没有找到开始日期和结束日期,可能数据库中没有存储对应时段的数据,开始时间:{},结束时间:{}",left,right);
+ return null;
+ }
+
+
+ private Integer getWorkDays(Date start, Date end) {
+ String startDateStr = DateUtils.format(start, DateUtils.DATE_PATTERN_YYYYMMDD);
+ String endDateStr = DateUtils.format(end, DateUtils.DATE_PATTERN_YYYYMMDD);
+ if (startDateStr.equals(endDateStr)) {
+ logger.info(String.format("%s-%s起止时间一致,返回<1,",startDateStr,endDateStr));
+ return 0;
+ }
+ SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMdd");
+ try {
+ Date startDate = simpleDateFormat.parse(startDateStr);
+ Date endDate = simpleDateFormat.parse(endDateStr);
+ long day = (endDate.getTime() - startDate.getTime()) / (24 * 60 * 60 * 1000);
+ logger.info(String.format("当前日期[%s]-被吹日期[%s]=%s", endDateStr, startDateStr, day));
+ List list = calenderDao.selectByStartAndEnd(startDateStr, endDateStr);
+
+ long totalHoliday = 0;
+ for (CalenderEntity calenderEntity : list) {
+ if (!"1".equals(calenderEntity.getType())) {
+ totalHoliday += 1;
+ }
+ }
+ logger.info(String.format("期间的节假日[%s-%s]=%s", endDateStr, startDateStr, totalHoliday));
+ long detentionDay = day - totalHoliday;
+ logger.info(String.format("当前日期[%s]-被吹日期[%s]-期间的节假日[%s]=%s", endDateStr, startDateStr, totalHoliday, detentionDay));
+ return (int)detentionDay;
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ return -1;
+ }
+
+
+ private Integer getCalendarDays(Date start, Date end) {
+ String startDateStr = DateUtils.format(start, DateUtils.DATE_PATTERN_YYYYMMDD);
+ String endDateStr = DateUtils.format(end, DateUtils.DATE_PATTERN_YYYYMMDD);
+ if (startDateStr.equals(endDateStr)) {
+ logger.info(String.format("%s-%s起止时间一致,返回<1,",startDateStr,endDateStr));
+ return 0;
+ }
+ SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMdd");
+ try {
+ Date startDate = simpleDateFormat.parse(startDateStr);
+ Date endDate = simpleDateFormat.parse(endDateStr);
+ long day = (endDate.getTime() - startDate.getTime()) / (24 * 60 * 60 * 1000);
+ return (int)day;
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ return -1;
+ }
+
}
diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/resources/mapper/CalenderDao.xml b/epmet-module/epmet-common-service/common-service-server/src/main/resources/mapper/CalenderDao.xml
index b1a3ab8e8d..13a7758445 100644
--- a/epmet-module/epmet-common-service/common-service-server/src/main/resources/mapper/CalenderDao.xml
+++ b/epmet-module/epmet-common-service/common-service-server/src/main/resources/mapper/CalenderDao.xml
@@ -61,4 +61,5 @@
AND QUERY_DATE BETWEEN #{begin}
AND #{end}
+
\ No newline at end of file
diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/ProjectSendMessageService.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/ProjectSendMessageService.java
new file mode 100644
index 0000000000..e005ed2543
--- /dev/null
+++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/ProjectSendMessageService.java
@@ -0,0 +1,21 @@
+package com.epmet.service;
+
+import com.epmet.commons.tools.utils.Result;
+import com.epmet.dto.ProjectDTO;
+import com.epmet.dto.extract.form.ExtractOriginFormDTO;
+
+/**
+ * @author zhaoqifeng
+ * @dscription
+ * @date 2020/10/26 15:19
+ */
+public interface ProjectSendMessageService {
+ /**
+ * 滞留提醒
+ * @author zhaoqifeng
+ * @date 2020/10/26 15:21
+ * @param formDTO
+ * @return com.epmet.commons.tools.utils.Result
+ */
+ Result projectSendMessage(ExtractOriginFormDTO formDTO);
+}
diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/ProjectSendMessageServiceImpl.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/ProjectSendMessageServiceImpl.java
new file mode 100644
index 0000000000..78418a8173
--- /dev/null
+++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/ProjectSendMessageServiceImpl.java
@@ -0,0 +1,35 @@
+package com.epmet.service.impl;
+
+import com.epmet.commons.tools.utils.Result;
+import com.epmet.dto.ProjectDTO;
+import com.epmet.dto.extract.form.ExtractOriginFormDTO;
+import com.epmet.feign.GovProjectOpenFeignClient;
+import com.epmet.service.ProjectSendMessageService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+/**
+ * @author zhaoqifeng
+ * @dscription
+ * @date 2020/10/26 15:22
+ */
+@Service
+public class ProjectSendMessageServiceImpl implements ProjectSendMessageService {
+ @Autowired
+ private GovProjectOpenFeignClient govProjectOpenFeignClient;
+
+ /**
+ * 滞留提醒
+ *
+ * @param formDTO
+ * @return com.epmet.commons.tools.utils.Result
+ * @author zhaoqifeng
+ * @date 2020/10/26 15:21
+ */
+ @Override
+ public Result projectSendMessage(ExtractOriginFormDTO formDTO) {
+ ProjectDTO projectDTO = new ProjectDTO();
+ projectDTO.setCustomerId(formDTO.getCustomerId());
+ return govProjectOpenFeignClient.sendMessageJob(projectDTO);
+ }
+}
diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/ProjectSendMessageTask.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/ProjectSendMessageTask.java
new file mode 100644
index 0000000000..d116882ee3
--- /dev/null
+++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/ProjectSendMessageTask.java
@@ -0,0 +1,43 @@
+package com.epmet.task;
+
+import com.alibaba.fastjson.JSON;
+import com.epmet.commons.tools.utils.Result;
+import com.epmet.dto.extract.form.ExtractOriginFormDTO;
+import com.epmet.service.ProjectSendMessageService;
+import org.apache.commons.lang3.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+/**
+ * @author zhaoqifeng
+ * @dscription
+ * @date 2020/10/26 15:26
+ */
+@Component("projectSendMessageTask")
+public class ProjectSendMessageTask implements ITask {
+ private Logger logger = LoggerFactory.getLogger(getClass());
+
+ @Autowired
+ private ProjectSendMessageService projectSendMessageService;
+ /**
+ * 执行定时任务接口
+ *
+ * @param params 参数,多参数使用JSON数据
+ */
+ @Override
+ public void run(String params) {
+ logger.info("ProjectSendMessageTask定时任务正在执行,参数为:{}", params);
+ ExtractOriginFormDTO formDTO = new ExtractOriginFormDTO();
+ if (StringUtils.isNotBlank(params)) {
+ formDTO = JSON.parseObject(params, ExtractOriginFormDTO.class);
+ }
+ Result result = projectSendMessageService.projectSendMessage(formDTO);
+ if (result.success()) {
+ logger.info("ProjectSendMessageTask定时任务执行成功");
+ } else {
+ logger.error("ProjectSendMessageTask定时任务执行失败:" + result.getMsg());
+ }
+ }
+}
diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/SubAgencyFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/SubAgencyFormDTO.java
index 6cdf21a193..ce80929e97 100644
--- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/SubAgencyFormDTO.java
+++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/SubAgencyFormDTO.java
@@ -39,5 +39,10 @@ public class SubAgencyFormDTO implements Serializable {
@NotBlank(message = "机关组织ID不能为空")
private String agencyId;
+ /**
+ * 机关组织数量
+ */
+ private Integer agencyNum = 10;
+
}
\ No newline at end of file
diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/SubListResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/SubListResultDTO.java
index 17dc985695..b6bf347332 100644
--- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/SubListResultDTO.java
+++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/SubListResultDTO.java
@@ -41,5 +41,9 @@ public class SubListResultDTO implements Serializable {
*/
private String agencyName = "";
+ /**
+ * 机关组织级别
+ */
+ private String agencyLevel = "";
}
\ No newline at end of file
diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java
index 2ebce80475..2856183dd3 100644
--- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java
+++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java
@@ -250,4 +250,13 @@ public interface GovOrgOpenFeignClient {
**/
@PostMapping("/gov/org/customeragency/userinfoext")
Result userInfoExt(@RequestBody ExtUserInfoResultDTO result);
+
+ /**
+ * @param formDTO
+ * @return
+ * @Author sun
+ * @Description 组织首页-下级机关列表
+ */
+ @PostMapping("/gov/org/agency/subagencylist")
+ Result subAgencyList(@RequestBody SubAgencyFormDTO formDTO);
}
diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java
index 8f70da4530..b132ebec6a 100644
--- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java
+++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java
@@ -146,4 +146,9 @@ public class GovOrgOpenFeignClientFallback implements GovOrgOpenFeignClient {
public Result userInfoExt(ExtUserInfoResultDTO result) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "userInfoExt", result);
}
+
+ @Override
+ public Result subAgencyList(SubAgencyFormDTO formDTO) {
+ return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "subAgencyList", formDTO);
+ }
}
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 cb1865ba35..08154a921d 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
@@ -38,7 +38,6 @@ import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
-import javax.xml.validation.Validator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java
index eeeecf60db..8c404a53c2 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java
+++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java
@@ -57,7 +57,7 @@ public interface CustomerAgencyDao extends BaseDao {
* @Author sun
* @Description 组织首页-下级机关列表
**/
- List selectSubAgencyById(@Param("pId") String pId);
+ List selectSubAgencyById(@Param("pId") String pId, @Param("agencyNum") Integer agencyNum);
/**
* @param pId
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 7595aafa33..8fbd617cf2 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
@@ -25,14 +25,12 @@ import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.constant.CustomerAgencyConstant;
import com.epmet.constant.RoleKeyConstants;
-import com.epmet.constant.UserWorkType;
import com.epmet.dao.CustomerAgencyDao;
import com.epmet.dto.CustomerAgencyDTO;
import com.epmet.dto.GovStaffRoleDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.result.*;
import com.epmet.entity.CustomerAgencyEntity;
-import com.epmet.feign.EpmetUserFeignClient;
import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.redis.CustomerAgencyRedis;
import com.epmet.service.AgencyService;
@@ -177,7 +175,7 @@ public class AgencyServiceImpl implements AgencyService {
public Result removeAgency(RemoveAgencyFormDTO formDTO) {
Result result = new Result();
//1:查询当前机关是否存在所属下级机关,存在下级的不能删除
- List agencyList = customerAgencyDao.selectSubAgencyById(formDTO.getAgencyId());
+ List agencyList = customerAgencyDao.selectSubAgencyById(formDTO.getAgencyId(), 10);
if (null != agencyList && agencyList.size() > NumConstant.ZERO) {
result.setCode(EpmetErrorCode.NOT_DEL_AGENCY.getCode());
result.setMsg(EpmetErrorCode.NOT_DEL_AGENCY.getMsg());
@@ -238,7 +236,7 @@ public class AgencyServiceImpl implements AgencyService {
public Result subAgencyList(SubAgencyFormDTO formDTO) {
SubAgencyResultDTO subAgencyResultDTO = new SubAgencyResultDTO();
//1:根据当前机关Id查询直属下一级机关列表,只返回前十条
- List agencyList = customerAgencyDao.selectSubAgencyById(formDTO.getAgencyId());
+ List