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

[账单[修改][实际应收金额影响欠缴]

release_toaliyun_real
gongbiao 6 лет назад
Родитель
Сommit
08787e1c99
3 измененных файлов: 34 добавлений и 30 удалений
  1. +27
    -26
      mallinkService/src/main/java/com/iformall/service/impl/WxBillAllServiceImpl.java
  2. +2
    -1
      mallinkService/src/main/java/com/iformall/service/impl/WxBillRentServiceImpl.java
  3. +5
    -3
      mallinkService/src/main/resources/mapper/WxBillAllMapper.xml

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

@@ -156,28 +156,25 @@ public class WxBillAllServiceImpl implements WxBillAllService {
}

public void cmputeTotalMoney(WxPayAccountBill wxPayAccountBill, WxBillAllVo e) {
if (!e.getBillTypeValue().equals(EnumBillTypeParam.RENT_DEPOSIT.getCode())
&& !e.getBillTypeValue().equals(EnumBillTypeParam.PROPERTY_DEPOSIT.getCode())) {
if (e.getReceivePay() != null) {
if (e.getLatePayPrice() == null) {
e.setLatePayPrice(0L);
}
BigDecimal servicePay;
if (e.getServiceChargePay() != null) {
servicePay = new BigDecimal(e.getServiceChargePay());
} else {
servicePay = new BigDecimal(e.getReceivePay()).multiply(new BigDecimal(wxPayAccountBill.getServiceChargeRate())).divide(new BigDecimal(10000), 2, BigDecimal.ROUND_HALF_UP);
}
Long realReceivePay = servicePay.longValue() + e.getLatePayPrice() + e.getReceivePay();
e.setRealReceivePay(realReceivePay);
e.setServiceChargePay(servicePay.intValue());
if (!e.getStatus().equals(EnumBillRentStatus.NOT_PAID.getCode()) &&
!e.getStatus().equals(EnumBillRentStatus.WAIT_PAY.getCode())) {
e.setOwe(0L);
}
if (e.getReceivePay() != null) {
if (e.getLatePayPrice() == null) {
e.setLatePayPrice(0L);
}
BigDecimal servicePay;
if (e.getServiceChargePay() != null) {
servicePay = new BigDecimal(e.getServiceChargePay());
} else {
servicePay = new BigDecimal(e.getReceivePay()).multiply(new BigDecimal(wxPayAccountBill.getServiceChargeRate())).divide(new BigDecimal(10000), 2, BigDecimal.ROUND_HALF_UP);
}
Long realReceivePay = servicePay.longValue() + e.getLatePayPrice() + e.getReceivePay();
e.setRealReceivePay(realReceivePay);
e.setServiceChargePay(servicePay.intValue());
if (!e.getStatus().equals(EnumBillRentStatus.NOT_PAID.getCode()) &&
!e.getStatus().equals(EnumBillRentStatus.WAIT_PAY.getCode())) {
e.setOwe(0L);
} else {
e.setOwe(realReceivePay - e.getPay());
}
} else {
e.setRealReceivePay(e.getReceivePay());
}
}

@@ -970,12 +967,14 @@ public class WxBillAllServiceImpl implements WxBillAllService {
wxBillRent.setUpdatetime(updateDate);
if (oldLatePrice != null) {
wxBillRent.setLatePayPrice(newLatePrice);
wxBillRent.setOwe(newPrice + wxBillRent.getServiceChargePay() + newLatePrice - wxBillRent.getPay());
wxBillRentMapper.updateById(wxBillRent);
addBillAction(EnumBillAction.UPDATE_LATE_PAY_MONEY, id, oldLatePrice, newLatePrice, user);
} else {
//租赁账单更新
wxBillRent.setReceivePay(newPrice);
wxBillRent.setOwe(newPrice - dbBill.getPay());
long latePayPrice = wxBillRent.getLatePayPrice() == null ? 0 : wxBillRent.getLatePayPrice();
wxBillRent.setOwe(newPrice + wxBillRent.getServiceChargePay() + latePayPrice - dbBill.getPay());
if (newPrice.equals(dbBill.getPay())) {
wxBillRent.setStatus(EnumBillRentStatus.PAID.getCode());
}
@@ -1023,11 +1022,13 @@ public class WxBillAllServiceImpl implements WxBillAllService {
wxBillProperty.setUpdatetime(updateDate);
if (oldLatePrice != null) {
wxBillProperty.setLatePayPrice(newLatePrice);
wxBillProperty.setOwe(newPrice + wxBillProperty.getServiceChargePay() + newLatePrice - wxBillProperty.getPay());
wxBillPropertyMapper.updateById(wxBillProperty);
addBillAction(EnumBillAction.UPDATE_LATE_PAY_MONEY, id, oldLatePrice, newLatePrice, user);
} else {
wxBillProperty.setReceivePay(newPrice);
wxBillProperty.setOwe(newPrice - dbBill.getPay());
long latePayPrice = wxBillProperty.getLatePayPrice() == null ? 0 : wxBillProperty.getLatePayPrice();
wxBillProperty.setOwe(newPrice + wxBillProperty.getServiceChargePay() + latePayPrice - dbBill.getPay());
if (newPrice.equals(dbBill.getPay())) {
wxBillProperty.setStatus(EnumBillRentStatus.PAID.getCode());
}
@@ -1070,7 +1071,7 @@ public class WxBillAllServiceImpl implements WxBillAllService {
WxBillOther wxBillOther = new WxBillOther();
wxBillOther.setId(id);
wxBillOther.setReceivePay(newPrice);
wxBillOther.setOwe(newPrice - dbBill.getPay());
wxBillOther.setOwe(newPrice + dbBill.getServiceChargePay() - dbBill.getPay());
if (newPrice.equals(dbBill.getPay())) {
wxBillOther.setStatus(EnumBillRentStatus.PAID.getCode());
}
@@ -1084,7 +1085,7 @@ public class WxBillAllServiceImpl implements WxBillAllService {
WxBillOtherDeposit wxBillOtherDeposit = new WxBillOtherDeposit();
wxBillOtherDeposit.setId(id);
wxBillOtherDeposit.setReceivePay(newPrice);
wxBillOtherDeposit.setOwe(newPrice - dbBill.getPay());
wxBillOtherDeposit.setOwe(newPrice + dbBill.getServiceChargePay() - dbBill.getPay());
if (newPrice.equals(dbBill.getPay())) {
wxBillOtherDeposit.setStatus(EnumBillRentStatus.PAID.getCode());
}
@@ -1550,7 +1551,7 @@ public class WxBillAllServiceImpl implements WxBillAllService {
WxBillDaily wxBillDaily = new WxBillDaily();
wxBillDaily.setId(businessId);
wxBillDaily.setReceivePay(newPrice);
wxBillDaily.setOwe(newPrice - dbBill.getPay());
wxBillDaily.setOwe(newPrice + dbBill.getServiceChargePay() - dbBill.getPay());
if (newPrice.equals(dbBill.getPay())) {
wxBillDaily.setStatus(EnumBillRentStatus.PAID.getCode());
}


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

@@ -390,7 +390,8 @@ public class WxBillRentServiceImpl implements WxBillRentService {
Long oldPrice = wxBillRent.getReceivePay();
Long newPrice = newReceivePay;
wxBillRent.setUpdatetime(new Date());

long latePayPrice = wxBillRent.getLatePayPrice() == null ? 0 : wxBillRent.getLatePayPrice();
wxBillRent.setOwe(newPrice + wxBillRent.getServiceChargePay() + latePayPrice - wxBillRent.getPay());
wxBillRentMapper.updateById(wxBillRent);

if (!oldPrice.equals(newPrice)) {


+ 5
- 3
mallinkService/src/main/resources/mapper/WxBillAllMapper.xml Просмотреть файл

@@ -41,6 +41,8 @@

<result column="freeze" property="freeze"/>
<result column="late_pay_price" property="latePayPrice"/>
<result column="service_charge_pay" property="serviceChargePay"/>

</resultMap>

@@ -912,17 +914,17 @@
<select id="allDepositList" parameterType="com.iformall.domain.vo.WxBillAll" resultMap="allVoResultMap">
select bill.*
from (
select id,merchant_id,shop_id,tenant_id,'租赁押金' name,2 bill_type_value,'租赁押金'
select id,merchant_id,shop_id,tenant_id,'租赁押金' name,2 billTypeValue,'租赁押金'
bill_type,need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,freeze,0 late_pay_price,0
service_charge_pay
from wx_bill_rent_deposit where tenant_id=#{tenantId}
union all
select id,merchant_id,shop_id,tenant_id,'物业押金' name,4 bill_type_value,'物业押金'
select id,merchant_id,shop_id,tenant_id,'物业押金' name,4 billTypeValue,'物业押金'
bill_type,need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,freeze,0 late_pay_price,0
service_charge_pay
from wx_bill_property_deposit where tenant_id=#{tenantId}
union all
select id,merchant_id,shop_id,tenant_id,comments as name,8 bill_type_value,concat('其他押金-',comments) as
select id,merchant_id,shop_id,tenant_id,comments as name,8 billTypeValue,concat('其他押金-',comments) as
bill_type,0 as need_pay,receive_pay,pay,owe,receive_date,pay_date,expired_day,status,freeze,0
late_pay_price,service_charge_pay
from wx_bill_other_deposit where tenant_id=#{tenantId}


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