废弃 ,换标文件上传 ,排车托盘锁粒度

This commit is contained in:
2026-09-14 20:21:07 +08:00
parent b3d74c5441
commit 70145e6b3b
9 changed files with 70 additions and 19 deletions
@@ -222,11 +222,12 @@ public class CargoDiscardService {
application.setUpdatedAt(reviewedAt); applications.updateById(application);
LastlegOrder linked = orders.findSource(customerId, "LASTLEG_DISCARD", "CARGO_DISCARD:" + application.getId());
if (linked != null) {
linked.setCurrentStatus(next); linked.setVersion((linked.getVersion() == null ? 0 : linked.getVersion()) + 1); linked.setUpdatedAt(reviewedAt);
String linkedStatus = mainOrderStatus(next);
linked.setCurrentStatus(linkedStatus); linked.setVersion((linked.getVersion() == null ? 0 : linked.getVersion()) + 1); linked.setUpdatedAt(reviewedAt);
orders.updateById(linked);
LastlegOrderStatusHistory orderHistory = new LastlegOrderStatusHistory(); orderHistory.setId(IdWorker.getId());
orderHistory.setCustomerId(customerId); orderHistory.setOrderId(linked.getId()); orderHistory.setFromStatus(PENDING_REVIEW);
orderHistory.setToStatus(next); orderHistory.setEventId("CARGO_DISCARD_REVIEW:" + application.getId()); orderHistory.setRemark(historyRemark); orderHistory.setCreatedAt(reviewedAt);
orderHistory.setToStatus(linkedStatus); orderHistory.setEventId("CARGO_DISCARD_REVIEW:" + application.getId()); orderHistory.setRemark(historyRemark); orderHistory.setCreatedAt(reviewedAt);
orderHistories.insert(orderHistory);
}
history(customerId, application.getId(), PENDING_REVIEW, next, operatorId, historyRemark, reviewedAt);
@@ -248,10 +249,12 @@ public class CargoDiscardService {
LocalDateTime at = now(); application.setStatus(to); application.setUpdatedAt(at); applications.updateById(application);
LastlegOrder linked = orders.findSource(customerId, "LASTLEG_DISCARD", "CARGO_DISCARD:" + application.getId());
if (linked != null) {
linked.setCurrentStatus(to); linked.setPackageCount(application.getTotalPackages());
String linkedFrom = mainOrderStatus(from);
String linkedTo = mainOrderStatus(to);
linked.setCurrentStatus(linkedTo); linked.setPackageCount(application.getTotalPackages());
linked.setVersion((linked.getVersion() == null ? 0 : linked.getVersion()) + 1); linked.setUpdatedAt(at); orders.updateById(linked);
LastlegOrderStatusHistory h = new LastlegOrderStatusHistory(); h.setId(IdWorker.getId()); h.setCustomerId(customerId); h.setOrderId(linked.getId());
h.setFromStatus(from); h.setToStatus(to); h.setEventId("CARGO_DISCARD_STATUS:" + application.getId() + ":" + to); h.setRemark(remark); h.setCreatedAt(at); orderHistories.insert(h);
h.setFromStatus(linkedFrom); h.setToStatus(linkedTo); h.setEventId("CARGO_DISCARD_STATUS:" + application.getId() + ":" + linkedTo); h.setRemark(remark); h.setCreatedAt(at); orderHistories.insert(h);
}
history(customerId, application.getId(), from, to, operatorId, remark, at);
}
@@ -360,6 +363,15 @@ public class CargoDiscardService {
}
}
/** Maps application/PDA-only states to the five states exposed by the tail-leg main order. */
private static String mainOrderStatus(String status) {
return switch (status) {
case REJECTED -> CANCELLED;
case PDA_COMPLETED -> "PROCESSING";
default -> status;
};
}
private String hash(Object value) {
try {
byte[] json = objectMapper.writeValueAsBytes(value);