|
|
@ -23,6 +23,7 @@ import com.epmet.service.stats.*; |
|
|
|
import com.epmet.util.DimIdGenerator; |
|
|
|
import com.epmet.util.ModuleConstant; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.apache.commons.collections4.ListUtils; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.springframework.beans.BeanUtils; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
@ -89,10 +90,15 @@ public class StatsGroupServiceImpl implements StatsGroupService { |
|
|
|
DimIdGenerator.DimIdBean dimIdBean = this.getDimIdBean(formDTO); |
|
|
|
if (customerIds.size() != NumConstant.ZERO) { |
|
|
|
customerIds.forEach(customerId -> { |
|
|
|
Boolean status = true; |
|
|
|
try { |
|
|
|
List<GridIdListByCustomerResultDTO> gridsInfo = customerGridService.getCustomerGridIdList(customerId, dimIdBean.getDateId()); |
|
|
|
List<GroupGridDailyResultDTO> resultDTOS = groupDataService.groupGridDaily(customerId, dimIdBean, gridsInfo); |
|
|
|
factGroupGridDailyService.statisticsGroupGridDaily(resultDTOS, customerId); |
|
|
|
List<List<GridIdListByCustomerResultDTO>> partition = ListUtils.partition(gridsInfo, NumConstant.ONE_HUNDRED); |
|
|
|
for (List<GridIdListByCustomerResultDTO> p : partition) { |
|
|
|
List<GroupGridDailyResultDTO> resultDTOS = groupDataService.groupGridDaily(customerId, dimIdBean, p); |
|
|
|
factGroupGridDailyService.statisticsGroupGridDaily(resultDTOS, customerId,status); |
|
|
|
status = false; |
|
|
|
} |
|
|
|
} catch (Exception e) { |
|
|
|
log.error(String.format(GroupConstant.STATS_FAILED_GRID_DAILY, customerId, LocalDate.now(), e)); |
|
|
|
} |
|
|
|