|
|
@@ -24,16 +24,14 @@ import com.jzg.quotation.summary.service.InsFeeOrdersService;
|
|
|
import com.jzg.quotation.summary.service.InsOrdersCostsService;
|
|
|
import com.jzg.quotation.summary.service.InsOrdersService;
|
|
|
import jakarta.annotation.Resource;
|
|
|
-import jakarta.servlet.http.HttpServletRequest;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
-import org.springframework.web.context.request.RequestContextHolder;
|
|
|
-import org.springframework.web.context.request.ServletRequestAttributes;
|
|
|
|
|
|
import java.lang.reflect.Method;
|
|
|
import java.math.BigDecimal;
|
|
|
import java.math.RoundingMode;
|
|
|
+import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
|
|
|
/**
|
|
|
@@ -61,15 +59,6 @@ public class InsFeeOrdersServiceImpl extends ServiceImpl<InsFeeOrdersMapper, Ins
|
|
|
private InsFeeOrdersMapper insFeeOrdersMapper;
|
|
|
|
|
|
|
|
|
- private String getSystemCode() {
|
|
|
- //如果是APP登录的话 则传递SystemCode的头部字段
|
|
|
- if (baseController.getUserSystemCode().equals("APP")) {
|
|
|
- HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
|
|
|
- return request.getHeader("system_code");
|
|
|
- }
|
|
|
- return baseController.getUserSystemCode();
|
|
|
- }
|
|
|
-
|
|
|
/**
|
|
|
* 订单审核时调整费用
|
|
|
*
|
|
|
@@ -162,7 +151,7 @@ public class InsFeeOrdersServiceImpl extends ServiceImpl<InsFeeOrdersMapper, Ins
|
|
|
Integer withTax, BigDecimal taxRate, int scale) {
|
|
|
|
|
|
// 计算基数
|
|
|
- BigDecimal base = BigDecimal.ZERO;
|
|
|
+ BigDecimal base;
|
|
|
if (withTax == 0) {
|
|
|
// 不含税:保费 / 1.06
|
|
|
base = premium.divide(taxRate, scale, RoundingMode.HALF_EVEN);
|
|
|
@@ -172,8 +161,8 @@ public class InsFeeOrdersServiceImpl extends ServiceImpl<InsFeeOrdersMapper, Ins
|
|
|
}
|
|
|
|
|
|
// ===================== 按比例计算各项费用 =====================
|
|
|
- BigDecimal commission = base.multiply(commissionRatio).setScale(scale, RoundingMode.HALF_EVEN);
|
|
|
BigDecimal inlet = base.multiply(inletRatio).setScale(scale, RoundingMode.HALF_EVEN);
|
|
|
+ BigDecimal commission = base.multiply(commissionRatio).setScale(scale, RoundingMode.HALF_EVEN);
|
|
|
BigDecimal follow = base.multiply(followRatio).setScale(scale, RoundingMode.HALF_EVEN);
|
|
|
|
|
|
// 加投直接乘
|
|
|
@@ -183,7 +172,8 @@ public class InsFeeOrdersServiceImpl extends ServiceImpl<InsFeeOrdersMapper, Ins
|
|
|
BigDecimal exportKeepPoint = premium.multiply(exportKeepPointRatio).setScale(scale, RoundingMode.HALF_EVEN);
|
|
|
// 留点比例直接乘, modify by lipf ,留点比例在infFeeOrder中计算得到。这里直接使用 2026年6月16日17:32:09, 为了保持金额一致,留点比例不适用百分比乘积,而是使用金额相减
|
|
|
// BigDecimal keepPoint = premium.multiply(keepPointRatio).setScale(scale, RoundingMode.HALF_EVEN);
|
|
|
- BigDecimal keepPoint = BigDecimalUtil.subtract(BigDecimalUtil.add(commission,addThrow),export);
|
|
|
+ BigDecimal keepPoint = BigDecimalUtil.subtract(BigDecimalUtil.add(inlet,addThrow),export);
|
|
|
+ log.info("计算留点:inlet=[{}],addThrow=[{}].export=[{}]", inlet, addThrow, export);
|
|
|
|
|
|
// 赋值到实体(自动匹配 jq / sy / jy)
|
|
|
if ("jq".equals(type)) {
|
|
|
@@ -194,7 +184,14 @@ public class InsFeeOrdersServiceImpl extends ServiceImpl<InsFeeOrdersMapper, Ins
|
|
|
insFeeOrders.setJqKeepPointPremium(keepPoint);
|
|
|
insFeeOrders.setJqExportPremium(export);
|
|
|
insFeeOrders.setJqExportKeepPointPremium(exportKeepPoint);
|
|
|
- insFeeOrders.setJqPayablePremium(commission);
|
|
|
+ insFeeOrders.setJqPayablePremium(export);
|
|
|
+
|
|
|
+ // add by lipf, 2026年6月23日10:42:36 更新具体某个险种的出口费用的时候,同步更新总的出口费用
|
|
|
+ List<BigDecimal> exportAmount = new ArrayList<>();
|
|
|
+ exportAmount.add(insFeeOrders.getJqExportPremium());
|
|
|
+ exportAmount.add(insFeeOrders.getSyExportPremium());
|
|
|
+ exportAmount.add(insFeeOrders.getJyExportPremium());
|
|
|
+ insFeeOrders.setTotalPayablePremium(BigDecimalUtil.add(exportAmount));
|
|
|
} else if ("sy".equals(type)) {
|
|
|
insFeeOrders.setSyCommissionPremium(commission);
|
|
|
insFeeOrders.setSyReceivablePremium(inlet);
|
|
|
@@ -203,7 +200,14 @@ public class InsFeeOrdersServiceImpl extends ServiceImpl<InsFeeOrdersMapper, Ins
|
|
|
insFeeOrders.setSyKeepPointPremium(keepPoint);
|
|
|
insFeeOrders.setSyExportPremium(export);
|
|
|
insFeeOrders.setSyExportKeepPointPremium(exportKeepPoint);
|
|
|
- insFeeOrders.setSyPayablePremium(commission);
|
|
|
+ insFeeOrders.setSyPayablePremium(export);
|
|
|
+
|
|
|
+ // add by lipf, 2026年6月23日10:42:36 更新具体某个险种的出口费用的时候,同步更新总的出口费用
|
|
|
+ List<BigDecimal> exportAmount = new ArrayList<>();
|
|
|
+ exportAmount.add(insFeeOrders.getJqExportPremium());
|
|
|
+ exportAmount.add(insFeeOrders.getSyExportPremium());
|
|
|
+ exportAmount.add(insFeeOrders.getJyExportPremium());
|
|
|
+ insFeeOrders.setTotalPayablePremium(BigDecimalUtil.add(exportAmount));
|
|
|
} else if ("jy".equals(type)) {
|
|
|
insFeeOrders.setJyCommissionPremium(commission);
|
|
|
insFeeOrders.setJyReceivablePremium(inlet);
|
|
|
@@ -212,7 +216,14 @@ public class InsFeeOrdersServiceImpl extends ServiceImpl<InsFeeOrdersMapper, Ins
|
|
|
insFeeOrders.setJyKeepPointPremium(keepPoint);
|
|
|
insFeeOrders.setJyExportPremium(export);
|
|
|
insFeeOrders.setJyExportKeepPointPremium(exportKeepPoint);
|
|
|
- insFeeOrders.setJyPayablePremium(commission);
|
|
|
+ insFeeOrders.setJyPayablePremium(export);
|
|
|
+
|
|
|
+ // add by lipf, 2026年6月23日10:42:36 更新具体某个险种的出口费用的时候,同步更新总的出口费用
|
|
|
+ List<BigDecimal> exportAmount = new ArrayList<>();
|
|
|
+ exportAmount.add(insFeeOrders.getJqExportPremium());
|
|
|
+ exportAmount.add(insFeeOrders.getSyExportPremium());
|
|
|
+ exportAmount.add(insFeeOrders.getJyExportPremium());
|
|
|
+ insFeeOrders.setTotalPayablePremium(BigDecimalUtil.add(exportAmount));
|
|
|
}
|
|
|
}
|
|
|
|