| @@ -59,6 +59,8 @@ public interface WxAllBillService { | |||||
| void backPay(WxBillPayDTO dto,MallUserInfo user); | void backPay(WxBillPayDTO dto,MallUserInfo user); | ||||
| void toMechantBackPay(WxBillPayDTO dto,MallUserInfo user); | |||||
| void rentContractStop(WxRentContract rentContract,MallUserInfo user); | void rentContractStop(WxRentContract rentContract,MallUserInfo user); | ||||
| void propertyContractStop(WxPropertyContract propertyContract,MallUserInfo user); | void propertyContractStop(WxPropertyContract propertyContract,MallUserInfo user); | ||||
| @@ -312,6 +312,10 @@ public class WxBillAllHelper { | |||||
| wxAllBillService.backPay(dto, user); | wxAllBillService.backPay(dto, user); | ||||
| } | } | ||||
| public void toMechantBackPay(WxBillPayDTO dto,MallUserInfo user) { | |||||
| wxAllBillService.toMechantBackPay(dto, user); | |||||
| } | |||||
| public void updatePay(WxBillPayDTO dto,MallUserInfo user) { | public void updatePay(WxBillPayDTO dto,MallUserInfo user) { | ||||
| wxAllBillService.updatePay(dto, user); | wxAllBillService.updatePay(dto, user); | ||||
| } | } | ||||
| @@ -520,6 +520,24 @@ public class WxAllBillServiceImpl extends WxBillBaseService implements WxAllBill | |||||
| dto.getAddpay(), dto.getAddpay(),dto.getSetOff(),wxBillRent.getPayDate(),dto.getPayWayObject(),dto.getRemark(),null,null, user); | dto.getAddpay(), dto.getAddpay(),dto.getSetOff(),wxBillRent.getPayDate(),dto.getPayWayObject(),dto.getRemark(),null,null, user); | ||||
| } | } | ||||
| @Override | |||||
| public void toMechantBackPay(WxBillPayDTO dto, MallUserInfo user) { | |||||
| WxAllBill dbBill = wxAllBillMapper.selectById(dto.getId(),dto.getTenantId()); | |||||
| BigDecimal oldreturnPay = new BigDecimal(0); | |||||
| if (StringUtils.isNotBlank(dbBill.getReturnPay())) { | |||||
| oldreturnPay = new BigDecimal(dbBill.getReturnPay()); | |||||
| } | |||||
| WxAllBill wxBillRent = new WxAllBill(); | |||||
| wxBillRent.setId(dto.getId()); | |||||
| wxBillRent.updateTenantInfo(dto); | |||||
| wxBillRent.setUpdatetime(new Date()); | |||||
| wxBillRent.setReturnPay(oldreturnPay.subtract(new BigDecimal(dto.getPayToMerchant())).toPlainString()); | |||||
| wxAllBillMapper.updateById(wxBillRent); | |||||
| EnumBillAction action = EnumBillAction.RETURN; | |||||
| this.addBillAction(action, dto.getBillTypeValue(),dto.getId(), | |||||
| oldreturnPay.toPlainString(), dto.getPayToMerchant(),null,null,null,dto.getRemark(),null,null, user); | |||||
| } | |||||
| @Override | @Override | ||||
| public void rentContractStop(WxRentContract rentContract,MallUserInfo user) { | public void rentContractStop(WxRentContract rentContract,MallUserInfo user) { | ||||
| //删除草稿状态的账单 | //删除草稿状态的账单 | ||||
| @@ -918,7 +918,8 @@ public class WxFinanceServiceImpl implements WxFinanceService { | |||||
| public void invalidReceive(WxFinanceReceive record, MallUserInfo user,boolean isRedSetoff) { | public void invalidReceive(WxFinanceReceive record, MallUserInfo user,boolean isRedSetoff) { | ||||
| //如果自身是预充单,则被冲抵了就不能作废 | //如果自身是预充单,则被冲抵了就不能作废 | ||||
| if (record.getType().intValue() == EnumFinanceReceiveType.ADVANCE.getCode().intValue()) { | |||||
| if (record.getType().intValue() == EnumFinanceCashierType.RECEIVE.getCode().intValue() && | |||||
| record.getReceiveType().intValue() == EnumFinanceReceiveType.ADVANCE.getCode().intValue()) { | |||||
| WxFinanceReceiveSetoff rsq0 = new WxFinanceReceiveSetoff(); | WxFinanceReceiveSetoff rsq0 = new WxFinanceReceiveSetoff(); | ||||
| rsq0.updateTenantInfo(record); | rsq0.updateTenantInfo(record); | ||||
| rsq0.setAdvanceId(record.getId()); | rsq0.setAdvanceId(record.getId()); | ||||
| @@ -964,13 +965,23 @@ public class WxFinanceServiceImpl implements WxFinanceService { | |||||
| payDto.updateTenantInfo(record); | payDto.updateTenantInfo(record); | ||||
| payDto.setId(bill.getId()); | payDto.setId(bill.getId()); | ||||
| payDto.setBillTypeValue(bill.getBillType()); | payDto.setBillTypeValue(bill.getBillType()); | ||||
| payDto.setAddpay(rb.getReceive()); | |||||
| if (isRedSetoff) { | |||||
| payDto.setRemark("收款单红冲,自动回退"); | |||||
| if (record.getType().intValue() == EnumFinanceCashierType.RECEIVE.getCode().intValue()) { | |||||
| payDto.setAddpay(rb.getReceive()); | |||||
| if (isRedSetoff) { | |||||
| payDto.setRemark("收款单红冲,自动回退"); | |||||
| }else { | |||||
| payDto.setRemark("收款单作废,自动回退"); | |||||
| } | |||||
| wxBillAllHelper.backPay(payDto, user); | |||||
| }else { | }else { | ||||
| payDto.setRemark("收款单作废,自动回退"); | |||||
| payDto.setPayToMerchant(rb.getPay()); | |||||
| if (isRedSetoff) { | |||||
| payDto.setRemark("付款单红冲,自动回退"); | |||||
| }else { | |||||
| payDto.setRemark("付款单作废,自动回退"); | |||||
| } | |||||
| wxBillAllHelper.toMechantBackPay(payDto, user); | |||||
| } | } | ||||
| wxBillAllHelper.backPay(payDto, user); | |||||
| }else { | }else { | ||||
| //预收单冲抵回退 | //预收单冲抵回退 | ||||