|
|
@@ -1333,12 +1333,15 @@ public class StatisticsServiceImpl implements IStatisticsService {
|
|
|
for (PjCorpsDesc item : corpsDescIPage.getRecords()) {
|
|
|
CorpBuySingular corpBuySingular1 = new CorpBuySingular();
|
|
|
corpBuySingular1.setCorpName(item.getCname());
|
|
|
+ corpBuySingular1.setDeliveryWarehouseName(item.getDeliveryWarehouseName());
|
|
|
+ corpBuySingular1.setSalesmanName(item.getSalesmanName());
|
|
|
if (!orderList.isEmpty()) {
|
|
|
List<PjOrder> orders = orderList.stream().filter(e -> e.getCustomerId().equals(item.getId())).collect(Collectors.toList());
|
|
|
if (!orders.isEmpty()) {
|
|
|
corpBuySingular1.setNum(new BigDecimal(orders.size()));
|
|
|
corpBuySingular1.setNumber(orders.stream().map(PjOrder::getGoodsTotalNum).reduce(BigDecimal.ZERO, BigDecimal::add));
|
|
|
corpBuySingular1.setDate(orders.get(0).getBusinesDate());
|
|
|
+ corpBuySingular1.setPurchaseMethod(orders.get(0).getBusinessSource());
|
|
|
}
|
|
|
}
|
|
|
corpBuySingularList.add(corpBuySingular1);
|
|
|
@@ -1360,7 +1363,7 @@ public class StatisticsServiceImpl implements IStatisticsService {
|
|
|
LambdaQueryWrapper<PjCorpsDesc> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
lambdaQueryWrapper.eq(PjCorpsDesc::getTenantId, AuthUtil.getTenantId())
|
|
|
.eq(PjCorpsDesc::getIsDeleted, 0)
|
|
|
- .like(ObjectUtils.isNotNull(corpBuySingular), PjCorpsDesc::getCname, corpBuySingular.getCorpName())
|
|
|
+ .like(ObjectUtils.isNotNull(corpBuySingular.getCorpName()), PjCorpsDesc::getCname, corpBuySingular.getCorpName())
|
|
|
.eq(PjCorpsDesc::getCorpType, "KH");
|
|
|
List<PjCorpsDesc> corpsDescIPage = corpsDescService.list(lambdaQueryWrapper);
|
|
|
if (!corpsDescIPage.isEmpty()) {
|
|
|
@@ -1379,20 +1382,23 @@ public class StatisticsServiceImpl implements IStatisticsService {
|
|
|
for (PjCorpsDesc item : corpsDescIPage) {
|
|
|
CorpBuySingular corpBuySingular1 = new CorpBuySingular();
|
|
|
corpBuySingular1.setCorpName(item.getCname());
|
|
|
+ corpBuySingular1.setDeliveryWarehouseName(item.getDeliveryWarehouseName());
|
|
|
+ corpBuySingular1.setSalesmanName(item.getSalesmanName());
|
|
|
if (!orderList.isEmpty()) {
|
|
|
List<PjOrder> orders = orderList.stream().filter(e -> e.getCustomerId().equals(item.getId())).collect(Collectors.toList());
|
|
|
if (!orders.isEmpty()) {
|
|
|
corpBuySingular1.setNum(new BigDecimal(orders.size()));
|
|
|
corpBuySingular1.setNumber(orders.stream().map(PjOrder::getGoodsTotalNum).reduce(BigDecimal.ZERO, BigDecimal::add));
|
|
|
corpBuySingular1.setDate(orders.get(0).getBusinesDate());
|
|
|
+ corpBuySingular1.setPurchaseMethod(orders.get(0).getBusinessSource());
|
|
|
}
|
|
|
}
|
|
|
corpBuySingularList.add(corpBuySingular1);
|
|
|
}
|
|
|
}
|
|
|
if (!corpBuySingularList.isEmpty()) {
|
|
|
- map.put("num", corpBuySingularList.stream().map(CorpBuySingular::getNum).reduce(BigDecimal.ZERO, BigDecimal::add));
|
|
|
- map.put("number", corpBuySingularList.stream().map(CorpBuySingular::getNumber).reduce(BigDecimal.ZERO, BigDecimal::add));
|
|
|
+ map.put("num", corpBuySingularList.stream().map(CorpBuySingular::getNum).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
|
|
|
+ map.put("number", corpBuySingularList.stream().map(CorpBuySingular::getNumber).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
|
|
|
} else {
|
|
|
map.put("num", new BigDecimal("0"));
|
|
|
map.put("number", new BigDecimal("0"));
|
|
|
@@ -1406,7 +1412,7 @@ public class StatisticsServiceImpl implements IStatisticsService {
|
|
|
LambdaQueryWrapper<PjCorpsDesc> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
lambdaQueryWrapper.eq(PjCorpsDesc::getTenantId, AuthUtil.getTenantId())
|
|
|
.eq(PjCorpsDesc::getIsDeleted, 0)
|
|
|
- .like(ObjectUtils.isNotNull(corpBuySingular), PjCorpsDesc::getCname, corpBuySingular.getCorpName())
|
|
|
+ .like(ObjectUtils.isNotNull(corpBuySingular.getCorpName()), PjCorpsDesc::getCname, corpBuySingular.getCorpName())
|
|
|
.eq(PjCorpsDesc::getCorpType, "KH");
|
|
|
List<PjCorpsDesc> corpsDescIPage = corpsDescService.list(lambdaQueryWrapper);
|
|
|
if (!corpsDescIPage.isEmpty()) {
|
|
|
@@ -1425,12 +1431,15 @@ public class StatisticsServiceImpl implements IStatisticsService {
|
|
|
for (PjCorpsDesc item : corpsDescIPage) {
|
|
|
CorpBuySingular corpBuySingular1 = new CorpBuySingular();
|
|
|
corpBuySingular1.setCorpName(item.getCname());
|
|
|
+ corpBuySingular1.setDeliveryWarehouseName(item.getDeliveryWarehouseName());
|
|
|
+ corpBuySingular1.setSalesmanName(item.getSalesmanName());
|
|
|
if (!orderList.isEmpty()) {
|
|
|
List<PjOrder> orders = orderList.stream().filter(e -> e.getCustomerId().equals(item.getId())).collect(Collectors.toList());
|
|
|
if (!orders.isEmpty()) {
|
|
|
corpBuySingular1.setNum(new BigDecimal(orders.size()));
|
|
|
corpBuySingular1.setNumber(orders.stream().map(PjOrder::getGoodsTotalNum).reduce(BigDecimal.ZERO, BigDecimal::add));
|
|
|
corpBuySingular1.setDate(orders.get(0).getBusinesDate());
|
|
|
+ corpBuySingular1.setPurchaseMethod(orders.get(0).getBusinessSource());
|
|
|
}
|
|
|
}
|
|
|
corpBuySingularList.add(corpBuySingular1);
|
|
|
@@ -1446,7 +1455,7 @@ public class StatisticsServiceImpl implements IStatisticsService {
|
|
|
LambdaQueryWrapper<PjCorpsDesc> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
lambdaQueryWrapper.eq(PjCorpsDesc::getTenantId, AuthUtil.getTenantId())
|
|
|
.eq(PjCorpsDesc::getIsDeleted, 0)
|
|
|
- .like(ObjectUtils.isNotNull(corpBuySingular), PjCorpsDesc::getCname, corpBuySingular.getCorpName())
|
|
|
+ .like(ObjectUtils.isNotNull(corpBuySingular.getCorpName()), PjCorpsDesc::getCname, corpBuySingular.getCorpName())
|
|
|
.eq(PjCorpsDesc::getCorpType, "KH");
|
|
|
List<PjCorpsDesc> corpsDescIPage = corpsDescService.list(lambdaQueryWrapper);
|
|
|
if (!corpsDescIPage.isEmpty()) {
|
|
|
@@ -1465,12 +1474,15 @@ public class StatisticsServiceImpl implements IStatisticsService {
|
|
|
for (PjCorpsDesc item : corpsDescIPage) {
|
|
|
CorpBuySingular corpBuySingular1 = new CorpBuySingular();
|
|
|
corpBuySingular1.setCorpName(item.getCname());
|
|
|
+ corpBuySingular1.setDeliveryWarehouseName(item.getDeliveryWarehouseName());
|
|
|
+ corpBuySingular1.setSalesmanName(item.getSalesmanName());
|
|
|
if (!orderList.isEmpty()) {
|
|
|
List<PjOrder> orders = orderList.stream().filter(e -> e.getCustomerId().equals(item.getId())).collect(Collectors.toList());
|
|
|
if (!orders.isEmpty()) {
|
|
|
corpBuySingular1.setNum(new BigDecimal(orders.size()));
|
|
|
corpBuySingular1.setNumber(orders.stream().map(PjOrder::getGoodsTotalNum).reduce(BigDecimal.ZERO, BigDecimal::add));
|
|
|
corpBuySingular1.setDate(orders.get(0).getBusinesDate());
|
|
|
+ corpBuySingular1.setPurchaseMethod(orders.get(0).getBusinessSource());
|
|
|
}
|
|
|
}
|
|
|
corpBuySingularList.add(corpBuySingular1);
|
|
|
@@ -1485,15 +1497,15 @@ public class StatisticsServiceImpl implements IStatisticsService {
|
|
|
list.add("10次以上");
|
|
|
List<Long> numberList = new ArrayList<>();
|
|
|
if (!corpBuySingularList.isEmpty()) {
|
|
|
- numberList.add(corpBuySingularList.stream().filter(e -> e.getNum().compareTo(new BigDecimal("0")) == 0).count());
|
|
|
- numberList.add(corpBuySingularList.stream().filter(e -> e.getNum().compareTo(new BigDecimal("1")) == 0).count());
|
|
|
- numberList.add(corpBuySingularList.stream().filter(e -> e.getNum().compareTo(new BigDecimal("2")) == 0 ||
|
|
|
- e.getNum().compareTo(new BigDecimal("3")) == 0).count());
|
|
|
- numberList.add(corpBuySingularList.stream().filter(e -> e.getNum().compareTo(new BigDecimal("3")) == 0 ||
|
|
|
- e.getNum().compareTo(new BigDecimal("4")) == 0).count());
|
|
|
- numberList.add(corpBuySingularList.stream().filter(e -> e.getNum().compareTo(new BigDecimal("5")) >= 0 ||
|
|
|
- e.getNum().compareTo(new BigDecimal("10")) <= 0).count());
|
|
|
- numberList.add(corpBuySingularList.stream().filter(e -> e.getNum().compareTo(new BigDecimal("10")) >= 0).count());
|
|
|
+ numberList.add(corpBuySingularList.stream().filter(e -> ObjectUtils.isNotNull(e.getNum()) && e.getNum().compareTo(new BigDecimal("0")) == 0).count());
|
|
|
+ numberList.add(corpBuySingularList.stream().filter(e -> ObjectUtils.isNotNull(e.getNum()) && e.getNum().compareTo(new BigDecimal("1")) == 0).count());
|
|
|
+ numberList.add(corpBuySingularList.stream().filter(e -> ObjectUtils.isNotNull(e.getNum()) && (e.getNum().compareTo(new BigDecimal("2")) == 0 ||
|
|
|
+ e.getNum().compareTo(new BigDecimal("3")) == 0)).count());
|
|
|
+ numberList.add(corpBuySingularList.stream().filter(e -> ObjectUtils.isNotNull(e.getNum()) && (e.getNum().compareTo(new BigDecimal("3")) == 0 ||
|
|
|
+ e.getNum().compareTo(new BigDecimal("4")) == 0)).count());
|
|
|
+ numberList.add(corpBuySingularList.stream().filter(e -> ObjectUtils.isNotNull(e.getNum()) && (e.getNum().compareTo(new BigDecimal("5")) >= 0 ||
|
|
|
+ e.getNum().compareTo(new BigDecimal("10")) <= 0)).count());
|
|
|
+ numberList.add(corpBuySingularList.stream().filter(e -> ObjectUtils.isNotNull(e.getNum()) && e.getNum().compareTo(new BigDecimal("10")) >= 0).count());
|
|
|
} else {
|
|
|
numberList.add(0L);
|
|
|
numberList.add(0L);
|