Jelajahi Sumber

审核的修改

dongxin 1 tahun lalu
induk
melakukan
156f3239a0

+ 117 - 113
tenant/insurance/quotation-summary/src/main/java/com/jzg/quotation/summary/service/impl/InsFeeAuditServiceImpl.java

@@ -22,8 +22,8 @@ import com.jzg.commons.exception.SystemException;
 import com.jzg.commons.util.AssertionUtils;
 import com.jzg.commons.util.PDFUtil;
 import com.jzg.commons.util.StringUtils;
-import com.jzg.quotation.commons.client.EsmInsCompanyClient;
 import com.jzg.quotation.commons.client.OrgClient;
+import com.jzg.quotation.commons.client.PlatformClient;
 import com.jzg.quotation.summary.mapper.InsFeeAuditMapper;
 import com.jzg.quotation.summary.service.*;
 import lombok.RequiredArgsConstructor;
@@ -56,7 +56,7 @@ public class InsFeeAuditServiceImpl extends ServiceImpl<InsFeeAuditMapper, InsFe
     private OrgClient orgClient;
 
     @Autowired
-    private EsmInsCompanyClient companyClient;
+    private PlatformClient platformClient;
 
     @Autowired
     private BaseController baseController;
@@ -91,7 +91,7 @@ public class InsFeeAuditServiceImpl extends ServiceImpl<InsFeeAuditMapper, InsFe
     public Page<FeeAuditVo> queryPage(FeeAuditParam param) {
         // 获取选中的保险公司条件
         String companyId = param.getCompanyId();
-        HttpResult<List<String>> result = companyClient.getChildCompanyId(companyId);
+        HttpResult<List<String>> result = platformClient.getChildCompanyId(companyId);
         AssertionUtils.isFail(Objects.isNull(result.getData()),"获取保险公司下级失败!");
         List<String> companyIdList = result.getData();
         param.setCompanyIdList(companyIdList);
@@ -336,63 +336,66 @@ public class InsFeeAuditServiceImpl extends ServiceImpl<InsFeeAuditMapper, InsFe
                               List<PtlAgreementCostTypeVo> costTypeVos,
                               InsFeeOrders feeOrders,
                               AgreementVo agreement) {
-        for (PtlAgreementCostTypeVo costTypeVo : costTypeVos) {
-            if(costTypeVo.getCostType().equals("1")){
-                AuditCostInfoVo jqInfoVo = new AuditCostInfoVo();
-                jqInfoVo.setCostType(costTypeVo.getCostType());
-                jqInfoVo.setPremium(feeOrders.getJqPremium());
-                jqInfoVo.setInletRadio(costTypeVo.getInlet());
-                jqInfoVo.setInletPremium(feeOrders.getJqReceivablePremium());
-                jqInfoVo.setEntranceFeeRatio(agreement.getJqEntranceFeeRatio());
-                jqInfoVo.setEntranceFeePremium(feeOrders.getJqCommissionPremium());
-                BigDecimal followRatio = costTypeVo.getInlet().subtract(agreement.getJqEntranceFeeRatio()); // 计算跟单比例
-                jqInfoVo.setFollowRatio(followRatio);
-                jqInfoVo.setFollowPremium(feeOrders.getJqFollowPremium());
-                jqInfoVo.setAddThrowRatio(costTypeVo.getAddThrow());
-                jqInfoVo.setAddThrowPremium(feeOrders.getJqAdditionalPremium());
-                jqInfoVo.setExportRatio(costTypeVo.getExport());
-                jqInfoVo.setExportPremium(feeOrders.getJqPayablePremium());
-                jqInfoVo.setKeepPointRatio(costTypeVo.getKeepPointRatio());
-                jqInfoVo.setKeepPointPremium(feeOrders.getJqKeepPointPremium());
-                auditCostInfoVos.add(jqInfoVo);
-            }else if(costTypeVo.getCostType().equals("2")){
-                AuditCostInfoVo syInfoVo = new AuditCostInfoVo();
-                syInfoVo.setCostType(costTypeVo.getCostType());
-                syInfoVo.setPremium(feeOrders.getSyPremium());
-                syInfoVo.setInletRadio(costTypeVo.getInlet());
-                syInfoVo.setInletPremium(feeOrders.getSyReceivablePremium());
-                syInfoVo.setEntranceFeeRatio(agreement.getSyEntranceFeeRatio());
-                syInfoVo.setEntranceFeePremium(feeOrders.getSyCommissionPremium());
-                BigDecimal followRatio = costTypeVo.getInlet().subtract(agreement.getSyEntranceFeeRatio()); // 计算跟单比例
-                syInfoVo.setFollowRatio(followRatio);
-                syInfoVo.setFollowPremium(feeOrders.getSyFollowPremium());
-                syInfoVo.setAddThrowRatio(costTypeVo.getAddThrow());
-                syInfoVo.setAddThrowPremium(feeOrders.getSyAdditionalPremium());
-                syInfoVo.setExportRatio(costTypeVo.getExport());
-                syInfoVo.setExportPremium(feeOrders.getSyPayablePremium());
-                syInfoVo.setKeepPointRatio(costTypeVo.getKeepPointRatio());
-                syInfoVo.setKeepPointPremium(feeOrders.getSyKeepPointPremium());
-                auditCostInfoVos.add(syInfoVo);
-            }else{
-                AuditCostInfoVo noInfoVo = new AuditCostInfoVo();
-                noInfoVo.setCostType(costTypeVo.getCostType());
-                noInfoVo.setPremium(feeOrders.getJyPremium());
-                noInfoVo.setInletRadio(costTypeVo.getInlet());
-                noInfoVo.setInletPremium(feeOrders.getJyReceivablePremium());
-                noInfoVo.setEntranceFeeRatio(agreement.getJyEntranceFeeRatio());
-                noInfoVo.setEntranceFeePremium(feeOrders.getJyCommissionPremium());
-                BigDecimal followRatio = costTypeVo.getInlet().subtract(agreement.getJyEntranceFeeRatio()); // 计算跟单比例
-                noInfoVo.setFollowRatio(followRatio);
-                noInfoVo.setFollowPremium(feeOrders.getJyFollowPremium());
-                noInfoVo.setAddThrowRatio(costTypeVo.getAddThrow());
-                noInfoVo.setAddThrowPremium(feeOrders.getJyAdditionalPremium());
-                noInfoVo.setExportRatio(costTypeVo.getExport());
-                noInfoVo.setExportPremium(feeOrders.getJyPayablePremium());
-                noInfoVo.setKeepPointRatio(costTypeVo.getKeepPointRatio());
-                noInfoVo.setKeepPointPremium(feeOrders.getJyKeepPointPremium());
-                auditCostInfoVos.add(noInfoVo);
+
+
+        costTypeVos.forEach(costTypeVo -> {
+            switch (costTypeVo.getCostType()) {
+                case "交强险":
+                    AuditCostInfoVo jqInfoVo = new AuditCostInfoVo();
+                    jqInfoVo.setCostType(costTypeVo.getCostType());
+                    jqInfoVo.setPremium(feeOrders.getJqPremium());
+                    jqInfoVo.setInletRadio(costTypeVo.getInlet());
+                    jqInfoVo.setInletPremium(feeOrders.getJqReceivablePremium());
+                    jqInfoVo.setEntranceFeeRatio(agreement.getJqEntranceFeeRatio());
+                    jqInfoVo.setEntranceFeePremium(feeOrders.getJqCommissionPremium());
+                    BigDecimal followRatio = costTypeVo.getInlet().subtract(agreement.getJqEntranceFeeRatio()); // 计算跟单比例
+                    jqInfoVo.setFollowRatio(followRatio);
+                    jqInfoVo.setFollowPremium(feeOrders.getJqFollowPremium());
+                    jqInfoVo.setAddThrowRatio(costTypeVo.getAddThrow());
+                    jqInfoVo.setAddThrowPremium(feeOrders.getJqAdditionalPremium());
+                    jqInfoVo.setExportRatio(costTypeVo.getExport());
+                    jqInfoVo.setExportPremium(feeOrders.getJqPayablePremium());
+                    jqInfoVo.setKeepPointRatio(costTypeVo.getKeepPointRatio());
+                    jqInfoVo.setKeepPointPremium(feeOrders.getJqKeepPointPremium());
+                    auditCostInfoVos.add(jqInfoVo);
+                case "商业险":
+                    AuditCostInfoVo syInfoVo = new AuditCostInfoVo();
+                    syInfoVo.setCostType(costTypeVo.getCostType());
+                    syInfoVo.setPremium(feeOrders.getSyPremium());
+                    syInfoVo.setInletRadio(costTypeVo.getInlet());
+                    syInfoVo.setInletPremium(feeOrders.getSyReceivablePremium());
+                    syInfoVo.setEntranceFeeRatio(agreement.getSyEntranceFeeRatio());
+                    syInfoVo.setEntranceFeePremium(feeOrders.getSyCommissionPremium());
+                    BigDecimal followRatio1 = costTypeVo.getInlet().subtract(agreement.getSyEntranceFeeRatio()); // 计算跟单比例
+                    syInfoVo.setFollowRatio(followRatio1);
+                    syInfoVo.setFollowPremium(feeOrders.getSyFollowPremium());
+                    syInfoVo.setAddThrowRatio(costTypeVo.getAddThrow());
+                    syInfoVo.setAddThrowPremium(feeOrders.getSyAdditionalPremium());
+                    syInfoVo.setExportRatio(costTypeVo.getExport());
+                    syInfoVo.setExportPremium(feeOrders.getSyPayablePremium());
+                    syInfoVo.setKeepPointRatio(costTypeVo.getKeepPointRatio());
+                    syInfoVo.setKeepPointPremium(feeOrders.getSyKeepPointPremium());
+                    auditCostInfoVos.add(syInfoVo);
+                case "驾意险":
+                    AuditCostInfoVo noInfoVo = new AuditCostInfoVo();
+                    noInfoVo.setCostType(costTypeVo.getCostType());
+                    noInfoVo.setPremium(feeOrders.getJyPremium());
+                    noInfoVo.setInletRadio(costTypeVo.getInlet());
+                    noInfoVo.setInletPremium(feeOrders.getJyReceivablePremium());
+                    noInfoVo.setEntranceFeeRatio(agreement.getJyEntranceFeeRatio());
+                    noInfoVo.setEntranceFeePremium(feeOrders.getJyCommissionPremium());
+                    BigDecimal followRatio2 = costTypeVo.getInlet().subtract(agreement.getJyEntranceFeeRatio()); // 计算跟单比例
+                    noInfoVo.setFollowRatio(followRatio2);
+                    noInfoVo.setFollowPremium(feeOrders.getJyFollowPremium());
+                    noInfoVo.setAddThrowRatio(costTypeVo.getAddThrow());
+                    noInfoVo.setAddThrowPremium(feeOrders.getJyAdditionalPremium());
+                    noInfoVo.setExportRatio(costTypeVo.getExport());
+                    noInfoVo.setExportPremium(feeOrders.getJyPayablePremium());
+                    noInfoVo.setKeepPointRatio(costTypeVo.getKeepPointRatio());
+                    noInfoVo.setKeepPointPremium(feeOrders.getJyKeepPointPremium());
+                    auditCostInfoVos.add(noInfoVo);
             }
-        }
+        });
     }
 
     /**
@@ -406,62 +409,63 @@ public class InsFeeAuditServiceImpl extends ServiceImpl<InsFeeAuditMapper, InsFe
                            InsFeeOrderRecord record,
                            List<PtlAgreementCostTypeVo> costTypeVos,
                            InsFeeOrders feeOrders) {
-        for (PtlAgreementCostTypeVo costTypeVo : costTypeVos) {
-            if(costTypeVo.getCostType().equals("1")){
-                AuditCostInfoVo jqInfoVo = new AuditCostInfoVo();
-                jqInfoVo.setCostType(costTypeVo.getCostType());
-                jqInfoVo.setPremium(feeOrders.getJqPremium());
-                jqInfoVo.setInletRadio(record.getJqInletRadio());
-                jqInfoVo.setInletPremium(feeOrders.getJqReceivablePremium());
-                jqInfoVo.setEntranceFeeRatio(record.getJqEntranceFeeRatio());
-                jqInfoVo.setEntranceFeePremium(feeOrders.getJqCommissionPremium());
-                jqInfoVo.setFollowRatio(record.getJqFollowRatio());
-                jqInfoVo.setFollowPremium(feeOrders.getJqFollowPremium());
-                jqInfoVo.setAddThrowRatio(record.getJqAddThrowRadio());
-                jqInfoVo.setAddThrowPremium(feeOrders.getJqAdditionalPremium());
-                jqInfoVo.setExportRatio(costTypeVo.getExport());
-                jqInfoVo.setExportPremium(feeOrders.getJqPayablePremium());
-                jqInfoVo.setKeepPointRatio(record.getJqKeepPointRatio());
-                jqInfoVo.setKeepPointPremium(feeOrders.getJqKeepPointPremium());
-                auditCostInfoVos.add(jqInfoVo);
-            }else if(costTypeVo.getCostType().equals("2")){
-                AuditCostInfoVo syInfoVo = new AuditCostInfoVo();
-                syInfoVo.setCostType(costTypeVo.getCostType());
-                syInfoVo.setPremium(feeOrders.getSyPremium());
-                syInfoVo.setInletRadio(record.getSyInletRadio());
-                syInfoVo.setInletPremium(feeOrders.getSyReceivablePremium());
-                syInfoVo.setEntranceFeeRatio(record.getSyEntranceFeeRatio());
-                syInfoVo.setEntranceFeePremium(feeOrders.getSyCommissionPremium());
-                syInfoVo.setFollowRatio(record.getSyFollowRatio());
-                syInfoVo.setFollowPremium(feeOrders.getSyFollowPremium());
-                syInfoVo.setAddThrowRatio(record.getSyAddThrowRadio());
-                syInfoVo.setAddThrowPremium(feeOrders.getSyAdditionalPremium());
-                syInfoVo.setExportRatio(costTypeVo.getExport());
-                syInfoVo.setExportPremium(feeOrders.getSyPayablePremium());
-                syInfoVo.setKeepPointRatio(record.getSyKeepPointRatio());
-                syInfoVo.setKeepPointPremium(feeOrders.getSyKeepPointPremium());
-                auditCostInfoVos.add(syInfoVo);
-            }else{
-                AuditCostInfoVo noInfoVo = new AuditCostInfoVo();
-                noInfoVo.setCostType(costTypeVo.getCostType());
-                noInfoVo.setPremium(feeOrders.getJyPremium());
-                noInfoVo.setInletRadio(record.getNoInletRadio());
-                noInfoVo.setInletPremium(feeOrders.getJyReceivablePremium());
-                noInfoVo.setEntranceFeeRatio(record.getNoEntranceFeeRatio());
-                noInfoVo.setEntranceFeePremium(feeOrders.getJyCommissionPremium());
-                noInfoVo.setFollowRatio(record.getNoFollowRatio());
-                noInfoVo.setFollowPremium(feeOrders.getJyFollowPremium());
-                noInfoVo.setAddThrowRatio(record.getNoAddThrowRadio());
-                noInfoVo.setAddThrowPremium(feeOrders.getJyAdditionalPremium());
-                noInfoVo.setExportRatio(costTypeVo.getExport());
-                noInfoVo.setExportPremium(feeOrders.getJyPayablePremium());
-                noInfoVo.setKeepPointRatio(record.getNoKeepPointRatio());
-                noInfoVo.setKeepPointPremium(feeOrders.getJyKeepPointPremium());
-                auditCostInfoVos.add(noInfoVo);
-            }
-        }
 
 
+        costTypeVos.forEach(costTypeVo -> {
+            switch (costTypeVo.getCostType()) {
+                case "交强险":
+                    AuditCostInfoVo jqInfoVo = new AuditCostInfoVo();
+                    jqInfoVo.setCostType(costTypeVo.getCostType());
+                    jqInfoVo.setPremium(feeOrders.getJqPremium());
+                    jqInfoVo.setInletRadio(record.getJqInletRadio());
+                    jqInfoVo.setInletPremium(feeOrders.getJqReceivablePremium());
+                    jqInfoVo.setEntranceFeeRatio(record.getJqEntranceFeeRatio());
+                    jqInfoVo.setEntranceFeePremium(feeOrders.getJqCommissionPremium());
+                    jqInfoVo.setFollowRatio(record.getJqFollowRatio());
+                    jqInfoVo.setFollowPremium(feeOrders.getJqFollowPremium());
+                    jqInfoVo.setAddThrowRatio(record.getJqAddThrowRadio());
+                    jqInfoVo.setAddThrowPremium(feeOrders.getJqAdditionalPremium());
+                    jqInfoVo.setExportRatio(costTypeVo.getExport());
+                    jqInfoVo.setExportPremium(feeOrders.getJqPayablePremium());
+                    jqInfoVo.setKeepPointRatio(record.getJqKeepPointRatio());
+                    jqInfoVo.setKeepPointPremium(feeOrders.getJqKeepPointPremium());
+                    auditCostInfoVos.add(jqInfoVo);
+                case "商业险":
+                    AuditCostInfoVo syInfoVo = new AuditCostInfoVo();
+                    syInfoVo.setCostType(costTypeVo.getCostType());
+                    syInfoVo.setPremium(feeOrders.getSyPremium());
+                    syInfoVo.setInletRadio(record.getSyInletRadio());
+                    syInfoVo.setInletPremium(feeOrders.getSyReceivablePremium());
+                    syInfoVo.setEntranceFeeRatio(record.getSyEntranceFeeRatio());
+                    syInfoVo.setEntranceFeePremium(feeOrders.getSyCommissionPremium());
+                    syInfoVo.setFollowRatio(record.getSyFollowRatio());
+                    syInfoVo.setFollowPremium(feeOrders.getSyFollowPremium());
+                    syInfoVo.setAddThrowRatio(record.getSyAddThrowRadio());
+                    syInfoVo.setAddThrowPremium(feeOrders.getSyAdditionalPremium());
+                    syInfoVo.setExportRatio(costTypeVo.getExport());
+                    syInfoVo.setExportPremium(feeOrders.getSyPayablePremium());
+                    syInfoVo.setKeepPointRatio(record.getSyKeepPointRatio());
+                    syInfoVo.setKeepPointPremium(feeOrders.getSyKeepPointPremium());
+                    auditCostInfoVos.add(syInfoVo);
+                case "驾意险":
+                    AuditCostInfoVo noInfoVo = new AuditCostInfoVo();
+                    noInfoVo.setCostType(costTypeVo.getCostType());
+                    noInfoVo.setPremium(feeOrders.getJyPremium());
+                    noInfoVo.setInletRadio(record.getNoInletRadio());
+                    noInfoVo.setInletPremium(feeOrders.getJyReceivablePremium());
+                    noInfoVo.setEntranceFeeRatio(record.getNoEntranceFeeRatio());
+                    noInfoVo.setEntranceFeePremium(feeOrders.getJyCommissionPremium());
+                    noInfoVo.setFollowRatio(record.getNoFollowRatio());
+                    noInfoVo.setFollowPremium(feeOrders.getJyFollowPremium());
+                    noInfoVo.setAddThrowRatio(record.getNoAddThrowRadio());
+                    noInfoVo.setAddThrowPremium(feeOrders.getJyAdditionalPremium());
+                    noInfoVo.setExportRatio(costTypeVo.getExport());
+                    noInfoVo.setExportPremium(feeOrders.getJyPayablePremium());
+                    noInfoVo.setKeepPointRatio(record.getNoKeepPointRatio());
+                    noInfoVo.setKeepPointPremium(feeOrders.getJyKeepPointPremium());
+                    auditCostInfoVos.add(noInfoVo);
+            }
+        });
     }
 }