Browse Source

1.掌柜结算调整

wuhp 1 năm trước cách đây
mục cha
commit
b254c85691

+ 11 - 0
src/main/java/com/ydtech/modules/fnc/controller/InsPlyIncomeController.java

@@ -622,6 +622,17 @@ public class InsPlyIncomeController extends BaseController {
         return HttpResult.ok();
     }
 
+    /**
+     * 保险非车手续费批量修改
+     * @param insPlyIncomeVo
+     */
+    @PostMapping("/correctData")
+    @ApiOperation(value = "批量保险非车修改比例确认")
+    public HttpResult<Object> correctData(@RequestBody InsPlyIncomeVo insPlyIncomeVo) {
+        insPlyIncomeService.correctData(insPlyIncomeVo);
+        return HttpResult.ok();
+    }
+
 }
 
 

+ 4 - 0
src/main/java/com/ydtech/modules/fnc/service/InsPlyIncomeService.java

@@ -277,5 +277,9 @@ public interface InsPlyIncomeService extends IService<InsPlyIncome> {
      * @param insPlyIncomeVo
      */
     void insuranceHandlingNotCarFeeBathConfirm(InsPlyIncomeVo insPlyIncomeVo);
+    /**
+     * 纠正数据
+     */
+    void correctData(InsPlyIncomeVo insPlyIncomeVo);
 
 }

+ 176 - 0
src/main/java/com/ydtech/modules/fnc/service/impl/InsPlyIncomeServiceImpl.java

@@ -500,6 +500,9 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
         insPlyIncome.setJqOtherCostsProportion(insFeeOrderNew.getJqOtherCostsProportion());  //交强跟单费比例
         insPlyIncome.setSyOtherCostsProportion(insFeeOrderNew.getSyOtherCostsProportion());  //商业跟单费比例
         insPlyIncome.setNoOtherCostsProportion(insFeeOrderNew.getNoOtherCostsProportion());  //非车跟单费比例
+        insPlyIncome.setJqOtherCostsPremium(insFeeOrderNew.getJqOtherCostsPremiums());
+        insPlyIncome.setSyOtherCostsPremium(insFeeOrderNew.getSyOtherCostsPremiums());
+        insPlyIncome.setNoOtherCostsPremium(insFeeOrderNew.getNoOtherCostsPremiums());
         insPlyIncome.setJqPremium(insFeeOrderNew.getJqPremium());
         insPlyIncome.setSyPremium(insFeeOrderNew.getSyPremium());
         insPlyIncome.setNoPremium(insFeeOrderNew.getNoPremium());
@@ -4000,4 +4003,177 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
         }
         return  list;
     }
+
+    /**
+     *  修改数据
+     * @param insPlyIncomeVo
+     */
+    @Override
+    @Transactional
+    public void correctData(InsPlyIncomeVo insPlyIncomeVo) {
+        String licenseno = insPlyIncomeVo.getLicenseno();
+        HashMap<String, Object> params = new HashMap<>();
+        params.put("licenseno", licenseno);
+        List<InsPlyIncome> insPlyIncomes = baseMapper.queryNew(params);
+        if (insPlyIncomes.isEmpty()) {
+            throw new SystemException("该车牌号不存在");
+        }
+//      如果 该数据是平台  则转为私有 如果是私有则转为 平台
+        InsPlyIncome insPlyIncome1 = insPlyIncomes.get(0);
+        if ("1".equals(insPlyIncome1.getAgreementType())) { //平台转私有
+            BigDecimal jqPremium = insPlyIncome1.getJqPremium();  //交强保费
+            BigDecimal syPremium = insPlyIncome1.getSyPremium();  //商业保费
+            BigDecimal noPremium = insPlyIncome1.getNoPremium();  //非车保费
+
+            BigDecimal jqSuperviseCostsProportion = insPlyIncome1.getJqSuperviseCostsProportion();//交强手续费比例
+            BigDecimal sySuperviseCostsProportion = insPlyIncome1.getSySuperviseCostsProportion(); //商业手续费比例
+            BigDecimal noSuperviseCostsProportion = insPlyIncome1.getNoSuperviseCostsProportion(); //非车手续费比例
+
+            BigDecimal jqOtherCostsProportion = insPlyIncome1.getJqOtherCostsProportion(); //交强跟单比例
+            BigDecimal syOtherCostsProportion = insPlyIncome1.getSyOtherCostsProportion(); // 商业跟单比例
+            BigDecimal noOtherCostsProportion = insPlyIncome1.getNoOtherCostsProportion(); // 非车跟单比例
+
+            if ((jqSuperviseCostsProportion.compareTo(BigDecimal.ZERO) > 0 || sySuperviseCostsProportion.compareTo(BigDecimal.ZERO) > 0) && jqPremium.compareTo(BigDecimal.ZERO)>0 || syPremium.compareTo(BigDecimal.ZERO)>0) {  //私有手续费
+                BigDecimal commissionFeerate = this.calculateTotal(insPlyIncome1.getJqSuperviseCostsProportion(), insPlyIncome1.getSySuperviseCostsProportion(), null);
+                BigDecimal commissionFeevalue = this.calculateTotal(insPlyIncome1.getJqSuperviseCostsPremiums(), insPlyIncome1.getSySuperviseCostsPremiums(), null);
+
+                InsPlyIncome insPlyIncome = new InsPlyIncome();
+                BeanUtils.copyProperties(insPlyIncome1, insPlyIncome);
+
+                insPlyIncome.setJqOtherCostsProportion(null);
+                insPlyIncome.setJqOtherCostsPremium(null);
+
+                insPlyIncome.setSyOtherCostsProportion(null);
+                insPlyIncome.setSyOtherCostsPremium(null);
+
+                insPlyIncome.setNoOtherCostsProportion(null);
+                insPlyIncome.setNoOtherCostsPremium(null);
+
+                insPlyIncome.setNoSuperviseCostsPremiums(null);
+                insPlyIncome.setNoSuperviseCostsProportion(null);
+
+                insPlyIncome.setOtherFeerate(null);
+                insPlyIncome.setOtherFeevalue(null);
+
+                insPlyIncome.setCommissionFeerate(commissionFeerate);
+                insPlyIncome.setCommissionFeevalue(commissionFeevalue);
+                insPlyIncome.setAllFeeValue(commissionFeevalue);
+                insPlyIncome.setAgreementId(insPlyIncomeVo.getAgreementId());
+                insPlyIncome.setId(null);
+
+                baseMapper.insert(insPlyIncome);
+            }
+
+            if ((jqOtherCostsProportion.compareTo(BigDecimal.ZERO) > 0 || syOtherCostsProportion.compareTo(BigDecimal.ZERO) > 0) && jqPremium.compareTo(BigDecimal.ZERO)>0 || syPremium.compareTo(BigDecimal.ZERO)>0) {
+
+                BigDecimal syOtherAmount = algorithmAmount(insPlyIncome1.getSyPremium(), insPlyIncome1.getSyOtherCostsProportion());
+                BigDecimal jqOtherAmount = algorithmAmount(insPlyIncome1.getJqPremium(), insPlyIncome1.getJqOtherCostsProportion());
+
+
+                BigDecimal otherFvalue = this.calculateTotal(syOtherAmount, jqOtherAmount, null);
+                BigDecimal otherFeet = this.calculateTotal(insPlyIncome1.getJqOtherCostsProportion(), insPlyIncome1.getSyOtherCostsProportion(), null);
+
+                InsPlyIncome insPlyIncome = new InsPlyIncome();
+                BeanUtils.copyProperties(insPlyIncome1, insPlyIncome);
+
+                insPlyIncome.setNoOtherCostsProportion(null);
+                insPlyIncome.setNoOtherCostsPremium(null);
+
+                insPlyIncome.setNoSuperviseCostsPremiums(null);
+                insPlyIncome.setNoSuperviseCostsProportion(null);
+
+                insPlyIncome.setJqSuperviseCostsProportion(null);
+                insPlyIncome.setJqSuperviseCostsPremiums(null);
+
+                insPlyIncome.setSySuperviseCostsPremiums(null);
+                insPlyIncome.setSySuperviseCostsProportion(null);
+
+                insPlyIncome.setCommissionFeevalue(null);
+                insPlyIncome.setCommissionFeerate(null);
+
+                insPlyIncome.setJqOtherCostsPremium(jqOtherAmount);
+                insPlyIncome.setSyOtherCostsPremium(syOtherAmount);
+                insPlyIncome.setOtherFeevalue(otherFvalue);
+                insPlyIncome.setOtherFeerate(otherFeet);
+                insPlyIncome.setAllFeeValue(otherFvalue);
+                insPlyIncome.setAgreementId(insPlyIncomeVo.getAgreementId());
+                insPlyIncome.setIsNotDocumentary("1");
+                insPlyIncome.setId(null);
+
+                baseMapper.insert(insPlyIncome);
+            }
+
+            if (noSuperviseCostsProportion.compareTo(BigDecimal.ZERO)>0 &&  noPremium.compareTo(BigDecimal.ZERO)>0) {  //非车手续费
+                InsPlyIncome insPlyIncome = new InsPlyIncome();
+                BeanUtils.copyProperties(insPlyIncome1, insPlyIncome);
+
+                insPlyIncome.setJqSuperviseCostsPremiums(null);
+                insPlyIncome.setJqSuperviseCostsProportion(null);
+
+                insPlyIncome.setSySuperviseCostsPremiums(null);
+                insPlyIncome.setSySuperviseCostsProportion(null);
+
+                insPlyIncome.setJqOtherCostsPremium(null);
+                insPlyIncome.setJqOtherCostsProportion(null);
+
+                insPlyIncome.setSyOtherCostsProportion(null);
+                insPlyIncome.setSyOtherCostsPremium(null);
+
+                insPlyIncome.setNoOtherCostsProportion(null);
+                insPlyIncome.setNoOtherCostsPremium(null);
+
+
+                insPlyIncome.setOtherFeevalue(null);
+                insPlyIncome.setOtherFeerate(null);
+
+                insPlyIncome.setCommissionFeevalue(insPlyIncome1.getNoSuperviseCostsPremiums());
+                insPlyIncome.setCommissionFeerate(insPlyIncome1.getNoSuperviseCostsProportion());
+                insPlyIncome.setAllFeeValue(insPlyIncome1.getNoSuperviseCostsPremiums());
+
+                insPlyIncome.setAgreementId(insPlyIncomeVo.getAgreementId());
+                insPlyIncome.setId(null);
+                insPlyIncome.setIsNotCar("1");
+                baseMapper.insert(insPlyIncome);
+            }
+
+            if (noOtherCostsProportion .compareTo(BigDecimal.ZERO) >0 && noPremium.compareTo(BigDecimal.ZERO)>0) {
+
+                //                algorithmAmount(syPremium, syOtherCostsProportion)
+                BigDecimal noOtherAmount = algorithmAmount(insPlyIncome1.getNoPremium(), insPlyIncome1.getNoOtherCostsProportion());
+
+
+                InsPlyIncome insPlyIncome = new InsPlyIncome();
+                BeanUtils.copyProperties(insPlyIncome1, insPlyIncome);
+
+                insPlyIncome.setJqSuperviseCostsPremiums(null);
+                insPlyIncome.setJqSuperviseCostsProportion(null);
+
+                insPlyIncome.setSySuperviseCostsPremiums(null);
+                insPlyIncome.setSySuperviseCostsProportion(null);
+
+                insPlyIncome.setJqOtherCostsPremium(null);
+                insPlyIncome.setJqOtherCostsProportion(null);
+
+                insPlyIncome.setSyOtherCostsProportion(null);
+                insPlyIncome.setSyOtherCostsPremium(null);
+
+                insPlyIncome.setNoSuperviseCostsPremiums(null);
+                insPlyIncome.setNoSuperviseCostsProportion(null);
+
+                insPlyIncome.setCommissionFeerate(null);
+                insPlyIncome.setCommissionFeevalue(null);
+
+                insPlyIncome.setOtherFeevalue(noOtherAmount);
+                insPlyIncome.setOtherFeerate(insPlyIncome1.getNoOtherCostsProportion());
+
+                insPlyIncome.setNoOtherCostsPremium(noOtherAmount);
+                insPlyIncome.setAgreementId(insPlyIncomeVo.getAgreementId());
+                insPlyIncome.setAllFeeValue(insPlyIncome1.getNoOtherCostsPremium());
+                insPlyIncome.setId(null);
+                insPlyIncome.setIsNotCar("1");
+                insPlyIncome.setIsNotDocumentary("1");
+                baseMapper.insert(insPlyIncome);
+            }
+        }
+    }
 }

+ 2 - 0
src/main/resources/mapper/modules/fnc/InsPlyIncomeMapper.xml

@@ -152,6 +152,8 @@
                 a.settlement_image_id as "settlementImageId",
                 a.task_id as "taskId",
                 a.create_time  as  "createTime",
+                a.leader_id  as  "leaderId",
+                a.leader_name  as  "leaderName",
                 a.add_type  as  "addType"
     </sql>