From d894dd37e17f8ca1f503cc5d5dece8ee169e4768 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 27 May 2021 16:33:21 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=B2=BB=E7=90=86=E6=8C=87=E8=B0=81?= =?UTF-8?q?=E7=BD=91=E6=A0=BC=E7=9B=B8=E5=85=B3v3:=20=E7=BD=91=E6=A0=BC?= =?UTF-8?q?=E8=87=AA=E6=B2=BB=E5=8D=A0=E6=AF=94=EF=BC=9A=E6=9C=AC=E7=BD=91?= =?UTF-8?q?=E6=A0=BC=E5=86=85=E4=BA=A7=E7=94=9F=E7=9A=84=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=EF=BC=8C=E5=B9=B6=E4=B8=94=E4=B8=80=E7=9B=B4=E5=9C=A8=E7=BD=91?= =?UTF-8?q?=E6=A0=BC=E7=BA=A7=E6=B5=81=E8=BD=AC=E7=9A=84=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=EF=BC=8C=E4=BB=8E=E5=93=AA=E5=87=BA=E6=9D=A5=E5=BD=92=E8=B0=81?= =?UTF-8?q?=E8=87=AA=E6=B2=BB=EF=BC=9B=E7=A4=BE=E5=8C=BA=E3=80=81=E8=A1=97?= =?UTF-8?q?=E9=81=93=E3=80=81=E5=8C=BA=E7=9B=B4=E9=83=A8=E9=97=A8=E8=A7=A3?= =?UTF-8?q?=E5=86=B3=E9=83=BD=E6=98=AF=E6=8C=87=E7=9A=84=EF=BC=8C=E4=BB=8E?= =?UTF-8?q?=E6=9C=AC=E7=BD=91=E6=A0=BC=E5=86=85=E5=87=BA=E6=9D=A5=E7=9A=84?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E4=B8=AD=EF=BC=8C=E5=86=8D=E5=8E=BB=E7=9C=8B?= =?UTF-8?q?=E8=B0=81=E8=A7=A3=E5=86=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../extract/FactOriginProjectLogDailyDTO.java | 10 +- .../constant/DimObjectActionConstant.java | 13 ++ .../extract/FactOriginProjectLogDailyDao.java | 20 +- .../FactOriginProjectMainDailyDao.java | 19 ++ .../epmet/dao/org/StatsCustomerAgencyDao.java | 8 + .../extract/GovernProjectInfoDTO.java | 20 ++ .../extract/ProjectInfoDTO.java | 15 -- .../FactOriginProjectMainDailyService.java | 19 ++ .../impl/FactGridGovernDailyServiceImpl.java | 197 +++++++++++++++++- ...FactOriginProjectMainDailyServiceImpl.java | 23 ++ .../service/org/CustomerAgencyService.java | 16 ++ .../org/impl/CustomerAgencyServiceImpl.java | 22 ++ .../extract/FactOriginProjectLogDailyDao.xml | 23 ++ .../extract/FactOriginProjectMainDailyDao.xml | 59 ++++++ .../mapper/org/StatsCustomerAgencyDao.xml | 18 ++ 15 files changed, 457 insertions(+), 25 deletions(-) create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/GovernProjectInfoDTO.java delete mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/ProjectInfoDTO.java diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactOriginProjectLogDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactOriginProjectLogDailyDTO.java index 8f5f1571db..4843b32966 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactOriginProjectLogDailyDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactOriginProjectLogDailyDTO.java @@ -17,9 +17,10 @@ package com.epmet.dto.extract; +import lombok.Data; + import java.io.Serializable; import java.util.Date; -import lombok.Data; /** @@ -44,7 +45,7 @@ public class FactOriginProjectLogDailyDTO implements Serializable { private String customerId; /** - * 网格grid,部门department + * 网格grid,部门department,组织:agency */ private String orgType; @@ -90,6 +91,11 @@ public class FactOriginProjectLogDailyDTO implements Serializable { */ private String yearId; + /** + * 项目ID + */ + private String projectId; + /** * 议题ID */ diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/DimObjectActionConstant.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/DimObjectActionConstant.java index 5476a93a1b..1b6697f1ec 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/DimObjectActionConstant.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/DimObjectActionConstant.java @@ -11,4 +11,17 @@ public interface DimObjectActionConstant { * 发布话题 */ String TOPIC_PUBLISH="discussing"; + + // response 处理/响应 + // close 结案 + // transfer 流转 + // return 退回 + // resolved 结案_已解决 + // unresolved 结案_无需解决 + // evaluate 满意度评价 + // bad 不满意 + // good 基本满意 + // perfect 非常满意 + // created 立项 + String PROJECT_RETURN="return"; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectLogDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectLogDailyDao.java index 78f9be78e9..3d7371fb56 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectLogDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectLogDailyDao.java @@ -18,12 +18,12 @@ package com.epmet.dao.evaluationindex.extract; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.extract.FactOriginProjectLogDailyDTO; import com.epmet.dto.extract.result.*; import com.epmet.entity.evaluationindex.extract.FactOriginProjectLogDailyEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; - import java.util.List; /** @@ -298,4 +298,22 @@ public interface FactOriginProjectLogDailyDao extends BaseDao */ List selectGridSelfDaily(@Param("customerId") String customerId, @Param("dateId") String dateId); + + /** + * @return java.util.List + * @param projectId + * @author yinzuomei + * @description 根据项目id, 查询处理明细 + * @Date 2021/5/27 12:58 + **/ + List selectListByProjectId(String projectId); + + /** + * @return com.epmet.dto.extract.FactOriginProjectLogDailyDTO + * @param projectId + * @author yinzuomei + * @description 查询某一个项目的结案操作明细 + * @Date 2021/5/27 12:58 + **/ + FactOriginProjectLogDailyDTO selectClosedLog(String projectId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectMainDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectMainDailyDao.java index d5042bbb7b..fe5a0e2584 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectMainDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectMainDailyDao.java @@ -29,6 +29,7 @@ import com.epmet.dto.screen.form.ProjectSourceMapFormDTO; import com.epmet.entity.evaluationindex.extract.FactOriginProjectMainDailyEntity; import com.epmet.entity.evaluationindex.extract.FactOriginProjectOrgPeriodDailyEntity; import com.epmet.entity.evaluationindex.extract.GovernGridTotalCommonDTO; +import com.epmet.entity.evaluationindex.extract.GovernProjectInfoDTO; import com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -477,4 +478,22 @@ public interface FactOriginProjectMainDailyDao extends BaseDao selectAgencyClosedProjectCount(@Param("customerId") String customerId, @Param("dateId") String dateId, @Param( "closedStatus") String closedStatus, @Param("origin") String origin); + + /** + * 当前网格内已结案的项目 + * + * @author zhaoqifeng + * @date 2021/5/26 15:09 + * @param customerId + * @param gridId + * @param projectStatus 状态:待处理 pending,结案closed + * @param origin 项目来源 来源:议题issue 组织agency + * @param isResolved unresolved,resolved + * @return com.epmet.entity.evaluationindex.extract.GovernProjectInfoDTO + */ + List getGridClosedProjectList(@Param("customerId")String customerId, + @Param("gridId") String gridId, + @Param("projectStatus")String projectStatus, + @Param("origin") String origin, + @Param("isResolved")String isResolved); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/StatsCustomerAgencyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/StatsCustomerAgencyDao.java index aa0f78f087..6a20ae9f7f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/StatsCustomerAgencyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/StatsCustomerAgencyDao.java @@ -35,4 +35,12 @@ public interface StatsCustomerAgencyDao extends BaseDao { CustomerAgencyEntity getRootAgencyInfo(String customerId); List queryAgencyListByCustomerId(String customerId); + + /** + * 查询部门所属组织信息 + * + * @param deptId + * @return com.epmet.entity.evaluationindex.screen.ScreenCustomerAgencyEntity + */ + CustomerAgencyEntity selectByDeptId(String deptId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/GovernProjectInfoDTO.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/GovernProjectInfoDTO.java new file mode 100644 index 0000000000..b4dfa42239 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/GovernProjectInfoDTO.java @@ -0,0 +1,20 @@ +package com.epmet.entity.evaluationindex.extract; + +import com.epmet.dto.extract.FactOriginProjectLogDailyDTO; +import com.epmet.dto.extract.FactOriginProjectMainDailyDTO; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 描述一下 + * + * @author yinzuomei@elink-cn.com + * @date 2021/5/26 18:00 + */ +@Data +public class GovernProjectInfoDTO extends FactOriginProjectMainDailyDTO implements Serializable { + private FactOriginProjectLogDailyDTO closeLogDTO; + private List projectLogDTOList; +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/ProjectInfoDTO.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/ProjectInfoDTO.java deleted file mode 100644 index 0b1eb1af59..0000000000 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/ProjectInfoDTO.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.epmet.entity.evaluationindex.extract; - -import lombok.Data; - -import java.io.Serializable; - -/** - * 描述一下 - * - * @author yinzuomei@elink-cn.com - * @date 2021/5/26 18:00 - */ -@Data -public class ProjectInfoDTO implements Serializable { -} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java index 9445559627..32c027b605 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java @@ -30,6 +30,7 @@ import com.epmet.dto.screen.form.ScreenCentralZoneDataFormDTO; import com.epmet.entity.evaluationindex.extract.FactOriginProjectMainDailyEntity; import com.epmet.entity.evaluationindex.extract.FactOriginProjectOrgPeriodDailyEntity; import com.epmet.entity.evaluationindex.extract.GovernGridTotalCommonDTO; +import com.epmet.entity.evaluationindex.extract.GovernProjectInfoDTO; import com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity; import java.util.List; @@ -448,4 +449,22 @@ public interface FactOriginProjectMainDailyService extends BaseService */ Map getAgencyClosedProjectCount(String customerId, String dateId, String closedStatus, String origin); + + /** + * 当前网格内已结案的项目 + * + * @author zhaoqifeng + * @date 2021/5/26 15:09 + * @param customerId + * @param gridId + * @param projectStatus 状态:待处理 pending,结案closed + * @param origin 项目来源 来源:议题issue 组织agency + * @param isResolved unresolved,resolved + * @return com.epmet.entity.evaluationindex.extract.GovernProjectInfoDTO + */ + List getGridClosedProjectList(String customerId, + String gridId, + String projectStatus, + String origin, + String isResolved); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactGridGovernDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactGridGovernDailyServiceImpl.java index 84c4addeea..24136c028f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactGridGovernDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactGridGovernDailyServiceImpl.java @@ -19,17 +19,22 @@ package com.epmet.service.evaluationindex.extract.todata.impl; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.constant.DimObjectActionConstant; import com.epmet.constant.DimObjectStatusConstant; import com.epmet.constant.ProjectConstant; import com.epmet.dao.evaluationindex.extract.FactGridGovernDailyDao; +import com.epmet.dto.extract.FactOriginProjectLogDailyDTO; import com.epmet.dto.org.GridInfoDTO; import com.epmet.entity.evaluationindex.extract.FactGridGovernDailyEntity; import com.epmet.entity.evaluationindex.extract.GovernGridClosedTotalCommonDTO; import com.epmet.entity.evaluationindex.extract.GovernGridTotalCommonDTO; +import com.epmet.entity.evaluationindex.extract.GovernProjectInfoDTO; +import com.epmet.entity.org.CustomerAgencyEntity; import com.epmet.service.evaluationindex.extract.todata.FactGridGovernDailyService; import com.epmet.service.evaluationindex.extract.todata.FactOriginIssueMainDailyService; import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectMainDailyService; import com.epmet.service.evaluationindex.extract.todata.FactOriginTopicMainDailyService; +import com.epmet.service.org.CustomerAgencyService; import com.epmet.service.org.CustomerGridService; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; @@ -39,10 +44,7 @@ import org.springframework.stereotype.Service; import java.math.BigDecimal; import java.text.NumberFormat; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.util.*; import java.util.stream.Collectors; /** @@ -62,7 +64,8 @@ public class FactGridGovernDailyServiceImpl extends BaseServiceImpl getGovernGridClosedTotalCommonDTOMap(String customerId, List gridIds) { - Map resultMap=new HashMap<>(); - for(String gridId:gridIds){ + Map resultMap = new HashMap<>(); + for (String gridId : gridIds) { + + GovernGridClosedTotalCommonDTO governGridClosedTotalCommonDTO = new GovernGridClosedTotalCommonDTO(); + governGridClosedTotalCommonDTO.setGridId(gridId); + + // 11、来源于议题的项目,未出网格结案并且已解决的项目数 + int fromIssueResolvedInGridCount = NumConstant.ZERO; + // 12、来源于议题的项目,未出网格结案并且无需解决的项目数 + int fromIssueUnResolvedInGridCount = NumConstant.ZERO; + // 13、来源于项目立项的项目,未出网格结案,并且已解决的项目数;因现在网格不能立项,所以此列默认为0 + int fromAgencyResolvedInGridCount = NumConstant.ZERO; + // 14、来源于项目立项的项目,未出网格结案,并且无需解决的项目数;因现在网格不能立项,所以此列默认为0 + int fromAgencyUnResolvedInGridCount = NumConstant.ZERO; + // 当前网格内出来的项目:由社区结案(已解决+未解决)的项目总数 + int communityClosedCount= NumConstant.ZERO; + // 当前网格内出来的项目:由街道结案(已解决+未解决)的项目总数 + int streetClosedCount=NumConstant.ZERO;; + // 当前网格内出来的项目:由街道结案(已解决+未解决)的项目总数 + int districtDeptClosedCount=NumConstant.ZERO; + + //当前网格内已结案的项目 + List currentGridClosedProjectList = factOriginProjectMainDailyService.getGridClosedProjectList(customerId, gridId, + ProjectConstant.CLOSED,null,null); + for (GovernProjectInfoDTO governProjectInfoDTO : currentGridClosedProjectList) { + // 1、先判断当前项目是否出了网格 + // 举例:A社区下有A1、A2两个网格;A1网格下的一个项目,流转给了A2网格的某人,他结案了。 只要项目流转部门未出grid ;就算是网格自治。 + boolean inGridClosed = checkIsInGridClosed(governProjectInfoDTO.getGridId(), + governProjectInfoDTO.getProjectLogDTOList()); + if (inGridClosed) { + // 2、在网格内流转结案的,计算以下下值 + if (ProjectConstant.PROJECT_ORIGIN_ISSUE.equals(governProjectInfoDTO.getOrigin())) { + if (ProjectConstant.RESOLVED.equals(governProjectInfoDTO.getIsResolved())) { + // 11、来源于议题的项目,未出网格(在网格内流转的)结案并且已解决的项目数 + fromIssueResolvedInGridCount += 1; + } else if (ProjectConstant.UNRESOLVED.equals(governProjectInfoDTO.getIsResolved())) { + // 12、来源于议题的项目,未出网格(在网格内流转的)结案并且无需解决的项目数 + fromIssueUnResolvedInGridCount += 1; + } + } else if (ProjectConstant.PROJECT_ORIGIN_AGENCY.equals(governProjectInfoDTO.getOrigin())) { + if (ProjectConstant.RESOLVED.equals(governProjectInfoDTO.getIsResolved())) { + // 13、来源于项目立项的项目,未出网格(在网格内流转的)结案,并且已解决的项目数;因现在网格不能立项,所以此列默认为0 + fromAgencyResolvedInGridCount += 1; + } else if (ProjectConstant.UNRESOLVED.equals(governProjectInfoDTO.getIsResolved())) { + // 14、来源于项目立项的项目,未出网格(在网格内流转的)结案,并且无需解决的项目数;因现在网格不能立项,所以此列默认为0 + fromAgencyUnResolvedInGridCount += 1; + } + } + } else { + // 3、出了网格的判断是由谁解决的? + String resolveOrgType=getProjectResolveOrgType(governProjectInfoDTO.getProjectLogDTOList()); + if("community".equals(resolveOrgType)){ + // 当前网格内出来的项目:由社区结案(已解决+未解决)的项目总数 + communityClosedCount+=1; + }else if("street".equals(resolveOrgType)){ + // 当前网格内出来的项目:由街道结案(已解决+未解决)的项目总数 + streetClosedCount+=1; + }else if("districtdept".equals(resolveOrgType)){ + // 当前网格内出来的项目:由街道结案(已解决+未解决)的项目总数 + districtDeptClosedCount+=1; + } + // todo 可能是 市级解决、省级解决呢??? + } + } + governGridClosedTotalCommonDTO.setFromIssueResolvedInGridCount(fromIssueResolvedInGridCount); + governGridClosedTotalCommonDTO.setFromIssueUnResolvedInGridCount(fromIssueUnResolvedInGridCount); + governGridClosedTotalCommonDTO.setFromAgencyResolvedInGridCount(fromAgencyResolvedInGridCount); + governGridClosedTotalCommonDTO.setFromAgencyUnResolvedInGridCount(fromAgencyUnResolvedInGridCount); + governGridClosedTotalCommonDTO.setCommunityClosedCount(communityClosedCount); + governGridClosedTotalCommonDTO.setStreetClosedCount(streetClosedCount); + governGridClosedTotalCommonDTO.setDistrictDeptClosedCount(districtDeptClosedCount); + resultMap.put(gridId, governGridClosedTotalCommonDTO); } return resultMap; } + /** + * 已经出网格的项目,到底归谁解决呢? + * + * @param projectLogDTOList 当前项目所有的处理明细 + * @return String 社区解决:community;街道解决:street;区直部门解决:districtdept + */ + private String getProjectResolveOrgType(List projectLogDTOList) { + List handleLevelList=new ArrayList<>(); + for (FactOriginProjectLogDailyDTO logDailyDTO : projectLogDTOList) { + if(logDailyDTO.getActionCode().equals(DimObjectActionConstant.PROJECT_RETURN)){ + //当前操作如果是退回,不参与比较 + continue; + } + + /** + * 机关级别(社区级:community, + 乡(镇、街道)级:street, + 区县级: district, + 市级: city + 省级:province) + */ + // orgType: 网格grid,部门department,组织:agency + if ("grid".equals(logDailyDTO.getOrgType())) { + handleLevelList.add(NumConstant.ONE); + } else if ("agency".equals(logDailyDTO.getOrgType())) { + CustomerAgencyEntity agencyEntity=customerAgencyService.getAgencyById(logDailyDTO.getOrgId()); + if("community".equals(agencyEntity.getLevel())){ + handleLevelList.add(NumConstant.TWO); + }else if("street".equals(agencyEntity.getLevel())){ + handleLevelList.add(NumConstant.THREE); + }else if("district".equals(agencyEntity.getLevel())){ + handleLevelList.add(NumConstant.FOUR); + }else if("city".equals(agencyEntity.getLevel())){ + handleLevelList.add(NumConstant.FIVE); + }else if("province".equals(agencyEntity.getLevel())){ + handleLevelList.add(NumConstant.SIX); + } + } else if ("department".equals(logDailyDTO.getOrgType())) { + CustomerAgencyEntity deptAgencyEntity=customerAgencyService.getAgencyByDeptId(logDailyDTO.getOrgId()); + if("district".equals(deptAgencyEntity.getLevel())){ + // 区直部门直接返回 + return "districtdept"; + }else if("community".equals(deptAgencyEntity.getLevel())){ + handleLevelList.add(NumConstant.TWO); + }else if("street".equals(deptAgencyEntity.getLevel())){ + handleLevelList.add(NumConstant.THREE); + }else if("city".equals(deptAgencyEntity.getLevel())){ + handleLevelList.add(NumConstant.FIVE); + }else if("province".equals(deptAgencyEntity.getLevel())){ + handleLevelList.add(NumConstant.SIX); + } + } + } + //网格:1 grid + //社区:2 community + //街道:3 street + //区县:4 district + //市级:5 city + //省:6 province + //区直部门:7 districtdept + //求出最高的处理部门级别 + String result = ""; + int max = Collections.max(handleLevelList); + switch (max) { + case NumConstant.ONE: + return "grid"; + case NumConstant.TWO: + result = "community"; + break; + case NumConstant.THREE: + result = "street"; + break; + case NumConstant.FOUR: + result = "district"; + break; + case NumConstant.FIVE: + result = "city"; + break; + case NumConstant.SIX: + result = "province"; + break; + case NumConstant.SEVEN: + result = "districtdept"; + } + return result; + } + + /** + * 根据项目处理的明细,判断当前项目是否在网格内自己解决的 + * + * @param gridId 当前项目所属网格 + * @param projectLogDTOList + * @return boolean + */ + private boolean checkIsInGridClosed(String gridId, List projectLogDTOList) { + boolean flag = true; + for (FactOriginProjectLogDailyDTO detail : projectLogDTOList) { + if(detail.getActionCode().equals(DimObjectActionConstant.PROJECT_RETURN)){ + //当前操作如果是退回,不参与比较 + continue; + } + //只要出了网格,就不算自治 + if (!"grid".equals(detail.getOrgType())) { + flag = false; + break; + } + } + return flag; + } + /** * 构造要插入的数据,每个网格一天一条数据,初始赋值0 * diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java index e31ea6fbaf..40d9738a7d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java @@ -40,6 +40,7 @@ import com.epmet.dto.screen.form.ScreenCentralZoneDataFormDTO; import com.epmet.entity.evaluationindex.extract.FactOriginProjectMainDailyEntity; import com.epmet.entity.evaluationindex.extract.FactOriginProjectOrgPeriodDailyEntity; import com.epmet.entity.evaluationindex.extract.GovernGridTotalCommonDTO; +import com.epmet.entity.evaluationindex.extract.GovernProjectInfoDTO; import com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity; import com.epmet.feign.EpmetCommonServiceOpenFeignClient; import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectMainDailyService; @@ -678,5 +679,27 @@ public class FactOriginProjectMainDailyServiceImpl extends BaseServiceImpl getGridClosedProjectList(String customerId, + String gridId, + String projectStatus, + String origin, + String isResolved) { + List resultList=baseDao.getGridClosedProjectList(customerId,gridId,projectStatus,origin,isResolved); + return resultList; + } + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/CustomerAgencyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/CustomerAgencyService.java index fd611edf23..176167685c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/CustomerAgencyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/CustomerAgencyService.java @@ -23,4 +23,20 @@ public interface CustomerAgencyService { List queryAgencyListByCustomerId(String customerId); + + /** + * 根据组织id查询基本信息 + * + * @param agencyId + * @return com.epmet.entity.evaluationindex.screen.ScreenCustomerAgencyEntity + */ + CustomerAgencyEntity getAgencyById(String agencyId); + + /** + * 查询部门所属组织信息 + * + * @param deptId + * @return com.epmet.entity.evaluationindex.screen.ScreenCustomerAgencyEntity + */ + CustomerAgencyEntity getAgencyByDeptId(String deptId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerAgencyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerAgencyServiceImpl.java index 5c6b5175b0..b61066f7a7 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerAgencyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerAgencyServiceImpl.java @@ -55,4 +55,26 @@ public class CustomerAgencyServiceImpl implements CustomerAgencyService { public List queryAgencyListByCustomerId(String customerId) { return customerAgencyDao.queryAgencyListByCustomerId(customerId); } + + /** + * 根据组织id查询基本信息 + * + * @param agencyId + * @return com.epmet.entity.evaluationindex.screen.ScreenCustomerAgencyEntity + */ + @Override + public CustomerAgencyEntity getAgencyById(String agencyId) { + return customerAgencyDao.selectById(agencyId); + } + + /** + * 查询部门所属组织信息 + * + * @param deptId + * @return com.epmet.entity.evaluationindex.screen.ScreenCustomerAgencyEntity + */ + @Override + public CustomerAgencyEntity getAgencyByDeptId(String deptId) { + return customerAgencyDao.selectByDeptId(deptId); + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectLogDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectLogDailyDao.xml index 411d959a57..c1b12a7da5 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectLogDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectLogDailyDao.xml @@ -664,4 +664,27 @@ GROUP BY GRID_ID + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml index f17dc573ef..633160b178 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml @@ -963,4 +963,63 @@ GROUP BY AGENCY_ID + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/StatsCustomerAgencyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/StatsCustomerAgencyDao.xml index a7b6c09ae2..771a60ba32 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/StatsCustomerAgencyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/StatsCustomerAgencyDao.xml @@ -132,4 +132,22 @@ where ca.del_flag='0' and ca.CUSTOMER_ID=#{customerId} + + \ No newline at end of file From 566c160ad4a2fe6d03dc10cc9dae86d93fbcfcd4 Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Thu, 27 May 2021 17:38:23 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=9F=BA=E5=B1=82=E6=B2=BB=E7=90=86-?= =?UTF-8?q?=E7=BB=84=E7=BB=87=E7=9A=84=E6=B2=BB=E7=90=86=E6=8C=87=E6=95=B0?= =?UTF-8?q?=EF=BC=8C=E6=8C=89=E5=A4=A9=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../FactAgencyGovernDailyServiceImpl.java | 61 ++++++++++++++++++- 1 file changed, 60 insertions(+), 1 deletion(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactAgencyGovernDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactAgencyGovernDailyServiceImpl.java index 5603dfde68..ba1ee9853d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactAgencyGovernDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactAgencyGovernDailyServiceImpl.java @@ -18,11 +18,25 @@ package com.epmet.service.evaluationindex.extract.todata.impl; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.NumConstant; import com.epmet.dao.evaluationindex.extract.FactAgencyGovernDailyDao; +import com.epmet.dto.extract.result.OrgStatisticsResultDTO; +import com.epmet.dto.stats.DimAgencyDTO; import com.epmet.entity.evaluationindex.extract.FactAgencyGovernDailyEntity; import com.epmet.service.evaluationindex.extract.todata.FactAgencyGovernDailyService; +import com.epmet.service.evaluationindex.extract.todata.FactOriginIssueMainDailyService; +import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectMainDailyService; +import com.epmet.service.evaluationindex.extract.todata.FactOriginTopicMainDailyService; +import com.epmet.service.stats.DimAgencyService; +import com.epmet.util.DimIdGenerator; import org.springframework.stereotype.Service; +import javax.annotation.Resource; +import java.math.BigDecimal; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + /** * 组织的治理指数,按天统计 * @@ -32,6 +46,14 @@ import org.springframework.stereotype.Service; @Service public class FactAgencyGovernDailyServiceImpl extends BaseServiceImpl implements FactAgencyGovernDailyService { + @Resource + private DimAgencyService dimAgencyService; + @Resource + private FactOriginTopicMainDailyService factOriginTopicMainDailyService; + @Resource + private FactOriginIssueMainDailyService factOriginIssueMainDailyService; + @Resource + private FactOriginProjectMainDailyService factOriginProjectMainDailyService; /** * 治理指数-组织相关 @@ -44,8 +66,14 @@ public class FactAgencyGovernDailyServiceImpl extends BaseServiceImpl agencyList = dimAgencyService.getAgencyInfoByCustomerId(customerId); + List agencyGovernDailyList = agencyList.stream().map(agency -> { + FactAgencyGovernDailyEntity entity = initEntity(agency, dateId); + return entity; + }).collect(Collectors.toList()); // 问题解决总数:当前组织下,话题关闭(已解决+无需解决)总数、议题关闭(已解决+无需解决)总数和项目结案(议题转为项目的结案数+项目立项结案数)总数之和 - + Map topicTotal = factOriginTopicMainDailyService.getAgencyClosedTopicCount(customerId, dateId, null, + null); // 党群自治占比:当前组织下,所有小组内关闭(已解决+无需解决)的话题数与问题解决总数之比(未出小组:未转议题的) // 网格自治占比:当前组织下,所有网格内结案项目数与问题解决总数之比(未出网格) // 参考:fact_index_govrn_ablity_grid_monthly的SELF_SOLVE_PROJECT_COUNT计算 @@ -61,4 +89,35 @@ public class FactAgencyGovernDailyServiceImpl extends BaseServiceImpl