|
|
|
@ -59,10 +59,10 @@ public class ReportDeductsSync {
|
|
|
|
|
List<CallDeduct> callDeducts;
|
|
|
|
|
if (companyId != null) {
|
|
|
|
|
callDeducts = callDeductRepository.queryByCompanyIdAndTime(companyId, beginOfDay, endOfDay);
|
|
|
|
|
Double sum = callDeducts.stream().mapToDouble(CallDeduct::getDeductAmount).sum();
|
|
|
|
|
double sum = callDeducts.stream().mapToDouble(CallDeduct::getDeductAmount).sum();
|
|
|
|
|
ReportDeduct reportDeduct = new ReportDeduct();
|
|
|
|
|
reportDeduct.setDeductAmount(sum);
|
|
|
|
|
reportDeduct.setBalance(map.get(companyId));
|
|
|
|
|
reportDeduct.setBalance(map.get(companyId) == null ? 0.0 : map.get(companyId));
|
|
|
|
|
reportDeduct.setCreateTime(new Date());
|
|
|
|
|
reportDeduct.setCompanyId(companyId);
|
|
|
|
|
list.add(reportDeduct);
|
|
|
|
@ -71,7 +71,7 @@ public class ReportDeductsSync {
|
|
|
|
|
Map<Long, List<CallDeduct>> collect = callDeducts.stream().collect(Collectors.groupingBy(CallDeduct::getCompanyId, Collectors.toList()));
|
|
|
|
|
for (Long key : map.keySet()) {
|
|
|
|
|
ReportDeduct reportDeduct = new ReportDeduct();
|
|
|
|
|
reportDeduct.setBalance(map.get(key));
|
|
|
|
|
reportDeduct.setBalance(map.get(key) == null ? 0.0 : map.get(key));
|
|
|
|
|
reportDeduct.setCreateTime(new Date());
|
|
|
|
|
reportDeduct.setCompanyId(key);
|
|
|
|
|
List<CallDeduct> callDeducts1 = collect.get(key);
|
|
|
|
|