jiangping
2024-01-23 0e31fd20a1be8899f0ade4b7b7fb0e8d196624bf
server/service/src/main/java/com/doumee/service/business/impl/TaxesServiceImpl.java
@@ -209,27 +209,43 @@
        if(model==null || !Constants.equalsInteger(model.getIsdeleted(),Constants.ZERO)){
            throw  new BusinessException(ResponseStatus.DATA_EMPTY);
        }
        //查询明细列表
        List<TaxDetial> detialList = getJoinDetailListById(id);
        List<TaxDetial> applyList = new ArrayList<>();//投保和加减保
        List<TaxDetial> delList = new ArrayList<>();//冲红单
        if(detialList!=null){
            for(TaxDetial d :delList){
                d.setSolutionName(model.getSolutionName());
                d.setFee(Constants.formatBigdecimal(d.getFee()));
                d.setTotalFee(Constants.formatBigdecimal(d.getTotalFee()));
                if(Constants.equalsInteger(d.getType(),Constants.ZERO) || Constants.equalsInteger(d.getType(),Constants.ONE)){
                    applyList.add(d);
                }else  if(Constants.equalsInteger(d.getType(),Constants.TWO)){
                    delList.add(d);
        if(Constants.equalsInteger(model.getType(),Constants.ZERO)){
            List<TaxDetial> detialList = getDetailsApplysListById(id);
            model.setApplyList(detialList);
        }else{
            //查询明细列表
            List<TaxDetial> detialList = getJoinDetailListById(id);
            List<TaxDetial> applyList = new ArrayList<>();//投保和加减保
            List<TaxDetial> delList = new ArrayList<>();//冲红单
            if(detialList!=null){
                for(TaxDetial d :delList){
                    d.setSolutionName(model.getSolutionName());
                    d.setFee(Constants.formatBigdecimal(d.getFee()));
                    d.setTotalFee(Constants.formatBigdecimal(d.getTotalFee()));
                    if(Constants.equalsInteger(d.getType(),Constants.ZERO) || Constants.equalsInteger(d.getType(),Constants.ONE)){
                        applyList.add(d);
                    }else  if(Constants.equalsInteger(d.getType(),Constants.TWO)){
                        delList.add(d);
                    }
                }
            }
            model.setApplyList(applyList);
            model.setDelTaxList(delList);
        }
        model.setApplyList(applyList);
        model.setDelTaxList(delList);
        return model;
    }
    private List<TaxDetial> getDetailsApplysListById(Integer id) {
            MPJLambdaWrapper<TaxDetial> queryWrapper = new MPJLambdaWrapper<>();
            queryWrapper.selectAll(TaxDetial.class);
            queryWrapper.selectAs(InsuranceApply::getCode,TaxDetial::getApplyCode);
            queryWrapper.selectAs(Solutions::getName,TaxDetial::getSolutionName);
            queryWrapper.leftJoin(InsuranceApply.class,InsuranceApply::getId,TaxDetial::getInsuranceApplyId);
            queryWrapper.leftJoin(Solutions.class,Solutions::getId,InsuranceApply::getSolutionId);
            List<TaxDetial> detialList =  taxDetailJoinMapper.selectJoinList(TaxDetial.class,queryWrapper.orderByAsc(TaxDetial::getType));
            return detialList;
    }
    @Override
    public Taxes findOne(Taxes taxes) {
        QueryWrapper<Taxes> wrapper = new QueryWrapper<>(taxes);