ソースを参照

[合同][修改][修改预账单]

release_toaliyun_real
luozukai 6年前
コミット
27664f6ab4
4個のファイルの変更35行の追加12行の削除
  1. +2
    -0
      mallinkAdmin/src/main/resources/db/migration/V201908021153__L_ALTER_CONTENT.sql
  2. +7
    -2
      mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java
  3. +14
    -6
      mallinkService/src/main/resources/mapper/WxBillPropertyMapper.xml
  4. +12
    -4
      mallinkService/src/main/resources/mapper/WxBillRentMapper.xml

+ 2
- 0
mallinkAdmin/src/main/resources/db/migration/V201908021153__L_ALTER_CONTENT.sql ファイルの表示

@@ -0,0 +1,2 @@
alter table wx_rent_contract modify `late_pay_day` INT(10) DEFAULT 0;
alter table wx_property_contract modify `late_pay_day` INT(10) DEFAULT 0;

+ 7
- 2
mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java ファイルの表示

@@ -1000,6 +1000,7 @@ public class WxRentContractServiceImpl implements WxRentContractService {
return shopInfoStr;
}


public Map<String, Object> buildRent(int receivePeriod, long[] priceArrs, List<Date> yearList, int dayType, WxRentContract wxRentContract, Long userId, int billcount, Integer isPreview, String shopInfoStr,boolean saveDb) {
SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd");
Map<String,Object> resultMap = new HashedMap();
@@ -1050,8 +1051,12 @@ public class WxRentContractServiceImpl implements WxRentContractService {
if(sd.format(billTimeVo.getStartDate()).equals(sd.format(billTimeVo.getEndDate()))){
needpayFront = getNeedPayMoney(wxRentContract,priceArrs[index-1],billTimeVo.getStartDate(),endDate,i,billTimeVoList.size(),saveDb);
}else{
needpayFront = getNeedPayMoney(wxRentContract,priceArrs[index-1],billTimeVo.getStartDate(),endDate,i,billTimeVoList.size(),saveDb);
needpayAfter = getNeedPayMoney(wxRentContract,priceArrs[index],endDate,billTimeVo.getEndDate(),i,billTimeVoList.size(),saveDb);
if(billTimeVo.getStartDate().before(endDate)){
needpayFront = getNeedPayMoney(wxRentContract, priceArrs[index - 1], billTimeVo.getStartDate(), endDate, i, billTimeVoList.size(), saveDb);
needpayAfter = getNeedPayMoney(wxRentContract, priceArrs[index], endDate, billTimeVo.getEndDate(), i, billTimeVoList.size(), saveDb);
}else{
needpayFront = getNeedPayMoney(wxRentContract, priceArrs[index], billTimeVo.getStartDate(), billTimeVo.getEndDate(), i, billTimeVoList.size(), saveDb);
}
}
needpay = needpayFront+needpayAfter;
flag = true;


+ 14
- 6
mallinkService/src/main/resources/mapper/WxBillPropertyMapper.xml ファイルの表示

@@ -139,9 +139,9 @@

<update id="updateNotPaidStatus" parameterType="hashmap">
update wx_bill_property b set b.status=#{notPaid},b.expired_day=
DATEDIFF(now(), date_add(b.receive_date,interval(select late_pay_day from wx_rent_contract where id = b.`property_contract_id`) day))
DATEDIFF(now(), date_add(b.receive_date,interval(select late_pay_day from wx_property_contract where id = b.`property_contract_id`) day))
where b.tenant_id=#{tenantId} and b.status!=#{paid} and b.status!=6 and
DATEDIFF(now(), date_add(b.receive_date,interval(select late_pay_day from wx_rent_contract where id = b.`property_contract_id`) day)) >0
DATEDIFF(now(), date_add(b.receive_date,interval(select late_pay_day from wx_property_contract where id = b.`property_contract_id`) day)) >0
</update>

<update id="updateWaitPayStatus" parameterType="hashmap">
@@ -233,10 +233,18 @@
</select>

<update id="autoAddLatePayPrice">
update wx_bill_property b set b.late_pay_price = b.late_pay_price +
round(
b.owe * (select late_pay_ratio from wx_property_contract where id = b.`property_contract_id`) /10000
,2)
update wx_bill_property b set b.late_pay_price =
if(b.late_pay_price is null,
round(
b.owe * (select late_pay_ratio from wx_property_contract where id = b.`property_contract_id`)
* DATEDIFF(now(), date_add(b.receive_date,interval(select late_pay_day from wx_property_contract where id = b.`property_contract_id`) day)) /100
,2)
,
b.late_pay_price +
round(
b.owe * (select late_pay_ratio from wx_property_contract where id = b.`property_contract_id`) /100
,2)
)
where b.status!=3 and b.status!=6
and (select late_pay_ratio from wx_property_contract where id = b.`property_contract_id`) > 0
and DATEDIFF(now(), date_add(b.receive_date,interval(select late_pay_day from wx_property_contract where id = b.`property_contract_id`) day)) >0;


+ 12
- 4
mallinkService/src/main/resources/mapper/WxBillRentMapper.xml ファイルの表示

@@ -235,10 +235,18 @@
</select>

<update id="autoAddLatePayPrice">
update wx_bill_rent b set b.late_pay_price = b.late_pay_price +
round(
b.owe * (select late_pay_ratio from wx_rent_contract where id = b.`rent_contract_id`) /10000
,2)
update wx_bill_rent b set b.late_pay_price =
if(b.late_pay_price is null,
round(
b.owe * (select late_pay_ratio from wx_rent_contract where id = b.`rent_contract_id`)
* DATEDIFF(now(), date_add(b.receive_date,interval(select late_pay_day from wx_rent_contract where id = b.`rent_contract_id`) day)) /100
,2)
,
b.late_pay_price +
round(
b.owe * (select late_pay_ratio from wx_rent_contract where id = b.`rent_contract_id`) /100
,2)
)
where b.status!=3 and b.status!=6
and (select late_pay_ratio from wx_rent_contract where id = b.`rent_contract_id`) > 0
and DATEDIFF(now(), date_add(b.receive_date,interval(select late_pay_day from wx_rent_contract where id = b.`rent_contract_id`) day)) >0;


読み込み中…
キャンセル
保存