|
|
@@ -65,6 +65,7 @@ public class CorpsStatisticsController {
|
|
|
lambdaQueryWrapper.eq(PjOrder::getBsType, "CG");
|
|
|
}
|
|
|
lambdaQueryWrapper.eq(PjOrder::getSalesCompanyId, AuthUtil.getDeptId());
|
|
|
+ lambdaQueryWrapper.apply("(( o.business_source = '外部销售' AND FIND_IN_SET( o.actual_payment_status, '2,3' ) ) OR (o.business_source = '内部销售' AND FIND_IN_SET( o.actual_payment_status, '0,1,2,3' )))");
|
|
|
if (ObjectUtils.isNotNull(corpsDescDto1.getCreditLimit()) && ObjectUtils.isNotNull(corpsDescDto1.getUseCreditLimit())) {
|
|
|
corpsDescDto1.setCreditLimitBalance(corpsDescDto1.getCreditLimit().subtract(corpsDescDto1.getUseCreditLimit()));
|
|
|
}
|
|
|
@@ -76,7 +77,7 @@ public class CorpsStatisticsController {
|
|
|
//未付
|
|
|
corpsDescDto1.setUnpaidAmount(totalAmount.subtract(corpsDescDto1.getPaidAmount()));
|
|
|
corpsDescDto1.setTotalAmount(totalAmount);
|
|
|
- corpsDescDto1.setNumber(orderList.stream().map(PjOrder::getGoodsTotalShipNum).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
|
|
|
+ corpsDescDto1.setNumber(orderList.stream().map(PjOrder::getGoodsTotalNum).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
|
|
|
} else {
|
|
|
//已付
|
|
|
corpsDescDto1.setPaidAmount(new BigDecimal("0.00"));
|
|
|
@@ -116,6 +117,7 @@ public class CorpsStatisticsController {
|
|
|
lambdaQueryWrapper.eq(PjOrder::getBsType, "CG");
|
|
|
}
|
|
|
lambdaQueryWrapper.eq(PjOrder::getSalesCompanyId, AuthUtil.getDeptId());
|
|
|
+ lambdaQueryWrapper.apply("(( o.business_source = '外部销售' AND FIND_IN_SET( o.actual_payment_status, '2,3' ) ) OR (o.business_source = '内部销售' AND FIND_IN_SET( o.actual_payment_status, '0,1,2,3' )))");
|
|
|
List<PjOrder> orderList = orderService.list(lambdaQueryWrapper);
|
|
|
if (ObjectUtils.isNotNull(orderList)) {
|
|
|
BigDecimal sumAmount = orderList.stream().map(PjOrder::getTotalMoney).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
@@ -157,6 +159,7 @@ public class CorpsStatisticsController {
|
|
|
if (ObjectUtils.isNotNull(corpsDescDto1.getCreditLimit()) && ObjectUtils.isNotNull(corpsDescDto1.getUseCreditLimit())) {
|
|
|
corpsDescDto1.setCreditLimitBalance(corpsDescDto1.getCreditLimit().subtract(corpsDescDto1.getUseCreditLimit()));
|
|
|
}
|
|
|
+ lambdaQueryWrapper.apply("(( o.business_source = '外部销售' AND FIND_IN_SET( o.actual_payment_status, '2,3' ) ) OR (o.business_source = '内部销售' AND FIND_IN_SET( o.actual_payment_status, '0,1,2,3' )))");
|
|
|
List<PjOrder> orderList = orderService.list(lambdaQueryWrapper);
|
|
|
if (ObjectUtils.isNotNull(orderList)) {
|
|
|
BigDecimal totalAmount = orderList.stream().map(PjOrder::getTotalMoney).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
@@ -165,7 +168,7 @@ public class CorpsStatisticsController {
|
|
|
//未付
|
|
|
corpsDescDto1.setUnpaidAmount(totalAmount.subtract(corpsDescDto1.getPaidAmount()));
|
|
|
corpsDescDto1.setTotalAmount(totalAmount);
|
|
|
- corpsDescDto1.setNumber(orderList.stream().map(PjOrder::getGoodsTotalShipNum).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
|
|
|
+ corpsDescDto1.setNumber(orderList.stream().map(PjOrder::getGoodsTotalNum).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add));
|
|
|
} else {
|
|
|
//已付
|
|
|
corpsDescDto1.setPaidAmount(new BigDecimal("0.00"));
|