尾程暂扣回传
This commit is contained in:
@@ -33,6 +33,7 @@ import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.ZoneOffset;
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
@@ -54,6 +55,7 @@ public class LastlegOrderService {
|
||||
@Resource private LastlegOrderOperationLogMapper operationLogMapper;
|
||||
@Resource private InboundPlanCartonMapper cartonMapper;
|
||||
@Resource private InventoryCommandService inventory;
|
||||
@Resource private InboundOrderDetainedOutboxService detainedOutbox;
|
||||
|
||||
public PageResult<LastlegOrderSummary> page(String customerId, LastlegOrderRequests.Query query) {
|
||||
Page<LastlegOrder> page = orderMapper.selectPage(
|
||||
@@ -123,6 +125,12 @@ public class LastlegOrderService {
|
||||
@Transactional
|
||||
public void setDetained(String customerId, long orderId, LastlegOrderRequests.SetDetained request,
|
||||
String operatorName) {
|
||||
setDetained(customerId, orderId, request, null, operatorName);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public void setDetained(String customerId, long orderId, LastlegOrderRequests.SetDetained request,
|
||||
String operatorId, String operatorName) {
|
||||
LastlegOrder current = findOwned(customerId, orderId);
|
||||
LastlegOrder order = orderMapper.lockById(current.getCustomerId(), orderId);
|
||||
if (order == null) throw new ResponseStatusException(HttpStatus.NOT_FOUND, "Tail-leg order not found");
|
||||
@@ -149,6 +157,10 @@ public class LastlegOrderService {
|
||||
operation.setResult(request.remark().trim());
|
||||
operation.setCreatedAt(now);
|
||||
operationLogMapper.insert(operation);
|
||||
if (StringUtils.hasText(order.getSourceInboundId())) {
|
||||
detainedOutbox.publish(order, detained, request.remark().trim(), operatorId, operatorName,
|
||||
now.toInstant(ZoneOffset.UTC), operation.getId());
|
||||
}
|
||||
}
|
||||
|
||||
@Transactional
|
||||
|
||||
Reference in New Issue
Block a user