Ver Fonte

优化报价代码

785834757 há 1 ano atrás
pai
commit
62cee108c4

+ 1 - 39
src/main/java/com/ydtech/modules/order/controller/QuoteController.java

@@ -121,46 +121,8 @@ public class QuoteController extends BaseController {
         List<KindInfoVo> kinds = quoteVo.getKinds();
         kinds.removeIf(item->Double.compare(item.getAmount(),0) == 0 && Double.compare(item.getUnitAmount(),0) == 0 && item.getServiceTimes() == 0);
 
-        String isTaxSource = quoteVo.getIsTaxSource();
-        boolean isExclude = true;
-        //排除的部门信息
-        List<TaxSourceExcludeDto> excludeDepts =
-                taxSourceExcludeService.list(new LambdaQueryWrapper<TaxSourceExcludeDto>()
-                        .eq(TaxSourceExcludeDto::getExcludeInfo, getDeptId())
-                        .eq(TaxSourceExcludeDto::getInsCompanyId, quoteVo.getCompanyId())
-                        .eq(TaxSourceExcludeDto::getType, TaxSourceStatusConstants.EXCLUDE_TYPE_DEPT));
-
         BaseQuoteInfoVo quoteInfo = insOrdersComponents.getQuoteInfo(quoteVo.getOrderNo(), quoteVo.getAgreementId(),quoteVo.getKinds());
-        //部门排除
-        String finalDeptId = getDeptId();
-        if (excludeDepts.stream().anyMatch(taxSourceDto -> taxSourceDto.getExcludeInfo().equals(finalDeptId))) {
-            isExclude = false;
-        }
-        if(Objects.isNull(quoteVo.getKinds())){
-            quoteVo.setKinds(new ArrayList<>());
-        }
-        ProductsType insuranceRisk = InsuranceRisk.determineInsuranceInformation(quoteVo.getKinds(), quoteVo.getRisks());
-        //默认协议走逻辑判断 且不在排除部门中走默认判断逻辑
-        if(StringUtils.isNotBlank(isTaxSource) && "1".equals(isTaxSource) && isExclude){
-            String taxAgreementId = ptlTaxSourceNewService.getAgreementId(getDeptId(), getUserId(), quoteVo.getCompanyId(), quoteInfo,insuranceRisk.getCode(),quoteVo.getOrderNo());
-            quoteVo.setAgreementId(taxAgreementId);
-//            log.info("======================订单号"+orderno+"走默认协议判断逻辑!匹配协议为:"+taxAgreementId+"=======================");
-            //throw new SystemException("订单号"+orderno+"走默认协议判断逻辑!匹配协议为:"+taxAgreementId);
-        }else{
-            //不在排除部门内进行默认判断
-            if(isExclude){
-                //走正常协议判断是错误的   判断是否有默认配置,如果有不可能进来,前台报错
-                List<PtlTaxSourceNew> taxSourceDtoList = ptlTaxSourceNewMapper.selectList(new LambdaQueryWrapper<PtlTaxSourceNew>()
-                        .eq(PtlTaxSourceNew::getInsCompanyId, quoteVo.getCompanyId())
-                        .eq(PtlTaxSourceNew::getDefaultFlag,"1"));
-                if(taxSourceDtoList!=null && !taxSourceDtoList.isEmpty()){
-                    //throw new SystemException("配置默认协议且部门未排除应走默认逻辑,操作错误,请联系管理员!!");
-                    //强制走默认状态
-                    String taxAgreementId = ptlTaxSourceNewService.getAgreementId(getDeptId(), getUserId(), quoteVo.getCompanyId(), quoteInfo,insuranceRisk.getCode(),quoteVo.getOrderNo());
-                    quoteVo.setAgreementId(taxAgreementId);
-                }
-            }
-        }
+        quoteInfo.setKindList(kinds);
 
         HttpResult<QuoteRespVo> respVo = null;
         DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");