From 9219e85f544780fa955945fc6c0c63e08d862ce3 Mon Sep 17 00:00:00 2001
From: skyouc
Date: 星期四, 03 七月 2025 16:43:55 +0800
Subject: [PATCH] 出库优先先进先出
---
zy-asrs-wms/src/main/java/com/zy/asrs/wms/apis/wcs/controller/OutStockController.java | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++----
1 files changed, 53 insertions(+), 4 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 d595118..1d48eb5 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
@@ -1,20 +1,28 @@
package com.zy.asrs.wms.apis.wcs.controller;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.zy.asrs.framework.common.R;
import com.zy.asrs.framework.exception.CoolException;
import com.zy.asrs.wms.apis.wcs.entity.request.ContainerArrivedParam;
import com.zy.asrs.wms.apis.wcs.entity.request.RfidSingalRequest;
import com.zy.asrs.wms.apis.wcs.entity.request.TasksStatusCallbackParam;
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.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.system.controller.BaseController;
import io.netty.util.internal.StringUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
+import javax.annotation.Resource;
+import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
@@ -28,6 +36,12 @@
@Autowired
private PlatformService platformService;
+
+ @Resource
+ private CacheSiteService cacheSiteService;
+
+ @Resource
+ private TaskService taskService;
/**
@@ -72,6 +86,43 @@
}
/**
+ * ESS 鎾澧欐媿鐏洖璋�
+ * 鎾澧欐媿鐏紝ESS璋冪敤
+ */
+ @PostMapping("/light/off")
+ public R lightOff(@RequestBody Map<String, Object> request) {
+ if (Objects.isNull(request)) {
+ throw new CoolException("鍙傛暟涓嶈兘涓虹┖锛侊紒");
+ }
+ if (Objects.isNull(request.get("tagCode"))) {
+ throw new CoolException("鐢靛瓙鏍囩缂栧彿涓嶈兘涓虹┖锛侊紒");
+ }
+ if (Objects.isNull(request.get("eventCode"))){
+ throw new CoolException("浜嬩欢鍚嶇О涓嶈兘涓虹┖锛侊紒");
+ }
+
+ log.info("鎾澧欐媿鐏紝璇锋眰鍙傛暟锛歿}", JSONObject.toJSONString(request));
+
+ // 鏍规嵁绔欑偣缂栫爜鏌ユ挱绉嶇珯鐐逛俊鎭�
+ CacheSite cacheSite = cacheSiteService.getOne(new LambdaQueryWrapper<CacheSite>().eq(CacheSite::getSiteNo, request.get("tagCode")));
+ if (Objects.isNull(cacheSite)) {
+ throw new CoolException("褰撳墠绔欑偣涓嶅瓨鍦紒锛�");
+ }
+ // 鏍规嵁鎾绔欑偣淇℃伅鏉$爜锛屾煡浠诲姟
+ Task task = taskService.getOne(new LambdaQueryWrapper<Task>().eq(Task::getBarcode, cacheSite.getBarcode()));
+ if (Objects.isNull(task)) {
+ throw new CoolException("褰撳墠绔欑偣浠诲姟涓嶅瓨鍦紒锛�");
+ }
+
+ Map<String, Object> param = new HashMap<>();
+ param.put("taskNo", task.getTaskNo());
+ param.put("siteNo", cacheSite.getSiteNo());
+ param.put("orderNo",cacheSite.getOrderNo());
+
+ return wcsApiService.slapLightLogic(param);
+ }
+
+ /**
* 瀹瑰櫒娴佸姩閫氱煡锛堝綋鍓嶇墿鏂欐挱绉嶅畬鎴愶級
* //fixme 姝ゆ帴鍙e皢涓嶅啀鍗曠嫭璋冪敤
* 1. 鏇存柊褰撳墠浠诲姟鐗╂枡淇℃伅
@@ -80,7 +131,7 @@
* @return
*/
@GetMapping("/container/converyor/{code}")
- public R containerConveyor(@PathVariable String code) {
+ public R containerConveyor(@PathVariable String code) throws Exception {
if (StringUtil.isNullOrEmpty(code)) {
return R.error("瀹瑰櫒缂栫爜涓嶈兘涓虹┖锛侊紒锛�");
}
@@ -109,9 +160,7 @@
throw new CoolException("褰撳墠浠诲姟璁㈠崟鍙蜂笉鑳戒负绌猴紒锛�");
}
- wcsApiService.slapLightLogic(request);
-
- return R.ok();
+ return wcsApiService.slapLightLogic(request);
}
--
Gitblit v1.9.1