Commit ddf90261 authored by Smile's avatar Smile

feat:空运渠道设置免收泡重需求

parent bd2f6a3d
......@@ -101,4 +101,9 @@ public class QueryChannelInfoEvent {
* 泡重比例
*/
private BigDecimal bubbleWeightRatio;
/**
* 免泡重量
*/
private BigDecimal bubbleExemptWeight;
}
......@@ -1778,23 +1778,40 @@ public class OrderWarehouseInServiceImpl extends AbstractService<OrderWarehouseI
}
if (paoKg.compareTo(weightSum) > 0) {
// 泡货异常
String descZh = String.format("该订单是泡货订单, 泡货重量(总):%sKg", paoKg);
String descEn = String.format("It's heavy order, weight(sum):%s", paoKg);
OrderExceptionCreateReqVO orderExceptionCreateReqVO = genOrderException(orderId, null, orderDO,
OrderExceptionEnum.ORDER_BULKY_CARGO_EXCEPTION, descZh, descEn, null);
orderExceptionService.createOrderException(orderExceptionCreateReqVO);
// 更新订单为泡货
orderService.updateOrderType(orderId, 3);
// v2.0空运 收费重量-实测重量<=0.05KG(字典值默认0.05),系统自动处理异常,处理结果为设置为普货,备注:泡货收费重量与实测重量相差在0.05KG内,系统自动设置为普货,操作人=admin
BigDecimal bubbleWeightFloatingThreshold = getBubbleWeightFloatingThreshold();
if ((paoKg.subtract(weightSum)).compareTo(bubbleWeightFloatingThreshold) <= 0) {
orderExceptionService.autoProcessException(orderId, null, OrderExceptionEnum.ORDER_BULKY_CARGO_EXCEPTION,
String.format("泡货收费重量%s与实测重量%s相差在%sKG内,系统自动设置为普货", paoKg, weightSum, bubbleWeightFloatingThreshold), OrderExceptionResult.ORDER_BULKY_CARGO_EXCEPTION_RESULT.GENERAL_CARGO);
//查找渠道免泡重量,当产生泡重<=渠道-免抛重量 , 订单不收泡重
QueryChannelInfoEvent event = new QueryChannelInfoEvent();
if (Objects.nonNull(orderDO.getChannelId()) && orderDO.getChannelId() > 0) {
event.setChannelId(orderDO.getChannelId());
applicationContext.publishEvent(event);
}
BigDecimal bubbleExemptWeight = event.getBubbleExemptWeight();
if (bubbleExemptWeight!=null && paoKg.compareTo(bubbleExemptWeight)<0){
List<ApplyInfoVO> infoVOList = new ArrayList<>();
ApplyInfoVO infoVO = new ApplyInfoVO();
infoVO.setName("空运渠道设置免收泡重");
infoVO.setNewValue(String.format("订单实测重量%s KG,泡重%s KG,符合%s渠道%sKG免泡设置,免收泡重。", weightSum, paoKg, event.getNameZh(), bubbleExemptWeight));
infoVOList.add(infoVO);
// 更新订单为普货
orderService.updateOrderType(orderId, 1);
orderBusinessService.addOrderOperateLog(orderId, "渠道设置免收泡重", JSONObject.toJSONString(Collections.singletonList(infoVO)));
}else {
// 泡货异常
String descZh = String.format("该订单是泡货订单, 泡货重量(总):%sKg", paoKg);
String descEn = String.format("It's heavy order, weight(sum):%s", paoKg);
OrderExceptionCreateReqVO orderExceptionCreateReqVO = genOrderException(orderId, null, orderDO,
OrderExceptionEnum.ORDER_BULKY_CARGO_EXCEPTION, descZh, descEn, null);
orderExceptionService.createOrderException(orderExceptionCreateReqVO);
// 更新订单为泡货
orderService.updateOrderType(orderId, 3);
// v2.0空运 收费重量-实测重量<=0.05KG(字典值默认0.05),系统自动处理异常,处理结果为设置为普货,备注:泡货收费重量与实测重量相差在0.05KG内,系统自动设置为普货,操作人=admin
BigDecimal bubbleWeightFloatingThreshold = getBubbleWeightFloatingThreshold();
if ((paoKg.subtract(weightSum)).compareTo(bubbleWeightFloatingThreshold) <= 0) {
orderExceptionService.autoProcessException(orderId, null, OrderExceptionEnum.ORDER_BULKY_CARGO_EXCEPTION,
String.format("泡货收费重量%s与实测重量%s相差在%sKG内,系统自动设置为普货", paoKg, weightSum, bubbleWeightFloatingThreshold), OrderExceptionResult.ORDER_BULKY_CARGO_EXCEPTION_RESULT.GENERAL_CARGO);
}
}
} else {
// v2.0空运 当入仓备货/理货记录修改审批后,订单非泡货且当前存在泡货异常未处理,系统自动处理异常,处理结果为设置为普货,备注:订单入仓记录修改,订单非泡货,系统自动处理为已处理,操作人=admin
orderExceptionService.autoProcessException(orderId, null, OrderExceptionEnum.ORDER_BULKY_CARGO_EXCEPTION, "订单入仓记录修改,订单非泡货,系统自动处理为已处理", OrderExceptionResult.ORDER_BULKY_CARGO_EXCEPTION_RESULT.GENERAL_CARGO);
......
......@@ -110,4 +110,9 @@ public class ChannelDO extends BaseDO {
*/
private BigDecimal bubbleWeightRatio;
/**
* 免泡重量
*/
private BigDecimal bubbleExemptWeight;
}
......@@ -77,6 +77,9 @@ public class ChannelBaseVO {
@ApiModelProperty(value = "泡重比例")
private BigDecimal bubbleWeightRatio;
@ApiModelProperty(value = "免泡重量")
private BigDecimal bubbleExemptWeight;
@ApiModelProperty(value = "快递公司名称")
private String companyName;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment