|
@ -133,9 +133,11 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private Date getStatsDateFromParam(StatsFormDTO formDTO) { |
|
|
private Date getStatsDateFromParam(StatsFormDTO formDTO) { |
|
|
Date statsDate = DateUtils.integrate(DateUtils.addDateDays(statsDate, -NumConstant.ONE), DateUtils.DATE_PATTERN); |
|
|
Date statsDate = null; |
|
|
if (null != formDTO && StringUtils.isNotBlank(formDTO.getDate())) { |
|
|
if (null != formDTO && StringUtils.isNotBlank(formDTO.getDate())) { |
|
|
statsDate = DateUtils.parse(formDTO.getDate(), DateUtils.DATE_PATTERN); |
|
|
statsDate = DateUtils.parse(formDTO.getDate(), DateUtils.DATE_PATTERN); |
|
|
|
|
|
} else { |
|
|
|
|
|
statsDate = DateUtils.integrate(DateUtils.addDateDays(statsDate, -NumConstant.ONE), DateUtils.DATE_PATTERN); |
|
|
} |
|
|
} |
|
|
return statsDate; |
|
|
return statsDate; |
|
|
} |
|
|
} |
|
@ -191,47 +193,41 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { |
|
|
DimIdGenerator.DimIdBean dimIdBean = DimIdGenerator.getDimIdBean(statsDate); |
|
|
DimIdGenerator.DimIdBean dimIdBean = DimIdGenerator.getDimIdBean(statsDate); |
|
|
|
|
|
|
|
|
if (null != formDTO && StringUtils.isNotBlank(formDTO.getCustomerId())) { |
|
|
if (null != formDTO && StringUtils.isNotBlank(formDTO.getCustomerId())) { |
|
|
|
|
|
|
|
|
try { |
|
|
try { |
|
|
statsTagUsedMonthly(dimIdBean.getMonthId(), formDTO.getCustomerId()); |
|
|
statsTagUsedMonthly(dimIdBean.getMonthId(), formDTO.getCustomerId()); |
|
|
} catch (Exception e) { |
|
|
} catch (Exception e) { |
|
|
log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "tagUsedMonthlyStatsjob", formDTO.getCustomerId(), dimIdBean.getMonthId()), e); |
|
|
log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "tagUsedMonthlyStatsjob", formDTO.getCustomerId(), dimIdBean.getMonthId()), e); |
|
|
} |
|
|
} |
|
|
} |
|
|
} else { |
|
|
} else |
|
|
int pageNo = NumConstant.ONE; |
|
|
|
|
|
int pageSize = NumConstant.ONE_HUNDRED; |
|
|
{ |
|
|
List<String> customerIdList = null; |
|
|
int pageNo = NumConstant.ONE; |
|
|
do { |
|
|
int pageSize = NumConstant.ONE_HUNDRED; |
|
|
customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize); |
|
|
List<String> customerIdList = null; |
|
|
if (!CollectionUtils.isEmpty(customerIdList)) { |
|
|
do { |
|
|
for (String customerId : customerIdList) { |
|
|
customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize); |
|
|
try { |
|
|
if (!CollectionUtils.isEmpty(customerIdList)) { |
|
|
statsTagUsedMonthly(dimIdBean.getMonthId(), customerId); |
|
|
for (String customerId : customerIdList) { |
|
|
} catch (Exception e) { |
|
|
try { |
|
|
log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "tagUsedMonthlyStatsjob", customerId, dimIdBean.getMonthId()), e); |
|
|
statsTagUsedMonthly(dimIdBean.getMonthId(), customerId); |
|
|
} |
|
|
} catch (Exception e) { |
|
|
|
|
|
log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "tagUsedMonthlyStatsjob", customerId, dimIdBean.getMonthId()), e); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} while (!CollectionUtils.isEmpty(customerIdList) && customerIdList.size() == pageSize); |
|
|
} while (!CollectionUtils.isEmpty(customerIdList) && customerIdList.size() == pageSize); |
|
|
} |
|
|
} |
|
|
|
|
|
return true; |
|
|
return true; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public Boolean tagViewedDailyStatsjob(StatsFormDTO formDTO) { |
|
|
public Boolean tagViewedDailyStatsjob(StatsFormDTO formDTO) { |
|
|
|
|
|
|
|
|
Date statsDate = getStatsDateFromParam(formDTO); |
|
|
Date statsDate = getStatsDateFromParam(formDTO); |
|
|
DimIdGenerator.DimIdBean dimIdBean = DimIdGenerator.getDimIdBean(statsDate); |
|
|
DimIdGenerator.DimIdBean dimIdBean = DimIdGenerator.getDimIdBean(statsDate); |
|
|
if (null != formDTO && StringUtils.isNotBlank(formDTO.getCustomerId())) { |
|
|
if (null != formDTO && StringUtils.isNotBlank(formDTO.getCustomerId())) { |
|
|
try { |
|
|
try { |
|
|
statsTagUsedMonthly(dimIdBean.getMonthId(), formDTO.getCustomerId()); |
|
|
statsTagViewedDaily(statsDate, dimIdBean, formDTO.getCustomerId()); |
|
|
} catch (Exception e) { |
|
|
} catch (Exception e) { |
|
|
log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "tagUsedMonthlyStatsjob", customerId, dimIdBean.getMonthId()), e); |
|
|
log.error(String.format(ProjectConstant.STATS_FAILED_PREFIX, "tagViewedDailyStatsjob", formDTO.getCustomerId(), dimIdBean.getMonthId()), e); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} else { |
|
|
} else { |
|
|
int pageNo = NumConstant.ONE; |
|
|
int pageNo = NumConstant.ONE; |
|
|
int pageSize = NumConstant.ONE_HUNDRED; |
|
|
int pageSize = NumConstant.ONE_HUNDRED; |
|
|