| | |
| | | import com.doumee.core.utils.Constants; |
| | | import com.doumee.core.utils.Utils; |
| | | import com.doumee.dao.business.YwContractBillMapper; |
| | | import com.doumee.dao.business.YwContractDetailMapper; |
| | | import com.doumee.dao.business.YwContractMapper; |
| | | import com.doumee.dao.business.YwContractRevenueMapper; |
| | | import com.doumee.dao.business.YwContractRoomMapper; |
| | |
| | | private YwElectricalBizService ywElectricalBizService; |
| | | @Autowired |
| | | private YwContractMapper ywContractMapper; |
| | | @Autowired |
| | | private YwContractDetailMapper ywContractDetailMapper; |
| | | @Autowired |
| | | private YwContractBillMapper ywContractBillMapper; |
| | | @Autowired |
| | |
| | | } else if (q.getPayTab() == 1) { |
| | | wrapper.eq(YwContractBill::getPayStatus, Constants.ONE); |
| | | } |
| | | } |
| | | if (q != null && q.getCostType() != null) { |
| | | wrapper.eq(YwContractBill::getCostType, q.getCostType()); |
| | | } |
| | | wrapper.orderByDesc(YwContractBill::getPlanPayDate); |
| | | IPage<YwContractBill> result = ywContractBillMapper.selectJoinPage(page, YwContractBill.class, wrapper); |
| | |
| | | applyRoomSummary(contract, roomMap.getOrDefault(contract.getId(), Collections.emptyList())); |
| | | contract.setPayTypeText(resolvePayTypeText(contract)); |
| | | contract.setFreeRentPeriod(resolveFreeRentPeriod(contract)); |
| | | initContractDetails(contract); |
| | | fillBillStatusTip(contract, loadContractBillMap(Collections.singletonList(contract.getId())) |
| | | .getOrDefault(contract.getId(), Collections.emptyList())); |
| | | if (withFiles) { |
| | |
| | | || Constants.equalsInteger(payStatus, Constants.FOUR); |
| | | } |
| | | |
| | | private void initContractDetails(YwContract contract) { |
| | | if (contract == null || contract.getId() == null) { |
| | | return; |
| | | } |
| | | contract.setZlDetailList(ywContractDetailMapper.selectJoinList(YwContractDetail.class, |
| | | new MPJLambdaWrapper<YwContractDetail>() |
| | | .selectAll(YwContractDetail.class) |
| | | .eq(YwContractDetail::getIsdeleted, Constants.ZERO) |
| | | .eq(YwContractDetail::getContractId, contract.getId()) |
| | | .in(YwContractDetail::getType, Constants.ZERO, Constants.TWO) |
| | | .orderByAsc(YwContractDetail::getSortnum))); |
| | | contract.setWyDetailList(ywContractDetailMapper.selectJoinList(YwContractDetail.class, |
| | | new MPJLambdaWrapper<YwContractDetail>() |
| | | .selectAll(YwContractDetail.class) |
| | | .eq(YwContractDetail::getIsdeleted, Constants.ZERO) |
| | | .eq(YwContractDetail::getContractId, contract.getId()) |
| | | .in(YwContractDetail::getType, Constants.ONE, Constants.THREE) |
| | | .orderByAsc(YwContractDetail::getSortnum))); |
| | | } |
| | | |
| | | private void initContractFiles(YwContract contract) { |
| | | List<Multifile> multifiles = multifileMapper.selectJoinList(Multifile.class, new MPJLambdaWrapper<Multifile>() |
| | | .selectAll(Multifile.class) |
| | |
| | | .eq(YwContractBill::getStatus, Constants.ZERO) |
| | | .eq(YwContractBill::getContractId, contractId) |
| | | .eq(YwContractBill::getBillType, billType != null ? billType : Constants.ZERO) |
| | | .orderByDesc(YwContractBill::getPlanPayDate) |
| | | .orderByDesc(YwContractBill::getId)); |
| | | enrichContractBillsForH5(bills); |
| | | return bills; |