Commit 9565f2f3 authored by lanbaoming's avatar lanbaoming

Merge branch 'dev'

parents c57fc85c b5225176
......@@ -2222,6 +2222,7 @@ public class OrderBusinessServiceImpl extends AbstractService<OrderMapper, Order
orderDO.getTransportId())
|| Objects.equals(TransportTypeShortEnum.AIR_SEA_COMBINED_TRANSPORT.getValue(),
orderDO.getTransportId())) {
// 没有待处理的清关费未报价异常,则需要生成
//生成清关费异常 lanbm 2024-06-06 添加参数type=6,是处理价格异常
noQuoteOrAutomaticNoQuote =
......@@ -2246,7 +2247,8 @@ public class OrderBusinessServiceImpl extends AbstractService<OrderMapper, Order
// 不可出渠道异常
this.createNoCanShipmentChannelException(orderDO,
event, item, warehouseInInfoVO, type, orderNoCanShipmentChannelExceptionDOList);
event, item, warehouseInInfoVO,
type, orderNoCanShipmentChannelExceptionDOList);
}
}
// 当订单未报价、或待确认商品时,都需要将预付状态置null
......@@ -2401,10 +2403,13 @@ public class OrderBusinessServiceImpl extends AbstractService<OrderMapper, Order
Integer type) {
//查询有无未报价异常 lanbm 2024-06-06 添加注释
List<OrderExceptionDO> orderNoQuoteExceptionDOList =
orderExceptionService.getPendingOrderExceptionByOrderIdAndOrderItemIdAndProdIdAndExceptionKey(orderDO.getOrderId(),
orderExceptionService.getPendingOrderExceptionByOrderIdAndOrderItemIdAndProdIdAndExceptionKey(
orderDO.getOrderId(),
null,
orderItemDO.getProdId(),
OrderExceptionEnum.ORDER_NO_QUOTE_EXCEPTION.getKey());
/*
String s = "type=" + type.toString() +
"getTransportId=" + orderDO.getTransportId().toString() +
"getNeedOrderInquiry=" + orderItemDO.getNeedOrderInquiry();
......@@ -2436,10 +2441,11 @@ public class OrderBusinessServiceImpl extends AbstractService<OrderMapper, Order
zTestMapper.insert(z);
}
//lanbm 2024-06-06 添加的逻辑点
*/
if (orderItemDO.getItemStatus() == -1 && !orderItemDO.getIsProd()) {
if (CollectionUtil.isEmpty(orderNoQuoteExceptionDOList)) {
OrderExceptionCreateReqVO orderExceptionCreateReqVO =
this.genOrderException(orderDO.getOrderId(),
orderDO,
......@@ -2457,6 +2463,11 @@ public class OrderBusinessServiceImpl extends AbstractService<OrderMapper, Order
}
noQuoteOrAutomaticNoQuote = 1;
} else {
zTest z = new zTest();
z.setTestname("测试点1");
z.setCreatedate(new Date());
zTestMapper.insert(z);
if (CollectionUtil.isNotEmpty(orderNoQuoteExceptionDOList)) {
// TODO 当其他业务补充了品名价格后,如果还有待处理的未报价异常,需要同步处理掉
orderExceptionService.autoProcessException(orderDO.getOrderId(),
......@@ -2469,6 +2480,7 @@ public class OrderBusinessServiceImpl extends AbstractService<OrderMapper, Order
}
return noQuoteOrAutomaticNoQuote;
}
private void saveLog(OrderDO orderDO,
OrderItemDO orderItemDO,
WarehouseInInfoVO warehouseInInfoVO,
......@@ -2541,7 +2553,7 @@ public class OrderBusinessServiceImpl extends AbstractService<OrderMapper, Order
orderItemDO.getOrderItemId(),
OrderExceptionEnum.LINE_LOOP_EXCEPTION.getKey());
saveLog(orderDO, orderItemDO, warehouseInInfoVO, type);
//saveLog(orderDO, orderItemDO, warehouseInInfoVO, type);
// 避免在前面自动处理未报价异常和清关费未报价异常时的回调,优先创建了单询异常,造成并发的重复创建
if (CollectionUtil.isEmpty(orderInquiryExceptionDOList)) {
......
......@@ -1603,11 +1603,18 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
}
private int createOrderNoQuoteException(OrderDO orderDO, int noQuoteOrAutomaticNoQuote, OrderItemDO orderItemDO) {
List<OrderExceptionDO> orderNoQuoteExceptionDOList = orderExceptionService.getPendingOrderExceptionByOrderIdAndOrderItemIdAndExceptionKey(orderDO.getOrderId(), orderItemDO.getOrderItemId(), OrderExceptionEnum.ORDER_NO_QUOTE_EXCEPTION.getKey());
private int createOrderNoQuoteException(OrderDO orderDO,
int noQuoteOrAutomaticNoQuote,
OrderItemDO orderItemDO) {
List<OrderExceptionDO> orderNoQuoteExceptionDOList =
orderExceptionService.getPendingOrderExceptionByOrderIdAndOrderItemIdAndExceptionKey(orderDO.getOrderId(), orderItemDO.getOrderItemId(), OrderExceptionEnum.ORDER_NO_QUOTE_EXCEPTION.getKey());
if (orderItemDO.getItemStatus() == -1 && !orderItemDO.getIsProd()) {
if (CollectionUtil.isEmpty(orderNoQuoteExceptionDOList)) {
OrderExceptionCreateReqVO orderExceptionCreateReqVO = this.genOrderException(orderDO.getOrderId(), orderDO, orderItemDO, null, OrderExceptionEnum.ORDER_NO_QUOTE_EXCEPTION, String.format("订单【%s】中的商品【%s】未报价", orderDO.getOrderNo(), orderItemDO.getProdTitleZh()), String.format("The goods 【%s】 in the order 【%s】 are not quoted", orderItemDO.getProdTitleEn(), orderDO.getOrderNo()));
OrderExceptionCreateReqVO orderExceptionCreateReqVO =
this.genOrderException(orderDO.getOrderId(),
orderDO, orderItemDO, null,
OrderExceptionEnum.ORDER_NO_QUOTE_EXCEPTION,
String.format("订单【%s】中的商品【%s】未报价", orderDO.getOrderNo(), orderItemDO.getProdTitleZh()), String.format("The goods 【%s】 in the order 【%s】 are not quoted", orderItemDO.getProdTitleEn(), orderDO.getOrderNo()));
orderExceptionService.createOrderException(orderExceptionCreateReqVO);
}
noQuoteOrAutomaticNoQuote = 1;
......@@ -5897,7 +5904,8 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
}
orderBusinessService.addOrderTimeLog(orderDO.getStatus(), orderDO, 7, now, now);
// 空运相关订单处理业务
if (Objects.equals(TransportTypeShortEnum.AIR_FREIGHT_LINE.getValue(), orderDO.getTransportId())
if (Objects.equals(TransportTypeShortEnum.AIR_FREIGHT_LINE.getValue(),
orderDO.getTransportId())
|| Objects.equals(TransportTypeShortEnum.AIR_SEA_COMBINED_TRANSPORT.getValue(), orderDO.getTransportId())) {
// 空运渠道异常处理,当编辑订单后,订单渠道补充完,则调用处理空运渠道异常
if ((Objects.isNull(oldOrder.getChannelId()) || oldOrder.getChannelId() == 0L) && Objects.nonNull(orderDO.getChannelId()) && orderDO.getChannelId() > 0) {
......@@ -5909,16 +5917,23 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
"未选择线路渠道", "No route channel selected");
orderExceptionService.createOrderException(orderExceptionCreateReqVO);
}
if ((Objects.isNull(oldOrder.getChannelId()) && Objects.nonNull(orderDO.getChannelId()))
|| (Objects.nonNull(oldOrder.getChannelId()) && Objects.nonNull(orderDO.getChannelId()) && oldOrder.getChannelId() != orderDO.getChannelId())) {
if ((Objects.isNull(oldOrder.getChannelId()) &&
Objects.nonNull(orderDO.getChannelId()))
|| (Objects.nonNull(oldOrder.getChannelId())
&& Objects.nonNull(orderDO.getChannelId()) &&
oldOrder.getChannelId() != orderDO.getChannelId())) {
// 渠道变更
OrderDto orderDto = new OrderDto();
BeanUtils.copyProperties(orderDO, orderDto);
applicationContext.publishEvent(new WarehouseInOrderChangeChannelEvent(orderDto));
applicationContext.publishEvent(
new WarehouseInOrderChangeChannelEvent(orderDto));
}
}
orderBusinessService.addOrderTimeLog(orderDO.getStatus(), orderDO, 7);
this.updateStatus(orderDO.getOrderId(), null, null, null, null, null, 0, this.getAuditResult(orderBackVO.getApplyStatus(), ORDER_UPDATE.getValue()), null, null, JSONObject.toJSONString(orderBackVO.getApplyInfoList()));
this.updateStatus(orderDO.getOrderId(),
null, null, null,
null, null, 0,
this.getAuditResult(orderBackVO.getApplyStatus(), ORDER_UPDATE.getValue()), null, null, JSONObject.toJSONString(orderBackVO.getApplyInfoList()));
if (orderBackVO.getIsDrawee()) {
......@@ -5969,7 +5984,8 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
}
// TODO 当运输方式出现变更时需要重置入仓业务
if (orderBackVO.getIsTransport()) {
applicationContext.publishEvent(new WarehouseInOrderChangeTransportEvent(orderDO.getOrderId()));
applicationContext.publishEvent(
new WarehouseInOrderChangeTransportEvent(orderDO.getOrderId()));
}
}
......
......@@ -35,11 +35,13 @@ import cn.iocoder.yudao.module.member.api.user.MemberUserApi;
import cn.iocoder.yudao.module.member.api.user.dto.UserRespDTO;
import cn.iocoder.yudao.module.order.convert.orderException.OrderExceptionConvert;
import cn.iocoder.yudao.module.order.dal.dataobject.order.OrderDO;
import cn.iocoder.yudao.module.order.dal.dataobject.order.zTest;
import cn.iocoder.yudao.module.order.dal.dataobject.orderConsignor.OrderConsignorDO;
import cn.iocoder.yudao.module.order.dal.dataobject.orderException.OrderExceptionDO;
import cn.iocoder.yudao.module.order.dal.dataobject.orderExceptionChannelPrice.OrderExceptionChannelPriceDO;
import cn.iocoder.yudao.module.order.dal.dataobject.orderExceptionResult.OrderExceptionResultDO;
import cn.iocoder.yudao.module.order.dal.dataobject.orderItem.OrderItemDO;
import cn.iocoder.yudao.module.order.dal.mysql.order.ZTestMapper2;
import cn.iocoder.yudao.module.order.dal.mysql.orderException.OrderExceptionMapper;
import cn.iocoder.yudao.module.order.enums.OrderAbnormalStateEnum;
import cn.iocoder.yudao.module.order.enums.OrderExceptionEnum;
......@@ -167,6 +169,8 @@ public class OrderExceptionServiceImpl extends AbstractService<OrderExceptionMap
private ApplicationContext applicationContext;
@Override
@Transactional(rollbackFor = Exception.class)
public Long createOrderException(OrderExceptionCreateReqVO createReqVO) {
......@@ -2666,7 +2670,13 @@ public class OrderExceptionServiceImpl extends AbstractService<OrderExceptionMap
}
@Override
public void autoProcessException(Long orderId, Long orderItemId, OrderExceptionEnum orderExceptionEnum, String remark, String orderExceptionHandlerResult) {
autoProcessException(orderId, orderItemId, orderExceptionEnum, remark, orderExceptionHandlerResult, true);
public void autoProcessException(Long orderId, Long orderItemId,
OrderExceptionEnum orderExceptionEnum,
String remark,
String orderExceptionHandlerResult) {
autoProcessException(orderId, orderItemId,
orderExceptionEnum, remark,
orderExceptionHandlerResult, true);
}
}
......@@ -4768,9 +4768,13 @@ public class OrderWarehouseInServiceImpl extends AbstractService<OrderWarehouseI
// 空运订单,渠道包装重量超限异常
if (orderDO.getTransportId() == 3 || orderDO.getTransportId() == 4) {
Long orderId = orderDO.getOrderId();
List<OrderWarehouseInDO> orderWarehouseInDOList = orderWarehouseInMapper.selectList(OrderWarehouseInDO::getOrderId, orderId);
List<OrderWarehouseInDO> orderWarehouseInDOList =
orderWarehouseInMapper.selectList(OrderWarehouseInDO::getOrderId, orderId);
List<ChannelPackagingOverWeightAdditionalBo> channelPackagingOverWeightAdditionalBoList = genChannelPackagingOverweightAdditionalBoList(orderDO, orderWarehouseInDOList);
List<ChannelPackagingOverWeightAdditionalBo>
channelPackagingOverWeightAdditionalBoList =
genChannelPackagingOverweightAdditionalBoList(orderDO,
orderWarehouseInDOList);
if (CollectionUtil.isNotEmpty(channelPackagingOverWeightAdditionalBoList)) {
channelPackagingOverWeightAdditionalBoList = channelPackagingOverWeightAdditionalBoList.stream().filter(t -> !t.isMerged()).collect(Collectors.toList());
......@@ -4785,7 +4789,11 @@ public class OrderWarehouseInServiceImpl extends AbstractService<OrderWarehouseI
}
} else {
orderExceptionService.autoProcessException(orderId, null, OrderExceptionEnum.CHANNEL_PACKAGING_OVERWEIGHT_EXCEPTION, "未超过路线渠道包装重量上限,系统已自动处理", OrderExceptionResult.CHANNEL_PACKAGING_OVERWEIGHT_EXCEPTION_RESULT.CONFIRMED_SEND);
orderExceptionService.autoProcessException(orderId,
null,
OrderExceptionEnum.CHANNEL_PACKAGING_OVERWEIGHT_EXCEPTION,
"未超过路线渠道包装重量上限,系统已自动处理",
OrderExceptionResult.CHANNEL_PACKAGING_OVERWEIGHT_EXCEPTION_RESULT.CONFIRMED_SEND);
}
}
}
......
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