From 75e7d7e4a62d2ba5219cc3ccbd11350dd1381e3f Mon Sep 17 00:00:00 2001 From: luozukai Date: Mon, 3 Jun 2019 17:02:12 +0800 Subject: [PATCH] =?UTF-8?q?[=E9=A2=84=E8=A7=88=E8=B4=A6=E5=8D=95][?= =?UTF-8?q?=E4=BF=AE=E6=94=B9][=E4=BF=AE=E6=94=B9=E9=A2=84=E8=B4=A6?= =?UTF-8?q?=E5=8D=95=E9=87=91=E9=A2=9D=E9=97=AE=E9=A2=98]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../db/migration/V201906031645__L_ALTER_MSG.sql | 7 +++++++ .../db/migration/V201906031651__L_ALTER_MSG.sql | 1 + .../service/impl/WxPropertyContractServiceImpl.java | 12 ++++++++---- .../service/impl/WxRentContractServiceImpl.java | 11 +++++++---- 4 files changed, 23 insertions(+), 8 deletions(-) create mode 100644 mallinkAdmin/src/main/resources/db/migration/V201906031645__L_ALTER_MSG.sql create mode 100644 mallinkAdmin/src/main/resources/db/migration/V201906031651__L_ALTER_MSG.sql diff --git a/mallinkAdmin/src/main/resources/db/migration/V201906031645__L_ALTER_MSG.sql b/mallinkAdmin/src/main/resources/db/migration/V201906031645__L_ALTER_MSG.sql new file mode 100644 index 000000000..6b0df422e --- /dev/null +++ b/mallinkAdmin/src/main/resources/db/migration/V201906031645__L_ALTER_MSG.sql @@ -0,0 +1,7 @@ +update wx_bill_rent set is_preview = 0 where rent_contract_id in( +select id from wx_rent_contract where apply_status = 2 +); + +update wx_bill_property set is_preview = 0 where property_contract_id in( +select id from wx_property_contract where apply_status = 2 +); \ No newline at end of file diff --git a/mallinkAdmin/src/main/resources/db/migration/V201906031651__L_ALTER_MSG.sql b/mallinkAdmin/src/main/resources/db/migration/V201906031651__L_ALTER_MSG.sql new file mode 100644 index 000000000..dd4a93681 --- /dev/null +++ b/mallinkAdmin/src/main/resources/db/migration/V201906031651__L_ALTER_MSG.sql @@ -0,0 +1 @@ +alter table wx_merchant_trade_daily modify column trade_amt BIGINT(20); \ No newline at end of file diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxPropertyContractServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxPropertyContractServiceImpl.java index 93eb65b20..d8a61d290 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxPropertyContractServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxPropertyContractServiceImpl.java @@ -358,7 +358,7 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService //建立账单 WxPropertyContract record = wxPropertyContractMapper.selectByPrimaryKey(id); if (record.getMerchantId() != null && record.getStatus().equals(EnumRentContractStatus.SIGNED_RENT_UNPAID.getCode()) - && record.getReceivePeriod() != null && record.getDeposit() > 0 && record.getPrice() > 0) { + && record.getReceivePeriod() != null && record.getPrice() > 0) { //WxBillProperty wxBillProperty = new WxBillProperty(); //wxBillProperty.setMerchantId(record.getMerchantId()); //List> billPropertyList = wxBillPropertyMapper.queryBillPropertyList(wxBillProperty); @@ -560,20 +560,24 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService priceD = new Double(price)/12; } + SimpleDateFormat sdM = new SimpleDateFormat("yyyy-MM"); if(i == 0){//第一期 if(wxPropertyContract.getAdjustPeriod().equals(EnumRentContractAdjustPeriod.ADJUST_PERIOD_NAR_MONTH.getCode())){ if(isFirstDay(billTimeVo.getStartDate())){ - needpay = new Double(receivePeriod * priceD).longValue(); + int months = WxRentContractServiceImpl.getMonths(sdM.format(billTimeVo.getStartDate())+"-01",sdM.format(billTimeVo.getEndDate())+"-01"); + needpay = new Double(months * priceD).longValue(); }else{ needpay = new Double(WxRentContractServiceImpl.getMonthNeedPay(priceD, billTimeVo.getStartDate(), billTimeVo.getEndDate())).longValue(); } }else{ - needpay = new Double(receivePeriod * priceD).longValue(); + int months = WxRentContractServiceImpl.getMonths(sdM.format(billTimeVo.getStartDate())+"-01",sdM.format(billTimeVo.getEndDate())+"-01"); + needpay = new Double(months * priceD).longValue(); } }else if(i == billTimeVoList.size()-1){//最后 needpay = new Double(WxRentContractServiceImpl.getMonthNeedPay(priceD,billTimeVo.getStartDate(),billTimeVo.getEndDate())).longValue(); }else{//中间 - needpay = new Double(receivePeriod * priceD).longValue(); + int months = WxRentContractServiceImpl.getMonths(sdM.format(billTimeVo.getStartDate())+"-01",sdM.format(billTimeVo.getEndDate())+"-01"); + needpay = new Double(months * priceD).longValue(); } } diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java index 0a9818517..83ef6b503 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java @@ -950,20 +950,24 @@ public class WxRentContractServiceImpl implements WxRentContractService { priceD = new Double(price)/12; } + SimpleDateFormat sdM = new SimpleDateFormat("yyyy-MM"); if(i == 0){//第一期 if(wxRentContract.getAdjustPeriod().equals(EnumRentContractAdjustPeriod.ADJUST_PERIOD_NAR_MONTH.getCode())){ if(isFirstDay(billTimeVo.getStartDate())){ - needpay = new Double(receivePeriod * priceD).longValue(); + int months = getMonths(sdM.format(billTimeVo.getStartDate())+"-01",sdM.format(billTimeVo.getEndDate())+"-01"); + needpay = new Double(months * priceD).longValue(); }else{ needpay = new Double(getMonthNeedPay(priceD, billTimeVo.getStartDate(), billTimeVo.getEndDate())).longValue(); } }else{ - needpay = new Double(receivePeriod * priceD).longValue(); + int months = getMonths(sdM.format(billTimeVo.getStartDate())+"-01",sdM.format(billTimeVo.getEndDate())+"-01"); + needpay = new Double(months * priceD).longValue(); } }else if(i == billTimeVoList.size()-1){//最后 needpay = new Double(getMonthNeedPay(priceD,billTimeVo.getStartDate(),billTimeVo.getEndDate())).longValue(); }else{//中间 - needpay = new Double(receivePeriod * priceD).longValue(); + int months = getMonths(sdM.format(billTimeVo.getStartDate())+"-01",sdM.format(billTimeVo.getEndDate())+"-01"); + needpay = new Double(months * priceD).longValue(); } } @@ -1277,7 +1281,6 @@ public class WxRentContractServiceImpl implements WxRentContractService { record.getMerchantId() != null && record.getStatus().equals(EnumRentContractStatus.SIGNED_RENT_UNPAID.getCode()) && record.getReceivePeriod() != null && - record.getDeposit() > 0 && record.getPrice() > 0) { WxBillRent wxBillRent = new WxBillRent(); wxBillRent.setMerchantId(record.getMerchantId());