生产更新:同步已提交的海外仓分析及业务修复(2026-10-16) #27

Merged
admin merged 138 commits from test into main 2026-10-16 18:02:59 +08:00
3 changed files with 16 additions and 7 deletions
Showing only changes of commit ec7e9b36ec - Show all commits
@@ -23,7 +23,13 @@ public final class ReturnOrderResponses {
}
}
public record ReceiptCarton(String receiptNo, String palletCode, String cartonMark, String countStatus,
LocalDateTime countedAt, List<ReceiptItem> items) { }
LocalDateTime countedAt, List<ReceiptItem> items,
BigDecimal length, BigDecimal width, BigDecimal height, BigDecimal weight) {
public ReceiptCarton(String receiptNo, String palletCode, String cartonMark, String countStatus,
LocalDateTime countedAt, List<ReceiptItem> items) {
this(receiptNo, palletCode, cartonMark, countStatus, countedAt, items, null, null, null, null);
}
}
public record PackingDetail(String sourceCartonMark, String targetCartonMark, String returnNo,
String skuCode, long quantity, LocalDateTime createdAt) { }
public record Photo(long fileId, String fileName, String contentType, long sizeBytes) { }
@@ -40,18 +46,19 @@ public final class ReturnOrderResponses {
public record Receipt(String receiptNo, String receiptBatchNo, String palletCode, String trackingNo, String startedBy,
long receivedQuantity, String operatorName, LocalDateTime signedAt,
String unitType, String unitCode, long boxCount, List<ReceiptItem> items,
String cartonMark, String printableHtml, List<CartonLabel> labels, boolean labelRepairRequired) {
String cartonMark, String printableHtml, List<CartonLabel> labels, boolean labelRepairRequired,
BigDecimal length, BigDecimal width, BigDecimal height, BigDecimal weight) {
public Receipt(String receiptNo, String receiptBatchNo, String palletCode, String trackingNo, String startedBy,
long receivedQuantity, String operatorName, LocalDateTime signedAt,
String unitType, String unitCode, long boxCount, List<ReceiptItem> items,
String cartonMark, String printableHtml, List<CartonLabel> labels) {
this(receiptNo, receiptBatchNo, palletCode, trackingNo, startedBy, receivedQuantity, operatorName, signedAt,
unitType, unitCode, boxCount, items, cartonMark, printableHtml, labels, false);
unitType, unitCode, boxCount, items, cartonMark, printableHtml, labels, false, null, null, null, null);
}
public Receipt(String receiptNo, String receiptBatchNo, String palletCode, String trackingNo, String startedBy,
long receivedQuantity, String operatorName, LocalDateTime signedAt) {
this(receiptNo, receiptBatchNo, palletCode, trackingNo, startedBy, receivedQuantity, operatorName, signedAt,
"PALLET", palletCode, 0, List.of(), null, null, List.of());
"PALLET", palletCode, 0, List.of(), null, null, List.of(), false, null, null, null, null);
}
}
public record CartonLabel(String cartonMark, String printableHtml) { }
@@ -705,11 +705,13 @@ public class ReturnInventoryService {
var task = read(snapshot.getResultJson(), new TypeReference<com.baiyue.lastleg.returnreceipt.dto.ReturnCartonCountDtos.Task>() { });
if (!receipt.getReceiptNo().equals(task.receiptNo())) throw new IllegalStateException("箱内清点快照与签收单不一致");
return task.boxes().stream().map(box -> new ReturnOrderResponses.ReceiptCarton(receipt.getReceiptNo(), receipt.getPalletCode(), box.cartonMark(), "CONFIRMED", snapshot.getCreatedAt(),
box.items().stream().map(line -> new ReturnOrderResponses.ReceiptItem(line.skuCode(), line.productNameZh(), line.quantity(), 1)).toList())).toList();
box.items().stream().map(line -> new ReturnOrderResponses.ReceiptItem(line.skuCode(), line.productNameZh(), line.quantity(), 1)).toList(),
box.length(), box.width(), box.height(), box.weight())).toList();
}
// Never present provisional averages or subsequently changed inventory as receipt facts.
return cartons.listReceipt(receipt.getId()).stream().map(box -> new ReturnOrderResponses.ReceiptCarton(receipt.getReceiptNo(), receipt.getPalletCode(), box.getCartonMark(),
"PENDING".equals(box.getCountStatus()) ? "PENDING" : "UNRECORDED", box.getCountedAt(), List.of())).toList();
"PENDING".equals(box.getCountStatus()) ? "PENDING" : "UNRECORDED", box.getCountedAt(), List.of(),
box.getLength(), box.getWidth(), box.getHeight(), box.getWeight())).toList();
}
@Transactional(readOnly = true)
@@ -286,7 +286,7 @@ public class ReturnReceiptService {
String printableHtml = combineLabels(labels);
return new ReturnOrderResponses.Receipt(receipt.getReceiptNo(), receipt.getReceiptBatchNo(), receipt.getPalletCode(), receipt.getTrackingNo(),
receipt.getBoundBy(), value(receipt.getReceivedQuantity()), receipt.getOperatorName(), receipt.getSignedAt(), receipt.getUnitType(), receipt.getUnitCode(), boxes, lines, cartonMark, printableHtml, labels,
inventory.receiptRepairRequired(receipt, boxes));
inventory.receiptRepairRequired(receipt, boxes), receipt.getLength(), receipt.getWidth(), receipt.getHeight(), receipt.getWeight());
}).toList();
Map<String, Map<String, ReturnOrderResponses.PalletItem>> palletItems = new LinkedHashMap<>();
Map<String, String> palletTypes = new LinkedHashMap<>();