This commit is contained in:
2026-08-17 16:45:43 +08:00
parent 592da4d7e2
commit c71db4b481
6 changed files with 308 additions and 17 deletions
@@ -141,11 +141,21 @@ public class OrderFulfillmentSplitService {
child.setDestinationWarehouseName(root.getDestinationWarehouseName()); child.setReceivingWarehouseId(root.getReceivingWarehouseId());
child.setReceivingWarehouseName(root.getReceivingWarehouseName()); child.setChannelCode(root.getChannelCode());
child.setChannelName(root.getChannelName()); child.setDestinationType(root.getDestinationType());
child.setInboundCode(remainderInboundCode(root, sequence));
child.setCreatedBy(operatorId); child.setUpdatedBy(operatorId);
if (orders.insert(child) != 1) throw new BizException(ResultCode.CONFLICT, "余量子订单创建失败");
return child;
}
private String remainderInboundCode(OrderEntity root, int sequence) {
String rootInboundCode = Optional.ofNullable(root.getInboundCode()).orElse("").trim();
String childInboundCode = rootInboundCode + "-" + sequence;
if (rootInboundCode.isEmpty() || sequence < 1 || childInboundCode.length() > 40) {
throw new BizException(ResultCode.CONFLICT, "根订单入仓码格式无效,无法创建余量子订单");
}
return childInboundCode;
}
private OrderFulfillmentSplitEntity ledger(OrderSplitDtos.CreateRequest r, OrderEntity root, OrderEntity source,
long childId, String role, String hash, long operatorId) {
OrderFulfillmentSplitEntity row = new OrderFulfillmentSplitEntity();
@@ -621,7 +621,7 @@ components:
success: {type: boolean}
orderId: {type: string, pattern: '^[1-9][0-9]*$'}
orderNo: {type: string}
inboundCode: {type: string, pattern: '^[A-Z]{4,6}[0-9]{10,}$', example: ZBYHK2608140001}
inboundCode: {type: string, pattern: '^[A-Z]{4,6}[0-9]{10,}(?:-[1-9][0-9]*)?$', example: ZBYHK2608140001, description: 根订单使用渠道前缀+业务日期+全局票序;履约拆分产生的余量子订单追加根范围 splitSequence 后缀,如 ZBYHK2608140001-1}
errorCode: {type: string}
errorMessage: {type: string}
FirstLegOrderCargo: