From 25d4333015921e7a2445564e7099c1503e0a2eac Mon Sep 17 00:00:00 2001
From: wangxinhui <wangxinhui@hnkhzn.com>
Date: 星期二, 10 二月 2026 17:21:44 +0800
Subject: [PATCH] 更新回库异常处理操作

---
 /dev/null                                                                  |    0 
 项目代码/WMS/WMSServices/WIDESEA_StockService/StockInfoService.cs              |    9 -
 项目代码/WMS/WMSServices/WIDESEA_TaskInfoService/TaskService_Inbound.cs        |    6 +
 项目代码/WMS/WMSClient/config/buttons.js                                       |   10 ++
 项目代码/WMS/WMSClient/src/extension/stock/stockInfo.js                        |   10 ++
 项目资料/接口协议/博斯通利拓接口.V2.xlsx                                                  |    0 
 项目资料/技术协议/副本机台位置清单1229.xlsx                                                |    0 
 项目资料/接口协议/博思通利拓接口.V1.xlsx                                                  |    0 
 项目代码/WMS/WMSServices/WIDESEA_WMSServer/Controllers/ERP/ErpBSTController.cs |    6 
 项目代码/WMS/WMSClient/src/extension/stock/extend/manualStock.vue              |  191 +++++++++++++++++++++++++++++++++++++++++++++++
 10 files changed, 221 insertions(+), 11 deletions(-)

diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSClient/config/buttons.js" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSClient/config/buttons.js"
index d6d7bb5..2ae3150 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSClient/config/buttons.js"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSClient/config/buttons.js"
@@ -218,6 +218,16 @@
     onClick: function () {
     }
 }
+,
+{
+    name: "鎵嬪姩107璇锋眰",
+    icon: '',
+    class: '',
+    value: 'ManualStock',
+    type: 'success',
+    onClick: function () {
+    }
+}
 ]
 
 export default buttons
\ No newline at end of file
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSClient/src/extension/stock/extend/manualOut.vue" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSClient/src/extension/stock/extend/manualOut.vue"
deleted file mode 100644
index e69de29..0000000
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSClient/src/extension/stock/extend/manualOut.vue"
+++ /dev/null
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSClient/src/extension/stock/extend/manualStock.vue" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSClient/src/extension/stock/extend/manualStock.vue"
new file mode 100644
index 0000000..a3dd9cf
--- /dev/null
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSClient/src/extension/stock/extend/manualStock.vue"
@@ -0,0 +1,191 @@
+<template>
+    <div>
+      <vol-box
+        v-model="showDetialBox"
+        :lazy="true"
+        width="600px"
+        :padding="15"
+        title="鎵嬪姩107璇锋眰"
+      >
+        <div style="margin-bottom: 20px;">
+            鑾峰彇鍒扮焊鍗锋潯鐮佹煡璇RP搴撳瓨
+            <br>
+            <br>
+            <el-input
+                v-model="requestBarCode"
+                style="width: 180px"
+                label="绾稿嵎鏉$爜"
+              ></el-input>
+              &nbsp;&nbsp;
+            <el-descriptions title="ERP搴撳瓨" v-if="showStock">
+                <el-descriptions-item label="閲嶉噺">{{ searchStock.weight ? searchStock.weight : "鏃犲簱瀛�"}}</el-descriptions-item>
+                <el-descriptions-item label="鐩村緞">{{ searchStock.thicknes ? searchStock.thicknes : "鏃犲簱瀛�" }}</el-descriptions-item>
+                <el-descriptions-item label="骞呭">{{ searchStock.wide ?  searchStock.wide : "鏃犲簱瀛�"}}</el-descriptions-item>
+            </el-descriptions>
+            <el-button type="primary" size="small" @click="search">鏌ヨ</el-button>
+        </div>
+        <div>
+          <el-form>
+            <el-form-item label="璇疯緭RFID锛�"
+              ><el-input
+                v-model="requestStock.rfId"
+                style="width: 180px"
+                label="璇疯緭RFID"
+              ></el-input>
+            </el-form-item>
+            <el-form-item label="璇疯緭閲嶉噺锛�"
+              ><el-input
+                v-model="requestStock.weight"
+                style="width: 180px"
+                label="璇疯緭閲嶉噺"
+              ></el-input>
+            </el-form-item>
+            <el-form-item label="璇疯緭鐩村緞锛�"
+              ><el-input
+                v-model="requestStock.thicknes"
+                style="width: 180px"
+                label="璇疯緭鐩村緞"
+              ></el-input>
+            </el-form-item>
+            <el-form-item label="璇疯緭骞呭锛�"
+              ><el-input
+                v-model="requestStock.wide"
+                style="width: 180px"
+                label="璇疯緭骞呭"
+              ></el-input>
+            </el-form-item>
+          </el-form>
+        </div>
+        <template #footer>
+          <el-button type="primary" size="small" @click="submit">纭</el-button>
+          <el-button type="danger" size="small" @click="close">鍏抽棴</el-button>
+        </template>
+      </vol-box>
+    </div>
+  </template>
+      
+      <script>
+  import VolBox from "@/components/basic/VolBox.vue";
+  export default {
+    components: { VolBox },
+    data() {
+      return {
+        showDetialBox: false,
+        showStock: false,
+        requestBarCode:null,
+        searchStock: {
+          weight: null,
+          thicknes: null,
+          wide: null
+        },
+        requestStock: {
+          rfId: null,
+          weight: null,
+          thicknes: null,
+          wide: null
+        },
+      };
+    },
+    methods: {
+      open() {
+        this.showDetialBox = true;
+      },
+      close() {
+        this.showDetialBox = false;
+        this.requestStock = {
+          rfId: null,
+          weight: null,
+          thicknes: null,
+          wide: null
+        };
+        this.showStock = false;
+        this.requestBarCode = null;
+        this.searchStock = {
+          weight: null,
+          thicknes: null,
+          wide: null
+        };
+      },
+      search(){
+        this.http
+          .post(
+            "api/ERPBST/BSTStockAsync?barCode=" + this.requestBarCode,
+            null,
+            "鏁版嵁澶勭悊涓�"
+          )
+          .then((x) => {
+            if(x.code==200){
+                this.showStock = true;
+                this.searchStock.weight= x.data.qty ==0 ? null:x.data.qty;
+                this.searchStock.thicknes= x.data.thick ==0 ? null:x.data.thick;
+                this.searchStock.wide= x.data.w  ==0 ? null:x.data.w;
+                console.log(this.searchStock);
+            }else{
+                this.$message.error(x.message);
+            }
+          });
+      },
+      submit() {
+        if (this.showStock == false) return this.$message.error("璇峰厛鏌ヨERP搴撳瓨");
+        if (this.requestStock.rfId == null) return this.$message.error("璇疯緭鍏FID");
+        if (this.requestStock.weight == null) return this.$message.error("璇疯緭鍏ラ噸閲�");
+        if (this.requestStock.thicknes == null) return this.$message.error("璇疯緭鍏ョ洿寰�");
+        if (this.requestStock.wide == null) return this.$message.error("璇疯緭鍏ュ箙瀹�");
+        this.http
+          .post(
+            "api/Task/YLPurchaseBoxing?palletCode=" + this.requestStock.rfId + "&weight=" + this.requestStock.weight + "&thickness=" + this.requestStock.thicknes + "&wide=" + this.requestStock.wide+ "&stationCode=107",
+            null,
+            "鏁版嵁澶勭悊涓�"
+          )
+          .then((x) => {
+            if (!x.status) return this.$message.error(x.message);
+            this.$message.success("鎿嶄綔鎴愬姛");
+            this.$parent.refresh();
+            this.close();
+          });
+      },
+    },
+    created() {},
+  };
+  </script>
+      
+      <style scoped>
+  .el-col {
+    border-radius: 4px;
+  }
+  
+  .grid-content {
+    border-radius: 4px;
+    min-height: 36px;
+  }
+  
+  .content-text {
+    display: flex;
+    align-items: center;
+    justify-content: center;
+  }
+  
+  .right-text {
+    display: flex;
+    align-items: center;
+    justify-content: flex-end;
+  }
+  </style>
+      <style>
+  .el-table .warning-row {
+    background: #e6a23c;
+  }
+  
+  .el-table .success-row {
+    background: #f0f9eb;
+  }
+  
+  .el-table .error-row {
+    background: #f56c6c;
+  }
+  
+  canvas {
+    display: block;
+    margin: auto;
+  }
+  </style>
\ No newline at end of file
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSClient/src/extension/stock/stockInfo.js" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSClient/src/extension/stock/stockInfo.js"
index 7fa2011..1de03ff 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSClient/src/extension/stock/stockInfo.js"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSClient/src/extension/stock/stockInfo.js"
@@ -1,10 +1,10 @@
 
 //姝s鏂囦欢鏄敤鏉ヨ嚜瀹氫箟鎵╁睍涓氬姟浠g爜锛屽彲浠ユ墿灞曚竴浜涜嚜瀹氫箟椤甸潰鎴栬�呴噸鏂伴厤缃敓鎴愮殑浠g爜
-
+import gridHeader from './extend/manualStock.vue'
 let extension = {
     components: {
       //鏌ヨ鐣岄潰鎵╁睍缁勪欢
-      gridHeader: '',
+      gridHeader: gridHeader,
       gridBody: '',
       gridFooter: '',
       //鏂板缓銆佺紪杈戝脊鍑烘鎵╁睍缁勪欢
@@ -41,6 +41,12 @@
             });
           }
         }
+        let manualStock = this.buttons.find(x => x.value == 'ManualStock');
+        if (manualStock) {
+          manualStock.onClick = function () {
+            this.$refs.gridHeader.open();
+          }
+        }
       },
       onInited() {
         //妗嗘灦鍒濆鍖栭厤缃悗
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_StockService/StockInfoService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_StockService/StockInfoService.cs"
index 444f52a..447614a 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_StockService/StockInfoService.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_StockService/StockInfoService.cs"
@@ -155,11 +155,12 @@
                     BSTResponse<BSTStockInfoDTO> bSTResponse = _invokeERPService.BSTStockAsync(item.PalletCode).DeserializeObject<BSTResponse<BSTStockInfoDTO>>();
                     if (bSTResponse.Code == 500)
                     {
-                        content.Message += $"鏉$爜{item.PalletCode}涓�鏈烢RP搴撳瓨涓嶅瓨鍦�,";
+                        stockInfosDel.Add(item);
+                        content.Message += $"鏉$爜{item.PalletCode}涓�鏈烢RP搴撳瓨宸蹭笉瀛樺湪,";
                         continue;
                     }
                     BSTStockInfoDTO bSTStockInfoDTO = bSTResponse.Data ?? throw new Exception($"涓�鏈烢RP鏈繑鍥瀧item.PalletCode}鐨勫簱瀛樹俊鎭�");
-                    if (item.StockLength != bSTStockInfoDTO.StockMeter && bSTStockInfoDTO.StockMeter>0)
+                    if (item.StockLength != bSTStockInfoDTO.StockMeter)
                     {
                         item.MaterielThickness = bSTStockInfoDTO.Thick;
                         item.MaterielWeight = bSTStockInfoDTO.Qty;
@@ -167,10 +168,6 @@
                         item.Remark = $"{item.StockLength}-{bSTStockInfoDTO.StockMeter}";
                         item.StockLength = bSTStockInfoDTO.StockMeter;
                         stockInfosUp.Add(item);
-                    }
-                    else if(item.StockLength != bSTStockInfoDTO.StockMeter && bSTStockInfoDTO.StockMeter == 0)
-                    {
-                        stockInfosDel.Add(item);
                     }
                 }
                 //鏁版嵁搴撴搷浣�
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_TaskInfoService/TaskService_Inbound.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_TaskInfoService/TaskService_Inbound.cs"
index b916eef..87a5efe 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_TaskInfoService/TaskService_Inbound.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_TaskInfoService/TaskService_Inbound.cs"
@@ -21,6 +21,7 @@
 using WIDESEA_Common.TaskEnum;
 using WIDESEA_Common.WareHouseEnum;
 using WIDESEA_Core;
+using WIDESEA_Core.Enums;
 using WIDESEA_Core.Helper;
 using WIDESEA_DTO;
 using WIDESEA_DTO.Basic;
@@ -229,6 +230,11 @@
                         _recordService.StockQuantityChangeRecordService.AddStockChangeRecord(stockInfoOld, oldQty, oldQty < stockInfoOld.StockLength ? stockInfoOld.StockLength- oldQty: oldQty- stockInfoOld.StockLength, StockChangeTypeEnum.MaterielGroup);
                         return content.OK($"鑰佸巶棰嗘枡閫�搴揜FID{stockInfoOld.RfidCode}鏉$爜{stockInfoOld.PalletCode}");
                     }
+                    else if (stockInfoOld != null && stockInfoOld.MaterielInvOrgId == MaterielInvOrgEnum.鑰佸巶.ObjToInt() && stockInfoOld.StockStatus == StockStatusEmun.鍑哄簱瀹屾垚.ObjToInt() && stockInfoOld.StockLength<=0 && stationCode.IsNullOrEmpty())
+                    {
+                        _stockRepository.StockInfoRepository.DeleteAndMoveIntoHty(stockInfoOld, App.User.UserId > 0 ? OperateTypeEnum.浜哄伐瀹屾垚 : OperateTypeEnum.鑷姩瀹屾垚);
+                        throw new Exception($"{palletCode}RFID淇℃伅鑰佸巶棰嗘枡鍚庢棤搴撳瓨閫�鏂�");
+                    }
                     else if (stockInfoOld != null)
                     {
                         throw new Exception($"{palletCode}RFID淇℃伅宸插瓨鍦�");
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_WMSServer/Controllers/ERP/ErpBSTController.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_WMSServer/Controllers/ERP/ErpBSTController.cs"
index 8acb76f..9a53c52 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_WMSServer/Controllers/ERP/ErpBSTController.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WMSServices/WIDESEA_WMSServer/Controllers/ERP/ErpBSTController.cs"
@@ -81,7 +81,7 @@
         /// 鎺ユ敹涓�鏈熺敓绠℃帓绋嬩俊鎭�
         /// </summary>
         /// <returns></returns>
-        [HttpPost, HttpGet, Route("ReceiveOutOrder")]
+        [HttpPost, HttpGet, Route("ReceiveOutOrder"), AllowAnonymous]
         public WebResponseContent AddOutSGOrder([FromBody] List<SGOutOrderDTO> outOrderDTOs)
         {
             return _taskService.AddOutSGOrder(outOrderDTOs);
@@ -91,7 +91,7 @@
         /// 鎺ユ敹鍗氭�濋�氶鏂欎俊鎭�
         /// </summary>
         /// <returns></returns>
-        [HttpPost, HttpGet, Route("ReceivePicking")]
+        [HttpPost, HttpGet, Route("ReceivePicking"), AllowAnonymous]
         public WebResponseContent ReceivePicking([FromBody] List<BSTPickInfoDTO> bSTPickInfoDTOs)
         {
             return _taskService.ReceivePicking(bSTPickInfoDTOs);
@@ -101,7 +101,7 @@
         /// 鎺ユ敹鍗氭�濋�氶��鏂欎俊鎭�
         /// </summary>
         /// <returns></returns>
-        [HttpPost, HttpGet, Route("ReceiveReturnOrder")]
+        [HttpPost, HttpGet, Route("ReceiveReturnOrder"), AllowAnonymous]
         public WebResponseContent ReceiveReturnOrder([FromBody] List<BSTReturnOrderDTO> bSTReturnOrderDTOs)
         {
             return _returnBSTOrderService.ReceiveReturnOrder(bSTReturnOrderDTOs);
diff --git "a/\351\241\271\347\233\256\350\265\204\346\226\231/\346\212\200\346\234\257\345\215\217\350\256\256/\345\211\257\346\234\254\346\234\272\345\217\260\344\275\215\347\275\256\346\270\205\345\215\2251229.xlsx" "b/\351\241\271\347\233\256\350\265\204\346\226\231/\346\212\200\346\234\257\345\215\217\350\256\256/\345\211\257\346\234\254\346\234\272\345\217\260\344\275\215\347\275\256\346\270\205\345\215\2251229.xlsx"
new file mode 100644
index 0000000..9a2e4fc
--- /dev/null
+++ "b/\351\241\271\347\233\256\350\265\204\346\226\231/\346\212\200\346\234\257\345\215\217\350\256\256/\345\211\257\346\234\254\346\234\272\345\217\260\344\275\215\347\275\256\346\270\205\345\215\2251229.xlsx"
Binary files differ
diff --git "a/\351\241\271\347\233\256\350\265\204\346\226\231/\346\216\245\345\217\243\345\215\217\350\256\256/\345\215\232\346\200\235\351\200\232\345\210\251\346\213\223\346\216\245\345\217\243.V1.xlsx" "b/\351\241\271\347\233\256\350\265\204\346\226\231/\346\216\245\345\217\243\345\215\217\350\256\256/\345\215\232\346\200\235\351\200\232\345\210\251\346\213\223\346\216\245\345\217\243.V1.xlsx"
index 9eb088d..a089c6c 100644
--- "a/\351\241\271\347\233\256\350\265\204\346\226\231/\346\216\245\345\217\243\345\215\217\350\256\256/\345\215\232\346\200\235\351\200\232\345\210\251\346\213\223\346\216\245\345\217\243.V1.xlsx"
+++ "b/\351\241\271\347\233\256\350\265\204\346\226\231/\346\216\245\345\217\243\345\215\217\350\256\256/\345\215\232\346\200\235\351\200\232\345\210\251\346\213\223\346\216\245\345\217\243.V1.xlsx"
Binary files differ
diff --git "a/\351\241\271\347\233\256\350\265\204\346\226\231/\346\216\245\345\217\243\345\215\217\350\256\256/\345\215\232\346\226\257\351\200\232\345\210\251\346\213\223\346\216\245\345\217\243.V2.xlsx" "b/\351\241\271\347\233\256\350\265\204\346\226\231/\346\216\245\345\217\243\345\215\217\350\256\256/\345\215\232\346\226\257\351\200\232\345\210\251\346\213\223\346\216\245\345\217\243.V2.xlsx"
index 7beb7b9..7be35df 100644
--- "a/\351\241\271\347\233\256\350\265\204\346\226\231/\346\216\245\345\217\243\345\215\217\350\256\256/\345\215\232\346\226\257\351\200\232\345\210\251\346\213\223\346\216\245\345\217\243.V2.xlsx"
+++ "b/\351\241\271\347\233\256\350\265\204\346\226\231/\346\216\245\345\217\243\345\215\217\350\256\256/\345\215\232\346\226\257\351\200\232\345\210\251\346\213\223\346\216\245\345\217\243.V2.xlsx"
Binary files differ

--
Gitblit v1.9.3