diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactGridMemberStatisticsDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactGridMemberStatisticsDailyDao.java index c32a837324..111f4d923a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactGridMemberStatisticsDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactGridMemberStatisticsDailyDao.java @@ -20,6 +20,7 @@ package com.epmet.dao.evaluationindex.extract; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.entity.evaluationindex.extract.FactGridMemberStatisticsDailyEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; /** * 网格员数据统计_日统计 @@ -29,5 +30,5 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface FactGridMemberStatisticsDailyDao extends BaseDao { - + int deleteDataByCustomer(@Param("customerId") String customerId, @Param("dateId") String dateId, @Param("deleteSize") Integer deleteSize); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueLogDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueLogDailyDao.java index 7154f5997e..5e9177adf7 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueLogDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueLogDailyDao.java @@ -20,6 +20,7 @@ package com.epmet.dao.evaluationindex.extract; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.extract.form.IssueLogDailyFormDTO; import com.epmet.dto.extract.result.IssueVoteUserCountResultDTO; +import com.epmet.dto.extract.result.OrgStatisticsResultDTO; import com.epmet.dto.extract.result.PartyActiveResultDTO; import com.epmet.entity.evaluationindex.extract.FactOriginIssueLogDailyEntity; import org.apache.ibatis.annotations.Mapper; @@ -130,4 +131,43 @@ public interface FactOriginIssueLogDailyDao extends BaseDao + */ + List getIssueToProjectCount(@Param("customerId") String customerId, @Param("dateId") String dateId); + + /** + * 议题转项目增量 + * @author zhaoqifeng + * @date 2021/7/5 15:55 + * @param customerId + * @param dateId + * @return java.util.List + */ + List getIssueToProjectIncr(@Param("customerId") String customerId, @Param("dateId") String dateId); + + /** + * 关闭议题数总量 + * @author zhaoqifeng + * @date 2021/7/5 16:37 + * @param customerId + * @param dateId + * @return java.util.List + */ + List getClosedIssueCount(@Param("customerId") String customerId, @Param("dateId") String dateId); + + /** + * 关闭议题数增量 + * @author zhaoqifeng + * @date 2021/7/5 16:38 + * @param customerId + * @param dateId + * @return java.util.List + */ + List getClosedIssueIncr(@Param("customerId") String customerId, @Param("dateId") String dateId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectLogDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectLogDailyDao.java index 3bdbc200bd..45f3ba2350 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 @@ -326,4 +326,59 @@ public interface FactOriginProjectLogDailyDao extends BaseDao + */ + List getProjectResponseCount(@Param("customerId") String customerId, @Param("dateId") String dateId); + /** + * 项目响应增量 + * @author zhaoqifeng + * @date 2021/7/5 17:01 + * @param customerId + * @param dateId + * @return java.util.List + */ + List getProjectResponseIncr(@Param("customerId") String customerId, @Param("dateId") String dateId); + /** + * 项目吹哨数 + * @author zhaoqifeng + * @date 2021/7/5 17:01 + * @param customerId + * @param dateId + * @return java.util.List + */ + List getProjectTransferCount(@Param("customerId") String customerId, @Param("dateId") String dateId); + /** + * 项目吹哨数增量 + * @author zhaoqifeng + * @date 2021/7/5 17:01 + * @param customerId + * @param dateId + * @return java.util.List + */ + List getProjectTransferIncr(@Param("customerId") String customerId, @Param("dateId") String dateId); + /** + * 项目结案数 + * @author zhaoqifeng + * @date 2021/7/5 17:01 + * @param customerId + * @param dateId + * @return java.util.List + */ + List getProjectClosedCount(@Param("customerId") String customerId, @Param("dateId") String dateId); + /** + * 项目结案数增量 + * @author zhaoqifeng + * @date 2021/7/5 17:01 + * @param customerId + * @param dateId + * @return java.util.List + */ + List getProjectClosedIncr(@Param("customerId") String customerId, @Param("dateId") String dateId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginProjectMainDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginProjectMainDailyEntity.java index be69a89f3d..aa3f6e3ca2 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginProjectMainDailyEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginProjectMainDailyEntity.java @@ -148,4 +148,9 @@ public class FactOriginProjectMainDailyEntity extends BaseEpmetEntity { */ private String finishOrgIds; + /** + * 项目创建人(议题转项目或立项人) + */ + private String projectCreator; + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginIssueLogDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginIssueLogDailyService.java index 5bb46392f6..755b53adb1 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginIssueLogDailyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginIssueLogDailyService.java @@ -19,9 +19,11 @@ package com.epmet.service.evaluationindex.extract.todata; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.dto.extract.result.IssueVoteUserCountResultDTO; +import com.epmet.dto.extract.result.OrgStatisticsResultDTO; import com.epmet.entity.evaluationindex.extract.FactOriginIssueLogDailyEntity; import java.util.List; +import java.util.Map; /** * 议题记录附表 @@ -77,4 +79,26 @@ public interface FactOriginIssueLogDailyService extends BaseService> + */ + Map> getIssueToProjectCount(String customerId, String dateId, Integer type); + + /** + * 工作人员关闭议题数 + * @author zhaoqifeng + * @date 2021/7/5 16:40 + * @param customerId + * @param dateId + * @param type + * @return java.util.Map> + */ + Map> getClosedIssueCount(String customerId, String dateId, Integer type); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectLogDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectLogDailyService.java index b925cc31e4..2d95509fca 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 @@ -330,4 +330,37 @@ public interface FactOriginProjectLogDailyService extends BaseService */ Map getAgencyGridSelfDaily(String customerId, String dateId); + + /** + * 项目响应数 + * @author zhaoqifeng + * @date 2021/7/5 16:56 + * @param customerId + * @param dateId + * @param type + * @return java.util.Map> + */ + Map> getProjectResponseCount(String customerId, String dateId, Integer type); + + /** + * 项目吹哨数 + * @author zhaoqifeng + * @date 2021/7/5 16:57 + * @param customerId + * @param dateId + * @param type + * @return java.util.Map> + */ + Map> getProjectTransferCount(String customerId, String dateId, Integer type); + + /** + * 项目结案数 + * @author zhaoqifeng + * @date 2021/7/5 16:57 + * @param customerId + * @param dateId + * @param type + * @return java.util.Map> + */ + Map> getProjectClosedCount(String customerId, String dateId, Integer type); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactGridMemberStatisticsDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactGridMemberStatisticsDailyServiceImpl.java index 6facddb614..e87f0a6459 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactGridMemberStatisticsDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactGridMemberStatisticsDailyServiceImpl.java @@ -19,6 +19,7 @@ package com.epmet.service.evaluationindex.extract.todata.impl; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.constant.IndexCalConstant; import com.epmet.constant.RoleKeyConstants; import com.epmet.dao.evaluationindex.extract.FactGridMemberStatisticsDailyDao; import com.epmet.dto.extract.result.OrgStatisticsResultDTO; @@ -26,6 +27,8 @@ import com.epmet.dto.org.CustomerStaffGridDTO; import com.epmet.dto.user.result.StaffRoleInfoDTO; import com.epmet.entity.evaluationindex.extract.FactGridMemberStatisticsDailyEntity; import com.epmet.service.evaluationindex.extract.todata.FactGridMemberStatisticsDailyService; +import com.epmet.service.evaluationindex.extract.todata.FactOriginIssueLogDailyService; +import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectLogDailyService; import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectMainDailyService; import com.epmet.service.org.CustomerGridService; import com.epmet.service.user.UserService; @@ -54,6 +57,10 @@ public class FactGridMemberStatisticsDailyServiceImpl extends BaseServiceImpl> projectIncrMap = factOriginProjectMainDailyService.getMemberProjectCount(customerId, dateId, NumConstant.ONE); //议题转项目数 + Map> issueToProjectCountMap = factOriginIssueLogDailyService.getIssueToProjectCount(customerId, dateId, + NumConstant.ZERO); + Map> issueToProjectIncrMap = factOriginIssueLogDailyService.getIssueToProjectCount(customerId, dateId, + NumConstant.ONE); //议题关闭数 + Map> closedIssueCountMap = factOriginIssueLogDailyService.getClosedIssueCount(customerId, dateId, + NumConstant.ZERO); + Map> closedIssueIncrMap = factOriginIssueLogDailyService.getClosedIssueCount(customerId, dateId, + NumConstant.ONE); //项目响应数 + Map> projectResponseCountMap = factOriginProjectLogDailyService.getProjectResponseCount(customerId, + dateId, NumConstant.ZERO); + Map> projectResponseIncrMap = factOriginProjectLogDailyService.getProjectResponseCount(customerId, dateId + , NumConstant.ONE); //项目吹哨数 + Map> projectTransferCountMap = factOriginProjectLogDailyService.getProjectTransferCount(customerId, + dateId, NumConstant.ZERO); + Map> projectTransferIncrMap = factOriginProjectLogDailyService.getProjectTransferCount(customerId, dateId + , NumConstant.ONE); //项目结案数 + Map> projectClosedCountMap = factOriginProjectLogDailyService.getProjectClosedCount(customerId, + dateId, NumConstant.ZERO); + Map> projectClosedIncrMap = factOriginProjectLogDailyService.getProjectClosedCount(customerId, dateId + , NumConstant.ONE); list.forEach(item -> { + //项目立项数 List projectCount = projectCountMap.get(item.getStaffId()); if (CollectionUtils.isNotEmpty(projectCount)) { projectCount.forEach(dto -> { @@ -118,7 +146,7 @@ public class FactGridMemberStatisticsDailyServiceImpl extends BaseServiceImpl projectIncr = projectIncrMap.get(item.getStaffId()); if (CollectionUtils.isNotEmpty(projectIncr)) { projectIncr.forEach(dto -> { @@ -127,8 +155,107 @@ public class FactGridMemberStatisticsDailyServiceImpl extends BaseServiceImpl issueToProjectCount = issueToProjectCountMap.get(item.getStaffId()); + if (CollectionUtils.isNotEmpty(issueToProjectCount)) { + issueToProjectCount.forEach(dto -> { + if (item.getGridId().equals(dto.getOrgId())) { + item.setIssueToProjectCount(dto.getCount()); + } + }); + } + //议题转项目日增量 + List issueToProjectIncr = issueToProjectIncrMap.get(item.getStaffId()); + if (CollectionUtils.isNotEmpty(issueToProjectIncr)) { + issueToProjectIncr.forEach(dto -> { + if (item.getGridId().equals(dto.getOrgId())) { + item.setIssueToProjectIncr(dto.getCount()); + } + }); + } + //议题关闭数 + List closedIssueCount = closedIssueCountMap.get(item.getStaffId()); + if (CollectionUtils.isNotEmpty(closedIssueCount)) { + closedIssueCount.forEach(dto -> { + if (item.getGridId().equals(dto.getOrgId())) { + item.setClosedIssueCount(dto.getCount()); + } + }); + } + //议题关闭数日增量 + List closedIssueIncr = closedIssueIncrMap.get(item.getStaffId()); + if (CollectionUtils.isNotEmpty(closedIssueIncr)) { + closedIssueIncr.forEach(dto -> { + if (item.getGridId().equals(dto.getOrgId())) { + item.setClosedIssueIncr(dto.getCount()); + } + }); + } + //项目响应数 + List projectResponseCount = projectResponseCountMap.get(item.getStaffId()); + if (CollectionUtils.isNotEmpty(projectResponseCount)) { + projectResponseCount.forEach(dto -> { + if (item.getGridId().equals(dto.getOrgId())) { + item.setProjectResponseCount(dto.getCount()); + } + }); + } + //项目响应数日增量 + List projectResponseIncr = projectResponseIncrMap.get(item.getStaffId()); + if (CollectionUtils.isNotEmpty(projectResponseIncr)) { + projectResponseIncr.forEach(dto -> { + if (item.getGridId().equals(dto.getOrgId())) { + item.setProjectResponseIncr(dto.getCount()); + } + }); + } + //项目吹哨数 + List projectTransferCount = projectTransferCountMap.get(item.getStaffId()); + if (CollectionUtils.isNotEmpty(projectTransferCount)) { + projectTransferCount.forEach(dto -> { + if (item.getGridId().equals(dto.getOrgId())) { + item.setProjectTransferCount(dto.getCount()); + } + }); + } + //项目吹哨数日增量 + List projectTransferIncr = projectTransferIncrMap.get(item.getStaffId()); + if (CollectionUtils.isNotEmpty(projectTransferIncr)) { + projectTransferIncr.forEach(dto -> { + if (item.getGridId().equals(dto.getOrgId())) { + item.setProjectTransferIncr(dto.getCount()); + } + }); + } + //项目响应数 + List projectClosedCount = projectClosedCountMap.get(item.getStaffId()); + if (CollectionUtils.isNotEmpty(projectClosedCount)) { + projectClosedCount.forEach(dto -> { + if (item.getGridId().equals(dto.getOrgId())) { + item.setProjectClosedCount(dto.getCount()); + } + }); + } + //项目响应数日增量 + List projectClosedIncr = projectClosedIncrMap.get(item.getStaffId()); + if (CollectionUtils.isNotEmpty(projectClosedIncr)) { + projectClosedIncr.forEach(dto -> { + if (item.getGridId().equals(dto.getOrgId())) { + item.setProjectClosedIncr(dto.getCount()); + } + }); + } }); + + if (CollectionUtils.isNotEmpty(list)) { + int deleteNum; + do { + deleteNum = baseDao.deleteDataByCustomer(customerId, dateId, IndexCalConstant.DELETE_SIZE); + } while (deleteNum != NumConstant.ZERO); + //删除旧数据 + insertBatch(list); + } } } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginIssueLogDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginIssueLogDailyServiceImpl.java index 9bde7a5a94..e05775938e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginIssueLogDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginIssueLogDailyServiceImpl.java @@ -25,6 +25,7 @@ import com.epmet.constant.DataSourceConstant; import com.epmet.constant.OrgTypeConstant; import com.epmet.dao.evaluationindex.extract.FactOriginIssueLogDailyDao; import com.epmet.dto.extract.result.IssueVoteUserCountResultDTO; +import com.epmet.dto.extract.result.OrgStatisticsResultDTO; import com.epmet.dto.stats.DimAgencyDTO; import com.epmet.entity.evaluationindex.extract.FactOriginIssueLogDailyEntity; import com.epmet.service.evaluationindex.extract.todata.FactOriginIssueLogDailyService; @@ -32,8 +33,12 @@ import com.epmet.service.stats.DimAgencyService; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; +import java.util.Collections; import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; /** * 议题记录附表 @@ -115,4 +120,52 @@ public class FactOriginIssueLogDailyServiceImpl extends BaseServiceImpl> + * @author zhaoqifeng + * @date 2021/7/5 15:52 + */ + @Override + public Map> getIssueToProjectCount(String customerId, String dateId, Integer type) { + List list; + if (type == NumConstant.ZERO) { + list = baseDao.getIssueToProjectCount(customerId, dateId); + } else { + list = baseDao.getIssueToProjectIncr(customerId, dateId); + } + if (CollectionUtils.isEmpty(list)) { + return Collections.emptyMap(); + } + return list.stream().collect(Collectors.groupingBy(OrgStatisticsResultDTO::getStaffId)); + } + + /** + * 工作人员关闭议题数 + * + * @param customerId + * @param dateId + * @param type + * @return java.util.Map> + * @author zhaoqifeng + * @date 2021/7/5 16:40 + */ + @Override + public Map> getClosedIssueCount(String customerId, String dateId, Integer type) { + List list; + if (type == NumConstant.ZERO) { + list = baseDao.getClosedIssueCount(customerId, dateId); + } else { + list = baseDao.getClosedIssueIncr(customerId, dateId); + } + if (CollectionUtils.isEmpty(list)) { + return Collections.emptyMap(); + } + return list.stream().collect(Collectors.groupingBy(OrgStatisticsResultDTO::getStaffId)); + } } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectLogDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectLogDailyServiceImpl.java index 73de4eb905..311da04715 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 @@ -433,5 +433,77 @@ public class FactOriginProjectLogDailyServiceImpl extends BaseServiceImpl> + * @author zhaoqifeng + * @date 2021/7/5 16:56 + */ + @Override + public Map> getProjectResponseCount(String customerId, String dateId, Integer type) { + List list; + if (type == NumConstant.ZERO) { + list = baseDao.getProjectResponseCount(customerId, dateId); + } else { + list = baseDao.getProjectResponseIncr(customerId, dateId); + } + if (CollectionUtils.isEmpty(list)) { + return Collections.emptyMap(); + } + return list.stream().collect(Collectors.groupingBy(OrgStatisticsResultDTO::getStaffId)); + } + + /** + * 项目吹哨数 + * + * @param customerId + * @param dateId + * @param type + * @return java.util.Map> + * @author zhaoqifeng + * @date 2021/7/5 16:57 + */ + @Override + public Map> getProjectTransferCount(String customerId, String dateId, Integer type) { + List list; + if (type == NumConstant.ZERO) { + list = baseDao.getProjectTransferCount(customerId, dateId); + } else { + list = baseDao.getProjectTransferIncr(customerId, dateId); + } + if (CollectionUtils.isEmpty(list)) { + return Collections.emptyMap(); + } + return list.stream().collect(Collectors.groupingBy(OrgStatisticsResultDTO::getStaffId)); + } + + /** + * 项目结案数 + * + * @param customerId + * @param dateId + * @param type + * @return java.util.Map> + * @author zhaoqifeng + * @date 2021/7/5 16:57 + */ + @Override + public Map> getProjectClosedCount(String customerId, String dateId, Integer type) { + List list; + if (type == NumConstant.ZERO) { + list = baseDao.getProjectClosedCount(customerId, dateId); + } else { + list = baseDao.getProjectClosedIncr(customerId, dateId); + } + if (CollectionUtils.isEmpty(list)) { + return Collections.emptyMap(); + } + return list.stream().collect(Collectors.groupingBy(OrgStatisticsResultDTO::getStaffId)); + } + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java index ef8e592bc8..65980d157a 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 @@ -732,7 +732,7 @@ public class FactOriginProjectMainDailyServiceImpl extends BaseServiceImpl pendingList = factOriginProjectMainDailyService.getPendingList(customerId); List finishOrgList = projectProcessService.getFinishOrg(customerId, dateString); if (!CollectionUtils.isEmpty(closedList)) { - List closeProjects = - pendingList.stream().flatMap(pending -> closedList.stream().filter(closed -> pending.getId().equals(closed.getProjectId())).map(process -> { - FactOriginProjectMainDailyEntity entity = new FactOriginProjectMainDailyEntity(); - entity.setId(process.getProjectId()); - entity.setProjectStatus(ProjectConstant.CLOSED); - entity.setCreatedTime(DateUtils.stringToDate(pending.getDateId(), DateUtils.DATE_PATTERN_YYYYMMDD)); - entity.setUpdatedTime(process.getUpdatedTime()); - entity.setIsResolved(process.getIsResolved()); - return entity; - })).collect(Collectors.toList()); - - if (!CollectionUtils.isEmpty(finishOrgList)) { - closeProjects.forEach(close -> finishOrgList.stream().filter(finish -> close.getId().equals(finish.getProjectId())).forEach(dto -> { - String[] orgIds = dto.getPIdPath().split(StrConstant.COLON); - String org = ""; - //取最短的ordIds中最后一个 则为最高级的那个orgIds - if (orgIds.length > NumConstant.ONE) { - org = orgIds[orgIds.length - 1]; - } else { - org = orgIds[0]; - } - if (StringUtils.isNotEmpty(dto.getGridId())) { - org = org + StrConstant.COLON + dto.getGridId(); - } else if (StringUtils.isNotEmpty(dto.getDepartmentId())) { - org = org + StrConstant.COLON + dto.getDepartmentId(); - } - close.setFinishOrgIds(org); - })); - } - //更新状态 - if (!closeProjects.isEmpty()) { - factOriginProjectMainDailyService.updateBatchById(closeProjects); + if(!CollectionUtils.isEmpty(pendingList)) { + List closeProjects = + pendingList.stream().flatMap(pending -> closedList.stream().filter(closed -> pending.getId().equals(closed.getProjectId())).map(process -> { + FactOriginProjectMainDailyEntity entity = new FactOriginProjectMainDailyEntity(); + entity.setId(process.getProjectId()); + entity.setProjectStatus(ProjectConstant.CLOSED); + entity.setCreatedTime(DateUtils.stringToDate(pending.getDateId(), DateUtils.DATE_PATTERN_YYYYMMDD)); + entity.setUpdatedTime(process.getUpdatedTime()); + entity.setIsResolved(process.getIsResolved()); + return entity; + })).collect(Collectors.toList()); + if (!CollectionUtils.isEmpty(finishOrgList)) { + closeProjects.forEach(close -> finishOrgList.stream().filter(finish -> close.getId().equals(finish.getProjectId())).forEach(dto -> { + String[] orgIds = dto.getPIdPath().split(StrConstant.COLON); + String org = ""; + //取最短的ordIds中最后一个 则为最高级的那个orgIds + if (orgIds.length > NumConstant.ONE) { + org = orgIds[orgIds.length - 1]; + } else { + org = orgIds[0]; + } + if (StringUtils.isNotEmpty(dto.getGridId())) { + org = org + StrConstant.COLON + dto.getGridId(); + } else if (StringUtils.isNotEmpty(dto.getDepartmentId())) { + org = org + StrConstant.COLON + dto.getDepartmentId(); + } + close.setFinishOrgIds(org); + })); + } + //更新状态 + if (!closeProjects.isEmpty()) { + factOriginProjectMainDailyService.updateBatchById(closeProjects); + } } } //获取项目信息 @@ -177,6 +178,7 @@ public class ProjectExtractServiceImpl implements ProjectExtractService { } entity.setIsParty(NumConstant.ZERO_STR); entity.setIsOverdue(NumConstant.ZERO_STR); + entity.setProjectCreator(project.getCreatedBy()); return entity; }).collect(Collectors.toList()); if (CollectionUtils.isNotEmpty(issueList)) { diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactGridMemberStatisticsDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactGridMemberStatisticsDailyDao.xml index fc2236377a..8a43152a4b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactGridMemberStatisticsDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactGridMemberStatisticsDailyDao.xml @@ -28,6 +28,12 @@ + + delete from fact_grid_member_statistics_daily + where CUSTOMER_ID = #{customerId} + AND DATE_ID = #{dateId} + limit #{deleteSize} + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueLogDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueLogDailyDao.xml index 521ef174e4..995c6cebad 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueLogDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueLogDailyDao.xml @@ -177,4 +177,64 @@ and M.IS_PARTY=#{isParty} + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectLogDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectLogDailyDao.xml index b5a2fe362f..1f440c14cc 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 @@ -737,4 +737,106 @@ GROUP BY da.ID + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectDao.xml index 18ba4d2a0f..f73f12eb5f 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 @@ -86,6 +86,7 @@ STATUS, CLOSED_STATUS, ORG_ID_PATH, + CREATED_BY, CREATED_TIME, UPDATED_TIME FROM project