| @@ -0,0 +1,2 @@ | |||||
| alter table wx_pay_account_bill | |||||
| add column `service_charge_rate` INT (5) NULL DEFAULT 0 COMMENT '手续费费率'; | |||||
| @@ -53,7 +53,6 @@ public class WxBillAction extends BaseEntity { | |||||
| @TableField(exist = false) | @TableField(exist = false) | ||||
| private Long newPrice; | private Long newPrice; | ||||
| @TableField(exist = false) | @TableField(exist = false) | ||||
| private String startDate; | private String startDate; | ||||
| @TableField(exist = false) | @TableField(exist = false) | ||||
| @@ -108,4 +108,11 @@ public class WxBillDaily extends BaseEntity{ | |||||
| @io.swagger.annotations.ApiModelProperty(value = "创建方式1手动2自动3导入", name = "buildWay") | @io.swagger.annotations.ApiModelProperty(value = "创建方式1手动2自动3导入", name = "buildWay") | ||||
| private Integer 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; | |||||
| } | } | ||||
| @@ -75,4 +75,12 @@ public class WxBillDeposit extends BaseEntity { | |||||
| @io.swagger.annotations.ApiModelProperty(value = "冻结状态,0正常1冻结", name = "freeze") | @io.swagger.annotations.ApiModelProperty(value = "冻结状态,0正常1冻结", name = "freeze") | ||||
| private Integer 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; | |||||
| } | } | ||||
| @@ -129,4 +129,12 @@ public class WxBillOther extends BaseEntity { | |||||
| private List<Map<String, Object>> shops; | private List<Map<String, Object>> shops; | ||||
| @io.swagger.annotations.ApiModelProperty(value = "冻结状态,0正常1冻结", name = "freeze") | @io.swagger.annotations.ApiModelProperty(value = "冻结状态,0正常1冻结", name = "freeze") | ||||
| private Integer 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; | |||||
| } | } | ||||
| @@ -138,4 +138,12 @@ public class WxBillOtherDeposit extends BaseEntity { | |||||
| private Date endtime; | private Date endtime; | ||||
| @io.swagger.annotations.ApiModelProperty(value = "冻结状态,0正常1冻结", name = "freeze") | @io.swagger.annotations.ApiModelProperty(value = "冻结状态,0正常1冻结", name = "freeze") | ||||
| private Integer 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; | |||||
| } | } | ||||
| @@ -183,4 +183,12 @@ public class WxBillProperty extends BaseEntity { | |||||
| @io.swagger.annotations.ApiModelProperty(value = "冻结状态,0正常1冻结", name = "freeze") | @io.swagger.annotations.ApiModelProperty(value = "冻结状态,0正常1冻结", name = "freeze") | ||||
| private Integer 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; | |||||
| } | } | ||||
| @@ -73,4 +73,12 @@ public class WxBillPropertyDeposit extends BaseEntity { | |||||
| @io.swagger.annotations.ApiModelProperty(value = "冻结状态,0正常1冻结", name = "freeze") | @io.swagger.annotations.ApiModelProperty(value = "冻结状态,0正常1冻结", name = "freeze") | ||||
| private Integer 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; | |||||
| } | } | ||||
| @@ -7,8 +7,6 @@ import com.iformall.common.SortColumn; | |||||
| import lombok.Data; | import lombok.Data; | ||||
| import lombok.EqualsAndHashCode; | import lombok.EqualsAndHashCode; | ||||
| import lombok.ToString; | import lombok.ToString; | ||||
| import java.math.BigDecimal; | import java.math.BigDecimal; | ||||
| import java.util.Date; | import java.util.Date; | ||||
| @@ -32,9 +30,10 @@ public class WxBillRent extends BaseEntity { | |||||
| @io.swagger.annotations.ApiModelProperty(value="租金合同ID",name="rentContractId") | @io.swagger.annotations.ApiModelProperty(value="租金合同ID",name="rentContractId") | ||||
| private Long rentContractId; | private Long rentContractId; | ||||
| @io.swagger.annotations.ApiModelProperty(value="实际应收金额",name="receivePay") | |||||
| @io.swagger.annotations.ApiModelProperty(value="应收金额",name="receivePay") | |||||
| private Long receivePay; | private Long receivePay; | ||||
| public String getReceivePayStr() { | public String getReceivePayStr() { | ||||
| return new BigDecimal(receivePay == null ? 0 : receivePay).divide(new BigDecimal(100)).toPlainString(); | 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") | @io.swagger.annotations.ApiModelProperty(value = "联营租金", name = "joinRentPrice") | ||||
| private Long 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; | |||||
| } | } | ||||
| @@ -49,6 +49,8 @@ public class WxPayAccountBill extends BaseEntity { | |||||
| return notifyUrl + "/refund"; | return notifyUrl + "/refund"; | ||||
| } | } | ||||
| @io.swagger.annotations.ApiModelProperty(value="手续费费率",name="serviceChargeRate") | |||||
| private Integer serviceChargeRate; | |||||
| } | } | ||||
| @@ -18,6 +18,7 @@ import com.iformall.mapper.WxShopMapper; | |||||
| import com.iformall.service.ExcelService; | import com.iformall.service.ExcelService; | ||||
| import com.iformall.service.WxBillActionService; | import com.iformall.service.WxBillActionService; | ||||
| import com.iformall.service.WxBillDailyService; | import com.iformall.service.WxBillDailyService; | ||||
| import com.iformall.service.WxPayAccountBillService; | |||||
| import com.iformall.utils.DateUtils; | import com.iformall.utils.DateUtils; | ||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||
| import org.slf4j.LoggerFactory; | import org.slf4j.LoggerFactory; | ||||
| @@ -52,16 +53,29 @@ public class WxBillDailyServiceImpl implements WxBillDailyService { | |||||
| StringRedisTemplate stringRedisTemplate; | StringRedisTemplate stringRedisTemplate; | ||||
| @Autowired | @Autowired | ||||
| WxMerchantShopMapper wxMerchantShopMapper; | WxMerchantShopMapper wxMerchantShopMapper; | ||||
| @Autowired | |||||
| WxPayAccountBillService wxPayAccountBillService; | |||||
| @Override | @Override | ||||
| public PageInfo<WxBillDaily> listAsPage(WxBillDaily record, Integer pageIndex, Integer pageSize) { | public PageInfo<WxBillDaily> listAsPage(WxBillDaily record, Integer pageIndex, Integer pageSize) { | ||||
| WxPayAccountBill wxPayAccountBill = wxPayAccountBillService.getByTenantId(record.getTenantId()); | |||||
| //分页对象设置页数和条数 | //分页对象设置页数和条数 | ||||
| PageHelper.startPage(pageIndex, pageSize); | PageHelper.startPage(pageIndex, pageSize); | ||||
| //查询 | //查询 | ||||
| List<WxBillDaily> billDepositList = wxBillDailyMapper.queryBillDailyList(record); | List<WxBillDaily> 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<WxBillDaily> pageInfo = new PageInfo<>(billDepositList); | PageInfo<WxBillDaily> pageInfo = new PageInfo<>(billDepositList); | ||||
| return pageInfo; | return pageInfo; | ||||
| } | } | ||||
| @Override | @Override | ||||
| @@ -9,6 +9,7 @@ import com.iformall.common.ResultData; | |||||
| import com.iformall.domain.po.MallUserInfo; | import com.iformall.domain.po.MallUserInfo; | ||||
| import com.iformall.domain.po.WxBillAction; | import com.iformall.domain.po.WxBillAction; | ||||
| import com.iformall.domain.po.WxBillDeposit; | import com.iformall.domain.po.WxBillDeposit; | ||||
| import com.iformall.domain.po.WxPayAccountBill; | |||||
| import com.iformall.enums.EnumBillAction; | import com.iformall.enums.EnumBillAction; | ||||
| import com.iformall.enums.EnumBillPayWay; | import com.iformall.enums.EnumBillPayWay; | ||||
| import com.iformall.enums.EnumBillRentStatus; | import com.iformall.enums.EnumBillRentStatus; | ||||
| @@ -17,6 +18,7 @@ import com.iformall.exception.MallinkException; | |||||
| import com.iformall.mapper.WxBillDepositMapper; | import com.iformall.mapper.WxBillDepositMapper; | ||||
| import com.iformall.service.WxBillActionService; | import com.iformall.service.WxBillActionService; | ||||
| import com.iformall.service.WxBillDepositService; | import com.iformall.service.WxBillDepositService; | ||||
| import com.iformall.service.WxPayAccountBillService; | |||||
| import com.iformall.utils.DateUtils; | import com.iformall.utils.DateUtils; | ||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||
| import org.slf4j.LoggerFactory; | import org.slf4j.LoggerFactory; | ||||
| @@ -43,10 +45,24 @@ public class WxBillDepositServiceImpl implements WxBillDepositService { | |||||
| @Autowired | @Autowired | ||||
| WxBillActionService wxBillActionService; | WxBillActionService wxBillActionService; | ||||
| @Autowired | |||||
| WxPayAccountBillService wxPayAccountBillService; | |||||
| @Override | @Override | ||||
| public PageInfo<Map<String, Object>> listAsPage(WxBillDeposit record, Integer pageIndex, Integer pageSize) { | public PageInfo<Map<String, Object>> listAsPage(WxBillDeposit record, Integer pageIndex, Integer pageSize) { | ||||
| WxPayAccountBill wxPayAccountBill = wxPayAccountBillService.getByTenantId(record.getTenantId()); | |||||
| PageHelper.startPage(pageIndex, pageSize); | PageHelper.startPage(pageIndex, pageSize); | ||||
| List<Map<String, Object>> billDepositList = wxBillDepositMapper.queryBillDepositList(record); | List<Map<String, Object>> 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<Map<String, Object>> pageInfo = new PageInfo<>(billDepositList); | PageInfo<Map<String, Object>> pageInfo = new PageInfo<>(billDepositList); | ||||
| return pageInfo; | return pageInfo; | ||||
| } | } | ||||
| @@ -7,10 +7,7 @@ import com.iformall.common.ErrorCode; | |||||
| import com.iformall.common.IdWorker; | import com.iformall.common.IdWorker; | ||||
| import com.iformall.common.Result; | import com.iformall.common.Result; | ||||
| import com.iformall.common.ResultData; | 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.enums.*; | ||||
| import com.iformall.exception.MallinkException; | import com.iformall.exception.MallinkException; | ||||
| import com.iformall.mapper.WxBillOtherDepositMapper; | import com.iformall.mapper.WxBillOtherDepositMapper; | ||||
| @@ -18,6 +15,7 @@ import com.iformall.mapper.WxShopMapper; | |||||
| import com.iformall.service.ExcelService; | import com.iformall.service.ExcelService; | ||||
| import com.iformall.service.WxBillActionService; | import com.iformall.service.WxBillActionService; | ||||
| import com.iformall.service.WxBillOtherDepositService; | import com.iformall.service.WxBillOtherDepositService; | ||||
| import com.iformall.service.WxPayAccountBillService; | |||||
| import com.iformall.utils.DateUtils; | import com.iformall.utils.DateUtils; | ||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||
| import org.slf4j.LoggerFactory; | import org.slf4j.LoggerFactory; | ||||
| @@ -49,12 +47,26 @@ public class WxBillOtherDepositServiceImpl implements WxBillOtherDepositService | |||||
| @Autowired | @Autowired | ||||
| ExcelService excelService; | ExcelService excelService; | ||||
| @Autowired | |||||
| WxPayAccountBillService wxPayAccountBillService; | |||||
| @Override | @Override | ||||
| public PageInfo<WxBillOtherDeposit> listAsPage(WxBillOtherDeposit record, Integer pageIndex, Integer pageSize) { | public PageInfo<WxBillOtherDeposit> listAsPage(WxBillOtherDeposit record, Integer pageIndex, Integer pageSize) { | ||||
| WxPayAccountBill wxPayAccountBill = wxPayAccountBillService.getByTenantId(record.getTenantId()); | |||||
| //分页对象设置页数和条数 | //分页对象设置页数和条数 | ||||
| PageHelper.startPage(pageIndex, pageSize); | PageHelper.startPage(pageIndex, pageSize); | ||||
| //查询 | //查询 | ||||
| List<WxBillOtherDeposit> billList = wxBillOtherDepositMapper.queryBillList(record); | List<WxBillOtherDeposit> 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<WxBillOtherDeposit> pageInfo = new PageInfo<>(billList); | PageInfo<WxBillOtherDeposit> pageInfo = new PageInfo<>(billList); | ||||
| return pageInfo; | return pageInfo; | ||||
| @@ -7,10 +7,7 @@ import com.iformall.common.ErrorCode; | |||||
| import com.iformall.common.IdWorker; | import com.iformall.common.IdWorker; | ||||
| import com.iformall.common.Result; | import com.iformall.common.Result; | ||||
| import com.iformall.common.ResultData; | 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.enums.*; | ||||
| import com.iformall.exception.MallinkException; | import com.iformall.exception.MallinkException; | ||||
| import com.iformall.mapper.WxBillOtherMapper; | import com.iformall.mapper.WxBillOtherMapper; | ||||
| @@ -18,6 +15,7 @@ import com.iformall.mapper.WxShopMapper; | |||||
| import com.iformall.service.ExcelService; | import com.iformall.service.ExcelService; | ||||
| import com.iformall.service.WxBillActionService; | import com.iformall.service.WxBillActionService; | ||||
| import com.iformall.service.WxBillOtherService; | import com.iformall.service.WxBillOtherService; | ||||
| import com.iformall.service.WxPayAccountBillService; | |||||
| import com.iformall.utils.DateUtils; | import com.iformall.utils.DateUtils; | ||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||
| import org.slf4j.LoggerFactory; | import org.slf4j.LoggerFactory; | ||||
| @@ -49,12 +47,26 @@ public class WxBillOtherServiceImpl implements WxBillOtherService { | |||||
| @Autowired | @Autowired | ||||
| ExcelService excelService; | ExcelService excelService; | ||||
| @Autowired | |||||
| WxPayAccountBillService wxPayAccountBillService; | |||||
| @Override | @Override | ||||
| public PageInfo<WxBillOther> listAsPage(WxBillOther record, Integer pageIndex, Integer pageSize) { | public PageInfo<WxBillOther> listAsPage(WxBillOther record, Integer pageIndex, Integer pageSize) { | ||||
| WxPayAccountBill wxPayAccountBill = wxPayAccountBillService.getByTenantId(record.getTenantId()); | |||||
| //分页对象设置页数和条数 | //分页对象设置页数和条数 | ||||
| PageHelper.startPage(pageIndex, pageSize); | PageHelper.startPage(pageIndex, pageSize); | ||||
| //查询 | //查询 | ||||
| List<WxBillOther> billList = wxBillOtherMapper.queryBillList(record); | List<WxBillOther> 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<WxBillOther> pageInfo = new PageInfo<>(billList); | PageInfo<WxBillOther> pageInfo = new PageInfo<>(billList); | ||||
| return pageInfo; | return pageInfo; | ||||
| @@ -9,6 +9,7 @@ import com.iformall.common.ResultData; | |||||
| import com.iformall.domain.po.MallUserInfo; | import com.iformall.domain.po.MallUserInfo; | ||||
| import com.iformall.domain.po.WxBillAction; | import com.iformall.domain.po.WxBillAction; | ||||
| import com.iformall.domain.po.WxBillPropertyDeposit; | import com.iformall.domain.po.WxBillPropertyDeposit; | ||||
| import com.iformall.domain.po.WxPayAccountBill; | |||||
| import com.iformall.enums.EnumBillAction; | import com.iformall.enums.EnumBillAction; | ||||
| import com.iformall.enums.EnumBillPayWay; | import com.iformall.enums.EnumBillPayWay; | ||||
| import com.iformall.enums.EnumBillRentStatus; | import com.iformall.enums.EnumBillRentStatus; | ||||
| @@ -17,6 +18,7 @@ import com.iformall.exception.MallinkException; | |||||
| import com.iformall.mapper.WxBillPropertyDepositMapper; | import com.iformall.mapper.WxBillPropertyDepositMapper; | ||||
| import com.iformall.service.WxBillActionService; | import com.iformall.service.WxBillActionService; | ||||
| import com.iformall.service.WxBillPropertyDepositService; | import com.iformall.service.WxBillPropertyDepositService; | ||||
| import com.iformall.service.WxPayAccountBillService; | |||||
| import com.iformall.utils.DateUtils; | import com.iformall.utils.DateUtils; | ||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||
| import org.slf4j.LoggerFactory; | import org.slf4j.LoggerFactory; | ||||
| @@ -41,11 +43,24 @@ public class WxBillPropertyDepositServiceImpl implements WxBillPropertyDepositSe | |||||
| WxBillPropertyDepositMapper wxBillPropertyDepositMapper; | WxBillPropertyDepositMapper wxBillPropertyDepositMapper; | ||||
| @Autowired | @Autowired | ||||
| WxBillActionService wxBillActionService; | WxBillActionService wxBillActionService; | ||||
| @Autowired | |||||
| WxPayAccountBillService wxPayAccountBillService; | |||||
| @Override | @Override | ||||
| public PageInfo<Map<String, Object>> listAsPage(WxBillPropertyDeposit record, Integer pageIndex, Integer pageSize) { | public PageInfo<Map<String, Object>> listAsPage(WxBillPropertyDeposit record, Integer pageIndex, Integer pageSize) { | ||||
| WxPayAccountBill wxPayAccountBill = wxPayAccountBillService.getByTenantId(record.getTenantId()); | |||||
| PageHelper.startPage(pageIndex, pageSize); | PageHelper.startPage(pageIndex, pageSize); | ||||
| List<Map<String, Object>> billDepositList = wxBillPropertyDepositMapper.queryBillDepositList(record); | List<Map<String, Object>> 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<Map<String, Object>> pageInfo = new PageInfo<>(billDepositList); | PageInfo<Map<String, Object>> pageInfo = new PageInfo<>(billDepositList); | ||||
| return pageInfo; | return pageInfo; | ||||
| } | } | ||||
| @@ -16,6 +16,7 @@ import com.iformall.mapper.WxBillPropertyMapper; | |||||
| import com.iformall.service.ExcelService; | import com.iformall.service.ExcelService; | ||||
| import com.iformall.service.WxBillActionService; | import com.iformall.service.WxBillActionService; | ||||
| import com.iformall.service.WxBillPropertyService; | import com.iformall.service.WxBillPropertyService; | ||||
| import com.iformall.service.WxPayAccountBillService; | |||||
| import com.iformall.utils.DateUtils; | import com.iformall.utils.DateUtils; | ||||
| import org.apache.commons.lang3.StringUtils; | import org.apache.commons.lang3.StringUtils; | ||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||
| @@ -51,11 +52,25 @@ public class WxBillPropertyServiceImpl implements WxBillPropertyService { | |||||
| @Autowired | @Autowired | ||||
| WxBillActionMapper wxBillActionMapper; | WxBillActionMapper wxBillActionMapper; | ||||
| @Autowired | |||||
| WxPayAccountBillService wxPayAccountBillService; | |||||
| @Override | @Override | ||||
| public PageInfo<WxBillProperty> listAsPage(WxBillProperty record, Integer pageIndex, Integer pageSize) { | public PageInfo<WxBillProperty> listAsPage(WxBillProperty record, Integer pageIndex, Integer pageSize) { | ||||
| WxPayAccountBill wxPayAccountBill = wxPayAccountBillService.getByTenantId(record.getTenantId()); | |||||
| PageHelper.startPage(pageIndex, pageSize); | PageHelper.startPage(pageIndex, pageSize); | ||||
| List<WxBillProperty> billRentList = wxBillPropertyMapper.queryBillPropertyList(record); | List<WxBillProperty> 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<WxBillProperty> pageInfo = new PageInfo<>(billRentList); | PageInfo<WxBillProperty> pageInfo = new PageInfo<>(billRentList); | ||||
| return pageInfo; | return pageInfo; | ||||
| } | } | ||||
| @@ -1,6 +1,5 @@ | |||||
| package com.iformall.service.impl; | package com.iformall.service.impl; | ||||
| import com.alibaba.fastjson.JSONArray; | |||||
| import com.alibaba.fastjson.JSONObject; | import com.alibaba.fastjson.JSONObject; | ||||
| import com.github.pagehelper.PageHelper; | import com.github.pagehelper.PageHelper; | ||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| @@ -16,6 +15,7 @@ import com.iformall.mapper.*; | |||||
| import com.iformall.service.ExcelService; | import com.iformall.service.ExcelService; | ||||
| import com.iformall.service.WxBillActionService; | import com.iformall.service.WxBillActionService; | ||||
| import com.iformall.service.WxBillRentService; | import com.iformall.service.WxBillRentService; | ||||
| import com.iformall.service.WxPayAccountBillService; | |||||
| import com.iformall.utils.DateUtils; | import com.iformall.utils.DateUtils; | ||||
| import org.apache.commons.lang3.StringUtils; | import org.apache.commons.lang3.StringUtils; | ||||
| import org.joda.time.DateTime; | import org.joda.time.DateTime; | ||||
| @@ -27,7 +27,6 @@ import org.slf4j.LoggerFactory; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.stereotype.Service; | import org.springframework.stereotype.Service; | ||||
| import org.springframework.transaction.annotation.Transactional; | import org.springframework.transaction.annotation.Transactional; | ||||
| import javax.servlet.http.HttpServletRequest; | import javax.servlet.http.HttpServletRequest; | ||||
| import javax.servlet.http.HttpServletResponse; | import javax.servlet.http.HttpServletResponse; | ||||
| import java.math.BigDecimal; | import java.math.BigDecimal; | ||||
| @@ -45,29 +44,37 @@ public class WxBillRentServiceImpl implements WxBillRentService { | |||||
| @Autowired | @Autowired | ||||
| WxBillRentMapper wxBillRentMapper; | WxBillRentMapper wxBillRentMapper; | ||||
| @Autowired | @Autowired | ||||
| WxBillDepositMapper wxBillDepositMapper; | WxBillDepositMapper wxBillDepositMapper; | ||||
| @Autowired | @Autowired | ||||
| WxBillActionService wxBillActionService; | WxBillActionService wxBillActionService; | ||||
| @Autowired | @Autowired | ||||
| ExcelService excelService; | ExcelService excelService; | ||||
| @Autowired | @Autowired | ||||
| WxBillActionMapper wxBillActionMapper; | WxBillActionMapper wxBillActionMapper; | ||||
| @Autowired | @Autowired | ||||
| WxRentContractMapper wxRentContractMapper; | WxRentContractMapper wxRentContractMapper; | ||||
| @Autowired | @Autowired | ||||
| WxMerchantTradeDailyMapper wxMerchantTradeDailyMapper; | WxMerchantTradeDailyMapper wxMerchantTradeDailyMapper; | ||||
| @Autowired | |||||
| WxPayAccountBillService wxPayAccountBillService; | |||||
| @Override | @Override | ||||
| public PageInfo<WxBillRent> listAsPage(WxBillRent record, Integer pageIndex, Integer pageSize) { | public PageInfo<WxBillRent> listAsPage(WxBillRent record, Integer pageIndex, Integer pageSize) { | ||||
| WxPayAccountBill wxPayAccountBill = wxPayAccountBillService.getByTenantId(record.getTenantId()); | |||||
| PageHelper.startPage(pageIndex, pageSize); | PageHelper.startPage(pageIndex, pageSize); | ||||
| List<WxBillRent> billRentList = wxBillRentMapper.queryBillRentList(record); | List<WxBillRent> 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<WxBillRent> pageInfo = new PageInfo<>(billRentList); | PageInfo<WxBillRent> pageInfo = new PageInfo<>(billRentList); | ||||
| return pageInfo; | return pageInfo; | ||||
| } | } | ||||
| @@ -14,10 +14,11 @@ | |||||
| <result column="real_rate" jdbcType="INTEGER" property="realRate"/> | <result column="real_rate" jdbcType="INTEGER" property="realRate"/> | ||||
| <result column="bank_account_name" jdbcType="VARCHAR" property="bankAccountName"/> | <result column="bank_account_name" jdbcType="VARCHAR" property="bankAccountName"/> | ||||
| <result column="bank_card_id" jdbcType="VARCHAR" property="bankCardId"/> | <result column="bank_card_id" jdbcType="VARCHAR" property="bankCardId"/> | ||||
| <result column="service_charge_rate" property="serviceChargeRate"/> | |||||
| </resultMap> | </resultMap> | ||||
| <sql id="allColumns"> | <sql id="allColumns"> | ||||
| `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 | |||||
| </sql> | </sql> | ||||
| <sql id="dynamicWhereConditions"> | <sql id="dynamicWhereConditions"> | ||||