From 0e31fd20a1be8899f0ade4b7b7fb0e8d196624bf Mon Sep 17 00:00:00 2001 From: jiangping <jp@doumee.com> Date: 星期二, 23 一月 2024 15:17:11 +0800 Subject: [PATCH] 开发业务接口 --- server/service/src/main/java/com/doumee/service/business/impl/TaxesServiceImpl.java | 46 +++++++++++++++++++++++++++++++--------------- 1 files changed, 31 insertions(+), 15 deletions(-) diff --git a/server/service/src/main/java/com/doumee/service/business/impl/TaxesServiceImpl.java b/server/service/src/main/java/com/doumee/service/business/impl/TaxesServiceImpl.java index 8f35fa4..62e836d 100644 --- a/server/service/src/main/java/com/doumee/service/business/impl/TaxesServiceImpl.java +++ b/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); -- Gitblit v1.9.3