From a3b3e3ac062d8ac4c1d66d7b2a992720ea5e7ca2 Mon Sep 17 00:00:00 2001
From: zhou zhou <3272660260@qq.com>
Date: 星期一, 02 二月 2026 09:35:00 +0800
Subject: [PATCH] #站点库位管理

---
 rsf-server/src/main/java/com/vincent/rsf/server/api/service/impl/PdaOtherServiceImpl.java  |  165 +++++++++++++++++++++++++++++++++++++++++
 rsf-server/src/main/java/com/vincent/rsf/server/api/controller/pda/PdaOtherController.java |   29 +++++++
 rsf-server/src/main/java/com/vincent/rsf/server/api/entity/params/PdaGeneralParam.java     |    7 +
 rsf-server/src/main/java/com/vincent/rsf/server/api/service/PdaOtherService.java           |    9 ++
 4 files changed, 210 insertions(+), 0 deletions(-)

diff --git a/rsf-server/src/main/java/com/vincent/rsf/server/api/controller/pda/PdaOtherController.java b/rsf-server/src/main/java/com/vincent/rsf/server/api/controller/pda/PdaOtherController.java
index 2f27222..0cdb7ce 100644
--- a/rsf-server/src/main/java/com/vincent/rsf/server/api/controller/pda/PdaOtherController.java
+++ b/rsf-server/src/main/java/com/vincent/rsf/server/api/controller/pda/PdaOtherController.java
@@ -45,4 +45,33 @@
         return pdaOtherService.inspectConfirm2(generalParam);
     }
 
+    @RequestMapping(value = "/other/station/page")
+    public R stationPage(@RequestParam String staNo,
+                          @RequestParam(defaultValue = "1") Integer curr,
+                          @RequestParam(defaultValue = "5") Integer limit) {
+
+        return pdaOtherService.stationPage(staNo,curr,limit);
+    }
+
+
+    @PostMapping(value = "/other/staOperate")
+    public R staOperate(@RequestBody PdaGeneralParam generalParam) {
+
+        return pdaOtherService.staOperate(generalParam,getLoginUser());
+    }
+
+    @RequestMapping(value = "/other/loc/page")
+    public R locPage(@RequestParam String locNo,
+                         @RequestParam(defaultValue = "1") Integer curr,
+                         @RequestParam(defaultValue = "5") Integer limit) {
+
+        return pdaOtherService.locPage(locNo,curr,limit);
+    }
+
+    @PostMapping(value = "/other/locOperate")
+    public R locOperate(@RequestBody PdaGeneralParam generalParam) {
+
+        return pdaOtherService.locOperate(generalParam,getLoginUser());
+    }
+
 }
diff --git a/rsf-server/src/main/java/com/vincent/rsf/server/api/entity/params/PdaGeneralParam.java b/rsf-server/src/main/java/com/vincent/rsf/server/api/entity/params/PdaGeneralParam.java
index b8218ff..f048465 100644
--- a/rsf-server/src/main/java/com/vincent/rsf/server/api/entity/params/PdaGeneralParam.java
+++ b/rsf-server/src/main/java/com/vincent/rsf/server/api/entity/params/PdaGeneralParam.java
@@ -19,4 +19,11 @@
 
     private List<LocItem> matnrList;
 
+    /**
+     * 绔欑偣鎿嶄綔绫诲瀷锛�1.瑙g 2.绂佺敤 3.閲婃斁
+     */
+    private Integer staOperateType;
+
+    private String locNo;
+
 }
diff --git a/rsf-server/src/main/java/com/vincent/rsf/server/api/service/PdaOtherService.java b/rsf-server/src/main/java/com/vincent/rsf/server/api/service/PdaOtherService.java
index 6ef1ad9..8ad2c95 100644
--- a/rsf-server/src/main/java/com/vincent/rsf/server/api/service/PdaOtherService.java
+++ b/rsf-server/src/main/java/com/vincent/rsf/server/api/service/PdaOtherService.java
@@ -2,6 +2,7 @@
 
 import com.vincent.rsf.framework.common.R;
 import com.vincent.rsf.server.api.entity.params.PdaGeneralParam;
+import com.vincent.rsf.server.system.entity.User;
 
 public interface PdaOtherService {
     R transferPage(String orderNo, Integer curr, Integer limit);
@@ -11,4 +12,12 @@
     R inspectConfirm(PdaGeneralParam generalParam);
 
     R inspectConfirm2(PdaGeneralParam generalParam);
+
+    R stationPage(String staNo, Integer curr, Integer limit);
+
+    R staOperate(PdaGeneralParam generalParam, User user);
+
+    R locPage(String locNo, Integer curr, Integer limit);
+
+    R locOperate(PdaGeneralParam generalParam, User loginUser);
 }
diff --git a/rsf-server/src/main/java/com/vincent/rsf/server/api/service/impl/PdaOtherServiceImpl.java b/rsf-server/src/main/java/com/vincent/rsf/server/api/service/impl/PdaOtherServiceImpl.java
index 9fc64ad..11a5e42 100644
--- a/rsf-server/src/main/java/com/vincent/rsf/server/api/service/impl/PdaOtherServiceImpl.java
+++ b/rsf-server/src/main/java/com/vincent/rsf/server/api/service/impl/PdaOtherServiceImpl.java
@@ -7,17 +7,22 @@
 import com.vincent.rsf.framework.exception.CoolException;
 import com.vincent.rsf.server.api.entity.params.PdaGeneralParam;
 import com.vincent.rsf.server.api.service.PdaOtherService;
+import com.vincent.rsf.server.manager.entity.BasStation;
 import com.vincent.rsf.server.manager.entity.Loc;
 import com.vincent.rsf.server.manager.entity.LocItem;
 import com.vincent.rsf.server.manager.entity.Transfer;
 import com.vincent.rsf.server.manager.enums.LocStatusType;
 import com.vincent.rsf.server.manager.enums.LocStsType;
+import com.vincent.rsf.server.manager.service.BasStationService;
 import com.vincent.rsf.server.manager.service.LocItemService;
 import com.vincent.rsf.server.manager.service.LocService;
 import com.vincent.rsf.server.manager.service.TransferService;
+import com.vincent.rsf.server.system.entity.User;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
 
+import java.util.Date;
 import java.util.List;
 
 @Service
@@ -30,6 +35,9 @@
     private LocService locService;
     @Autowired
     private LocItemService locItemService;
+
+    @Autowired
+    private BasStationService basStationService;
 
     @Override
     public R transferPage(String orderNo, Integer curr, Integer limit) {
@@ -113,4 +121,161 @@
         }
         return R.ok();
     }
+
+    @Override
+    public R stationPage(String staNo, Integer curr, Integer limit) {
+        Page<BasStation> page = new Page<>(curr, limit);
+        LambdaQueryWrapper<BasStation> basStationLambdaQueryWrapper = new LambdaQueryWrapper<>();
+        basStationLambdaQueryWrapper.eq(!Cools.isEmpty(staNo), BasStation::getStationName, staNo);
+        Page<BasStation> page1 = basStationService.page(page, basStationLambdaQueryWrapper);
+        return R.ok(page1);
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public R staOperate(PdaGeneralParam generalParam, User user) {
+        switch (generalParam.getStaOperateType()){
+            case 1:
+                stationDisabled(generalParam.getTransferStationNo(),user);
+                break;
+            case 2:
+                stationLiftTheBan(generalParam.getTransferStationNo(),user);
+                break;
+            case 3:
+                stationRelease(generalParam.getTransferStationNo(),user);
+                break;
+            default:
+                break;
+        }
+
+        return R.ok();
+    }
+
+
+    @Transactional(rollbackFor = Exception.class)
+    public void stationDisabled(String transferStationNo,User user){
+        BasStation basStation = basStationService.getOne(new LambdaQueryWrapper<BasStation>().eq(BasStation::getStationName, transferStationNo));
+        if (Cools.isEmpty(basStation)) {
+            throw new CoolException("鏈壘鍒版纭殑绔欑偣");
+        }
+        if (basStation.getUseStatus().equals(LocStsType.LOC_STS_TYPE_S.type) || basStation.getUseStatus().equals(LocStsType.LOC_STS_TYPE_R.type)) {
+            throw new CoolException("褰撳墠绔欑偣姝e湪宸ヤ綔");
+        }
+        basStation.setUseStatus(LocStsType.LOC_STS_TYPE_X.type);
+        basStation.setUpdateBy(user.getId());
+        basStation.setUpdateTime(new Date());
+        basStationService.updateById(basStation);
+    }
+
+    @Transactional(rollbackFor = Exception.class)
+    public void stationLiftTheBan(String transferStationNo,User user){
+        BasStation basStation = basStationService.getOne(new LambdaQueryWrapper<BasStation>().eq(BasStation::getStationName, transferStationNo));
+        if (Cools.isEmpty(basStation)) {
+            throw new CoolException("鏈壘鍒版纭殑绔欑偣");
+        }
+        if (basStation.getUseStatus().equals(LocStsType.LOC_STS_TYPE_S.type) || basStation.getUseStatus().equals(LocStsType.LOC_STS_TYPE_R.type)) {
+            throw new CoolException("褰撳墠绔欑偣姝e湪宸ヤ綔");
+        }
+
+        basStation.setUseStatus(Cools.isEmpty(basStation.getBarcode())?LocStsType.LOC_STS_TYPE_O.type:LocStsType.LOC_STS_TYPE_F.type);
+        basStation.setUpdateBy(user.getId());
+        basStation.setUpdateTime(new Date());
+        basStationService.updateById(basStation);
+    }
+
+    @Transactional(rollbackFor = Exception.class)
+    public void stationRelease(String transferStationNo,User user){
+        BasStation basStation = basStationService.getOne(new LambdaQueryWrapper<BasStation>().eq(BasStation::getStationName, transferStationNo));
+        if (Cools.isEmpty(basStation)) {
+            throw new CoolException("鏈壘鍒版纭殑绔欑偣");
+        }
+        if (basStation.getUseStatus().equals(LocStsType.LOC_STS_TYPE_S.type) || basStation.getUseStatus().equals(LocStsType.LOC_STS_TYPE_R.type)) {
+            throw new CoolException("褰撳墠绔欑偣姝e湪宸ヤ綔");
+        }
+
+        basStation.setUseStatus(LocStsType.LOC_STS_TYPE_O.type);
+        basStation.setBarcode(null);
+        basStation.setUpdateBy(user.getId());
+        basStation.setUpdateTime(new Date());
+        basStationService.updateById(basStation);
+    }
+
+
+    @Override
+    public R locPage(String locNo, Integer curr, Integer limit) {
+        Page<Loc> page = new Page<>(curr, limit);
+        LambdaQueryWrapper<Loc> basStationLambdaQueryWrapper = new LambdaQueryWrapper<>();
+        basStationLambdaQueryWrapper.eq(!Cools.isEmpty(locNo), Loc::getCode, locNo);
+        Page<Loc> page1 = locService.page(page, basStationLambdaQueryWrapper);
+        return R.ok(page1);
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public R locOperate(PdaGeneralParam generalParam, User user) {
+        switch (generalParam.getStaOperateType()){
+            case 1:
+                locDisabled(generalParam.getLocNo(),user);
+                break;
+            case 2:
+                locLiftTheBan(generalParam.getLocNo(),user);
+                break;
+            case 3:
+                locRelease(generalParam.getLocNo(),user);
+                break;
+            default:
+                break;
+        }
+
+        return R.ok();
+    }
+
+    @Transactional(rollbackFor = Exception.class)
+    public void locDisabled(String transferStationNo,User user){
+        Loc lco = locService.getOne(new LambdaQueryWrapper<Loc>().eq(Loc::getCode, transferStationNo));
+        if (Cools.isEmpty(lco)) {
+            throw new CoolException("鏈壘鍒版纭殑搴撲綅");
+        }
+        if (lco.getUseStatus().equals(LocStsType.LOC_STS_TYPE_S.type) || lco.getUseStatus().equals(LocStsType.LOC_STS_TYPE_R.type)) {
+            throw new CoolException("褰撳墠绔欑偣姝e湪宸ヤ綔");
+        }
+        lco.setUseStatus(LocStsType.LOC_STS_TYPE_X.type);
+        lco.setUpdateBy(user.getId());
+        lco.setUpdateTime(new Date());
+        locService.updateById(lco);
+    }
+
+    @Transactional(rollbackFor = Exception.class)
+    public void locLiftTheBan(String transferStationNo,User user){
+        Loc lco = locService.getOne(new LambdaQueryWrapper<Loc>().eq(Loc::getCode, transferStationNo));
+        if (Cools.isEmpty(lco)) {
+            throw new CoolException("鏈壘鍒版纭殑搴撲綅");
+        }
+        if (lco.getUseStatus().equals(LocStsType.LOC_STS_TYPE_S.type) || lco.getUseStatus().equals(LocStsType.LOC_STS_TYPE_R.type)) {
+            throw new CoolException("褰撳墠搴撲綅姝e湪宸ヤ綔");
+        }
+
+        lco.setUseStatus(Cools.isEmpty(lco.getBarcode())?LocStsType.LOC_STS_TYPE_O.type:LocStsType.LOC_STS_TYPE_F.type);
+        lco.setUpdateBy(user.getId());
+        lco.setUpdateTime(new Date());
+        locService.updateById(lco);
+    }
+
+    @Transactional(rollbackFor = Exception.class)
+    public void locRelease(String transferStationNo,User user){
+        Loc lco = locService.getOne(new LambdaQueryWrapper<Loc>().eq(Loc::getCode, transferStationNo));
+        if (Cools.isEmpty(lco)) {
+            throw new CoolException("鏈壘鍒版纭殑搴撲綅");
+        }
+        if (lco.getUseStatus().equals(LocStsType.LOC_STS_TYPE_S.type) || lco.getUseStatus().equals(LocStsType.LOC_STS_TYPE_R.type)) {
+            throw new CoolException("褰撳墠搴撲綅姝e湪宸ヤ綔");
+        }
+
+        lco.setUseStatus(LocStsType.LOC_STS_TYPE_O.type);
+        lco.setBarcode(null);
+        lco.setUpdateBy(user.getId());
+        lco.setUpdateTime(new Date());
+        locService.updateById(lco);
+    }
+
 }

--
Gitblit v1.9.1