|
|
@ -12,6 +12,7 @@ import com.epmet.entity.project.ProjectProcessEntity; |
|
|
|
import com.epmet.entity.stats.*; |
|
|
|
import com.epmet.service.Issue.IssueService; |
|
|
|
import com.epmet.service.StatsProjectService; |
|
|
|
import com.epmet.service.org.CustomerGridService; |
|
|
|
import com.epmet.service.project.ProjectProcessService; |
|
|
|
import com.epmet.service.project.ProjectService; |
|
|
|
import com.epmet.service.stats.*; |
|
|
@ -29,6 +30,7 @@ import java.text.NumberFormat; |
|
|
|
import java.text.SimpleDateFormat; |
|
|
|
import java.util.*; |
|
|
|
import java.util.concurrent.atomic.AtomicInteger; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
/** |
|
|
|
* 数据统计-项目(独立于任何具体数据源外层的service) |
|
|
@ -59,6 +61,8 @@ public class StatsProjectServiceImpl implements StatsProjectService { |
|
|
|
private FactGridProjectDailyService factGridProjectDailyService; |
|
|
|
@Autowired |
|
|
|
private FactGridProjectMonthlyService factGridProjectMonthlyService; |
|
|
|
@Autowired |
|
|
|
private CustomerGridService customerGridService; |
|
|
|
|
|
|
|
/** |
|
|
|
* @Author sun |
|
|
@ -123,6 +127,31 @@ public class StatsProjectServiceImpl implements StatsProjectService { |
|
|
|
log.info("StatsProjectServiceImpl.customerAgencyStats-根据客户Id查询项目进展表业务数据,对应客户Id:" + customerId); |
|
|
|
List<ProjectProcessEntity> processList = projectProcessService.getProcessList(projectEntity); |
|
|
|
|
|
|
|
//20210721 sun 业务逻辑调整,网格删除,组织没有删除情况,相应的组织层级数据统计应舍弃以删除网格数据 start
|
|
|
|
//处理逻辑:查询已删除网格下项目Id,将已查询的项目、节点数据中的脏数据剔除【项目库有张表有网格Id,可以查出每个项目所属网格,但是关联该表后sql查询效率极低固舍弃此方案】
|
|
|
|
//4-1.查询客户下已删除网格列表下存在的项目Id集合
|
|
|
|
List<String> list = customerGridService.getdelGridProjectIdList(customerId); |
|
|
|
if (list.size() > NumConstant.ZERO) { |
|
|
|
Map<String, String> map = list.stream().collect(Collectors.toMap(String::toString, v -> v, (c1, c2) -> c1)); |
|
|
|
//4-2.遍历删除项目主表查询的无效数据
|
|
|
|
Iterator<ProjectEntity> proiter = projectList.iterator(); |
|
|
|
while (proiter.hasNext()) { |
|
|
|
ProjectEntity next = proiter.next(); |
|
|
|
if (map.containsKey(next.getId())) { |
|
|
|
proiter.remove(); |
|
|
|
} |
|
|
|
} |
|
|
|
//4-3.遍历删除项目节点表查询的无效数据
|
|
|
|
Iterator<ProjectProcessEntity> iterator = processList.iterator(); |
|
|
|
while (iterator.hasNext()) { |
|
|
|
ProjectProcessEntity next = iterator.next(); |
|
|
|
if (map.containsKey(next.getProjectId())) { |
|
|
|
iterator.remove(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
//20210721 sun end
|
|
|
|
|
|
|
|
//5:机关层级日月统计
|
|
|
|
if (null != dimAgencyList && dimAgencyList.size() > NumConstant.ZERO) { |
|
|
|
//5.1:执行机关日数据统计
|
|
|
|