修改提交

This commit is contained in:
2026-08-22 12:35:32 +08:00
parent 996102e77d
commit e398f1f7e0
31 changed files with 540 additions and 27 deletions
@@ -12,6 +12,7 @@ import java.math.BigDecimal;
public class InboundPlanLine {
@TableId(type = IdType.INPUT)
private Long id;
private String customerId;
private Long planId;
private Long orderId;
private String inboundCode;
@@ -13,6 +13,7 @@ import java.time.LocalDateTime;
public class InboundPlanPallet {
@TableId(type = IdType.INPUT)
private Long id;
private String customerId;
private Long planId;
private String palletNo;
private String destinationWarehouseId;
@@ -12,6 +12,7 @@ import java.math.BigDecimal;
public class InboundPlanPalletAllocation {
@TableId(type = IdType.INPUT)
private Long id;
private String customerId;
private Long planId;
private Long lineId;
private Long palletId;
@@ -43,8 +43,8 @@ public interface InboundPlanOrderMapper {
@Param("planNo") String planNo, @Param("palletCount") int palletCount,
@Param("updatedAt") LocalDateTime updatedAt);
@Insert("INSERT INTO ll_loading_order_status_history(order_id,from_status,to_status,remark,created_at) " +
"VALUES(#{orderId},#{fromStatus},'INBOUND_PLANNED',#{remark},#{createdAt})")
int insertHistory(@Param("orderId") Long orderId, @Param("fromStatus") String fromStatus,
@Insert("INSERT INTO ll_loading_order_status_history(customer_id,order_id,from_status,to_status,remark,created_at) " +
"VALUES(#{customerId},#{orderId},#{fromStatus},'INBOUND_PLANNED',#{remark},#{createdAt})")
int insertHistory(@Param("customerId") String customerId, @Param("orderId") Long orderId, @Param("fromStatus") String fromStatus,
@Param("remark") String remark, @Param("createdAt") LocalDateTime createdAt);
}
@@ -108,7 +108,7 @@ public class InboundPlanService {
if (orderMapper.markPlanned(customerId, order.orderId(), plan.getPlanNo(), count, now) != 1) {
throw new IllegalStateException("Failed to update order " + order.orderId());
}
orderMapper.insertHistory(order.orderId(), order.currentStatus(),
orderMapper.insertHistory(customerId, order.orderId(), order.currentStatus(),
"Inbound order converted to inbound plan " + plan.getPlanNo(), now);
}
return detail(customerId, plan);
@@ -158,6 +158,7 @@ public class InboundPlanService {
for (SourceOrderSnapshot order : orders) {
InboundPlanLine line = new InboundPlanLine();
line.setId(IdWorker.getId());
line.setCustomerId(order.customerId());
line.setPlanId(plan.getId());
line.setOrderId(order.orderId());
line.setInboundCode(order.inboundCode());
@@ -182,6 +183,7 @@ public class InboundPlanService {
SourceOrderSnapshot sample = warehouseSamples.get(draft.warehouseKey());
InboundPlanPallet pallet = new InboundPlanPallet();
pallet.setId(IdWorker.getId());
pallet.setCustomerId(plan.getCustomerId());
pallet.setPlanId(plan.getId());
pallet.setPalletNo(plan.getPlanNo() + "-P" + String.format("%03d", result.size() + 1));
pallet.setDestinationWarehouseId(sample.destinationWarehouseId());
@@ -205,6 +207,7 @@ public class InboundPlanService {
for (PalletAllocator.AllocationDraft draft : allocation.allocations()) {
InboundPlanPalletAllocation item = new InboundPlanPalletAllocation();
item.setId(IdWorker.getId());
item.setCustomerId(plan.getCustomerId());
item.setPlanId(plan.getId());
item.setLineId(lineByOrder.get(draft.orderId()).getId());
item.setPalletId(pallets.get(draft.pallet()).getId());