Browse Source

机关项目日统计程序调整优化

dev
sunyuchao 4 years ago
parent
commit
15216eccf6
  1. 8
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsProjectServiceImpl.java

8
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsProjectServiceImpl.java

@ -336,7 +336,7 @@ public class StatsProjectServiceImpl implements StatsProjectService {
} }
}); });
//1.4:封装机关日数据对象 //4-3.封装机关日数据对象
FactAgencyProjectDailyEntity entity = new FactAgencyProjectDailyEntity(); FactAgencyProjectDailyEntity entity = new FactAgencyProjectDailyEntity();
if (mapList.containsKey(agency.getId())) { if (mapList.containsKey(agency.getId())) {
entity = mapList.get(agency.getId()); entity = mapList.get(agency.getId());
@ -374,16 +374,16 @@ public class StatsProjectServiceImpl implements StatsProjectService {
} while (!CollectionUtil.isEmpty(projectList) && projectList.size() == NumConstant.ONE_THOUSAND); } while (!CollectionUtil.isEmpty(projectList) && projectList.size() == NumConstant.ONE_THOUSAND);
List<FactAgencyProjectDailyEntity> projectDateEntityList = new ArrayList<>(mapList.values()); List<FactAgencyProjectDailyEntity> projectDateEntityList = new ArrayList<>(mapList.values());
//2:批量保存数据,先删后增 //三、批量保存数据,先删后增
if (null != projectDateEntityList && projectDateEntityList.size() > NumConstant.ZERO) { if (null != projectDateEntityList && projectDateEntityList.size() > NumConstant.ZERO) {
//2.1:根据客户Id、日维度Id批量物理删除一下可能存在的历史数据 //5:根据客户Id、日维度Id批量物理删除一下可能存在的历史数据
FactAgencyProjectDailyEntity delEntity = new FactAgencyProjectDailyEntity(); FactAgencyProjectDailyEntity delEntity = new FactAgencyProjectDailyEntity();
delEntity.setCustomerId(customerId); delEntity.setCustomerId(customerId);
delEntity.setDateId(dimId.getDateId()); delEntity.setDateId(dimId.getDateId());
log.info("StatsProjectServiceImpl.agencyDateProjectStats-根据客户Id、日维度Id批量删除机关项目日统计表数据,对应客户Id:" + customerId + ",日维度Id:" + dimId.getDateId()); log.info("StatsProjectServiceImpl.agencyDateProjectStats-根据客户Id、日维度Id批量删除机关项目日统计表数据,对应客户Id:" + customerId + ",日维度Id:" + dimId.getDateId());
factAgencyProjectDailyService.delDateProject(delEntity); factAgencyProjectDailyService.delDateProject(delEntity);
//2.2:批量保存机关日统计数据 //6:批量保存机关日统计数据
log.info("StatsProjectServiceImpl.agencyDateProjectStats-批量新增机关项目日统计表数据,对应客户Id:" + customerId + ",日维度Id:" + dimId.getDateId()); log.info("StatsProjectServiceImpl.agencyDateProjectStats-批量新增机关项目日统计表数据,对应客户Id:" + customerId + ",日维度Id:" + dimId.getDateId());
factAgencyProjectDailyService.insertBatch(projectDateEntityList); factAgencyProjectDailyService.insertBatch(projectDateEntityList);
} }

Loading…
Cancel
Save