From 25579b7079f5fab8fc660358644deb5aea633ed2 Mon Sep 17 00:00:00 2001 From: skyouc Date: 星期四, 10 七月 2025 12:46:13 +0800 Subject: [PATCH] no message --- zy-asrs-wms/src/main/java/com/zy/asrs/wms/apis/wcs/controller/OutStockController.java | 29 +++++++++++++++++++++++------ 1 files changed, 23 insertions(+), 6 deletions(-) diff --git a/zy-asrs-wms/src/main/java/com/zy/asrs/wms/apis/wcs/controller/OutStockController.java b/zy-asrs-wms/src/main/java/com/zy/asrs/wms/apis/wcs/controller/OutStockController.java index bb425dc..7d7c5e2 100644 --- a/zy-asrs-wms/src/main/java/com/zy/asrs/wms/apis/wcs/controller/OutStockController.java +++ b/zy-asrs-wms/src/main/java/com/zy/asrs/wms/apis/wcs/controller/OutStockController.java @@ -11,10 +11,13 @@ import com.zy.asrs.wms.apis.wcs.services.WcsApiService; import com.zy.asrs.wms.asrs.entity.CacheSite; import com.zy.asrs.wms.asrs.entity.Task; +import com.zy.asrs.wms.asrs.entity.WaveSeed; import com.zy.asrs.wms.asrs.entity.param.BindPlatformParam; import com.zy.asrs.wms.asrs.service.CacheSiteService; import com.zy.asrs.wms.asrs.service.PlatformService; import com.zy.asrs.wms.asrs.service.TaskService; +import com.zy.asrs.wms.asrs.service.WaveSeedService; +import com.zy.asrs.wms.asrs.service.impl.WaveSeedServiceImpl; import com.zy.asrs.wms.system.controller.BaseController; import io.netty.util.internal.StringUtil; import lombok.extern.slf4j.Slf4j; @@ -23,8 +26,10 @@ import javax.annotation.Resource; import java.util.HashMap; +import java.util.List; import java.util.Map; import java.util.Objects; +import java.util.stream.Collectors; @Slf4j @RestController @@ -42,6 +47,9 @@ @Resource private TaskService taskService; + + @Autowired + private WaveSeedService waveSeedService; /** @@ -108,19 +116,28 @@ if (Objects.isNull(cacheSite)) { throw new CoolException("褰撳墠绔欑偣涓嶅瓨鍦紒锛�"); } + + List<WaveSeed> waveSeed = waveSeedService.list(new LambdaQueryWrapper<WaveSeed>().eq(WaveSeed::getSiteNo, request.get("tagCode").toString())); + if (Objects.isNull(waveSeed)) { + throw new CoolException("鎾澧欏湴鏍囨湭缁戝畾锛侊紒"); + } + + List<Long> taskIds = waveSeed.stream().map(WaveSeed::getTaskId).collect(Collectors.toList()); + // 鏍规嵁鎾绔欑偣淇℃伅鏉$爜锛屾煡浠诲姟 - Task task = taskService.getOne(new LambdaQueryWrapper<Task>().eq(Task::getBarcode, cacheSite.getBarcode())); - if (Objects.isNull(task)) { + List<Task> tasks = taskService.list(new LambdaQueryWrapper<Task>().in(Task::getId, taskIds)); + if (tasks.isEmpty()) { throw new CoolException("褰撳墠绔欑偣浠诲姟涓嶅瓨鍦紒锛�"); } + List<String> taskNos = tasks.stream().map(Task::getTaskNo).collect(Collectors.toList()); + Map<String, Object> param = new HashMap<>(); - param.put("taskNo", task.getTaskNo()); + param.put("taskNo", taskNos); + param.put("siteNo", cacheSite.getSiteNo()); param.put("orderNo",cacheSite.getOrderNo()); - wcsApiService.slapLightLogic(param); - - return R.ok(); + return wcsApiService.slapLightLogic(param); } /** -- Gitblit v1.9.1