|
|
@ -1,9 +1,11 @@ |
|
|
|
package com.epmet.service.impl; |
|
|
|
|
|
|
|
import com.epmet.commons.tools.constant.NumConstant; |
|
|
|
import com.epmet.commons.tools.utils.DateUtils; |
|
|
|
import com.epmet.constant.GroupConstant; |
|
|
|
import com.epmet.dto.AgencySubTreeDto; |
|
|
|
import com.epmet.dto.group.form.AgencyMonthlyFormDTO; |
|
|
|
import com.epmet.dto.group.form.GroupStatsFormDTO; |
|
|
|
import com.epmet.dto.group.result.*; |
|
|
|
import com.epmet.dto.stats.DimAgencyDTO; |
|
|
|
import com.epmet.entity.stats.DimAgencyEntity; |
|
|
@ -56,13 +58,13 @@ public class StatsGroupServiceImpl implements StatsGroupService { |
|
|
|
* @author zxc |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public void groupGridDaily(Date date) { |
|
|
|
public void groupGridDaily(GroupStatsFormDTO formDTO) { |
|
|
|
Integer pageNo = NumConstant.ONE; |
|
|
|
Integer pageSize = NumConstant.ONE_HUNDRED; |
|
|
|
List<String> customerIds; |
|
|
|
do { |
|
|
|
customerIds = dimCustomerService.selectCustomerIdPage(pageNo,pageSize); |
|
|
|
DimIdGenerator.DimIdBean dimIdBean = this.getDimIdBean(date); |
|
|
|
DimIdGenerator.DimIdBean dimIdBean = this.getDimIdBean(formDTO); |
|
|
|
if (customerIds.size() != NumConstant.ZERO){ |
|
|
|
customerIds.forEach(customerId -> { |
|
|
|
try { |
|
|
@ -83,14 +85,14 @@ public class StatsGroupServiceImpl implements StatsGroupService { |
|
|
|
* @author zxc |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public void groupAgencyDaily(Date date) { |
|
|
|
public void groupAgencyDaily(GroupStatsFormDTO formDTO) { |
|
|
|
Integer pageNo = NumConstant.ONE; |
|
|
|
Integer pageSize = NumConstant.ONE_HUNDRED; |
|
|
|
List<String> customerIds; |
|
|
|
do { |
|
|
|
customerIds = dimCustomerService.selectCustomerIdPage(pageNo++,pageSize); |
|
|
|
if (customerIds.size() != NumConstant.ZERO){ |
|
|
|
DimIdGenerator.DimIdBean dimIdBean = this.getDimIdBean(date); |
|
|
|
DimIdGenerator.DimIdBean dimIdBean = this.getDimIdBean(formDTO); |
|
|
|
customerIds.forEach(customerId -> { |
|
|
|
try { |
|
|
|
List<DimAgencyDTO> customerAgencyInfos = dimAgencyService.getAgencyInfoByCustomerId(customerId); |
|
|
@ -109,8 +111,8 @@ public class StatsGroupServiceImpl implements StatsGroupService { |
|
|
|
* @author zxc String customerId |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public void groupAgencyMonthly(Date date) { |
|
|
|
DimIdGenerator.DimIdBean dimIdBean = this.getDimIdBean(date); |
|
|
|
public void groupAgencyMonthly(GroupStatsFormDTO formDTO) { |
|
|
|
DimIdGenerator.DimIdBean dimIdBean = this.getDimIdBean(formDTO); |
|
|
|
String monthId = dimIdBean.getMonthId(); |
|
|
|
List<AgencyMonthlyFormDTO> lastDayAgency = factGroupAgencyDailyService.getLastDayAgency(monthId); |
|
|
|
List<AgencyGroupMonthlyResultDTO> monthGroupIncr = factGroupAgencyDailyService.getMonthGroupIncr(monthId); |
|
|
@ -308,9 +310,9 @@ public class StatsGroupServiceImpl implements StatsGroupService { |
|
|
|
* @param |
|
|
|
* @author zxc |
|
|
|
*/ |
|
|
|
public DimIdGenerator.DimIdBean getDimIdBean(Date date){ |
|
|
|
if (date != null){ |
|
|
|
return DimIdGenerator.getDimIdBean(date); |
|
|
|
public DimIdGenerator.DimIdBean getDimIdBean(GroupStatsFormDTO formDTO){ |
|
|
|
if (formDTO.getDate() != null){ |
|
|
|
return DimIdGenerator.getDimIdBean(DateUtils.parse(formDTO.getDate(),DateUtils.DATE_PATTERN)); |
|
|
|
} |
|
|
|
ZoneId zoneId = ZoneId.systemDefault(); |
|
|
|
LocalDate localDate = LocalDate.now().minusDays(NumConstant.ONE); |
|
|
|