doum
2026-06-17 ea689dd91eaa72425dc01759042c3b4eb2186512
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwCustomerH5BizServiceImpl.java
@@ -13,6 +13,7 @@
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;
@@ -63,6 +64,8 @@
    private YwElectricalBizService ywElectricalBizService;
    @Autowired
    private YwContractMapper ywContractMapper;
    @Autowired
    private YwContractDetailMapper ywContractDetailMapper;
    @Autowired
    private YwContractBillMapper ywContractBillMapper;
    @Autowired
@@ -211,6 +214,9 @@
            } 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);
@@ -385,6 +391,7 @@
        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) {
@@ -588,6 +595,26 @@
                || 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)
@@ -674,6 +701,7 @@
                        .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;