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 c983812f2a..803b93525e 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 @@ -14,6 +14,7 @@ import com.epmet.dao.evaluationindex.indexcoll.FactIndexServiceAblityGridMonthly import com.epmet.dao.evaluationindex.screen.ScreenCustomerGridDao; import com.epmet.dao.stats.DimCustomerDao; import com.epmet.dao.stats.DimDateDao; +import com.epmet.dao.stats.DimMonthDao; import com.epmet.dto.AgencySubTreeDto; import com.epmet.dto.extract.form.ExtractFormDTO; import com.epmet.dto.indexcal.CalculateCommonFormDTO; @@ -25,7 +26,9 @@ import com.epmet.entity.evaluationindex.screen.ScreenCustomerGridEntity; import com.epmet.entity.stats.DimAgencyEntity; import com.epmet.entity.stats.DimCustomerEntity; import com.epmet.entity.stats.DimDateEntity; +import com.epmet.entity.stats.DimMonthEntity; import com.epmet.service.StatsDemoService; +import com.epmet.service.evaluationindex.extract.CalCpcIndexService; import com.epmet.service.evaluationindex.extract.CalGridIndexService; import com.epmet.service.evaluationindex.extract.FactOriginProjectLogDailyService; import com.epmet.service.evaluationindex.extract.FactOriginTopicMainDailyService; @@ -82,6 +85,8 @@ public class DemoController { @Autowired private DimDateDao dimDateDao; @Autowired + private DimMonthDao dimMonthDao; + @Autowired private DimCustomerDao dimCustomerDao; @Autowired private FactOriginTopicMainDailyService factOriginTopicMainDailyService; @@ -571,5 +576,43 @@ public class DemoController { ); } + @Autowired + private CalCpcIndexService calCpcIndexService; + + @PostMapping("calCpcPartyAbility") + public Result calCpcPartyAbility(@RequestParam("customerId") String customerId, @RequestParam("monthId")String monthId) { + if (StringUtils.isNotBlank(customerId) && StringUtils.isNotBlank(monthId)) { + calCpcIndexService.calCpcPartyAbility(customerId,monthId); + }else{ + QueryWrapper customerEntityQueryWrapper = new QueryWrapper<>(); + List customerEntityList=dimCustomerDao.selectList(customerEntityQueryWrapper); + QueryWrapper wrapper = new QueryWrapper<>(); + List dimMonthEntityList= dimMonthDao.selectList(wrapper); + for(DimCustomerEntity customerEntity:customerEntityList){ + for(DimMonthEntity monthEntity:dimMonthEntityList) { + calCpcIndexService.calCpcPartyAbility(customerEntity.getId(),monthEntity.getId()); + } + } + } + return new Result(); + } + + @PostMapping("calGridIndexServiceAbility") + public Result calGridIndexServiceAbility(@RequestParam("customerId") String customerId, @RequestParam("monthId")String monthId) { + if (StringUtils.isNotBlank(customerId) && StringUtils.isNotBlank(monthId)) { + calGridIndexService.calGridIndexServiceAbility(customerId,monthId); + }else{ + QueryWrapper customerEntityQueryWrapper = new QueryWrapper<>(); + List customerEntityList=dimCustomerDao.selectList(customerEntityQueryWrapper); + QueryWrapper wrapper = new QueryWrapper<>(); + List dimMonthEntityList= dimMonthDao.selectList(wrapper); +// for(DimCustomerEntity customerEntity:customerEntityList){ + for(DimMonthEntity monthEntity:dimMonthEntityList) { + calGridIndexService.calGridIndexServiceAbility("3ef7e4bb195eb9e622d68b52509aa940",monthEntity.getId()); + } +// } + } + return new Result(); + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/CalGridIndexServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/CalGridIndexServiceImpl.java index 8093d38d03..46fa256caf 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/CalGridIndexServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/CalGridIndexServiceImpl.java @@ -404,7 +404,7 @@ public class CalGridIndexServiceImpl implements CalGridIndexService { //1、构造好初始数据,各指标赋值0 List entityList=factIndexServiceAbilityGridMonthlyService.initAllGridList(customerId); if(CollectionUtils.isEmpty(entityList)){ - log.info("screen_customer_grid do not any records"); + log.info("customerId:"+customerId+",screen_customer_grid do not any records"); return true; } String quarterId= DateUtils.getQuarterId(monthId); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/FactIndexServiceAbilityGridMonthlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/FactIndexServiceAbilityGridMonthlyServiceImpl.java index 7bbf688492..fc18939393 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/FactIndexServiceAbilityGridMonthlyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/FactIndexServiceAbilityGridMonthlyServiceImpl.java @@ -32,6 +32,7 @@ public class FactIndexServiceAbilityGridMonthlyServiceImpl implements FactIndexS * @Date 2020/9/21 9:38 **/ @Override + @DataSource(DataSourceConstant.EVALUATION_INDEX) public List initAllGridList(String customerId) { return baseDao.initAllGridList(customerId); } @@ -44,6 +45,7 @@ public class FactIndexServiceAbilityGridMonthlyServiceImpl implements FactIndexS * @Date 2020/9/21 10:05 **/ @Override + @DataSource(DataSourceConstant.EVALUATION_INDEX) public void insertBatchEntity(List list) { baseDao.insertBatchEntity(list); }