|
|
@@ -1691,6 +1691,12 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
|
|
|
log.info("根据订单号[{}]没有找到车险订单信息和订单的费用信息",orderNo);
|
|
|
continue;
|
|
|
}
|
|
|
+ // add by lipf, 进行费用的修改
|
|
|
+ if(this.rationIsNotNull(batchModifyVo)){
|
|
|
+ log.info("费用比例不为空,同步调整费用。batchModifyVo=[{}]", JSONUtil.toJsonStr(batchModifyVo));
|
|
|
+ PtlAgreementCostRatioVo param = this.calRatio(insFeeOrders,batchModifyVo);
|
|
|
+ insFeeAuditService.saveCostInfo(param);
|
|
|
+ }
|
|
|
log.info("车险订单[{}]对应的订单明细是[{}]", orderNo, JSONUtil.toJsonStr(oldInsOrders));
|
|
|
if(batchModifyVo.getSigningTime() != null){
|
|
|
baseMapper.update(null, new LambdaUpdateWrapper<InsOrders>()
|
|
|
@@ -1716,4 +1722,78 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
|
|
|
log.info(msg);
|
|
|
return HttpResult.ok(msg);
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 结合原有的费用比例,计算更新后的费用比例
|
|
|
+ *
|
|
|
+ * @param insFeeOrders 订单的费用信息
|
|
|
+ * @param batchModifyVo 批量修改的费用比例
|
|
|
+ *
|
|
|
+ * @author lipf
|
|
|
+ * @date 2026/6/23 16:35
|
|
|
+ */
|
|
|
+ private PtlAgreementCostRatioVo calRatio(InsFeeOrders insFeeOrders, BatchModifyVo batchModifyVo) {
|
|
|
+ log.info("batchModifyVo.转换百分比之前的数据=【{}】", JSONUtil.toJsonStr(batchModifyVo));
|
|
|
+
|
|
|
+ batchModifyVo.divide100();
|
|
|
+
|
|
|
+ PtlAgreementCostRatioVo vo = new PtlAgreementCostRatioVo();
|
|
|
+ vo.setOrderNo(insFeeOrders.getOrderNo());
|
|
|
+
|
|
|
+ // 加投费比例
|
|
|
+ vo.setJqAdditionalRatio(insFeeOrders.getJqAdditionalRatio());
|
|
|
+ vo.setSyAdditionalRatio(insFeeOrders.getSyAdditionalRatio());
|
|
|
+ vo.setJyAdditionalRatio(insFeeOrders.getJyAdditionalRatio());
|
|
|
+
|
|
|
+ // 手续费比例
|
|
|
+ vo.setJqCommissionRatio(batchModifyVo.getJqSuperviseCostsProportion() != null ? batchModifyVo.getJqSuperviseCostsProportion(): insFeeOrders.getJqCommissionRatio());
|
|
|
+ vo.setSyCommissionRatio(batchModifyVo.getSySuperviseCostsProportion() != null ? batchModifyVo.getSySuperviseCostsProportion(): insFeeOrders.getSyCommissionRatio());
|
|
|
+ vo.setJyCommissionRatio(batchModifyVo.getJySuperviseCostsProportion() != null ? batchModifyVo.getJySuperviseCostsProportion(): insFeeOrders.getJyCommissionRatio());
|
|
|
+
|
|
|
+ // 跟单费比例
|
|
|
+ vo.setJqFollowRatio(batchModifyVo.getJqOtherCostsProportion() != null ? batchModifyVo.getJqOtherCostsProportion(): insFeeOrders.getJqFollowRatio());
|
|
|
+ vo.setSyFollowRatio(batchModifyVo.getSyOtherCostsProportion() != null ? batchModifyVo.getSyOtherCostsProportion(): insFeeOrders.getSyFollowRatio());
|
|
|
+ vo.setJyFollowRatio(batchModifyVo.getJyOtherCostsProportion() != null ? batchModifyVo.getJyOtherCostsProportion(): insFeeOrders.getJyFollowRatio());
|
|
|
+
|
|
|
+ // 入口比例
|
|
|
+ vo.setJqInletRatio(BigDecimalUtil.add(vo.getJqCommissionRatio(), vo.getJqFollowRatio()));
|
|
|
+ vo.setSyInletRatio(BigDecimalUtil.add(vo.getSyCommissionRatio(), vo.getSyFollowRatio()));
|
|
|
+ vo.setJyInletRatio(BigDecimalUtil.add(vo.getJyCommissionRatio(), vo.getJyFollowRatio()));
|
|
|
+
|
|
|
+ // 出口比例
|
|
|
+ vo.setJqExportRatio(insFeeOrders.getJqExportRatio());
|
|
|
+ vo.setSyExportRatio(insFeeOrders.getSyExportRatio());
|
|
|
+ vo.setJyExportRatio(insFeeOrders.getJyExportRatio());
|
|
|
+
|
|
|
+ // 留点比例
|
|
|
+ vo.setJqKeepPointRatio(BigDecimalUtil.subtract(BigDecimalUtil.add(vo.getJqInletRatio(), vo.getJqAdditionalRatio()),vo.getJqExportRatio()));
|
|
|
+ vo.setSyKeepPointRatio(BigDecimalUtil.subtract(BigDecimalUtil.add(vo.getSyInletRatio(), vo.getSyAdditionalRatio()),vo.getSyExportRatio()));
|
|
|
+ vo.setJyKeepPointRatio(BigDecimalUtil.subtract(BigDecimalUtil.add(vo.getJyInletRatio(), vo.getJyAdditionalRatio()),vo.getJyExportRatio()));
|
|
|
+
|
|
|
+ // 出口留点比例
|
|
|
+ vo.setJqExportKeepPointRatio(insFeeOrders.getJqExportKeepPointRatio());
|
|
|
+ vo.setSyExportKeepPointRatio(insFeeOrders.getSyExportKeepPointRatio());
|
|
|
+ vo.setJyExportKeepPointRatio(insFeeOrders.getJyExportKeepPointRatio());
|
|
|
+ log.info("调整前的比例:fee=[{}]", JSONUtil.toJsonStr(insFeeOrders));
|
|
|
+ log.info("调整后的比例信息:vo=[{}]", JSONUtil.toJsonStr(vo));
|
|
|
+ return vo;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 存在是否不为空的费用比例
|
|
|
+ * 所有费用比例都为空,返回false, 有任意一个不为空,返回true
|
|
|
+ *
|
|
|
+ * @author lipf
|
|
|
+ * @date 2026/6/23 16:34
|
|
|
+ */
|
|
|
+ private boolean rationIsNotNull(BatchModifyVo vo) {
|
|
|
+ boolean hasSuperviseOrOtherCosts = vo.getJqSuperviseCostsProportion() != null
|
|
|
+ || vo.getSySuperviseCostsProportion() != null
|
|
|
+ || vo.getJySuperviseCostsProportion() != null
|
|
|
+ || vo.getJqOtherCostsProportion() != null
|
|
|
+ || vo.getSyOtherCostsProportion() != null
|
|
|
+ || vo.getJyOtherCostsProportion() != null;
|
|
|
+ log.info("hasSuperviseOrOtherCosts=[{}]",hasSuperviseOrOtherCosts);
|
|
|
+ return hasSuperviseOrOtherCosts;
|
|
|
+ }
|
|
|
}
|