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

合包装箱业务对非预装订单被合包装箱进行拦截

parent 031263d8
......@@ -2898,7 +2898,7 @@ public class OrderBusinessServiceImpl extends AbstractService<OrderMapper, Order
orderItemDO,
null,
OrderExceptionEnum.ORDER_NO_QUOTE_EXCEPTION,
String.format("订单【%s】中的商品【%s】未报价6",
String.format("订单【%s】中的商品【%s】未报价",
orderDO.getOrderNo(),
orderItemDO.getProdTitleZh()),
String.format("The goods 【%s】 in the order 【%s】 are not quoted",
......
......@@ -45,8 +45,7 @@ import java.util.stream.Collectors;
import java.util.stream.Stream;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
import static cn.iocoder.yudao.module.order.enums.ErrorCodeConstants.ORDER_IS_PRE_INSTALLED;
import static cn.iocoder.yudao.module.order.enums.ErrorCodeConstants.ORDER_NOT_EXISTS;
import static cn.iocoder.yudao.module.order.enums.ErrorCodeConstants.*;
import static cn.iocoder.yudao.module.shipment.enums.ErrorCodeConstants.*;
/**
......@@ -226,7 +225,15 @@ public class BoxPkgOrderServiceImpl extends AbstractService<BoxPkgOrderMapper, B
private void create(BoxPkgOrderCreateReqVO createReqVO) {
checkMergePkgStatus(createReqVO.getPkgId());
BoxDO boxDO = checkMergePkgStatus(createReqVO.getPkgId());
// 这里添加合包装箱时,需要检查订单是否为该出货单下的预装订单
long count = boxPreloadGoodsMapper.selectCount(new LambdaQueryWrapper<BoxPreloadGoodsDO>()
.eq(BoxPreloadGoodsDO::getOrderId, createReqVO.getOrderId())
.eq(BoxPreloadGoodsDO::getShipmentId, boxDO.getId()));
if (count == 0){
// 订单未预装,不能合包
throw exception(ORDER_IS_NOT_PRE_INSTALLED);
}
List<OrderItemDO> orderItemDOS = orderItemService.selectList(OrderItemDO::getOrderId, createReqVO.getOrderId());
orderItemDOS.stream().forEach(item -> {
// 插入
......@@ -359,11 +366,12 @@ public class BoxPkgOrderServiceImpl extends AbstractService<BoxPkgOrderMapper, B
return map;
}
private void checkMergePkgStatus(Long pkgId) {
private BoxDO checkMergePkgStatus(Long pkgId) {
BoxMergePkgDO boxMergePkgDO = boxMergePkgService.selectOne(BoxMergePkgDO::getId, pkgId);
BoxDO box = boxService.getBox(boxMergePkgDO.getShipmentId());
if (box.getAirShipmentStatus() != AirShipmentStatusEnum.UNSHIPMENT.getStatus()) {
throw exception(MERGE_PKG_IS_FINISH);
}
return box;
}
}
......@@ -998,4 +998,4 @@ order.already.in.merge.pkg=The order has been placed under the packaging box
customer.is.new.or.old.no.change=customer current business type is {}, it's no change
order.is.pre.installed=Order pre installed
customer.delay.approval.times.more.then.one=delay approval times more then one
order.is.not.pre.installed =Order not pre installed, unable to package together
......@@ -1001,4 +1001,4 @@ case.num.in.merge.pkg=\u6B64\u7BB1\u5DF2\u88AB\u5408\u5305\uFF0C\u8BF7\u626B\u63
order.already.in.merge.pkg=\u8BA2\u5355\u5DF2\u5728\u5408\u5305\u7BB1\u4E0B
customer.is.new.or.old.no.change=\u5BA2\u6237\u5F53\u524D\u4E1A\u7EE9\u7C7B\u578B\u662F{}\u5BA2\u6237\uFF0C\u4E0D\u9700\u8981\u66F4\u65B0
order.is.pre.installed=\u8BA2\u5355\u5DF2\u9884\u88C5
order.is.not.pre.installed =\u8BA2\u5355\u672A\u88C5\u7BB1\uFF0C\u4E0D\u80FD\u5408\u5305
order.is.not.pre.installed =\u8ba2\u5355\u672a\u9884\u88c5\uff0c\u4e0d\u80fd\u5408\u5305
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