From 039ea2a8d16e84f524e65ec47f9352b3ef625940 Mon Sep 17 00:00:00 2001
From: skyouc
Date: 星期三, 09 七月 2025 16:21:16 +0800
Subject: [PATCH] no message

---
 zy-asrs-wms/src/main/java/com/zy/asrs/wms/apis/wcs/services/Impl/WaveManagentServiceImpl.java |   45 ++++++++++++++++++++++++++++++++++-----------
 1 files changed, 34 insertions(+), 11 deletions(-)

diff --git a/zy-asrs-wms/src/main/java/com/zy/asrs/wms/apis/wcs/services/Impl/WaveManagentServiceImpl.java b/zy-asrs-wms/src/main/java/com/zy/asrs/wms/apis/wcs/services/Impl/WaveManagentServiceImpl.java
index b59a34e..254e93c 100644
--- a/zy-asrs-wms/src/main/java/com/zy/asrs/wms/apis/wcs/services/Impl/WaveManagentServiceImpl.java
+++ b/zy-asrs-wms/src/main/java/com/zy/asrs/wms/apis/wcs/services/Impl/WaveManagentServiceImpl.java
@@ -7,6 +7,7 @@
 import com.zy.asrs.wms.apis.wcs.entity.domain.WaveTaskDetl;
 import com.zy.asrs.wms.apis.wcs.entity.response.SowSeeds;
 import com.zy.asrs.wms.apis.wcs.services.WaveManagentService;
+import com.zy.asrs.wms.apis.wcs.utils.HttpEssUtils;
 import com.zy.asrs.wms.asrs.entity.*;
 import com.zy.asrs.wms.asrs.entity.dto.LargeScreenTaskDto;
 import com.zy.asrs.wms.asrs.entity.enums.OrderPickStatus;
@@ -15,15 +16,16 @@
 import com.zy.asrs.wms.asrs.mapper.*;
 import com.zy.asrs.wms.asrs.service.TaskService;
 import com.zy.asrs.wms.asrs.service.WaveSeedService;
-import org.aspectj.weaver.ast.Or;
+import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
-import java.math.BigDecimal;
-import java.util.ArrayList;
+import javax.servlet.http.HttpServletRequest;
 import java.util.List;
-import java.util.stream.Collectors;
 
+import static com.zy.asrs.wms.utils.HttpUtils.getClientIpAddress;
+
+@Slf4j
 @Service
 public class WaveManagentServiceImpl implements WaveManagentService {
     @Autowired
@@ -65,9 +67,21 @@
     }
 
     @Override
-    public R getTask() {
-         List<LargeScreenTaskDto> taskDtos =  taskMapper.getTaskIntegrateByTaskNo(new LambdaQueryWrapper<Task>().eq(Task::getTaskSts, TaskStsType.WAVE_SEED.id).orderByAsc(Task::getUpdateTime).last("limit 1"));
-
+    public R getTask(HttpServletRequest request) {
+        log.info("ip鍦板潃====>锛� {}",  getClientIpAddress(request));
+        String locIp =  getClientIpAddress(request);
+        List<LargeScreenTaskDto> taskDtos;
+        if (locIp.equals(HttpEssUtils.S2_SITE_NO)) {
+            taskDtos =  taskMapper.getTaskIntegrateByTaskNo(new LambdaQueryWrapper<Task>()
+                    .eq(Task::getTaskSts, TaskStsType.WAVE_SEED.id)
+                            .eq(Task::getTargetSite, "S2")
+                    .orderByAsc(Task::getUpdateTime).last("limit 1"));
+        } else {
+            taskDtos =  taskMapper.getTaskIntegrateByTaskNo(new LambdaQueryWrapper<Task>()
+                    .eq(Task::getTaskSts, TaskStsType.WAVE_SEED.id)
+                    .eq(Task::getTargetSite, "S1")
+                    .orderByAsc(Task::getUpdateTime).last("limit 1"));
+        }
          return R.ok(taskDtos);
     }
 
@@ -79,12 +93,14 @@
 
     /**
      * 鑾峰彇闈炴眹鎬绘槑缁嗘暟鎹�
+     *
      * @param taskNo
+     * @param waveNo
      * @return
      */
     @Override
-    public R getTaskDetlQutify(String taskNo) {
-        List<WaveTaskDetl> taskDetls = taskMapper.getTaskDetlQutify(taskNo);
+    public R getTaskDetlQutify(String taskNo, String waveNo) {
+        List<WaveTaskDetl> taskDetls = taskMapper.getTaskDetlQutify(taskNo, waveNo);
         return R.ok(taskDetls);
     }
 
@@ -121,8 +137,15 @@
      * @return
      */
     @Override
-    public R AllSeedLocs() {
-        List<CacheSite> cacheSites = cacheSiteMapper.selectList(new LambdaQueryWrapper<CacheSite>());
+    public R AllSeedLocs(HttpServletRequest request) {
+        log.info("ip鍦板潃====>锛� {}",  getClientIpAddress(request));
+        String locIp =  getClientIpAddress(request);
+        List<CacheSite> cacheSites;
+        if (locIp.equals(HttpEssUtils.S2_SITE_NO)) {
+            cacheSites = cacheSiteMapper.selectList(new LambdaQueryWrapper<CacheSite>().eq(CacheSite::getChannel, "S2"));
+        } else {
+            cacheSites = cacheSiteMapper.selectList(new LambdaQueryWrapper<CacheSite>().eq(CacheSite::getChannel, "S1"));
+        }
         if (cacheSites.isEmpty()) {
             return R.error("褰撳墠鎾澧欎俊鎭湭璁剧疆锛侊紒");
         }

--
Gitblit v1.9.1