Commit b5fb9bab authored by 332784038@qq.com's avatar 332784038@qq.com

对重量超限异常判断修正

parent b6f8060d
......@@ -2614,18 +2614,38 @@ public class OrderBusinessServiceImpl extends AbstractService<OrderMapper, Order
orderExceptionService.getPendingOrderExceptionByOrderIdAndOrderItemIdAndExceptionKey(orderDO.getOrderId(),
null,
OrderExceptionEnum.NOT_SHIPPING_CHANNEL_EXCEPTION.getKey());
List<OrderExceptionDO> overweightExceptionDOList = new ArrayList<>();
List<OrderExceptionDO> lineOverweightExceptionDOList =
orderExceptionService.getPendingOrderExceptionByOrderIdAndOrderItemIdAndProdIdAndExceptionKeys(orderDO.getOrderId(),
null,
null,
CollectionUtil.newArrayList(OrderExceptionEnum.LINE_WEIGHT_EXCEPTION.getKey()));
if (CollectionUtil.isNotEmpty(lineOverweightExceptionDOList) ||
lineOverweightExceptionDOList.isEmpty()){
overweightExceptionDOList.addAll(lineOverweightExceptionDOList);
}
orderDO.setIsAutomaticHandleNoCanShipmentChannelException(false);
// 拆单子订单如果被标记为独立订单,则与非拆单订单一样的处理逻辑
if (orderDO.getStatus() > OrderStatusEnum.DRAFT.getValue()) {
for (OrderItemDO orderItemDO : newOrderItemDOList) {
WarehouseInInfoVO warehouseInInfoVO =
orderItemDO.getWarehouseInInfoVO();
List<OrderExceptionDO> goodsOverweightExceptionDOList =
orderExceptionService.getPendingOrderExceptionByOrderIdAndOrderItemIdAndProdIdAndExceptionKeys(orderDO.getOrderId(),
null,
orderItemDO.getProdId(),
CollectionUtil.newArrayList(OrderExceptionEnum.GOODS_OVERWEIGHT_EXCEPTION.getKey()));
if (CollectionUtil.isNotEmpty(goodsOverweightExceptionDOList) ||
goodsOverweightExceptionDOList.isEmpty()){
overweightExceptionDOList.addAll(goodsOverweightExceptionDOList);
}
//生成未报价异常 (草稿订单除外)
//创建未报价异常 type=6,是处理价格异常
noQuoteOrAutomaticNoQuote =
this.createOrderNoQuoteException(orderDO,
noQuoteOrAutomaticNoQuote,
orderItemDO, type);
orderItemDO, type, overweightExceptionDOList);
//专线空运,海空联运
if (Objects.equals(TransportTypeShortEnum.AIR_FREIGHT_LINE.getValue(),
......@@ -2638,7 +2658,7 @@ public class OrderBusinessServiceImpl extends AbstractService<OrderMapper, Order
noQuoteOrAutomaticNoQuote =
this.createClearanceFeeNoQuiteException(orderDO,
noQuoteOrAutomaticNoQuote,
orderItemDO, type);
orderItemDO, type, overweightExceptionDOList);
// 这里可能因为自动处理未报价异常(包括未报价清关费异常)时,
// 已经对此业务进行过校验更新,所以需要对品名进行数据再查询,以保证获取的是最新状态
OrderItemDO item =
......@@ -2829,7 +2849,7 @@ public class OrderBusinessServiceImpl extends AbstractService<OrderMapper, Order
private int createOrderNoQuoteException(OrderDO orderDO,
int noQuoteOrAutomaticNoQuote,
OrderItemDO orderItemDO,
Integer type) {
Integer type, List<OrderExceptionDO> overweightExceptionDOList) {
if (orderDO == null) {
return noQuoteOrAutomaticNoQuote;
}
......@@ -2844,13 +2864,6 @@ public class OrderBusinessServiceImpl extends AbstractService<OrderMapper, Order
null,
orderItemDO.getProdId(),
OrderExceptionEnum.ORDER_NO_QUOTE_EXCEPTION.getKey());
// TODO 查询是否有重量超限异常和渠道包装重量超限异常,如果有则不生成清关费异常
List<OrderExceptionDO> goodsOverweightExceptionDOList =
orderExceptionService.getPendingOrderExceptionByOrderIdAndOrderItemIdAndProdIdAndExceptionKeys(orderDO.getOrderId(),
null,
orderItemDO.getProdId(),
CollectionUtil.newArrayList(OrderExceptionEnum.GOODS_OVERWEIGHT_EXCEPTION.getKey(), OrderExceptionEnum.LINE_WEIGHT_EXCEPTION.getKey()));
if (orderItemDO.getNeedOrderInquiry() != null) {
// 添加的逻辑点 海运和空运只要是单询价都按同一套逻辑来处理
if (orderItemDO.getNeedOrderInquiry() == 1) {
......@@ -2871,7 +2884,8 @@ public class OrderBusinessServiceImpl extends AbstractService<OrderMapper, Order
//
if (orderItemDO.getItemStatus() == -1 && !orderItemDO.getIsProd()) {
if (CollectionUtil.isEmpty(goodsOverweightExceptionDOList)) {
if (CollectionUtil.isEmpty(overweightExceptionDOList) ||
overweightExceptionDOList.isEmpty()) {
if (CollectionUtil.isEmpty(orderNoQuoteExceptionDOList)) {
OrderExceptionCreateReqVO orderExceptionCreateReqVO =
this.genOrderException(orderDO.getOrderId(),
......@@ -2958,7 +2972,7 @@ public class OrderBusinessServiceImpl extends AbstractService<OrderMapper, Order
private int createClearanceFeeNoQuiteException(OrderDO orderDO,
int noQuoteOrAutomaticNoQuote,
OrderItemDO orderItemDO,
Integer type) {
Integer type, List<OrderExceptionDO> overweightExceptionDOList) {
// 添加的是否为空判断逻辑
if (orderDO == null) {
......@@ -2969,13 +2983,6 @@ public class OrderBusinessServiceImpl extends AbstractService<OrderMapper, Order
}
// 查询是否有重量超限异常,如果有则不生成清关费异常
// TODO 查询是否有重量超限异常和渠道包装重量超限异常,如果有则不生成清关费异常
List<OrderExceptionDO> goodsOverweightExceptionDOList =
orderExceptionService.getPendingOrderExceptionByOrderIdAndOrderItemIdAndProdIdAndExceptionKeys(orderDO.getOrderId(),
null,
orderItemDO.getProdId(),
CollectionUtil.newArrayList(OrderExceptionEnum.GOODS_OVERWEIGHT_EXCEPTION.getKey(), OrderExceptionEnum.LINE_WEIGHT_EXCEPTION.getKey()));
if (orderItemDO.getNeedOrderInquiry() != null) {
String sNo = "";
if (orderDO.getOrderNo() != null) sNo = orderDO.getOrderNo();
......@@ -3018,8 +3025,8 @@ public class OrderBusinessServiceImpl extends AbstractService<OrderMapper, Order
// 渠道重量超限异常 channel_packaging_overweight_exception
// List<OrderExceptionDO> channelPackagingOverweightExceptionDOList = orderExceptionService.getPendingOrderExceptionByOrderIdAndOrderItemIdAndExceptionKey(orderDO.getOrderId(), orderItemDO.getOrderItemId(), OrderExceptionEnum.CHANNEL_PACKAGING_OVERWEIGHT_EXCEPTION.getKey());
// if (CollectionUtil.isEmpty(goodsOverweightExceptionDOList) && CollectionUtil.isEmpty(channelPackagingOverweightExceptionDOList)) {
if (CollectionUtil.isEmpty(goodsOverweightExceptionDOList) ||
goodsOverweightExceptionDOList.size() == 0) {
if (CollectionUtil.isEmpty(overweightExceptionDOList) ||
overweightExceptionDOList.isEmpty()) {
List<OrderExceptionDO> orderClearanceFeeNoQuoteExceptionDOList =
orderExceptionService.getPendingOrderExceptionByOrderIdAndOrderItemIdAndExceptionKey(orderDO.getOrderId(),
......
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