浏览代码

1.结算协议内部机构

wuhp 2 年之前
父节点
当前提交
c3decaf4f1

+ 4 - 0
src/main/java/com/ydtech/modules/fnc/entity/InsPlyIncome.java

@@ -280,6 +280,10 @@ public class InsPlyIncome implements Serializable {
     @TableField("no_other_costs_proportion")
     private BigDecimal noOtherCostsProportion;
 
+    @ApiModelProperty("非车跟单金额")
+    @TableField("no_other_costs_premium")
+    private BigDecimal noOtherCostsPremiums;
+
     @ApiModelProperty("交强跟单金额")
     @TableField("jq_other_costs_premium")
     private BigDecimal jqOtherCostsPremium;

+ 21 - 5
src/main/java/com/ydtech/modules/fnc/service/impl/InsPlyIncomeServiceImpl.java

@@ -171,7 +171,7 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
         }
         insPlyIncome.setOtherFeevalue(insFeeOrderNew.getNoOtherCostsPremiums());  //非车跟单费
         insPlyIncome.setOtherFeerate(insFeeOrderNew.getNoOtherCostsProportion()); //非车跟单费用比例
-        insPlyIncome.setDeptId(insFeeOrderNew.getDeptId());
+//        insPlyIncome.setDeptId(insFeeOrderNew.getDeptId());
         this.saveRiskCode(order.getProductid(),insPlyIncome);
         insPlyIncome.setPayDate(insAreaCompany.getPayDate());
         insPlyIncome.setSignDate(insAreaCompany.getSigningTime());
@@ -179,6 +179,7 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
         insPlyIncome.setAgreementId(insFeeOrderNew.getAgreementId());
         insPlyIncome.setLicenseno(order.getLicenseno());
         insPlyIncome.setTaxamount(insAreaCompany.getTaxamount());
+        insPlyIncome.setNoTaxPremium(insFeeOrderNew.getNoNoTaxPremium());
         insPlyIncome.setCreateTime(LocalDate.now());
         insPlyIncome.setDocumentaryFeesStatus("0");
         insPlyIncome.setHandlingFeesStatus("0");
@@ -191,7 +192,10 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
         insPlyIncome.setSyStartDate(insAreaCompany.getSyStartDate());
         insPlyIncome.setSyEndDate(insAreaCompany.getSyEndDate());
         insPlyIncome.setAllFeeValue(insFeeOrderNew.getNoOtherCostsPremiums());
+        insPlyIncome.setNoOtherCostsPremium(insFeeOrderNew.getNoOtherCostsPremiums());
+        insPlyIncome.setNoOtherCostsProportion(insFeeOrderNew.getNoOtherCostsProportion());
         this.saveByCompanyId(insFeeOrderNew ,insAreaCompany.getCompanyId(),insPlyIncome);
+        this.getDeptId(insPlyIncome);
         baseMapper.insert(insPlyIncome);
     }
 
@@ -205,7 +209,7 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
             insPlyIncome.setNoPolicyno(noPolicyno); // 非车保单号
         }
 
-        insPlyIncome.setDeptId(insFeeOrderNew.getDeptId());
+//        insPlyIncome.setDeptId(insFeeOrderNew.getDeptId());
         this.saveRiskCode(order.getProductid(),insPlyIncome);
         insPlyIncome.setPayDate(insAreaCompany.getPayDate());
         insPlyIncome.setSignDate(insAreaCompany.getSigningTime());
@@ -227,6 +231,9 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
         insPlyIncome.setJqEndDate(insAreaCompany.getJqEndDate());
         insPlyIncome.setSyStartDate(insAreaCompany.getSyStartDate());
         insPlyIncome.setSyEndDate(insAreaCompany.getSyEndDate());
+        insPlyIncome.setNoSuperviseCostsPremiums(insFeeOrderNew.getNoSuperviseCostsPremiums());
+        insPlyIncome.setNoSuperviseCostsProportion(insFeeOrderNew.getNoSuperviseCostsProportion());
+        this.getDeptId(insPlyIncome);
         this.saveByCompanyId(insFeeOrderNew ,insAreaCompany.getCompanyId(),insPlyIncome);
 
         baseMapper.insert(insPlyIncome);
@@ -259,7 +266,7 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
         BigDecimal allPremium = this.calculateTotal(insFeeOrderNew.getJqPremium(), insFeeOrderNew.getSyPremium(), null);// 总保费
 
 
-        InsPlyIncome insPlyIncome = new InsPlyIncome(insFeeOrderNew.getInsOrderNo(),insAreaCompany.getJqpolicyno(),insAreaCompany.getSypolicyno(),null,null,insFeeOrderNew.getDeptId(),null,order.getProductid(),insAreaCompany.getPayDate(),insAreaCompany.getSigningTime(),insAreaCompany.getCompanyId(),null,insFeeOrderNew.getAgreementId(),order.getLicenseno(),insAreaCompany.getTaxamount(),
+        InsPlyIncome insPlyIncome = new InsPlyIncome(insFeeOrderNew.getInsOrderNo(),insAreaCompany.getJqpolicyno(),insAreaCompany.getSypolicyno(),null,null,null,null,order.getProductid(),insAreaCompany.getPayDate(),insAreaCompany.getSigningTime(),insAreaCompany.getCompanyId(),null,insFeeOrderNew.getAgreementId(),order.getLicenseno(),insAreaCompany.getTaxamount(),
                 allNoTaxPremium,null,otherProportion,null,otherAmount,otherAmount,null,null,LocalDate.now(),null,null,null,"0","0","0","1");
         this.saveRiskCode(order.getProductid(),insPlyIncome);
         insPlyIncome.setTaxPremium(allPremium);
@@ -277,6 +284,7 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
         insPlyIncome.setSyEndDate(insAreaCompany.getSyEndDate());
         insPlyIncome.setUserId(insFeeOrderNew.getUserId());
         insPlyIncome.setInsuredName(order.getInsuredname());
+        this.getDeptId(insPlyIncome);
         this.saveByCompanyId(insFeeOrderNew ,insAreaCompany.getCompanyId(),insPlyIncome);
 
         baseMapper.insert(insPlyIncome);
@@ -287,7 +295,7 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
         BigDecimal handlingAmount = this.calculateTotal(insFeeOrderNew.getJqSuperviseCostsPremiums(), insFeeOrderNew.getSySuperviseCostsPremiums(),null);
         BigDecimal handlingProportion = this.calculateTotal(insFeeOrderNew.getJqSuperviseCostsProportion(), insFeeOrderNew.getSySuperviseCostsProportion(),null);
         BigDecimal allNoTaxPremium = this.calculateTotal(insFeeOrderNew.getJqNoTaxPremium(), insFeeOrderNew.getSyNoTaxPremium(), null);//不含税保费
-        InsPlyIncome insPlyIncome = new InsPlyIncome(insFeeOrderNew.getInsOrderNo(),insAreaCompany.getJqpolicyno(),insAreaCompany.getSypolicyno(),null,null,insFeeOrderNew.getDeptId(),null,order.getProductid(),insAreaCompany.getPayDate(),insAreaCompany.getSigningTime(),insAreaCompany.getCompanyId(),null,insFeeOrderNew.getAgreementId(),order.getLicenseno(),insAreaCompany.getTaxamount()
+        InsPlyIncome insPlyIncome = new InsPlyIncome(insFeeOrderNew.getInsOrderNo(),insAreaCompany.getJqpolicyno(),insAreaCompany.getSypolicyno(),null,null,null,null,order.getProductid(),insAreaCompany.getPayDate(),insAreaCompany.getSigningTime(),insAreaCompany.getCompanyId(),null,insFeeOrderNew.getAgreementId(),order.getLicenseno(),insAreaCompany.getTaxamount()
         ,allNoTaxPremium,handlingProportion,null,handlingAmount,null,handlingAmount,null,null,LocalDate.now(),null,null,null,"0","0","0","0");
         BigDecimal allTaxPremium = this.calculateTotal(insFeeOrderNew.getJqPremium(), insFeeOrderNew.getSyPremium(), null);
         insPlyIncome.setJqPremium(insFeeOrderNew.getJqPremium());
@@ -307,6 +315,7 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
         insPlyIncome.setSyStartDate(insAreaCompany.getSyStartDate());
         insPlyIncome.setSyEndDate(insAreaCompany.getSyEndDate());
         this.saveByCompanyId(insFeeOrderNew ,insAreaCompany.getCompanyId(),insPlyIncome);
+        this.getDeptId(insPlyIncome);
         baseMapper.insert(insPlyIncome);
     }
 
@@ -352,7 +361,7 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
 
         String noPolicyno  = this.setNoPolicyno(insAreaCompany);
         InsPlyIncome insPlyIncome = new InsPlyIncome(insFeeOrderNew.getInsOrderNo(),insAreaCompany.getJqpolicyno(),insAreaCompany.getSypolicyno(),
-                noPolicyno,null,insFeeOrderNew.getDeptId(), null,order.getProductid(),insAreaCompany.getPayDate(),insAreaCompany.getSigningTime(),insAreaCompany.getCompanyId(),
+                noPolicyno,null,null, null,order.getProductid(),insAreaCompany.getPayDate(),insAreaCompany.getSigningTime(),insAreaCompany.getCompanyId(),
                 null,insFeeOrderNew.getAgreementId(),order.getLicenseno(),insAreaCompany.getTaxamount(),allNoTaxPremium,handlingProportion,
                 otherProportion,handlingAmount,otherAmount,allAmount,null,null,LocalDate.now(),null,null,null,"0","0","0","0");
         insPlyIncome.setJqReceivableProportion(jqReceivableProportion);
@@ -379,12 +388,19 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
         insPlyIncome.setJqEndDate(StringOperations.emptyStringToNull(insAreaCompany.getJqEndDate()));
         insPlyIncome.setSyStartDate(StringOperations.emptyStringToNull(insAreaCompany.getSyStartDate()));
         insPlyIncome.setSyEndDate(StringOperations.emptyStringToNull(insAreaCompany.getSyEndDate()));
+        this.getDeptId(insPlyIncome);
         this.saveRiskCode(order.getProductid(),insPlyIncome);
         insPlyIncome.setInsuredName(order.getInsuredname());
         this.saveByCompanyId(insFeeOrderNew ,insAreaCompany.getCompanyId(),insPlyIncome);
         baseMapper.insert(insPlyIncome);
     }
 
+    private void getDeptId(InsPlyIncome insPlyIncome) {
+        PtlAgreement ptlAgreement = ptlAgreementService.getById(insPlyIncome.getAgreementId());
+        String deptId = ptlAgreement.getDeptId();
+        insPlyIncome.setDeptId(deptId);
+    }
+
     private void saveByCompanyId(InsFeeOrderNew insFeeOrderNew,String companyId, InsPlyIncome insPlyIncome) {
         PtlAgreement  ptlAgreementQueryVo  = this.ptlAgreementService.getByAgreementIdNew(insFeeOrderNew.getAgreementId());
         if(ObjectUtils.isNotEmpty(ptlAgreementQueryVo)){