jiangping
2024-02-04 3c2e49d7bcc91268a75689db400d1f1698c0f8b7
server/service/src/main/java/com/doumee/service/business/impl/TaxesServiceImpl.java
@@ -393,6 +393,7 @@
            queryWrapper.le(queryModel.getEndDate() != null,Taxes::getCreateDate,  (queryModel.getEndDate()));
            queryWrapper.eq(!Objects.isNull(queryModel.getInsuranceApplyId()),Taxes::getInsuranceApplyId,queryModel.getInsuranceApplyId());
            queryWrapper.eq(!Objects.isNull(queryModel.getStatus()),Taxes::getStatus,queryModel.getStatus());
            queryWrapper.exists(!Objects.isNull(queryModel.getApplyId())," select 1 from tax_detial td where td.insurance_apply_id = "+queryModel.getApplyId()+" and t.id = td.tax_id ");
        }
        queryWrapper.orderByAsc(Taxes::getCreateDate);
@@ -417,7 +418,7 @@
            || Objects.isNull(entrustInvoicingDTO.getInvoicingMoney())
            || Objects.isNull(entrustInvoicingDTO.getType())
            || Objects.isNull(entrustInvoicingDTO.getTaxDetialList())
            || StringUtils.isNotBlank(entrustInvoicingDTO.getAddress())
            || StringUtils.isBlank(entrustInvoicingDTO.getAddress())
        ){
            throw new BusinessException(ResponseStatus.BAD_REQUEST);
        }
@@ -455,7 +456,7 @@
            //查询每个保单下可以投保的金额
            InsuranceApply insuranceApply = insuranceApplyJoinMapper.selectJoinOne(InsuranceApply.class,new MPJLambdaWrapper<InsuranceApply>()
                    .selectAll(InsuranceApply.class)
                    .select(" ( select sum(td.fee) from taxes ts inner join tax_detial td on ts.TAX_ID = ts.id  where ts.status != 2 and td.INSURANCE_APPLY_ID = t.id ) as taxesMoney ")
                    .select(" ifnull(( select sum(td.fee) from taxes ts inner join tax_detial td on td.TAX_ID = ts.id  where ts.status != 2 and td.INSURANCE_APPLY_ID = t.id ),0) as taxesMoney ")
                    .eq(InsuranceApply::getId,taxDetial.getInsuranceApplyId())
            );
            if(Objects.isNull(insuranceApply)){