| | |
| | | if(model==null || !Constants.equalsInteger(model.getIsdeleted(),Constants.ZERO)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY); |
| | | } |
| | | if(Constants.equalsInteger(model.getType(),Constants.ZERO)){ |
| | | if(Constants.equalsInteger(model.getApplyType(),Constants.ZERO)){ |
| | | List<TaxDetial> detialList = getDetailsApplysListById(id); |
| | | model.setApplyList(detialList); |
| | | }else{ |
| | |
| | | queryWrapper.selectAll(TaxDetial.class); |
| | | queryWrapper.selectAs(InsuranceApply::getCode,TaxDetial::getApplyCode); |
| | | queryWrapper.selectAs(Solutions::getName,TaxDetial::getSolutionName); |
| | | queryWrapper.selectAs(ApplyChange::getValidCode,TaxDetial::getChangApplyCode); |
| | | queryWrapper.leftJoin(InsuranceApply.class,InsuranceApply::getId,TaxDetial::getInsuranceApplyId); |
| | | queryWrapper.leftJoin(Solutions.class,Solutions::getId,InsuranceApply::getSolutionId); |
| | | queryWrapper.leftJoin(ApplyChange.class,ApplyChange::getId,TaxDetial::getApplyChangeId); |
| | | queryWrapper.in(TaxDetial::getType,Constants.ZERO,Constants.ONE); |
| | | queryWrapper.eq(TaxDetial::getTaxId,id); |
| | | List<TaxDetial> detialList = taxDetailJoinMapper.selectJoinList(TaxDetial.class,queryWrapper.orderByAsc(TaxDetial::getType)); |
| | | return detialList; |
| | | } |
| | |
| | | taxes.setAddr(entrustInvoicingDTO.getAddress()); |
| | | taxes.setCompanyName(company.getName()); |
| | | taxes.setApplyType(Constants.ZERO); |
| | | taxes.setTaxBank(company.getTaxBank()); |
| | | taxesMapper.insert(taxes); |
| | | |
| | | List<TaxDetial> taxDetialList = entrustInvoicingDTO.getTaxDetialList(); |
| | |
| | | List<ApplyChange> applyChangeList = applyChangeJoinMapper.selectJoinList(ApplyChange.class,new MPJLambdaWrapper<ApplyChange>() |
| | | .selectAll(ApplyChange.class) |
| | | .selectAs(InsuranceApply::getCode,ApplyChange::getApplyCode) |
| | | .selectAs(Solutions::getName,ApplyChange::getSolutionsName) |
| | | .select("( select count(1) from apply_chagne_detail ad where t.id = ad.APPLY_CHANGE_ID and ad.TYPE = 0 ) as addNum ") |
| | | .select("( select count(1) from apply_chagne_detail ad where t.id = ad.APPLY_CHANGE_ID and ad.TYPE = 1 ) as delNum ") |
| | | .select("( select ifnull(sum(ad.FEE),0) from apply_chagne_detail ad where t.id = ad.APPLY_CHANGE_ID ) as changeMoney" ) |
| | |
| | | |
| | | if(CollectionUtils.isNotEmpty(applyChangeList)){ |
| | | for (ApplyChange applyChange:applyChangeList) { |
| | | insuranceApply.setFee(insuranceApply.getFee().subtract(applyChange.getFee())); |
| | | TaxesInvoicingVO taxesInvoicingVO = applyChange.toTaxesInvoicingVO(); |
| | | if(!Objects.isNull(insuranceApply)){ |
| | | taxesInvoicingVO.setAmount(BigDecimal.ZERO); |
| | | insuranceApply.setFee(insuranceApply.getFee().subtract(applyChange.getFee())); |
| | | } |
| | | TaxesInvoicingVO taxesInvoicingVO = applyChange.toTaxesInvoicingVO(); |
| | | // if(!Objects.isNull(insuranceApply)){ |
| | | // taxesInvoicingVO.setAmount(BigDecimal.ZERO); |
| | | // } |
| | | taxesInvoicingVOList.add(taxesInvoicingVO); |
| | | } |
| | | } |
| | |
| | | taxes.setType(directInvoicingDTO.getType()); |
| | | taxes.setTaxCode(company.getTaxCode()); |
| | | taxes.setTaxAccount(company.getTaxAccount()); |
| | | taxes.setTaxBank(company.getTaxBank()); |
| | | taxes.setTaxAddr(company.getTaxAddr()); |
| | | taxes.setAddr(directInvoicingDTO.getAddress()); |
| | | taxes.setCompanyName(company.getName()); |
| | |
| | | taxDetial.setTaxId(taxes.getId()); |
| | | taxDetial.setTotalFee(taxesInvoicingVO.getAmount()); |
| | | taxDetial.setFee(taxesInvoicingVO.getAmount()); |
| | | taxDetial.setInsuranceApplyId(taxes.getApplyId()); |
| | | if(taxesInvoicingVO.getType().equals(Constants.ZERO)){ |
| | | taxDetial.setInsuranceApplyId(taxesInvoicingVO.getId()); |
| | | taxDetial.setType(taxesInvoicingVO.getType()); |
| | | }else if(taxesInvoicingVO.getType().equals(Constants.ONE)){ |
| | | taxDetial.setApplyChangeId(taxesInvoicingVO.getId()); |