jiangping
2024-12-06 88502b104e7a17fb7040771c6f4c93071ec57577
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwContractRevenueServiceImpl.java
@@ -85,7 +85,12 @@
        ){
             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(),"未查询到账单信息");
        }
@@ -189,7 +194,8 @@
        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())