diff --git a/mallinkAdmin/src/main/resources/db/migration/V201910091526__L_CONTRACT.sql b/mallinkAdmin/src/main/resources/db/migration/V201910091526__L_CONTRACT.sql new file mode 100644 index 000000000..cd9c03da9 --- /dev/null +++ b/mallinkAdmin/src/main/resources/db/migration/V201910091526__L_CONTRACT.sql @@ -0,0 +1,2 @@ +alter table wx_pay_account_bill +add column `service_charge_rate` INT (5) NULL DEFAULT 0 COMMENT '手续费费率'; diff --git a/mallinkService/src/main/java/com/iformall/domain/po/WxBillAction.java b/mallinkService/src/main/java/com/iformall/domain/po/WxBillAction.java index ac11df1ca..255bb5e8f 100644 --- a/mallinkService/src/main/java/com/iformall/domain/po/WxBillAction.java +++ b/mallinkService/src/main/java/com/iformall/domain/po/WxBillAction.java @@ -53,7 +53,6 @@ public class WxBillAction extends BaseEntity { @TableField(exist = false) private Long newPrice; - @TableField(exist = false) private String startDate; @TableField(exist = false) diff --git a/mallinkService/src/main/java/com/iformall/domain/po/WxBillDaily.java b/mallinkService/src/main/java/com/iformall/domain/po/WxBillDaily.java index 7d339cb23..ecbb56853 100644 --- a/mallinkService/src/main/java/com/iformall/domain/po/WxBillDaily.java +++ b/mallinkService/src/main/java/com/iformall/domain/po/WxBillDaily.java @@ -108,4 +108,11 @@ public class WxBillDaily extends BaseEntity{ @io.swagger.annotations.ApiModelProperty(value = "创建方式1手动2自动3导入", name = "buildWay") private Integer buildWay; + @io.swagger.annotations.ApiModelProperty(value = "手续费", name = "serviceChargePay") + @TableField(exist = false) + private Integer serviceChargePay; + + @io.swagger.annotations.ApiModelProperty(value="实际应收金额",name="realReceivePay") + @TableField(exist = false) + private Long realReceivePay; } diff --git a/mallinkService/src/main/java/com/iformall/domain/po/WxBillDeposit.java b/mallinkService/src/main/java/com/iformall/domain/po/WxBillDeposit.java index eda10cd93..f016cacc9 100644 --- a/mallinkService/src/main/java/com/iformall/domain/po/WxBillDeposit.java +++ b/mallinkService/src/main/java/com/iformall/domain/po/WxBillDeposit.java @@ -75,4 +75,12 @@ public class WxBillDeposit extends BaseEntity { @io.swagger.annotations.ApiModelProperty(value = "冻结状态,0正常1冻结", name = "freeze") private Integer freeze; + + @io.swagger.annotations.ApiModelProperty(value = "手续费", name = "serviceChargePay") + @TableField(exist = false) + private Integer serviceChargePay; + + @io.swagger.annotations.ApiModelProperty(value="实际应收金额",name="realReceivePay") + @TableField(exist = false) + private Long realReceivePay; } diff --git a/mallinkService/src/main/java/com/iformall/domain/po/WxBillOther.java b/mallinkService/src/main/java/com/iformall/domain/po/WxBillOther.java index d0dfee561..15c06e95e 100644 --- a/mallinkService/src/main/java/com/iformall/domain/po/WxBillOther.java +++ b/mallinkService/src/main/java/com/iformall/domain/po/WxBillOther.java @@ -129,4 +129,12 @@ public class WxBillOther extends BaseEntity { private List> shops; @io.swagger.annotations.ApiModelProperty(value = "冻结状态,0正常1冻结", name = "freeze") private Integer freeze; + + @io.swagger.annotations.ApiModelProperty(value = "手续费", name = "serviceChargePay") + @TableField(exist = false) + private Integer serviceChargePay; + + @io.swagger.annotations.ApiModelProperty(value="实际应收金额",name="realReceivePay") + @TableField(exist = false) + private Long realReceivePay; } diff --git a/mallinkService/src/main/java/com/iformall/domain/po/WxBillOtherDeposit.java b/mallinkService/src/main/java/com/iformall/domain/po/WxBillOtherDeposit.java index ec724d5d9..736f432ec 100644 --- a/mallinkService/src/main/java/com/iformall/domain/po/WxBillOtherDeposit.java +++ b/mallinkService/src/main/java/com/iformall/domain/po/WxBillOtherDeposit.java @@ -138,4 +138,12 @@ public class WxBillOtherDeposit extends BaseEntity { private Date endtime; @io.swagger.annotations.ApiModelProperty(value = "冻结状态,0正常1冻结", name = "freeze") private Integer freeze; + + @io.swagger.annotations.ApiModelProperty(value = "手续费", name = "serviceChargePay") + @TableField(exist = false) + private Integer serviceChargePay; + + @io.swagger.annotations.ApiModelProperty(value="实际应收金额",name="realReceivePay") + @TableField(exist = false) + private Long realReceivePay; } diff --git a/mallinkService/src/main/java/com/iformall/domain/po/WxBillProperty.java b/mallinkService/src/main/java/com/iformall/domain/po/WxBillProperty.java index 78c7a76ca..407740ec6 100644 --- a/mallinkService/src/main/java/com/iformall/domain/po/WxBillProperty.java +++ b/mallinkService/src/main/java/com/iformall/domain/po/WxBillProperty.java @@ -183,4 +183,12 @@ public class WxBillProperty extends BaseEntity { @io.swagger.annotations.ApiModelProperty(value = "冻结状态,0正常1冻结", name = "freeze") private Integer freeze; + + @io.swagger.annotations.ApiModelProperty(value = "手续费", name = "serviceChargePay") + @TableField(exist = false) + private Integer serviceChargePay; + + @io.swagger.annotations.ApiModelProperty(value="实际应收金额",name="realReceivePay") + @TableField(exist = false) + private Long realReceivePay; } diff --git a/mallinkService/src/main/java/com/iformall/domain/po/WxBillPropertyDeposit.java b/mallinkService/src/main/java/com/iformall/domain/po/WxBillPropertyDeposit.java index 6ea43752c..57a5a73f4 100644 --- a/mallinkService/src/main/java/com/iformall/domain/po/WxBillPropertyDeposit.java +++ b/mallinkService/src/main/java/com/iformall/domain/po/WxBillPropertyDeposit.java @@ -73,4 +73,12 @@ public class WxBillPropertyDeposit extends BaseEntity { @io.swagger.annotations.ApiModelProperty(value = "冻结状态,0正常1冻结", name = "freeze") private Integer freeze; + + @io.swagger.annotations.ApiModelProperty(value = "手续费", name = "serviceChargePay") + @TableField(exist = false) + private Integer serviceChargePay; + + @io.swagger.annotations.ApiModelProperty(value="实际应收金额",name="realReceivePay") + @TableField(exist = false) + private Long realReceivePay; } diff --git a/mallinkService/src/main/java/com/iformall/domain/po/WxBillRent.java b/mallinkService/src/main/java/com/iformall/domain/po/WxBillRent.java index 756f9c97c..0a55b5df9 100644 --- a/mallinkService/src/main/java/com/iformall/domain/po/WxBillRent.java +++ b/mallinkService/src/main/java/com/iformall/domain/po/WxBillRent.java @@ -7,8 +7,6 @@ import com.iformall.common.SortColumn; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; - - import java.math.BigDecimal; import java.util.Date; @@ -32,9 +30,10 @@ public class WxBillRent extends BaseEntity { @io.swagger.annotations.ApiModelProperty(value="租金合同ID",name="rentContractId") private Long rentContractId; - @io.swagger.annotations.ApiModelProperty(value="实际应收金额",name="receivePay") + @io.swagger.annotations.ApiModelProperty(value="应收金额",name="receivePay") private Long receivePay; + public String getReceivePayStr() { return new BigDecimal(receivePay == null ? 0 : receivePay).divide(new BigDecimal(100)).toPlainString(); } @@ -196,4 +195,13 @@ public class WxBillRent extends BaseEntity { @io.swagger.annotations.ApiModelProperty(value = "联营租金", name = "joinRentPrice") private Long joinRentPrice; + + + @io.swagger.annotations.ApiModelProperty(value = "手续费", name = "serviceChargePay") + @TableField(exist = false) + private Integer serviceChargePay; + + @io.swagger.annotations.ApiModelProperty(value="实际应收金额",name="realReceivePay") + @TableField(exist = false) + private Long realReceivePay; } diff --git a/mallinkService/src/main/java/com/iformall/domain/po/WxPayAccountBill.java b/mallinkService/src/main/java/com/iformall/domain/po/WxPayAccountBill.java index 4d49ac4b2..dd9699bed 100644 --- a/mallinkService/src/main/java/com/iformall/domain/po/WxPayAccountBill.java +++ b/mallinkService/src/main/java/com/iformall/domain/po/WxPayAccountBill.java @@ -49,6 +49,8 @@ public class WxPayAccountBill extends BaseEntity { return notifyUrl + "/refund"; } + @io.swagger.annotations.ApiModelProperty(value="手续费费率",name="serviceChargeRate") + private Integer serviceChargeRate; } diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxBillDailyServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxBillDailyServiceImpl.java index bd029e7fd..9d388fd77 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxBillDailyServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxBillDailyServiceImpl.java @@ -18,6 +18,7 @@ import com.iformall.mapper.WxShopMapper; import com.iformall.service.ExcelService; import com.iformall.service.WxBillActionService; import com.iformall.service.WxBillDailyService; +import com.iformall.service.WxPayAccountBillService; import com.iformall.utils.DateUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -52,16 +53,29 @@ public class WxBillDailyServiceImpl implements WxBillDailyService { StringRedisTemplate stringRedisTemplate; @Autowired WxMerchantShopMapper wxMerchantShopMapper; + @Autowired + WxPayAccountBillService wxPayAccountBillService; + @Override public PageInfo listAsPage(WxBillDaily record, Integer pageIndex, Integer pageSize) { + WxPayAccountBill wxPayAccountBill = wxPayAccountBillService.getByTenantId(record.getTenantId()); //分页对象设置页数和条数 PageHelper.startPage(pageIndex, pageSize); //查询 List billDepositList = wxBillDailyMapper.queryBillDailyList(record); + billDepositList.stream().forEach(e->{ + //手续费 = 合同应收+手续费+滞纳金 + if(e.getReceivePay() != null){ + if(e.getLatePayPrice() == null) e.setLatePayPrice(0l); + BigDecimal 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()); + } + }); //结果放入分页对象 PageInfo pageInfo = new PageInfo<>(billDepositList); return pageInfo; - } @Override diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxBillDepositServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxBillDepositServiceImpl.java index 7f4aaf772..d9501a00f 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxBillDepositServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxBillDepositServiceImpl.java @@ -9,6 +9,7 @@ import com.iformall.common.ResultData; import com.iformall.domain.po.MallUserInfo; import com.iformall.domain.po.WxBillAction; import com.iformall.domain.po.WxBillDeposit; +import com.iformall.domain.po.WxPayAccountBill; import com.iformall.enums.EnumBillAction; import com.iformall.enums.EnumBillPayWay; import com.iformall.enums.EnumBillRentStatus; @@ -17,6 +18,7 @@ import com.iformall.exception.MallinkException; import com.iformall.mapper.WxBillDepositMapper; import com.iformall.service.WxBillActionService; import com.iformall.service.WxBillDepositService; +import com.iformall.service.WxPayAccountBillService; import com.iformall.utils.DateUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -43,10 +45,24 @@ public class WxBillDepositServiceImpl implements WxBillDepositService { @Autowired WxBillActionService wxBillActionService; + @Autowired + WxPayAccountBillService wxPayAccountBillService; + @Override public PageInfo> listAsPage(WxBillDeposit record, Integer pageIndex, Integer pageSize) { + WxPayAccountBill wxPayAccountBill = wxPayAccountBillService.getByTenantId(record.getTenantId()); PageHelper.startPage(pageIndex, pageSize); List> billDepositList = wxBillDepositMapper.queryBillDepositList(record); + billDepositList.stream().forEach(e->{ + //手续费 = 合同应收+手续费+滞纳金 + if(e.get("receivePay") != null){ + Long receivePayB = (Long)e.get("receivePay"); + BigDecimal servicePay = new BigDecimal(receivePayB).multiply(new BigDecimal(wxPayAccountBill.getServiceChargeRate())).divide(new BigDecimal(10000), 2, BigDecimal.ROUND_HALF_UP); + Long realReceivePay = servicePay.longValue() + receivePayB; + e.put("realReceivePay",realReceivePay); + e.put("serviceChargePay",servicePay.intValue()); + } + }); PageInfo> pageInfo = new PageInfo<>(billDepositList); return pageInfo; } diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxBillOtherDepositServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxBillOtherDepositServiceImpl.java index 1ca8460e9..5e69ae6d9 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxBillOtherDepositServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxBillOtherDepositServiceImpl.java @@ -7,10 +7,7 @@ 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.MallUserInfo; -import com.iformall.domain.po.WxBillAction; -import com.iformall.domain.po.WxBillOtherDeposit; -import com.iformall.domain.po.WxShop; +import com.iformall.domain.po.*; import com.iformall.enums.*; import com.iformall.exception.MallinkException; import com.iformall.mapper.WxBillOtherDepositMapper; @@ -18,6 +15,7 @@ import com.iformall.mapper.WxShopMapper; import com.iformall.service.ExcelService; import com.iformall.service.WxBillActionService; import com.iformall.service.WxBillOtherDepositService; +import com.iformall.service.WxPayAccountBillService; import com.iformall.utils.DateUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -49,12 +47,26 @@ public class WxBillOtherDepositServiceImpl implements WxBillOtherDepositService @Autowired ExcelService excelService; + @Autowired + WxPayAccountBillService wxPayAccountBillService; + @Override public PageInfo listAsPage(WxBillOtherDeposit record, Integer pageIndex, Integer pageSize) { + WxPayAccountBill wxPayAccountBill = wxPayAccountBillService.getByTenantId(record.getTenantId()); //分页对象设置页数和条数 PageHelper.startPage(pageIndex, pageSize); //查询 List billList = wxBillOtherDepositMapper.queryBillList(record); + billList.stream().forEach(e->{ + //手续费 = 合同应收+手续费+滞纳金 + if(e.getReceivePay() != null){ + if(e.getLatePayPrice() == null) e.setLatePayPrice(0l); + BigDecimal 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()); + } + }); //结果放入分页对象 PageInfo pageInfo = new PageInfo<>(billList); return pageInfo; diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxBillOtherServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxBillOtherServiceImpl.java index c9f355329..49ecfd152 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxBillOtherServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxBillOtherServiceImpl.java @@ -7,10 +7,7 @@ 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.MallUserInfo; -import com.iformall.domain.po.WxBillAction; -import com.iformall.domain.po.WxBillOther; -import com.iformall.domain.po.WxShop; +import com.iformall.domain.po.*; import com.iformall.enums.*; import com.iformall.exception.MallinkException; import com.iformall.mapper.WxBillOtherMapper; @@ -18,6 +15,7 @@ import com.iformall.mapper.WxShopMapper; import com.iformall.service.ExcelService; import com.iformall.service.WxBillActionService; import com.iformall.service.WxBillOtherService; +import com.iformall.service.WxPayAccountBillService; import com.iformall.utils.DateUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -49,12 +47,26 @@ public class WxBillOtherServiceImpl implements WxBillOtherService { @Autowired ExcelService excelService; + @Autowired + WxPayAccountBillService wxPayAccountBillService; + @Override public PageInfo listAsPage(WxBillOther record, Integer pageIndex, Integer pageSize) { + WxPayAccountBill wxPayAccountBill = wxPayAccountBillService.getByTenantId(record.getTenantId()); //分页对象设置页数和条数 PageHelper.startPage(pageIndex, pageSize); //查询 List billList = wxBillOtherMapper.queryBillList(record); + billList.stream().forEach(e->{ + //手续费 = 合同应收+手续费+滞纳金 + if(e.getReceivePay() != null){ + if(e.getLatePayPrice() == null) e.setLatePayPrice(0l); + BigDecimal 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()); + } + }); //结果放入分页对象 PageInfo pageInfo = new PageInfo<>(billList); return pageInfo; diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxBillPropertyDepositServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxBillPropertyDepositServiceImpl.java index 13acbb78d..729922016 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxBillPropertyDepositServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxBillPropertyDepositServiceImpl.java @@ -9,6 +9,7 @@ import com.iformall.common.ResultData; import com.iformall.domain.po.MallUserInfo; import com.iformall.domain.po.WxBillAction; import com.iformall.domain.po.WxBillPropertyDeposit; +import com.iformall.domain.po.WxPayAccountBill; import com.iformall.enums.EnumBillAction; import com.iformall.enums.EnumBillPayWay; import com.iformall.enums.EnumBillRentStatus; @@ -17,6 +18,7 @@ import com.iformall.exception.MallinkException; import com.iformall.mapper.WxBillPropertyDepositMapper; import com.iformall.service.WxBillActionService; import com.iformall.service.WxBillPropertyDepositService; +import com.iformall.service.WxPayAccountBillService; import com.iformall.utils.DateUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -41,11 +43,24 @@ public class WxBillPropertyDepositServiceImpl implements WxBillPropertyDepositSe WxBillPropertyDepositMapper wxBillPropertyDepositMapper; @Autowired WxBillActionService wxBillActionService; + @Autowired + WxPayAccountBillService wxPayAccountBillService; @Override public PageInfo> listAsPage(WxBillPropertyDeposit record, Integer pageIndex, Integer pageSize) { + WxPayAccountBill wxPayAccountBill = wxPayAccountBillService.getByTenantId(record.getTenantId()); PageHelper.startPage(pageIndex, pageSize); List> billDepositList = wxBillPropertyDepositMapper.queryBillDepositList(record); + billDepositList.stream().forEach(e->{ + //手续费 = 合同应收+手续费+滞纳金 + if(e.get("receivePay") != null){ + Long receivePayB = (Long)e.get("receivePay"); + BigDecimal servicePay = new BigDecimal(receivePayB).multiply(new BigDecimal(wxPayAccountBill.getServiceChargeRate())).divide(new BigDecimal(10000), 2, BigDecimal.ROUND_HALF_UP); + Long realReceivePay = servicePay.longValue() + receivePayB; + e.put("realReceivePay",realReceivePay); + e.put("serviceChargePay",servicePay.intValue()); + } + }); PageInfo> pageInfo = new PageInfo<>(billDepositList); return pageInfo; } diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxBillPropertyServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxBillPropertyServiceImpl.java index 1c113086f..9bc4ff6eb 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxBillPropertyServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxBillPropertyServiceImpl.java @@ -16,6 +16,7 @@ import com.iformall.mapper.WxBillPropertyMapper; import com.iformall.service.ExcelService; import com.iformall.service.WxBillActionService; import com.iformall.service.WxBillPropertyService; +import com.iformall.service.WxPayAccountBillService; import com.iformall.utils.DateUtils; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; @@ -51,11 +52,25 @@ public class WxBillPropertyServiceImpl implements WxBillPropertyService { @Autowired WxBillActionMapper wxBillActionMapper; + @Autowired + WxPayAccountBillService wxPayAccountBillService; + @Override public PageInfo listAsPage(WxBillProperty record, Integer pageIndex, Integer pageSize) { + WxPayAccountBill wxPayAccountBill = wxPayAccountBillService.getByTenantId(record.getTenantId()); PageHelper.startPage(pageIndex, pageSize); List billRentList = wxBillPropertyMapper.queryBillPropertyList(record); + billRentList.stream().forEach(e->{ + //手续费 = 合同应收+手续费+滞纳金 + if(e.getReceivePay() != null){ + if(e.getLatePayPrice() == null) e.setLatePayPrice(0l); + BigDecimal 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()); + } + }); PageInfo pageInfo = new PageInfo<>(billRentList); return pageInfo; } diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxBillRentServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxBillRentServiceImpl.java index 59c0c0370..dbbcc9402 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxBillRentServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxBillRentServiceImpl.java @@ -1,6 +1,5 @@ package com.iformall.service.impl; -import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; @@ -16,6 +15,7 @@ import com.iformall.mapper.*; import com.iformall.service.ExcelService; import com.iformall.service.WxBillActionService; import com.iformall.service.WxBillRentService; +import com.iformall.service.WxPayAccountBillService; import com.iformall.utils.DateUtils; import org.apache.commons.lang3.StringUtils; import org.joda.time.DateTime; @@ -27,7 +27,6 @@ import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; - import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.math.BigDecimal; @@ -45,29 +44,37 @@ public class WxBillRentServiceImpl implements WxBillRentService { @Autowired WxBillRentMapper wxBillRentMapper; - @Autowired WxBillDepositMapper wxBillDepositMapper; - @Autowired WxBillActionService wxBillActionService; - @Autowired ExcelService excelService; - @Autowired WxBillActionMapper wxBillActionMapper; - @Autowired WxRentContractMapper wxRentContractMapper; - @Autowired WxMerchantTradeDailyMapper wxMerchantTradeDailyMapper; + @Autowired + WxPayAccountBillService wxPayAccountBillService; @Override public PageInfo listAsPage(WxBillRent record, Integer pageIndex, Integer pageSize) { + WxPayAccountBill wxPayAccountBill = wxPayAccountBillService.getByTenantId(record.getTenantId()); + PageHelper.startPage(pageIndex, pageSize); List billRentList = wxBillRentMapper.queryBillRentList(record); + billRentList.stream().forEach(e->{ + //手续费 = 合同应收+手续费+滞纳金 + if(e.getReceivePay() != null){ + if(e.getLatePayPrice() == null) e.setLatePayPrice(0l); + BigDecimal 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()); + } + }); PageInfo pageInfo = new PageInfo<>(billRentList); return pageInfo; } diff --git a/mallinkService/src/main/resources/mapper/WxPayAccountBillMapper.xml b/mallinkService/src/main/resources/mapper/WxPayAccountBillMapper.xml index 1af26ac7b..e4b505971 100644 --- a/mallinkService/src/main/resources/mapper/WxPayAccountBillMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxPayAccountBillMapper.xml @@ -14,10 +14,11 @@ + - `id`,`mch_id`,`sub_mch_id`,`api_key`,`notify_url`,`cert_path`,`type`,`share`,`rate`,`real_rate` + `id`,`mch_id`,`sub_mch_id`,`api_key`,`notify_url`,`cert_path`,`type`,`share`,`rate`,`real_rate`,service_charge_rate