Explorar el Código

1. 费用添加合伙人

785834757 hace 10 meses
padre
commit
1a4cdd613a

+ 1 - 0
src/main/java/com/ydtech/modules/fee/service/FeeRuleSchemeNewService.java

@@ -82,6 +82,7 @@ public interface FeeRuleSchemeNewService {
     ReCalcuLateProportion recalculateProportion(BigDecimal costsProportion,
                                                 BigDecimal deptProportion,
                                                 BigDecimal retailProportion,
+                                                BigDecimal partnerProportion,
                                                 BigDecimal taxRadio,
                                                 Integer retailLevel,
                                                 PtlAgreementProductCostsExport ptlAgreementProductCostsExport,

+ 3 - 2
src/main/java/com/ydtech/modules/fee/service/FeeRuleSchemeService.java

@@ -78,7 +78,7 @@ public interface FeeRuleSchemeService {
      * @return
      */
      FeeOrderNewVo.ExportFee calcExportFee(BigDecimal premium, BigDecimal superviseCostsProportion, BigDecimal entranceTotalProportion,
-                                                 BigDecimal deptTotalProportion, BigDecimal retailTotalProportion, BigDecimal taxRate, BigDecimal enterProportion);
+                                                 BigDecimal deptTotalProportion, BigDecimal retailTotalProportion,BigDecimal partnerProportion, BigDecimal taxRate, BigDecimal enterProportion);
 
     /**
      * 计算分销费用
@@ -123,10 +123,11 @@ public interface FeeRuleSchemeService {
      * @param deptManagerFee 机构管理
      * @param exportFee      出口
      * @param retailRadio    分销比例
+     * @param partnerProportion 合伙人比例
      * @param premiums       保费
      * @return
      */
-    boolean calculateProportion(FeeOrderNewVo.EntranceFee entranceFee, FeeOrderNewVo.DeptManagerFee deptManagerFee, FeeOrderNewVo.ExportFee exportFee, BigDecimal retailRadio, BigDecimal taxRadio, BigDecimal premiums);
+    boolean calculateProportion(FeeOrderNewVo.EntranceFee entranceFee, FeeOrderNewVo.DeptManagerFee deptManagerFee, FeeOrderNewVo.ExportFee exportFee, BigDecimal retailRadio, BigDecimal taxRadio, BigDecimal partnerProportion, BigDecimal premiums);
 
     List<DistributionLevelVo> converDistrbutionData(InsFeeOrderNew insFeeOrderNew);
 }

+ 9 - 3
src/main/java/com/ydtech/modules/fee/service/impl/FeeRuleSchemeServiceImpl.java

@@ -2931,13 +2931,18 @@ public class FeeRuleSchemeServiceImpl implements FeeRuleSchemeService {
      */
     public FeeOrderNewVo.ExportFee calcExportFee(BigDecimal premium, BigDecimal superviseCostsProportion,
                                                  BigDecimal entranceTotalProportion,
-                                                 BigDecimal deptTotalProportion, BigDecimal retailTotalProportion, BigDecimal taxRate, BigDecimal enterProportion) {
+                                                 BigDecimal deptTotalProportion, BigDecimal retailTotalProportion,
+                                                 BigDecimal taxRate,BigDecimal partnerProportion, BigDecimal enterProportion) {
         FeeOrderNewVo.ExportFee exportFee = new FeeOrderNewVo.ExportFee();
         exportFee.setPremium(premium);
         //去税后的入口比例
         BigDecimal noTaxEntranceTotalProportion = entranceTotalProportion.divide(taxRate, 2, RoundingMode.DOWN);
         //出口的总比例
-        BigDecimal exportTotalProportion = noTaxEntranceTotalProportion.subtract(deptTotalProportion).subtract(retailTotalProportion).subtract(enterProportion);
+        BigDecimal exportTotalProportion = noTaxEntranceTotalProportion
+                .subtract(deptTotalProportion)
+                .subtract(retailTotalProportion)
+                .subtract(enterProportion)
+                .subtract(partnerProportion);
 
         // 外部
         exportFee.setExternalProportion(enterProportion);
@@ -3166,7 +3171,7 @@ public class FeeRuleSchemeServiceImpl implements FeeRuleSchemeService {
      */
     @Override
     public boolean calculateProportion(FeeOrderNewVo.EntranceFee entranceFee, FeeOrderNewVo.DeptManagerFee deptManagerFee,
-                                       FeeOrderNewVo.ExportFee exportFee, BigDecimal retailRadio, BigDecimal taxRadio, BigDecimal premiums) {
+                                       FeeOrderNewVo.ExportFee exportFee, BigDecimal retailRadio, BigDecimal taxRadio,BigDecimal partnerProportion, BigDecimal premiums) {
         if (entranceFee.getTotalAmount().compareTo(BigDecimal.ZERO) == 0)
             return true;
         //去税入口比例
@@ -3178,6 +3183,7 @@ public class FeeRuleSchemeServiceImpl implements FeeRuleSchemeService {
                 .subtract(deptManagerFee.getDeptProportionLevelThree())
                 .subtract(deptManagerFee.getDeptProportionLevelFoure())
                 .subtract(deptManagerFee.getDeptProportionLevelFive())
+                .subtract(partnerProportion)
                 .subtract(retailRadio).compareTo(BigDecimal.ZERO) == 0;
     }
 }

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 495 - 444
src/main/java/com/ydtech/modules/fee/service/impl/FeeRuleSchemeServiceNewImpl.java


+ 4 - 0
src/main/java/com/ydtech/modules/protocols/entity/po/InsFeeOrderNew.java

@@ -568,6 +568,10 @@ public class InsFeeOrderNew {
     @TableField(value = "no_external_premiums")
     private BigDecimal noExternalPremiums;
 
+    @ApiModelProperty(value = "合伙人比例")
+    @TableField(value = "partner_proportion")
+    private BigDecimal partnerProportion;
+
     @ApiModelProperty(value = "签单日期")
     @TableField(exist = false)
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")

+ 21 - 0
src/main/java/com/ydtech/modules/protocols/service/impl/PtlAgreementProductCostsNewServiceImpl.java

@@ -32,6 +32,8 @@ import com.ydtech.modules.order.entity.vo.FeeOrderNewRecordVo;
 import com.ydtech.modules.order.entity.vo.FeeOrderNewVo;
 import com.ydtech.modules.order.service.InsAreaCompanyService;
 import com.ydtech.modules.order.service.InsOrdersService;
+import com.ydtech.modules.partner.model.vo.CommissionRulesVo;
+import com.ydtech.modules.partner.service.PartnerCommissionService;
 import com.ydtech.modules.protocol.constants.ValidStatus;
 import com.ydtech.modules.protocol.entity.po.PtlAgreement;
 import com.ydtech.modules.protocol.entity.po.PtlAreaLicense;
@@ -112,6 +114,9 @@ public class PtlAgreementProductCostsNewServiceImpl extends ServiceImpl<PtlAgree
     @Autowired
     private PtlAgreementAttributionService ptlAgreementAttributionService;
 
+    @Autowired
+    private PartnerCommissionService partnerCommissionService;
+
     @Override
     public Page<PtlAgreementProductCostsNew> getProductPage(Page page, SysChannelGroupPageVo sysChannelGroupPageVo) {
         Page<PtlAgreementProductCostsNew> selectPage = this.baseMapper.getProductPage(page, sysChannelGroupPageVo);
@@ -1699,6 +1704,16 @@ public class PtlAgreementProductCostsNewServiceImpl extends ServiceImpl<PtlAgree
         }
 
 
+        // 判断用户是否是新用户  如果是新用户则计算合伙人费用
+        BigDecimal partnerProportion = BigDecimal.ZERO;
+        if (sysUser.getNewApp() == 1){
+            CommissionRulesVo commissionRulesVo = partnerCommissionService.queryAll();
+            partnerProportion = partnerProportion.add(new BigDecimal(commissionRulesVo.getAdministrator().getFounderRatio()))
+                    .add(new BigDecimal(commissionRulesVo.getAdministrator().getSharedRatio()))
+                    .add(new BigDecimal(commissionRulesVo.getPartner().getSharedRatio()));
+        }
+        insFeeOrderNew.setPartnerProportion(partnerProportion);
+
         List<FeeOrderNewVo.EntranceFee> entranceFeeList = new ArrayList<>();
         List<FeeOrderNewVo.DeptManagerFee> deptManagerFeeList = new ArrayList<>();
         List<FeeOrderNewVo.ExportFee> exportFeeList = new ArrayList<>();
@@ -1814,6 +1829,7 @@ public class PtlAgreementProductCostsNewServiceImpl extends ServiceImpl<PtlAgree
                 feeOrderNewVo.getEntranceFee().get(0).getTotalProportion(),
                 jqDeptProportion,
                 jqRetailProportion,
+                partnerProportion,
                 taxRadio,
                 retailLevel,
                 ptlAgreementProductCostsExport,
@@ -1825,6 +1841,7 @@ public class PtlAgreementProductCostsNewServiceImpl extends ServiceImpl<PtlAgree
                 feeOrderNewVo.getEntranceFee().get(1).getTotalProportion(),
                 syDeptProportion,
                 syRetailProportion,
+                partnerProportion,
                 taxRadio,
                 retailLevel,
                 ptlAgreementProductCostsExport,
@@ -1837,6 +1854,7 @@ public class PtlAgreementProductCostsNewServiceImpl extends ServiceImpl<PtlAgree
                 feeOrderNewVo.getEntranceFee().get(2).getTotalProportion(),
                 noDeptProportion,
                 noRetailProportion,
+                partnerProportion,
                 taxRadio,
                 retailLevel,
                 ptlAgreementProductCostsExport,
@@ -2022,6 +2040,7 @@ public class PtlAgreementProductCostsNewServiceImpl extends ServiceImpl<PtlAgree
                 jqDeptRadio,
                 jqRetailRadio,
                 taxRadio,
+                partnerProportion,
                 jqReCalcuLateProportion.getProxyProportion()
         );
 
@@ -2036,6 +2055,7 @@ public class PtlAgreementProductCostsNewServiceImpl extends ServiceImpl<PtlAgree
                 syDeptRadio,
                 syRetailRadio,
                 taxRadio,
+                partnerProportion,
                 syReCalcuLateProportion.getProxyProportion()
         );
 
@@ -2051,6 +2071,7 @@ public class PtlAgreementProductCostsNewServiceImpl extends ServiceImpl<PtlAgree
                 noDeptRadio,
                 noRetailRadio,
                 taxRadio,
+                partnerProportion,
                 noReCalcuLateProportion.getProxyProportion()
         );
 

Algunos archivos no se mostraron porque demasiados archivos cambiaron en este cambio