Просмотр исходного кода

[商户账单][修改][生成催缴单]

release_toaliyun_real
gongbiao 7 лет назад
Родитель
Сommit
7d566c6ba6
1 измененных файлов: 17 добавлений и 10 удалений
  1. +17
    -10
      mallinkService/src/main/java/com/iformall/service/impl/WxBillAllServiceImpl.java

+ 17
- 10
mallinkService/src/main/java/com/iformall/service/impl/WxBillAllServiceImpl.java Просмотреть файл

@@ -620,7 +620,8 @@ public class WxBillAllServiceImpl implements WxBillAllService {
String number = "JF" + DateUtils.getSystemTime("yyyyMMddHHmmss"); String number = "JF" + DateUtils.getSystemTime("yyyyMMddHHmmss");
result.put("number", number); result.put("number", number);
//数据 //数据
if (wxBillAll.getStatus() == null) {
Integer status = wxBillAll.getStatus();
if (status == null) {
List<Integer> statusList = new ArrayList<>(); List<Integer> statusList = new ArrayList<>();
statusList.add(EnumBillRentStatus.NOT_PAID.getCode()); statusList.add(EnumBillRentStatus.NOT_PAID.getCode());
statusList.add(EnumBillRentStatus.WAIT_PAY.getCode()); statusList.add(EnumBillRentStatus.WAIT_PAY.getCode());
@@ -631,27 +632,33 @@ public class WxBillAllServiceImpl implements WxBillAllService {
List<WxBillAllVo> list = wxBillAllMapper.list(wxBillAll); List<WxBillAllVo> list = wxBillAllMapper.list(wxBillAll);
if (!list.isEmpty()) { if (!list.isEmpty()) {
//租金总额 //租金总额
Long rentSum = list.parallelStream().filter(b -> b.getBillTypeValue().equals(EnumBillTypeParam.RENT.getCode())).collect(Collectors.summingLong(b -> filterHasPay != null ? b.getOwe() : b.getReceivePay()));
Long rentSum = list.parallelStream().filter(b -> b.getBillTypeValue().equals(EnumBillTypeParam.RENT.getCode()))
.collect(Collectors.summingLong(b -> status == null && filterHasPay == null ? b.getReceivePay() : b.getOwe()));
//物业总额 //物业总额
Long propertySum = list.parallelStream().filter(b -> b.getBillTypeValue().equals(EnumBillTypeParam.PROPERTY.getCode())).collect(Collectors.summingLong(b -> filterHasPay != null ? b.getOwe() : b.getReceivePay()));
Long propertySum = list.parallelStream().filter(b -> b.getBillTypeValue().equals(EnumBillTypeParam.PROPERTY.getCode()))
.collect(Collectors.summingLong(b -> status == null && filterHasPay == null ? b.getReceivePay() : b.getOwe()));
//押金总额 //押金总额
Long depositSum = list.parallelStream().filter(b -> b.getBillTypeValue().equals(EnumBillTypeParam.RENT_DEPOSIT.getCode()) || Long depositSum = list.parallelStream().filter(b -> b.getBillTypeValue().equals(EnumBillTypeParam.RENT_DEPOSIT.getCode()) ||
b.getBillTypeValue().equals(EnumBillTypeParam.PROPERTY_DEPOSIT.getCode()) || b.getBillTypeValue().equals(EnumBillTypeParam.ATHER_DEPOSIT.getCode())) b.getBillTypeValue().equals(EnumBillTypeParam.PROPERTY_DEPOSIT.getCode()) || b.getBillTypeValue().equals(EnumBillTypeParam.ATHER_DEPOSIT.getCode()))
.collect(Collectors.summingLong(b -> filterHasPay != null ? b.getOwe() : b.getReceivePay()));
.collect(Collectors.summingLong(b -> status == null && filterHasPay == null ? b.getReceivePay() : b.getOwe()));
//水费 //水费
Long waterSum = list.parallelStream().filter(b -> b.getBillTypeValue().equals(EnumBillTypeParam.WATER.getCode())).collect(Collectors.summingLong(b -> filterHasPay != null ? b.getOwe() : b.getReceivePay()));
Long waterSum = list.parallelStream().filter(b -> b.getBillTypeValue().equals(EnumBillTypeParam.WATER.getCode()))
.collect(Collectors.summingLong(b -> status == null && filterHasPay == null ? b.getReceivePay() : b.getOwe()));
//电费 //电费
Long powerSum = list.parallelStream().filter(b -> b.getBillTypeValue().equals(EnumBillTypeParam.POWER.getCode())).collect(Collectors.summingLong(b -> filterHasPay != null ? b.getOwe() : b.getReceivePay()));
Long powerSum = list.parallelStream().filter(b -> b.getBillTypeValue().equals(EnumBillTypeParam.POWER.getCode()))
.collect(Collectors.summingLong(b -> status == null && filterHasPay == null ? b.getReceivePay() : b.getOwe()));
//空调费 //空调费
Long airConditioningSum = list.parallelStream().filter(b -> b.getBillTypeValue().equals(EnumBillTypeParam.AIR_CONDITIONING.getCode())).collect(Collectors.summingLong(b -> filterHasPay != null ? b.getOwe() : b.getReceivePay()));
Long airConditioningSum = list.parallelStream().filter(b -> b.getBillTypeValue().equals(EnumBillTypeParam.AIR_CONDITIONING.getCode()))
.collect(Collectors.summingLong(b -> status == null && filterHasPay == null ? b.getReceivePay() : b.getOwe()));
//其他费用 //其他费用
Long otherSum = list.parallelStream().filter(b -> b.getBillTypeValue().equals(EnumBillTypeParam.ROUTINE.getCode())).collect(Collectors.summingLong(b -> filterHasPay != null ? b.getOwe() : b.getReceivePay()));
Long otherSum = list.parallelStream().filter(b -> b.getBillTypeValue().equals(EnumBillTypeParam.ROUTINE.getCode()))
.collect(Collectors.summingLong(b -> status == null && filterHasPay == null ? b.getReceivePay() : b.getOwe()));
//押金明细 //押金明细
StringBuffer depositDetail = new StringBuffer(); StringBuffer depositDetail = new StringBuffer();
list.parallelStream().filter(b -> b.getBillTypeValue().equals(EnumBillTypeParam.RENT_DEPOSIT.getCode()) || list.parallelStream().filter(b -> b.getBillTypeValue().equals(EnumBillTypeParam.RENT_DEPOSIT.getCode()) ||
b.getBillTypeValue().equals(EnumBillTypeParam.PROPERTY_DEPOSIT.getCode()) || b.getBillTypeValue().equals(EnumBillTypeParam.ATHER_DEPOSIT.getCode())) b.getBillTypeValue().equals(EnumBillTypeParam.PROPERTY_DEPOSIT.getCode()) || b.getBillTypeValue().equals(EnumBillTypeParam.ATHER_DEPOSIT.getCode()))
.forEach(b -> { .forEach(b -> {
BigDecimal owe = new BigDecimal(filterHasPay != null ? b.getOwe() : b.getReceivePay()).divide(new BigDecimal(100)).setScale(2, RoundingMode.HALF_EVEN);
BigDecimal owe = new BigDecimal(status == null && filterHasPay == null ? b.getReceivePay() : b.getOwe()).divide(new BigDecimal(100)).setScale(2, RoundingMode.HALF_EVEN);
depositDetail.append(b.getName()).append(":[").append(owe.toPlainString()).append("] "); depositDetail.append(b.getName()).append(":[").append(owe.toPlainString()).append("] ");
}); });


@@ -659,7 +666,7 @@ public class WxBillAllServiceImpl implements WxBillAllService {
StringBuffer otherDetail = new StringBuffer(); StringBuffer otherDetail = new StringBuffer();
list.parallelStream().filter(b -> b.getBillTypeValue().equals(EnumBillTypeParam.ROUTINE.getCode())) list.parallelStream().filter(b -> b.getBillTypeValue().equals(EnumBillTypeParam.ROUTINE.getCode()))
.forEach(b -> { .forEach(b -> {
BigDecimal owe = new BigDecimal(filterHasPay != null ? b.getOwe() : b.getReceivePay()).divide(new BigDecimal(100)).setScale(2, RoundingMode.HALF_EVEN);
BigDecimal owe = new BigDecimal(status == null && filterHasPay == null ? b.getReceivePay() : b.getOwe()).divide(new BigDecimal(100)).setScale(2, RoundingMode.HALF_EVEN);
otherDetail.append(b.getName()).append(":[").append(owe.toPlainString()).append("] "); otherDetail.append(b.getName()).append(":[").append(owe.toPlainString()).append("] ");
}); });
//总计 //总计


Загрузка…
Отмена
Сохранить