| | |
| | | @ExcelColumn(name="合同编号",index = 2,width = 10) |
| | | @TableField(exist = false) |
| | | private String contractCode; |
| | | @ApiModelProperty(value = "合同状态", example = "1") |
| | | @TableField(exist = false) |
| | | private Integer contractStatus; |
| | | |
| | | @ApiModelProperty(value = "楼宇房间", example = "1") |
| | | @ExcelColumn(name="楼宇房间",index = 1,width = 10) |
| | |
| | | ){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | | } |
| | | YwContractBill ywContractBill = ywContractBillMapper.selectById(ywContractRevenue.getBillId()); |
| | | YwContractBill ywContractBill = ywContractBillMapper.selectJoinOne(YwContractBill.class, |
| | | new MPJLambdaWrapper<YwContractBill>() |
| | | .selectAll(YwContractBill.class) |
| | | .selectAs(YwContract::getStatus, YwContractBill::getContractStatus) |
| | | .leftJoin(YwContract.class,YwContract::getId,YwContractBill::getContractId) |
| | | .eq(YwContractBill::getId,ywContractRevenue.getBillId())); |
| | | if(Objects.isNull(ywContractBill)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"未查询到账单信息"); |
| | | } |
| | |
| | | ywContractRevenueMapper.insert(ywContractRevenue); |
| | | ywContractBillMapper.updateById(ywContractBill); |
| | | //如果账单完结,则查询合同下开启中的账单是否存在退款中 如果不存在则标记合同已退款 |
| | | if(Constants.equalsInteger(ywContractBill.getPayStatus(),Constants.ONE)){ |
| | | if(Constants.equalsInteger(ywContractBill.getContractStatus(),Constants.THREE) |
| | | && Constants.equalsInteger(ywContractBill.getPayStatus(),Constants.ONE)){ |
| | | if( ywContractBillMapper |
| | | .selectCount(new QueryWrapper<YwContractBill>().lambda().eq(YwContractBill::getContractId,ywContractBill.getContractId()) |
| | | .ne(YwContractBill::getId,ywContractBill.getId()) |
| | |
| | | .replace("{param3}",DateUtil.getDateLongSlash(model.getBtDate())) |
| | | .replace("{param4}",fee.compareTo(new BigDecimal(0)) >=0?"收":"付") |
| | | .replace("{param5}",(fee.compareTo(new BigDecimal(0)) >=0? |
| | | Constants.formatBigdecimal2Float(model.getBtFee()).intValue() |
| | | :(Constants.formatBigdecimal2Float(model.getBtFee()).intValue() * -1))+"" ); |
| | | Constants.formatBigdecimal2Float(model.getBtFee()) |
| | | :(Constants.formatBigdecimal2Float(model.getBtFee()).multiply(new BigDecimal(-1)))).toString()); |
| | | return str; |
| | | } |
| | | private String getbackRentLogByParam(YwContract model) { |
| | | BigDecimal fee = Constants.formatBigdecimal(model.getBtFee()); |
| | | String str = "【退租日{param1},退租原因:{param2},退租协议中统计的费用总计{param3}元。】"; |
| | | String str = "【退租日{param1},退租原因:{param2},退租协议中统计的费用总计需{param4}{param5}元。】"; |
| | | str = str.replace("{param1}",DateUtil.getDateLongSlash(model.getBtDate())) |
| | | .replace("{param2}",StringUtils.defaultString(model.getBtInfo(),"")) |
| | | .replace("{param3}",Constants.formatBigdecimal2Float(model.getBtFee()).doubleValue()+""); |
| | | .replace("{param4}",fee.compareTo(new BigDecimal(0)) >=0?"收":"付") |
| | | .replace("{param5}",(fee.compareTo(new BigDecimal(0)) >=0? |
| | | Constants.formatBigdecimal2Float(model.getBtFee()) |
| | | :(Constants.formatBigdecimal2Float(model.getBtFee()).multiply(new BigDecimal(-1)))).toString()); |
| | | return str; |
| | | } |
| | | |