| | |
| | | || Objects.isNull(ywContractBill.getBillType()) |
| | | || Objects.isNull(ywContractBill.getCompanyId()) |
| | | || com.github.xiaoymin.knife4j.core.util.CollectionUtils.isEmpty(ywContractBill.getYwContractRoomList()) |
| | | || Objects.nonNull(ywContractBill.getFeeType()) |
| | | || Objects.isNull(ywContractBill.getFeeType()) |
| | | || (Constants.equalsInteger(ywContractBill.getFeeType(),Constants.ZERO)&& (Objects.isNull(ywContractBill.getStartDate()) |
| | | || Objects.isNull(ywContractBill.getEndDate()))) |
| | | ){ |
| | |
| | | ywContractBill.setIsdeleted(Constants.ZERO); |
| | | ywContractBill.setType(Constants.ONE); |
| | | ywContractBill.setStatus(Constants.ZERO); |
| | | if(Constants.equalsInteger(ywContractBill.getBillType(),Constants.ZERO)){ |
| | | ywContractBill.setPayStatus(Constants.ZERO); |
| | | }else{ |
| | | ywContractBill.setPayStatus(Constants.THREE); |
| | | } |
| | | |
| | | if(Constants.equalsInteger(ywContractBill.getFeeType(),Constants.ONE)){ |
| | | ywContractBill.setStartDate(ywContractBill.getPlanPayDate()); |
| | | ywContractBill.setEndDate(ywContractBill.getPlanPayDate()); |
| | | } |
| | | //查询合同下的最大的序号 |
| | | List<YwContractBill> ywContractBillList = ywContractBillMapper.selectList(new QueryWrapper<YwContractBill>().lambda().eq(YwContractBill::getContractId,ywContract.getId()).orderByDesc(YwContractBill::getId)); |
| | | if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(ywContractBillList)){ |
| | | ywContractBill.setSortnum(ywContractBillList.size() + 1 ); |
| | | }else{ |
| | | ywContractBill.setSortnum(Constants.ZERO); |
| | | } |
| | | ywContractBillMapper.insert(ywContractBill); |
| | | |
| | | //房源数据 |
| | |
| | | .select(" ( select ifnull(sum(yw.ACT_RECEIVABLE_FEE),0) from yw_contract_revenue yw where yw.bill_id = t.id and yw.status = 0 and yw.isdeleted = 0 ) as actReceivableFee ") |
| | | .selectAs(YwContract::getCode,YwContractBill::getContractCode) |
| | | .selectAs(YwCustomer::getName,YwContractBill::getCustomerName) |
| | | .selectAs(Company::getName,YwContractBill::getCompanyName) |
| | | .leftJoin(YwContract.class,YwContract::getId,YwContractBill::getContractId) |
| | | .leftJoin(YwCustomer.class,YwCustomer::getId,YwContract::getRenterId) |
| | | .leftJoin(Company.class,Company::getId,YwContract::getCompanyId) |
| | | .eq(YwContractBill::getIsdeleted,Constants.ZERO) |
| | | .eq(YwContractBill::getId,id)); |
| | | if(Objects.isNull(ywContractBill)){ |
| | |
| | | YwCustomer::getName,model.getCustomerName()) |
| | | .eq(Objects.nonNull(model)&&Objects.nonNull(model.getStatus()), |
| | | YwContractBill::getStatus,model.getStatus()) |
| | | .eq(Objects.nonNull(model)&&Objects.nonNull(model.getBillType()), |
| | | YwContractBill::getBillType,model.getBillType()) |
| | | .eq(Objects.nonNull(model)&&Objects.nonNull(model.getPayStatus()), |
| | | YwContractBill::getPayStatus,model.getPayStatus()) |
| | | .eq(Objects.nonNull(model)&&Objects.nonNull(model.getType()), |
| | |
| | | ywContractBill.getReceivableFee().subtract(ywContractBill.getActReceivableFee()) |
| | | ); |
| | | //是否逾期 |
| | | if(Constants.equalsInteger(ywContractBill.getStatus(),Constants.ZERO) && (Constants.equalsInteger(ywContractBill.getPayStatus(),Constants.ZERO) |
| | | if(Constants.equalsInteger(ywContractBill.getStatus(),Constants.ZERO) |
| | | && (Constants.equalsInteger(ywContractBill.getPayStatus(),Constants.ZERO) |
| | | || Constants.equalsInteger(ywContractBill.getPayStatus(),Constants.TWO) |
| | | || Constants.equalsInteger(ywContractBill.getPayStatus(),Constants.THREE) |
| | | || Constants.equalsInteger(ywContractBill.getPayStatus(),Constants.FOUR)) |
| | | && ywContractBill.getEndDate().getTime() < System.currentTimeMillis()){ |
| | | && ywContractBill.getPlanPayDate().getTime() < System.currentTimeMillis()){ |
| | | ywContractBill.setIsOverdue(Constants.ONE); |
| | | }else{ |
| | | ywContractBill.setIsOverdue(Constants.ZERO); |