From 78eac3ed422b3ee734638f7ad6a8a0c7c932af6d Mon Sep 17 00:00:00 2001 From: gongbiao Date: Fri, 2 Aug 2019 11:31:49 +0800 Subject: [PATCH 1/5] =?UTF-8?q?[=E7=A7=AF=E5=88=86=E8=A7=84=E5=88=99][?= =?UTF-8?q?=E4=BF=AE=E6=94=B9][=E5=88=9D=E5=A7=8B=E5=8C=96=E6=95=B0?= =?UTF-8?q?=E6=8D=AE]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/iformall/domain/po/WxScoreRules.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mallinkService/src/main/java/com/iformall/domain/po/WxScoreRules.java b/mallinkService/src/main/java/com/iformall/domain/po/WxScoreRules.java index 808f4bd0c..1b46e7207 100644 --- a/mallinkService/src/main/java/com/iformall/domain/po/WxScoreRules.java +++ b/mallinkService/src/main/java/com/iformall/domain/po/WxScoreRules.java @@ -40,6 +40,7 @@ public class WxScoreRules extends BaseEntity { " {\"businessId\":8,\"limit\":0,\"step\":1,\"score\":0 ,\"desc\":\"线上交易1元\"}," + " {\"businessId\":9,\"limit\":0,\"step\":1,\"score\":0 ,\"desc\":\"线上交易1元\"}," + " {\"businessId\":10,\"limit\":0,\"step\":1,\"score\":0 ,\"desc\":\"线上交易1元\"}," + + " {\"businessId\":11,\"limit\":0,\"step\":1,\"score\":0 ,\"desc\":\"线上交易1元\"}," + " {\"businessId\":6,\"limit\":0,\"step\":1,\"score\":0 ,\"desc\":\"线上交易1元\"}" + "]}," + "{\"id\":3,\"limit\":1,\"step\":1,\"score\":0,\"desc\":\"绑定车牌1个\"}," + @@ -62,6 +63,7 @@ public class WxScoreRules extends BaseEntity { " {\"businessId\":8,\"limit\":0,\"step\":1,\"score\":0 ,\"desc\":\"线上交易1元\"}," + " {\"businessId\":9,\"limit\":0,\"step\":1,\"score\":0 ,\"desc\":\"线上交易1元\"}," + " {\"businessId\":10,\"limit\":0,\"step\":1,\"score\":0 ,\"desc\":\"线上交易1元\"}," + + " {\"businessId\":11,\"limit\":0,\"step\":1,\"score\":0 ,\"desc\":\"线上交易1元\"}," + " {\"businessId\":6,\"limit\":0,\"step\":1,\"score\":0 ,\"desc\":\"线上交易1元\"}" + "]}," + "{\"id\":3,\"limit\":1,\"step\":1,\"score\":0,\"desc\":\"绑定车牌1个\"}," + From 27664f6ab415834d6d437ff19846270a0f997f06 Mon Sep 17 00:00:00 2001 From: luozukai Date: Fri, 2 Aug 2019 17:23:13 +0800 Subject: [PATCH 2/5] =?UTF-8?q?[=E5=90=88=E5=90=8C][=E4=BF=AE=E6=94=B9][?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=A2=84=E8=B4=A6=E5=8D=95]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../V201908021153__L_ALTER_CONTENT.sql | 2 ++ .../impl/WxRentContractServiceImpl.java | 9 +++++++-- .../resources/mapper/WxBillPropertyMapper.xml | 20 +++++++++++++------ .../resources/mapper/WxBillRentMapper.xml | 16 +++++++++++---- 4 files changed, 35 insertions(+), 12 deletions(-) create mode 100644 mallinkAdmin/src/main/resources/db/migration/V201908021153__L_ALTER_CONTENT.sql diff --git a/mallinkAdmin/src/main/resources/db/migration/V201908021153__L_ALTER_CONTENT.sql b/mallinkAdmin/src/main/resources/db/migration/V201908021153__L_ALTER_CONTENT.sql new file mode 100644 index 000000000..887c759c5 --- /dev/null +++ b/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; \ No newline at end of file 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 fb016c149..679366023 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java @@ -1000,6 +1000,7 @@ public class WxRentContractServiceImpl implements WxRentContractService { return shopInfoStr; } + public Map buildRent(int receivePeriod, long[] priceArrs, List yearList, int dayType, WxRentContract wxRentContract, Long userId, int billcount, Integer isPreview, String shopInfoStr,boolean saveDb) { SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd"); Map 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; diff --git a/mallinkService/src/main/resources/mapper/WxBillPropertyMapper.xml b/mallinkService/src/main/resources/mapper/WxBillPropertyMapper.xml index ca7195c3d..c474f6b22 100644 --- a/mallinkService/src/main/resources/mapper/WxBillPropertyMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxBillPropertyMapper.xml @@ -139,9 +139,9 @@ 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 @@ -233,10 +233,18 @@ - 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; diff --git a/mallinkService/src/main/resources/mapper/WxBillRentMapper.xml b/mallinkService/src/main/resources/mapper/WxBillRentMapper.xml index f3fc95312..07329ef2b 100644 --- a/mallinkService/src/main/resources/mapper/WxBillRentMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxBillRentMapper.xml @@ -235,10 +235,18 @@ - 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; From 6396b676a63930d066232a1adfa63fe328597b4b Mon Sep 17 00:00:00 2001 From: gongbiao Date: Fri, 2 Aug 2019 17:59:04 +0800 Subject: [PATCH 3/5] =?UTF-8?q?[C=E7=AB=AF=E9=A6=96=E9=A1=B5][=E4=BF=AE?= =?UTF-8?q?=E6=94=B9][=E6=8D=A2=E4=B8=80=E6=8D=A2=E6=8B=BC=E5=9B=A2?= =?UTF-8?q?=E4=B8=8E=E7=A0=8D=E4=BB=B7]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/WxCouponChannelController.java | 3 +-- .../iformall/service/WxCouponChannelService.java | 2 +- .../service/impl/WxCouponChannelServiceImpl.java | 14 ++++++++++---- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/mallinkCApi/src/main/java/com/iformall/controller/WxCouponChannelController.java b/mallinkCApi/src/main/java/com/iformall/controller/WxCouponChannelController.java index 0150bfadb..0e13d506f 100644 --- a/mallinkCApi/src/main/java/com/iformall/controller/WxCouponChannelController.java +++ b/mallinkCApi/src/main/java/com/iformall/controller/WxCouponChannelController.java @@ -106,8 +106,7 @@ public class WxCouponChannelController extends BaseController { wxCouponChannel.setStatus(EnumCouponChannelStatus.STATUS_THROW_IN.getCode()); wxCouponChannel.setCouponStatus(EnumCouponStatus.COUPON_STATUS_THROW_IN.getCode()); wxCouponChannel.setSortColumns(BaseEntity.SortField.UpdateDate_DESC, BaseEntity.SortField.Id_DESC); - WxCouponChannelVo vo = wxCouponChannelService.change(wxCouponChannel); - return new ResultData(vo); + return wxCouponChannelService.change(wxCouponChannel); } diff --git a/mallinkService/src/main/java/com/iformall/service/WxCouponChannelService.java b/mallinkService/src/main/java/com/iformall/service/WxCouponChannelService.java index 70974113c..70d3b5043 100644 --- a/mallinkService/src/main/java/com/iformall/service/WxCouponChannelService.java +++ b/mallinkService/src/main/java/com/iformall/service/WxCouponChannelService.java @@ -70,6 +70,6 @@ public interface WxCouponChannelService { void updateStatusByCouponId(Long couponId,String tenantId,int status); - WxCouponChannelVo change(WxCouponChannel wxCouponChannel); + ResultData change(WxCouponChannel wxCouponChannel); } diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxCouponChannelServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxCouponChannelServiceImpl.java index 9b5b86653..12f5447b7 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxCouponChannelServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxCouponChannelServiceImpl.java @@ -4,6 +4,7 @@ import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import com.iformall.common.ErrorCode; import com.iformall.common.IdWorker; +import com.iformall.common.Result; import com.iformall.common.ResultData; import com.iformall.domain.po.WxCoupon; import com.iformall.domain.po.WxCouponChannel; @@ -138,7 +139,7 @@ public class WxCouponChannelServiceImpl implements WxCouponChannelService { } @Override - public WxCouponChannelVo change(WxCouponChannel record) { + public ResultData change(WxCouponChannel record) { Long couponId = 0L; if (record.getCouponId() != null) { couponId = record.getCouponId(); @@ -146,10 +147,13 @@ public class WxCouponChannelServiceImpl implements WxCouponChannelService { } List voList = wxCouponChannelMapper.findVoList(record); if (voList.isEmpty()) { - return null; + return new ResultData(Result.SUCCESS, "查询成功", null); } + Map data = new HashMap<>(); if (voList.size() == 1) { - return voList.get(0); + data.put("size", 1); + data.put("data", voList.get(0)); + return new ResultData(Result.SUCCESS, "查询成功", data); } Long finalCouponId = couponId; voList = voList.stream() @@ -157,7 +161,9 @@ public class WxCouponChannelServiceImpl implements WxCouponChannelService { .collect(Collectors.toList()); int size = voList.size(); Random random = new Random(); - return voList.get(random.nextInt(size)); + data.put("size", size); + data.put("data", voList.get(random.nextInt(size))); + return new ResultData(Result.SUCCESS, "查询成功", data); } private boolean isCouponMerchantValid(Long couponId) { From bc3337ee333f4ba78800985bc28083bffd15a6f2 Mon Sep 17 00:00:00 2001 From: luozukai Date: Fri, 2 Aug 2019 18:17:52 +0800 Subject: [PATCH 4/5] =?UTF-8?q?[=E6=BB=9E=E7=BA=B3=E9=87=91][=E4=BF=AE?= =?UTF-8?q?=E6=94=B9][=E4=BF=9D=E5=AD=98billAction]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../schedule/LatePayBillActionSchedule.java | 42 +------------------ .../iformall/mapper/WxBillPropertyMapper.java | 5 +++ .../com/iformall/mapper/WxBillRentMapper.java | 5 +++ .../resources/mapper/WxBillPropertyMapper.xml | 24 +++++++++-- .../resources/mapper/WxBillRentMapper.xml | 26 +++++++++--- 5 files changed, 53 insertions(+), 49 deletions(-) diff --git a/mallinkSchedule/src/main/java/com/iformall/schedule/LatePayBillActionSchedule.java b/mallinkSchedule/src/main/java/com/iformall/schedule/LatePayBillActionSchedule.java index b3764334b..98d1772fc 100644 --- a/mallinkSchedule/src/main/java/com/iformall/schedule/LatePayBillActionSchedule.java +++ b/mallinkSchedule/src/main/java/com/iformall/schedule/LatePayBillActionSchedule.java @@ -1,22 +1,12 @@ package com.iformall.schedule; -import com.iformall.common.IdWorker; -import com.iformall.domain.po.WxBillAction; -import com.iformall.domain.po.WxBillProperty; -import com.iformall.domain.po.WxBillRent; -import com.iformall.enums.EnumBillAction; -import com.iformall.mapper.WxBillActionMapper; import com.iformall.mapper.WxBillPropertyMapper; import com.iformall.mapper.WxBillRentMapper; -import com.iformall.service.WxBillPropertyService; -import com.iformall.service.WxBillRentService; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; -import java.math.BigDecimal; -import java.util.List; /** * @author luozukai @@ -24,13 +14,6 @@ import java.util.List; @Component public class LatePayBillActionSchedule { private final Logger logger = LoggerFactory.getLogger(this.getClass()); - - @Autowired - private WxBillRentService wxBillRentService; - @Autowired - private WxBillPropertyService wxBillPropertyService; - @Autowired - private WxBillActionMapper wxBillActionMapper; @Autowired private WxBillRentMapper wxBillRentMapper; @Autowired @@ -42,30 +25,9 @@ public class LatePayBillActionSchedule { public void updateBillStatus() { try { logger.info("账单滞纳金更新开始"); - final IdWorker idWorker = IdWorker.get(); - List billRentList = wxBillRentService.findLatePayBill(); - for (WxBillRent wxBillRent : billRentList) { - WxBillAction billAction = new WxBillAction(); - billAction.setId(idWorker.nextId()); - billAction.setUserName("系统端"); - billAction.setAction(EnumBillAction.UPDATE_LATE_PAY_MONEY.getCode()); - billAction.setBillId(wxBillRent.getId()); - BigDecimal divide = new BigDecimal(wxBillRent.getOwe()).multiply(new BigDecimal(wxBillRent.getLatePayRatio())).divide(new BigDecimal(10000), 2, BigDecimal.ROUND_HALF_UP); - billAction.setDetails("系统计入"+ divide.toString()+"元"); - wxBillActionMapper.insertSelective(billAction); - } + wxBillRentMapper.insertBillAction(); + wxBillPropertyMapper.insertBillAction(); - List billPropertyList = wxBillPropertyService.findLatePayBill(); - for (WxBillProperty wxBillRent : billPropertyList) { - WxBillAction billAction = new WxBillAction(); - billAction.setId(idWorker.nextId()); - billAction.setUserName("系统端"); - billAction.setAction(EnumBillAction.UPDATE_LATE_PAY_MONEY.getCode()); - billAction.setBillId(wxBillRent.getId()); - BigDecimal divide = new BigDecimal(wxBillRent.getOwe()).multiply(new BigDecimal(wxBillRent.getLatePayRatio())).divide(new BigDecimal(10000), 2, BigDecimal.ROUND_HALF_UP); - billAction.setDetails("系统计入"+ divide.toString()+"元"); - wxBillActionMapper.insertSelective(billAction); - } wxBillRentMapper.autoAddLatePayPrice(); wxBillPropertyMapper.autoAddLatePayPrice(); logger.info("账单滞纳金更新结束"); diff --git a/mallinkService/src/main/java/com/iformall/mapper/WxBillPropertyMapper.java b/mallinkService/src/main/java/com/iformall/mapper/WxBillPropertyMapper.java index 53ce3ae72..d7511c725 100644 --- a/mallinkService/src/main/java/com/iformall/mapper/WxBillPropertyMapper.java +++ b/mallinkService/src/main/java/com/iformall/mapper/WxBillPropertyMapper.java @@ -52,4 +52,9 @@ public interface WxBillPropertyMapper extends CommonMapper * 累加每一天的滞纳金 */ void autoAddLatePayPrice(); + + /** + * 保存billAction + */ + void insertBillAction(); } diff --git a/mallinkService/src/main/java/com/iformall/mapper/WxBillRentMapper.java b/mallinkService/src/main/java/com/iformall/mapper/WxBillRentMapper.java index 67f7bf2e4..b39254a4b 100644 --- a/mallinkService/src/main/java/com/iformall/mapper/WxBillRentMapper.java +++ b/mallinkService/src/main/java/com/iformall/mapper/WxBillRentMapper.java @@ -49,4 +49,9 @@ public interface WxBillRentMapper extends CommonMapper { * 累加每一天的滞纳金 */ void autoAddLatePayPrice(); + + /** + * 保存billAction + */ + void insertBillAction(); } diff --git a/mallinkService/src/main/resources/mapper/WxBillPropertyMapper.xml b/mallinkService/src/main/resources/mapper/WxBillPropertyMapper.xml index c474f6b22..c536190ea 100644 --- a/mallinkService/src/main/resources/mapper/WxBillPropertyMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxBillPropertyMapper.xml @@ -226,11 +226,27 @@ AND date_format(starttime,'%Y-%m-%d 00:00:00.0') = #{starttime} AND date_format(endtime,'%Y-%m-%d 00:00:00.0') = #{endtime} - + and DATEDIFF(now(), date_add(b.receive_date,interval(c.late_pay_day) day)) >0 + and b.status!=3 and b.status!=6 + update wx_bill_property b set b.late_pay_price = diff --git a/mallinkService/src/main/resources/mapper/WxBillRentMapper.xml b/mallinkService/src/main/resources/mapper/WxBillRentMapper.xml index 07329ef2b..8d20ec925 100644 --- a/mallinkService/src/main/resources/mapper/WxBillRentMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxBillRentMapper.xml @@ -228,11 +228,27 @@ AND date_format(starttime,'%Y-%m-%d 00:00:00.0') = #{starttime} AND date_format(endtime,'%Y-%m-%d 00:00:00.0') = #{endtime} - + + insert into wx_bill_action(id,user_name,`action`,bill_id,details) + select + (select unix_timestamp(now()) + CEILING(RAND()*90000+10000)) id + ,'系统端' user_name,7 `action`,b.id bill_id, + CONCAT('系统计入', + if(b.late_pay_price is null, + round( + b.owe * c.late_pay_ratio * DATEDIFF(now(), date_add(b.receive_date,interval(c.late_pay_day) day)) /10000 + ,2) + , + round( + b.owe * (c.late_pay_ratio) /10000 + ,2) + ) + ,'元') details + from wx_bill_rent b left join wx_rent_contract c on(b.rent_contract_id=c.id) + where c.late_pay_ratio >0 + and DATEDIFF(now(), date_add(b.receive_date,interval(c.late_pay_day) day)) >0 + and b.status!=3 and b.status!=6 + update wx_bill_rent b set b.late_pay_price = From 5ccfde51285bc26bfd64d14a6a72190f54a0a622 Mon Sep 17 00:00:00 2001 From: luozukai Date: Fri, 2 Aug 2019 18:19:18 +0800 Subject: [PATCH 5/5] =?UTF-8?q?[=E6=BB=9E=E7=BA=B3=E9=87=91][=E4=BF=AE?= =?UTF-8?q?=E6=94=B9][=E4=BF=9D=E5=AD=98billAction]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../contract/WxRentContractController.java | 31 ++----------------- 1 file changed, 3 insertions(+), 28 deletions(-) diff --git a/mallinkAdmin/src/main/java/com/iformall/controller/contract/WxRentContractController.java b/mallinkAdmin/src/main/java/com/iformall/controller/contract/WxRentContractController.java index 6ccd412cc..6be4e6f0c 100644 --- a/mallinkAdmin/src/main/java/com/iformall/controller/contract/WxRentContractController.java +++ b/mallinkAdmin/src/main/java/com/iformall/controller/contract/WxRentContractController.java @@ -56,39 +56,14 @@ public class WxRentContractController extends BaseController { WxBillRentMapper wxBillRentMapper; @Autowired WxBillPropertyMapper wxBillPropertyMapper; - @Autowired - private WxBillActionMapper wxBillActionMapper; - @Autowired - private WxBillPropertyService wxBillPropertyService; @GetMapping("autolatePay") @SystemControllerLog(description = "autolatePay") public ResultData autolatePay(String startDate, String endDate) throws Exception{ try { logger.info("账单滞纳金更新开始"); - final IdWorker idWorker = IdWorker.get(); - List billRentList = wxBillRentService.findLatePayBill(); - for (WxBillRent wxBillRent : billRentList) { - WxBillAction billAction = new WxBillAction(); - billAction.setId(idWorker.nextId()); - billAction.setUserName("系统端"); - billAction.setAction(EnumBillAction.UPDATE_LATE_PAY_MONEY.getCode()); - billAction.setBillId(wxBillRent.getId()); - BigDecimal divide = new BigDecimal(wxBillRent.getOwe()).multiply(new BigDecimal(wxBillRent.getLatePayRatio())).divide(new BigDecimal(10000), 2, BigDecimal.ROUND_HALF_UP); - billAction.setDetails("系统计入"+ divide.toString()+"元"); - wxBillActionMapper.insertSelective(billAction); - } - - List billPropertyList = wxBillPropertyService.findLatePayBill(); - for (WxBillProperty wxBillRent : billPropertyList) { - WxBillAction billAction = new WxBillAction(); - billAction.setId(idWorker.nextId()); - billAction.setUserName("系统端"); - billAction.setAction(EnumBillAction.UPDATE_LATE_PAY_MONEY.getCode()); - billAction.setBillId(wxBillRent.getId()); - BigDecimal divide = new BigDecimal(wxBillRent.getOwe()).multiply(new BigDecimal(wxBillRent.getLatePayRatio())).divide(new BigDecimal(10000), 2, BigDecimal.ROUND_HALF_UP); - billAction.setDetails("系统计入"+ divide.toString()+"元"); - wxBillActionMapper.insertSelective(billAction); - } + wxBillRentMapper.insertBillAction(); + wxBillPropertyMapper.insertBillAction(); + wxBillRentMapper.autoAddLatePayPrice(); wxBillPropertyMapper.autoAddLatePayPrice(); logger.info("账单滞纳金更新结束");