| @@ -345,6 +345,9 @@ public class WxRentContractController extends BaseController { | |||||
| if(StringUtils.isBlank(payAccountBill.getBankCardId())) { | if(StringUtils.isBlank(payAccountBill.getBankCardId())) { | ||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL, "甲方银行账户卡号未填写"); | return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL, "甲方银行账户卡号未填写"); | ||||
| } | } | ||||
| if (payAccountBill.getServiceChargeRate() == null) { | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL, "手续费费率未填写"); | |||||
| } | |||||
| String tenantId = getTenantId(); | String tenantId = getTenantId(); | ||||
| WxPayAccountBill payAccountBillNew = payAccountBillService.getByTenantId(tenantId); | WxPayAccountBill payAccountBillNew = payAccountBillService.getByTenantId(tenantId); | ||||
| payAccountBillNew.setBankAccountName(payAccountBill.getBankAccountName()); | payAccountBillNew.setBankAccountName(payAccountBill.getBankAccountName()); | ||||
| @@ -1,10 +1,7 @@ | |||||
| package com.iformall.mapper; | package com.iformall.mapper; | ||||
| import com.iformall.common.CommonMapper; | import com.iformall.common.CommonMapper; | ||||
| import com.iformall.domain.po.WxBillProperty; | |||||
| import com.iformall.domain.po.WxBillRent; | |||||
| import com.iformall.domain.po.WxPropertyContract; | |||||
| import com.iformall.domain.po.WxRentContract; | |||||
| import com.iformall.domain.po.*; | |||||
| import java.util.List; | import java.util.List; | ||||
| import java.util.Map; | import java.util.Map; | ||||
| @@ -55,4 +52,7 @@ public interface WxBillPropertyMapper extends CommonMapper<WxBillProperty, Long> | |||||
| * 保存billAction | * 保存billAction | ||||
| */ | */ | ||||
| void insertBillAction(); | void insertBillAction(); | ||||
| void updateServiceCharge(WxPayAccountBill tenantId); | |||||
| } | } | ||||
| @@ -2,6 +2,7 @@ package com.iformall.mapper; | |||||
| import com.iformall.common.CommonMapper; | import com.iformall.common.CommonMapper; | ||||
| import com.iformall.domain.po.WxBillRent; | import com.iformall.domain.po.WxBillRent; | ||||
| import com.iformall.domain.po.WxPayAccountBill; | |||||
| import com.iformall.domain.po.WxRentContract; | import com.iformall.domain.po.WxRentContract; | ||||
| import org.apache.ibatis.annotations.Param; | import org.apache.ibatis.annotations.Param; | ||||
| @@ -52,4 +53,7 @@ public interface WxBillRentMapper extends CommonMapper<WxBillRent, Long> { | |||||
| * 保存billAction | * 保存billAction | ||||
| */ | */ | ||||
| void insertBillAction(); | void insertBillAction(); | ||||
| void updateServiceCharge(WxPayAccountBill record); | |||||
| } | } | ||||
| @@ -363,12 +363,17 @@ public class WxBillAllServiceImpl implements WxBillAllService { | |||||
| //status不是欠缴,都展示0,与前端保持一致 | //status不是欠缴,都展示0,与前端保持一致 | ||||
| if (!EnumBillRentStatus.NOT_PAID.getCode().equals(wxBillAllVo.getStatus())) { | if (!EnumBillRentStatus.NOT_PAID.getCode().equals(wxBillAllVo.getStatus())) { | ||||
| wxBillAllVo.setOwe(0l); | |||||
| wxBillAllVo.setOwe(0L); | |||||
| wxBillAllVo.setOweStr("0"); | wxBillAllVo.setOweStr("0"); | ||||
| } | } | ||||
| datalist.add(wxBillAllVo); | datalist.add(wxBillAllVo); | ||||
| } | } | ||||
| } | } | ||||
| WxPayAccountBill wxPayAccountBill = wxPayAccountBillService.getByTenantId(wxBillAll.getTenantId()); | |||||
| datalist.stream().forEach(e -> { | |||||
| //手续费 = 合同应收+手续费+滞纳金 | |||||
| cmputeTotalMoney(wxPayAccountBill, e); | |||||
| }); | |||||
| excelService.exportExcel(datalist, null, "账单数据", WxBillAllVo.class, "账单数据.xlsx", response, false); | excelService.exportExcel(datalist, null, "账单数据", WxBillAllVo.class, "账单数据.xlsx", response, false); | ||||
| } | } | ||||
| @@ -289,11 +289,10 @@ public class WxBillPropertyServiceImpl implements WxBillPropertyService { | |||||
| WxBillPropertyDeposit deposit = null; | WxBillPropertyDeposit deposit = null; | ||||
| List<WxBillPropertyDeposit> billDepositList = wxBillPropertyDepositMapper.queryBillDepositList(depositParam); | List<WxBillPropertyDeposit> billDepositList = wxBillPropertyDepositMapper.queryBillDepositList(depositParam); | ||||
| if (!billDepositList.isEmpty()) { | if (!billDepositList.isEmpty()) { | ||||
| WxPayAccountBill wxPayAccountBill = wxPayAccountBillService.getByTenantId(property.getTenantId()); | |||||
| deposit = billDepositList.get(0); | deposit = billDepositList.get(0); | ||||
| wxBillPropertyDepositService.computeTotalMoney(wxPayAccountBill, deposit); | |||||
| deposit.setOwe(deposit.getRealReceivePay() - deposit.getPay()); | |||||
| //WxPayAccountBill wxPayAccountBill = wxPayAccountBillService.getByTenantId(property.getTenantId()); | |||||
| //wxBillPropertyDepositService.computeTotalMoney(wxPayAccountBill, deposit); | |||||
| //deposit.setOwe(deposit.getRealReceivePay() - deposit.getPay()); | |||||
| } | } | ||||
| Map<String, Object> result = new HashMap<>(2); | Map<String, Object> result = new HashMap<>(2); | ||||
| result.put("property", property); | result.put("property", property); | ||||
| @@ -289,10 +289,10 @@ public class WxBillRentServiceImpl implements WxBillRentService { | |||||
| WxBillDeposit deposit = null; | WxBillDeposit deposit = null; | ||||
| List<WxBillDeposit> billDepositList = wxBillDepositMapper.queryBillDepositList(depositParam); | List<WxBillDeposit> billDepositList = wxBillDepositMapper.queryBillDepositList(depositParam); | ||||
| if (!billDepositList.isEmpty()) { | if (!billDepositList.isEmpty()) { | ||||
| WxPayAccountBill wxPayAccountBill = wxPayAccountBillService.getByTenantId(rent.getTenantId()); | |||||
| deposit = billDepositList.get(0); | deposit = billDepositList.get(0); | ||||
| wxBillDepositService.computeTotalMoney(wxPayAccountBill, deposit); | |||||
| deposit.setOwe(deposit.getRealReceivePay() - deposit.getPay()); | |||||
| //WxPayAccountBill wxPayAccountBill = wxPayAccountBillService.getByTenantId(rent.getTenantId()); | |||||
| //wxBillDepositService.computeTotalMoney(wxPayAccountBill, deposit); | |||||
| //deposit.setOwe(deposit.getRealReceivePay() - deposit.getPay()); | |||||
| } | } | ||||
| //周期 | //周期 | ||||
| Map<String, Object> result = new HashMap<>(3); | Map<String, Object> result = new HashMap<>(3); | ||||
| @@ -5,6 +5,8 @@ import com.github.pagehelper.PageHelper; | |||||
| import com.github.pagehelper.PageInfo; | import com.github.pagehelper.PageInfo; | ||||
| import com.iformall.common.IdWorker; | import com.iformall.common.IdWorker; | ||||
| import com.iformall.domain.po.WxPayAccountBill; | import com.iformall.domain.po.WxPayAccountBill; | ||||
| import com.iformall.mapper.WxBillPropertyMapper; | |||||
| import com.iformall.mapper.WxBillRentMapper; | |||||
| import com.iformall.mapper.WxPayAccountBillMapper; | import com.iformall.mapper.WxPayAccountBillMapper; | ||||
| import com.iformall.service.WxPayAccountBillService; | import com.iformall.service.WxPayAccountBillService; | ||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||
| @@ -19,6 +21,11 @@ public class WxPayAccountBillServiceImpl implements WxPayAccountBillService { | |||||
| @Autowired | @Autowired | ||||
| WxPayAccountBillMapper wxPayAccountBillMapper; | WxPayAccountBillMapper wxPayAccountBillMapper; | ||||
| @Autowired | |||||
| WxBillRentMapper wxBillRentMapper; | |||||
| @Autowired | |||||
| WxBillPropertyMapper wxBillPropertyMapper; | |||||
| @Override | @Override | ||||
| public PageInfo<WxPayAccountBill> listAsPage(WxPayAccountBill record, Integer pageIndex, Integer pageSize) { | public PageInfo<WxPayAccountBill> listAsPage(WxPayAccountBill record, Integer pageIndex, Integer pageSize) { | ||||
| @@ -40,13 +47,17 @@ public class WxPayAccountBillServiceImpl implements WxPayAccountBillService { | |||||
| @Override | @Override | ||||
| public void saveOrUpdate(WxPayAccountBill record) { | public void saveOrUpdate(WxPayAccountBill record) { | ||||
| if (record.getId() == null) { | if (record.getId() == null) { | ||||
| //record.setId(UUID.randomUUID().toString().replaceAll("-", "")); | |||||
| final IdWorker idWorker = IdWorker.get(); | final IdWorker idWorker = IdWorker.get(); | ||||
| record.setId(idWorker.nextId()); | record.setId(idWorker.nextId()); | ||||
| wxPayAccountBillMapper.insert(record); | wxPayAccountBillMapper.insert(record); | ||||
| } else { | } else { | ||||
| wxPayAccountBillMapper.updateById(record); | wxPayAccountBillMapper.updateById(record); | ||||
| } | } | ||||
| //更新手续费 | |||||
| wxBillRentMapper.updateServiceCharge(record); | |||||
| wxBillPropertyMapper.updateServiceCharge(record); | |||||
| } | } | ||||
| @Override | @Override | ||||
| @@ -268,5 +268,10 @@ | |||||
| and (select late_pay_ratio from wx_property_contract where id = b.`property_contract_id`) > 0 | 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; | 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; | ||||
| </update> | </update> | ||||
| <update id="updateServiceCharge" parameterType="com.iformall.domain.po.WxPayAccountBill"> | |||||
| update wx_bill_property set service_charge_pay=round(receive_pay+receive_pay*#{serviceChargeRate}/100) where tenant_id=#{tenantId} and status in(1,2,4) | |||||
| </update> | |||||
| </mapper> | </mapper> | ||||
| @@ -274,5 +274,10 @@ | |||||
| and (select late_pay_ratio from wx_rent_contract where id = b.`rent_contract_id`) > 0 | 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; | 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; | ||||
| </update> | </update> | ||||
| <update id="updateServiceCharge" parameterType="com.iformall.domain.po.WxPayAccountBill"> | |||||
| update wx_bill_rent set service_charge_pay=round(receive_pay+receive_pay*#{serviceChargeRate}/100) where tenant_id=#{tenantId} and status in(1,2,4) | |||||
| </update> | |||||
| </mapper> | </mapper> | ||||