费用提交
This commit is contained in:
+6
-2
@@ -16,8 +16,12 @@ public final class PdaCargoDiscardDtos {
|
||||
public record ActualLine(@NotNull Long itemId, @PositiveOrZero int actualPackages) { }
|
||||
public record Confirm(@NotEmpty List<@Valid ActualLine> lines,
|
||||
@NotEmpty @Size(max = 20) List<@NotNull @jakarta.validation.constraints.Positive Long> photoFileIds,
|
||||
List<@NotBlank String> scannedCartonMarks, Boolean confirmAllCartons) {
|
||||
public Confirm(List<ActualLine> lines, List<Long> photoFileIds) { this(lines, photoFileIds, null, false); }
|
||||
List<@NotBlank String> scannedCartonMarks, Boolean confirmAllCartons,
|
||||
@NotBlank @Size(max=255) String idempotencyKey) {
|
||||
/** 兼容已有调用,正式 PDA 必须提交扫码幂等键。 */
|
||||
public Confirm(List<ActualLine> lines,List<Long> photos,List<String> marks,Boolean all){this(lines,photos,marks,all,null);}
|
||||
/** 兼容已有内部照片确认调用。 */
|
||||
public Confirm(List<ActualLine> lines, List<Long> photoFileIds) { this(lines, photoFileIds, null, false,null); }
|
||||
}
|
||||
/** 明细数量按来源标识单位:退货库存为件,其余箱级库存为箱。 */
|
||||
public record Sku(Long itemId, String skuCode, String productName, int plannedPackages,
|
||||
|
||||
+4
@@ -23,6 +23,7 @@ public class PdaCargoDiscardService {
|
||||
@Resource private CargoDiscardInventoryAdjustmentService adjustments;
|
||||
@Resource private CargoDiscardService discardService;
|
||||
@Resource private com.baiyue.lastleg.discard.service.CargoDiscardStockService stockService;
|
||||
@Resource private com.baiyue.lastleg.storagerent.service.StorageRentService storageRent;
|
||||
|
||||
/** 只读取绑定仓已审核申请的实际托盘任务。 */
|
||||
public List<PdaCargoDiscardDtos.PalletTask> tasks(PdaWarehouseIdentity identity) {
|
||||
@@ -95,6 +96,9 @@ public class PdaCargoDiscardService {
|
||||
// 已完成托盘保持原始实点结果,终态重放不得再次扣减或释放库存。
|
||||
if (palletItems.stream().allMatch(item -> "COMPLETED".equals(item.getPdaStatus()))) return task;
|
||||
if (terminal) throw conflict("废弃终态不能执行未完成托盘");
|
||||
storageRent.consume(String.valueOf(identity.overseasWarehouseId()),new com.baiyue.lastleg.storagerent.dto.StorageRentDtos.PrepareRequest(
|
||||
"DISCARD",discardNo,null,null,null,null,palletNo,request.idempotencyKey(),null,null,null,
|
||||
request.lines(),request.photoFileIds(),request.scannedCartonMarks(),request.confirmAllCartons()));
|
||||
LocalDateTime now = LocalDateTime.now();
|
||||
for (CargoDiscardItem item : palletItems) {
|
||||
if ("COMPLETED".equals(item.getPdaStatus())) {
|
||||
|
||||
+2
@@ -50,6 +50,7 @@ import java.util.Set;
|
||||
|
||||
@Service
|
||||
public class CargoDiscardService {
|
||||
@jakarta.annotation.Resource private com.baiyue.lastleg.storagerent.service.StorageRentService storageRent;
|
||||
@Resource private CargoDiscardStatisticsService statisticsService;
|
||||
@Resource private com.baiyue.lastleg.discard.repository.CargoDiscardQuantityRepository quantities;
|
||||
@Resource private com.baiyue.lastleg.service.LastlegOrderNoGenerator orderNoGenerator;
|
||||
@@ -389,6 +390,7 @@ public class CargoDiscardService {
|
||||
release(customerId, application, links, items.listApplication(customerId, application.getId()));
|
||||
LocalDateTime at = now();
|
||||
String from = application.getStatus();
|
||||
storageRent.cancelExecution("DISCARD",discardNo);
|
||||
application.setStatus(CANCELLED); application.setReviewedBy(platform ? operatorId : application.getReviewedBy());
|
||||
application.setReviewRemark(platform ? "平台取消" : application.getReviewRemark());
|
||||
application.setUpdatedAt(at); applications.updateById(application);
|
||||
|
||||
Reference in New Issue
Block a user