推广管理零售公司

master
Caps 6 years ago
parent 3d67816f26
commit a293b504e5

@ -377,12 +377,12 @@ public class RetailCompanyService {
//计算两个时间间隔用于计算平均值 //计算两个时间间隔用于计算平均值
LocalDate start = LocalDate.parse(startTime); LocalDate start = LocalDate.parse(startTime);
LocalDate end = LocalDate.parse(endTime); LocalDate end = LocalDate.parse(endTime);
long days = end.until(start, ChronoUnit.DAYS); long days = end.until(start, ChronoUnit.DAYS) + 1;
organizationalVO.setNewCustomer((int) (countEnd - count)); organizationalVO.setNewCustomer((int) (countEnd - count));
organizationalVO.setNewEffectiveCustomer((int) (countEnd2 - count2)); organizationalVO.setNewEffectiveCustomer((int) (countEnd2 - count2));
organizationalVO.setAvgNewCustomer(check(countEnd - count, days)); organizationalVO.setAvgNewCustomer(check1(countEnd - count, days));
organizationalVO.setAvgNewEffectiveCustomer(check(countEnd2 - count2, days)); organizationalVO.setAvgNewEffectiveCustomer(check1(countEnd2 - count2, days));
} }
private void newCustomerStore(String startTime, String endTime, DataVO organizationalVO, List<Long> storeIds) { private void newCustomerStore(String startTime, String endTime, DataVO organizationalVO, List<Long> storeIds) {
@ -436,6 +436,20 @@ public class RetailCompanyService {
return Math.round((l1 / l2) * 100); return Math.round((l1 / l2) * 100);
} }
} }
/**
*
*
* @param l1
* @param l2
* @return
*/
public Integer check1(Long l1, Long l2) {
if (l2 == null || l1 == null || l2 == 0) {
return 0;
} else {
return Math.round((l1 / l2));
}
}
/** /**
* 广 * 广

Loading…
Cancel
Save