diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxBillAllServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxBillAllServiceImpl.java index 6d3da94d4..afa9f0fa6 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxBillAllServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxBillAllServiceImpl.java @@ -772,26 +772,26 @@ public class WxBillAllServiceImpl implements WxBillAllService { if (!list.isEmpty()) { //租金总额 Long rentSum = list.stream().filter(b -> b.getBillTypeValue().equals(EnumBillTypeParam.RENT.getCode())) - .collect(Collectors.summingLong(b -> status == null && filterHasPay == null ? b.getReceivePay() : b.getOwe())); + .collect(Collectors.summingLong(b -> status == null && filterHasPay == null ? b.getReceivePay() + b.getLatePayPrice() + b.getServiceChargePay() : b.getOwe())); //物业总额 Long propertySum = list.parallelStream().filter(b -> b.getBillTypeValue().equals(EnumBillTypeParam.PROPERTY.getCode())) - .collect(Collectors.summingLong(b -> status == null && filterHasPay == null ? b.getReceivePay() : b.getOwe())); + .collect(Collectors.summingLong(b -> status == null && filterHasPay == null ? b.getReceivePay() + b.getLatePayPrice() + b.getServiceChargePay() : b.getOwe())); //押金总额 Long depositSum = list.stream().filter(b -> b.getBillTypeValue().equals(EnumBillTypeParam.RENT_DEPOSIT.getCode()) || b.getBillTypeValue().equals(EnumBillTypeParam.PROPERTY_DEPOSIT.getCode()) || b.getBillTypeValue().equals(EnumBillTypeParam.ATHER_DEPOSIT.getCode())) - .collect(Collectors.summingLong(b -> status == null && filterHasPay == null ? b.getReceivePay() : b.getOwe())); + .collect(Collectors.summingLong(b -> status == null && filterHasPay == null ? b.getReceivePay() + b.getLatePayPrice() + b.getServiceChargePay() : b.getOwe())); //水费 Long waterSum = list.stream().filter(b -> b.getBillTypeValue().equals(EnumBillTypeParam.WATER.getCode())) - .collect(Collectors.summingLong(b -> status == null && filterHasPay == null ? b.getReceivePay() : b.getOwe())); + .collect(Collectors.summingLong(b -> status == null && filterHasPay == null ? b.getReceivePay() + b.getLatePayPrice() + b.getServiceChargePay() : b.getOwe())); //电费 Long powerSum = list.stream().filter(b -> b.getBillTypeValue().equals(EnumBillTypeParam.POWER.getCode())) - .collect(Collectors.summingLong(b -> status == null && filterHasPay == null ? b.getReceivePay() : b.getOwe())); + .collect(Collectors.summingLong(b -> status == null && filterHasPay == null ? b.getReceivePay() + b.getLatePayPrice() + b.getServiceChargePay() : b.getOwe())); //空调费 Long airConditioningSum = list.stream().filter(b -> b.getBillTypeValue().equals(EnumBillTypeParam.AIR_CONDITIONING.getCode())) - .collect(Collectors.summingLong(b -> status == null && filterHasPay == null ? b.getReceivePay() : b.getOwe())); + .collect(Collectors.summingLong(b -> status == null && filterHasPay == null ? b.getReceivePay() + b.getLatePayPrice() + b.getServiceChargePay() : b.getOwe())); //其他费用 Long otherSum = list.stream().filter(b -> b.getBillTypeValue().equals(EnumBillTypeParam.ROUTINE.getCode())) - .collect(Collectors.summingLong(b -> status == null && filterHasPay == null ? b.getReceivePay() : b.getOwe())); + .collect(Collectors.summingLong(b -> status == null && filterHasPay == null ? b.getReceivePay() + b.getLatePayPrice() + b.getServiceChargePay() : b.getOwe())); //押金明细 StringBuffer depositDetail = new StringBuffer(); list.stream().filter(b -> b.getBillTypeValue().equals(EnumBillTypeParam.RENT_DEPOSIT.getCode()) || diff --git a/mallinkService/src/main/resources/mapper/WxBillAllMapper.xml b/mallinkService/src/main/resources/mapper/WxBillAllMapper.xml index 904b53125..722969558 100644 --- a/mallinkService/src/main/resources/mapper/WxBillAllMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxBillAllMapper.xml @@ -59,41 +59,43 @@ select id,merchant_id,shop_id,tenant_id,'租金' name,1 bill_type_value,'租金' bill_type,need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,starttime, endtime,rent_shop_type,case when shop_info is null then '[]' else shop_info end shop_info,comments,'' - price_detail,updatetime,freeze,late_pay_price + price_detail,updatetime,freeze,ifnull(late_pay_price,0) late_pay_price,service_charge_pay from wx_bill_rent where tenant_id=#{tenantId} and is_preview = 0 union all select id,merchant_id,shop_id,tenant_id,'租赁押金' name,2 bill_type_value,'租赁押金' bill_type,need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,starttime, - endtime,rent_shop_type,shop_info,NULL comments,'' price_detail,updatetime,freeze,'' late_pay_price from wx_bill_rent_deposit where - tenant_id=#{tenantId} + endtime,rent_shop_type,shop_info,NULL comments,'' price_detail,updatetime,freeze,0 + late_pay_price,service_charge_pay + from wx_bill_rent_deposit where tenant_id=#{tenantId} union all select id,merchant_id,shop_id,tenant_id,'物业费' name,3 bill_type_value,'物业费' bill_type,need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,starttime, endtime,rent_shop_type,case when shop_info is null then '[]' else shop_info end shop_info,comments,'' - price_detail,updatetime,freeze,late_pay_price + price_detail,updatetime,freeze,ifnull(late_pay_price,0) late_pay_price,service_charge_pay from wx_bill_property where tenant_id=#{tenantId} and is_preview = 0 union all select id,merchant_id,shop_id,tenant_id,'物业押金' name,4 bill_type_value,'物业押金' bill_type,need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,starttime, - endtime,rent_shop_type,shop_info,NULL comments,'' price_detail,updatetime,freeze,'' late_pay_price from wx_bill_property_deposit where + endtime,rent_shop_type,shop_info,NULL comments,'' price_detail,updatetime,freeze,0 + late_pay_price,service_charge_pay from wx_bill_property_deposit where tenant_id=#{tenantId} union all select id,merchant_id,shop_id,tenant_id,case when type=1 then '水费' when type=2 then '电费' else '空调费' end name, case when type=1 then 5 when type=2 then 6 else 9 end bill_type_value, case when type=1 then '水费' when type=2 then '电费' else '空调费' end bill_type,0 as need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,starttime,endtime, - rent_shop_type,'[]' shop_info, NULL comments,price_detail,updatetime,freeze,'' late_pay_price + rent_shop_type,'[]' shop_info, NULL comments,price_detail,updatetime,freeze,0 late_pay_price,service_charge_pay from wx_bill_daily where tenant_id=#{tenantId} union all select id,merchant_id,shop_id,tenant_id,name,7 bill_type_value,concat('其他费用-',name) as bill_type,0 as need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,starttime,endtime, - rent_shop_type,'[]' shop_info,comments,'' price_detail,updatetime,freeze,'' late_pay_price + rent_shop_type,'[]' shop_info,comments,'' price_detail,updatetime,freeze,0 late_pay_price,service_charge_pay from wx_bill_other where tenant_id=#{tenantId} union all select id,merchant_id,shop_id,tenant_id,comments as name,8 bill_type_value,concat('其他押金-',comments) as bill_type,0 as need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,starttime,endtime, - rent_shop_type,'[]' shop_info,comments,'' price_detail,updatetime,freeze,'' late_pay_price + rent_shop_type,'[]' shop_info,comments,'' price_detail,updatetime,freeze,0 late_pay_price,service_charge_pay from wx_bill_other_deposit where tenant_id=#{tenantId} ) bill left join wx_merchant m on bill.merchant_id=m.id