From 0b5ccdca6263cf7a2cee460f30c76ef1efea2811 Mon Sep 17 00:00:00 2001
From: dengjunjie <dengjunjie@hnkhzn.com>
Date: 星期六, 27 四月 2024 17:47:27 +0800
Subject: [PATCH] 人工出库,人工入库,人工移库,PDA扫码确认外协物料已被取走接口

---
 代码管理/WMS/WMS_Client/src/extension/widesea_wms/system/dt_inventory.js                  |   19 +++
 代码管理/WMS/WMS_Server/WIDESEA_WMS/ToMes/AddToFloat3.cs                                  |   34 +++++
 代码管理/WMS/WMS_Server/WIDESEA_WMS/Services/system/Partial/dt_inventoryService.cs        |  242 +++++++++++++++++++++++++++++++++++++++
 代码管理/WMS/WMS_Client/src/api/http.js                                                   |    2 
 代码管理/WMS/WMS_Client/src/views/widesea_wms/baseinfo/dt_geometry_data_detectionline.vue |   48 ++++----
 代码管理/WMS/WMS_Client/src/views/widesea_wms/system/dt_inventory.vue                     |    7 
 6 files changed, 319 insertions(+), 33 deletions(-)

diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WMS_Client/src/api/http.js" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WMS_Client/src/api/http.js"
index eb0a016..0af90a4 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WMS_Client/src/api/http.js"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WMS_Client/src/api/http.js"
@@ -12,7 +12,7 @@
 let loadingInstance;
 let loadingStatus = false;
 if (process.env.NODE_ENV == 'development') {
-    axios.defaults.baseURL = 'http://192.168.12.101:8098/';
+    axios.defaults.baseURL = 'http://127.0.0.1:8098/';
 }
 else if (process.env.NODE_ENV == 'debug') {
     axios.defaults.baseURL = 'http://192.168.12.101:8098/';
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WMS_Client/src/extension/widesea_wms/system/dt_inventory.js" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WMS_Client/src/extension/widesea_wms/system/dt_inventory.js"
index 8935403..cddef02 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WMS_Client/src/extension/widesea_wms/system/dt_inventory.js"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WMS_Client/src/extension/widesea_wms/system/dt_inventory.js"
@@ -32,7 +32,24 @@
         //       this.$Message.success('鐐瑰嚮浜嗘寜閽�');
         //     }
         //   });
-
+        this.buttons.forEach(x => {
+          if(x.value == 'Add')
+          {
+            x.name = '浜哄伐鍏ュ簱'
+          }
+        });
+        this.buttons.forEach(x => {
+          if(x.value == 'Update')
+          {
+            x.name = '浜哄伐绉诲簱';
+          }
+        });
+        this.buttons.forEach(x => {
+          if(x.value == 'Delete')
+          {
+            x.name = '浜哄伐鍑哄簱'
+          }
+        });
         //绀轰緥锛氳缃慨鏀规柊寤恒�佺紪杈戝脊鍑烘瀛楁鏍囩鐨勯暱搴�
         // this.boxOptions.labelWidth = 150;
     },
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WMS_Client/src/views/widesea_wms/baseinfo/dt_geometry_data_detectionline.vue" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WMS_Client/src/views/widesea_wms/baseinfo/dt_geometry_data_detectionline.vue"
index 056437b..2f67675 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WMS_Client/src/views/widesea_wms/baseinfo/dt_geometry_data_detectionline.vue"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WMS_Client/src/views/widesea_wms/baseinfo/dt_geometry_data_detectionline.vue"
@@ -30,31 +30,31 @@
                 sortName: "ID"
             });
             const editFormFields = ref({"TypeId":"","Description":"","a":"","b":"","c":"","d":"","e":"","f":"","g":"","h":"","skip_01":"","skip_02":"","skip_03":"","skip_04":"","skip_05":"","skip_06":"","skip_07":"","skip_08":"","skip_09":"","skip_10":"","skip_11":"","skip_12":"","skip_13":"","skip_14":"","skip_15":""});
-            const editFormOptions = ref([[{"title":"","required":true,"field":"TypeId","type":"text"},
+            const editFormOptions = ref([[{"title":"TypeId","required":true,"field":"TypeId","type":"text"},
                                {"title":"鍥惧彿","required":true,"field":"Description","type":"text"}],
-                              [{"title":"","required":true,"field":"a","type":"text"},
-                               {"title":"","required":true,"field":"b","type":"text"}],
-                              [{"title":"","required":true,"field":"c","type":"text"},
-                               {"title":"","required":true,"field":"d","type":"text"}],
-                              [{"title":"","required":true,"field":"e","type":"text"},
-                               {"title":"","required":true,"field":"f","type":"text"}],
-                              [{"title":"","required":true,"field":"g","type":"text"},
-                               {"title":"","required":true,"field":"h","type":"text"}],
-                              [{"title":"","field":"skip_01","type":"text"},
-                               {"title":"","field":"skip_02","type":"text"}],
-                              [{"title":"","field":"skip_03","type":"text"},
-                               {"title":"","field":"skip_04","type":"text"}],
-                              [{"title":"","field":"skip_05","type":"text"},
-                               {"title":"","field":"skip_06","type":"text"}],
-                              [{"title":"","field":"skip_07","type":"text"},
-                               {"title":"","field":"skip_08","type":"text"}],
-                              [{"title":"","field":"skip_09","type":"text"},
-                               {"title":"","field":"skip_10","type":"text"}],
-                              [{"title":"","field":"skip_11","type":"text"},
-                               {"title":"","field":"skip_12","type":"text"}],
-                              [{"title":"","field":"skip_13","type":"text"},
-                               {"title":"","field":"skip_14","type":"text"}],
-                              [{"title":"","field":"skip_15","type":"text"}]]);
+                              [{"title":"a","required":true,"field":"a","type":"text"},
+                               {"title":"b","required":true,"field":"b","type":"text"}],
+                              [{"title":"c","required":true,"field":"c","type":"text"},
+                               {"title":"d","required":true,"field":"d","type":"text"}],
+                              [{"title":"e","required":true,"field":"e","type":"text"},
+                               {"title":"f","required":true,"field":"f","type":"text"}],
+                              [{"title":"g","required":true,"field":"g","type":"text"},
+                               {"title":"h","required":true,"field":"h","type":"text"}],
+                              [{"title":"skip_01","field":"skip_01","type":"text"},
+                               {"title":"skip_02","field":"skip_02","type":"text"},
+                               {"title":"skip_03","field":"skip_03","type":"text"}],
+                              [{"title":"skip_04","field":"skip_04","type":"text"},
+                               {"title":"skip_05","field":"skip_05","type":"text"},
+                               {"title":"skip_06","field":"skip_06","type":"text"}],
+                              [{"title":"skip_07","field":"skip_07","type":"text"},
+                               {"title":"skip_08","field":"skip_08","type":"text"},
+                               {"title":"skip_09","field":"skip_09","type":"text"}],
+                              [{"title":"skip_10","field":"skip_10","type":"text"},
+                               {"title":"skip_11","field":"skip_11","type":"text"},
+                               {"title":"skip_12","field":"skip_12","type":"text"}],
+                              [{"title":"skip_13","field":"skip_13","type":"text"},
+                               {"title":"skip_14","field":"skip_14","type":"text"},
+                               {"title":"skip_15","field":"skip_15","type":"text"}]]);
             const searchFormFields = ref({"TypeId":"","Description":""});
             const searchFormOptions = ref([[{"title":"鍥惧彿","field":"Description","type":"like"},{"title":"","field":"TypeId","type":"like"}]]);
             const columns = ref([{field:'ID',title:'ID',type:'int',width:110,hidden:true,readonly:true,require:true,align:'left'},
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WMS_Client/src/views/widesea_wms/system/dt_inventory.vue" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WMS_Client/src/views/widesea_wms/system/dt_inventory.vue"
index 8a447ac..709a23c 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WMS_Client/src/views/widesea_wms/system/dt_inventory.vue"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WMS_Client/src/views/widesea_wms/system/dt_inventory.vue"
@@ -29,8 +29,11 @@
                 url: "/dt_inventory/",
                 sortName: "ID"
             });
-            const editFormFields = ref({});
-            const editFormOptions = ref([]);
+            const editFormFields = ref({"stationCode":"","SN":""});
+            const editFormOptions = ref([
+                [{"title":"缂撳瓨鏋剁紪鍙�","required":true,"field":"stationCode"}],//,"disabled": true
+                [{"title":"杞﹁疆SN鍙�","required":true,"field":"SN"}],
+            ]);
             const searchFormFields = ref({"SN":"","Name":"","HearthNumber":"","HeatNumber":"","BilletNumber":"","remark":""});
             const searchFormOptions = ref([
                 [{"title":"杞﹁疆SN鍙�","field":"SN","type":"like"},{"title":"璐т綅缂栧彿","field":"stationCode","type":"like"},{"title":"浜у搧鍚嶇О","field":"Name","type":"like"}],
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WMS_Server/WIDESEA_WMS/Services/system/Partial/dt_inventoryService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WMS_Server/WIDESEA_WMS/Services/system/Partial/dt_inventoryService.cs"
index c00277e..8ac8691 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WMS_Server/WIDESEA_WMS/Services/system/Partial/dt_inventoryService.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WMS_Server/WIDESEA_WMS/Services/system/Partial/dt_inventoryService.cs"
@@ -21,6 +21,21 @@
 using WIDESEA_Comm.LogInfo;
 using WIDESEA_Core.ManageUser;
 using OfficeOpenXml.FormulaParsing.Excel.Functions.Text;
+using WIDESEA_Core.EFDbContext;
+using WIDESEA_WMS.Repositories;
+using System.Collections.Generic;
+using System.Threading.Tasks;
+using static WIDESEA_Comm.MES_Info.BasicSN;
+using System.Collections;
+using static FreeSql.Internal.GlobalFilter;
+using WIDESEA_Comm.MES_Info.Request;
+using System.Xml.Linq;
+using Newtonsoft.Json;
+using Confluent.Kafka;
+using WIDESEA_WMS.Common;
+using WIDESEA_Comm.MES_Info;
+using System.Reflection;
+using static System.Collections.Specialized.BitVector32;
 
 namespace WIDESEA_WMS.Services
 {
@@ -42,6 +57,170 @@
             //base.Init(dbRepository);
         }
 
+
+        /// <summary>
+        /// 娣诲姞搴撳瓨
+        /// </summary>
+        /// <param name="saveDataModel"></param>
+        /// <returns></returns>
+        public override WebResponseContent Add(SaveModel saveDataModel)
+        {
+            WebResponseContent content = new WebResponseContent();
+            VOLContext context = new VOLContext();
+            IVV_Mes_WorkinfoRepository workinfoRepository = new VV_Mes_WorkinfoRepository(context);
+            Idt_stationinfoRepository stationinfoRepository = new dt_stationinfoRepository(context);
+            var stationCode = saveDataModel.MainData["stationCode"].ToString();
+            try
+            {
+                if (string.IsNullOrEmpty(stationCode)) throw new Exception($"缂撳瓨鏋剁紪鍙蜂笉鑳戒负绌�!");
+                if (!stationCode.Contains("B") && !stationCode.Contains("C") && !stationCode.Contains("D")) throw new Exception($"缂撳瓨鏋剁被鍨嬫湁璇�!");
+                var station = stationinfoRepository.Find(x => x.stationCode == stationCode).FirstOrDefault();
+                if (station == null) throw new Exception($"鏈壘鍒拌揣浣峽stationCode}");
+                var bindSNs = saveDataModel.MainData["SN"].ToString().Split(",");
+                var SNS = bindSNs.GroupBy(x => x).Where(x => x.Count() > 1).Select(x => x.Key);
+                foreach (var SN in SNS)
+                {
+                    throw new Exception($"閲嶅鐨凷N鍙穥SN}");
+                }
+                List<detail> list = new List<detail>();
+                List<VV_Mes_Workinfo> workinfos = new List<VV_Mes_Workinfo>();
+                foreach (var item in bindSNs)
+                {
+                    var work = workinfoRepository.Find(x => x.SN == item && x.processCode == "17").FirstOrDefault();
+                    if (work == null) throw new Exception($"鏈壘鍒拌溅杞甋N鍙凤細{item}鐨勫伐鍗曚俊鎭紒");
+                    workinfos.Add(work);
+                    detail detail = new detail();
+                    detail.sn = item;
+                    list.Add(detail);
+                }
+                agvInWarehousePara outWarehousePara = new agvInWarehousePara()
+                {
+                    //WorkOrder = task.jobID,
+                    zoneID = stationCode,
+                    //processCode = task.agv_worktype.ToString(),
+                    details = list,
+                    layerNo = 1,
+                    stackID = "1",
+                    warehouseName = "Agv搴�",
+                    Operator = UserContext.Current.UserName,
+                };
+                var postJson = JsonConvert.SerializeObject(outWarehousePara);
+                var mesData = Request.RequestData(postJson, MESAPIAddress.IPAddress_MES + "agvInWarehouse");
+                if (mesData.Contains("杩炴帴灏濊瘯澶辫触")) throw new Exception(mesData);
+                MES_Response requestMes = JsonConvert.DeserializeObject<MES_Response>(mesData);
+
+                if (requestMes.code == "200" && requestMes.Type == "success")
+                {
+                    //鏃ュ織璁板綍涓婁紶鏁版嵁鎴愬姛
+                    WriteWMSLog.LogAdd("", "鎴愬姛", "MES", "WMS", postJson, mesData, "浜哄伐鍚屾MES杞﹁疆鍏ュ簱", "agvInWarehouse", requestMes.message);
+                    foreach (var workinfo in workinfos)
+                    {
+                        dt_inventory inventory = new dt_inventory()
+                        {
+                            SN = workinfo.SN,
+                            Name = workinfo.productName,
+                            FigureNumber = workinfo.drawingNo,
+                            materialCode = workinfo.materialCode,
+                            HeatNumber = workinfo.heatID,
+                            drawingNoVer = workinfo.drawingNoVer,
+                            BilletNumber = workinfo.billetID,
+                            OnlineTime = DateTime.Now,
+                            Operator = "admin",
+                            stationCode = stationCode,
+                            area = station.area,
+                            jobID = workinfo.jobID,
+                            workOrder = workinfo.workOrder,
+                            ID = Guid.NewGuid()
+                        };
+                        _repository.Add(inventory, true);
+                    }
+                    WriteDBLog.Write($"鎵嬪姩娣诲姞搴撳瓨 ", $"璐т綅缂栧彿锛歿stationCode}锛汼N鍙凤細{saveDataModel.MainData["SN"]}", LogState.Sucess, "WMS", UserContext.Current.UserName);
+                }
+                else
+                {
+                    WriteWMSLog.LogAdd("", "澶辫触", "MES", "WMS", postJson, mesData, "浜哄伐鍚屾MES杞﹁疆鍏ュ簱", "agvInWarehouse", requestMes.message);
+                    throw new Exception("浜哄伐鍚屾MES杞﹁疆鍏ュ簱澶辫触锛�" + requestMes.message);
+                }
+            }
+            catch (Exception ex)
+            {
+                content.Message = ex.Message;
+                WriteDBLog.Write($"鎵嬪姩娣诲姞搴撳瓨 ", new { 閿欒淇℃伅 = ex.Message, 鏁版嵁 = $"璐т綅缂栧彿锛歿stationCode}锛汼N鍙凤細{saveDataModel.MainData["SN"]}" }, LogState.Error, "WMS", UserContext.Current.UserName);
+            }
+            return content;
+            //return base.Add(saveDataModel);
+        }
+        /// <summary>
+        /// 淇敼搴撳瓨
+        /// </summary>
+        /// <param name="saveModel"></param>
+        /// <returns></returns>
+        public override WebResponseContent Update(SaveModel saveModel)
+        {
+            WebResponseContent content = new WebResponseContent();
+            string str = "";
+            try
+            {
+                VOLContext context = new VOLContext();
+                Idt_stationinfoRepository stationinfoRepository = new dt_stationinfoRepository(context);
+                var stationCode = saveModel.MainData["stationCode"].ToString();
+                if (string.IsNullOrEmpty(stationCode)) throw new Exception($"缂撳瓨鏋剁紪鍙蜂笉鑳戒负绌�!");
+                if (!stationCode.Contains("B") && !stationCode.Contains("C") && !stationCode.Contains("D")) throw new Exception($"缂撳瓨鏋剁被鍨嬫湁璇�!");
+                if (!stationinfoRepository.Find(x => x.stationCode == stationCode).Any()) throw new Exception($"鏈壘鍒拌揣浣峽stationCode}");
+                var inventory = _repository.Find(x => x.ID.ToString() == saveModel.MainData["ID"].ToString()).FirstOrDefault();
+                str = $"鍘熻揣浣嶇紪鍙凤細{inventory.stationCode}锛涚幇璐т綅缂栧彿锛歿stationCode}锛汼N鍙凤細{inventory.SN}";
+                List<detail1> list1 = new List<detail1>();
+                detail1 detail = new detail1();
+                detail.sn = inventory.SN;
+                list1.Add(detail);
+                agvMoveWarehousePara moveWarehousePara = new agvMoveWarehousePara()
+                {
+                    fromZoneID = inventory.stationCode,
+                    toZoneID = stationCode,
+                    details = list1,
+                    fromLayerNo = "1",
+                    fromStackID = "1",
+                    fromWarehouseName = "Agv搴�",
+                    toLayerNo = "1",
+                    toStackID = "1",
+                    toWarehouseName = "Agv搴�",
+                    Operator = UserContext.Current.UserName,
+                };
+                var postJson = JsonConvert.SerializeObject(moveWarehousePara);
+                var mesData = Request.RequestData(postJson, MESAPIAddress.IPAddress_MES + "agvMoveWarehouse");
+                if (mesData.Contains("杩炴帴灏濊瘯澶辫触"))
+                    throw new Exception(mesData);
+                MES_Response requestMes = JsonConvert.DeserializeObject<MES_Response>(mesData);
+                if (requestMes.code == "200" && requestMes.Type == "success")
+                {
+                    //鏃ュ織璁板綍涓婁紶鏁版嵁鎴愬姛
+                    WriteWMSLog.LogAdd("", "鎴愬姛", "MES", "WMS", postJson, mesData, "浜哄伐鍚屾MES杞﹁疆绉诲簱", "agvMoveWarehouse", requestMes.message);
+                    inventory.stationCode = stationCode;
+                    _repository.Update(inventory, true);
+                    WriteDBLog.Write($"鎵嬪姩绉诲簱搴撳瓨 ", str, LogState.Sucess, "WMS", UserContext.Current.UserName);
+                }
+                else
+                {
+                    WriteWMSLog.LogAdd("", "澶辫触", "MES", "WMS", postJson, mesData, "浜哄伐鍚屾MES杞﹁疆绉诲簱", "agvMoveWarehouse", requestMes.message);
+                    throw new Exception("浜哄伐鍚屾MES杞﹁疆绉诲簱澶辫触锛�" + requestMes.message);
+                }
+
+                content.OK();
+            }
+            catch (Exception ex)
+            {
+                content.Message = ex.Message;
+                WriteDBLog.Write($"鎵嬪姩绉诲簱搴撳瓨 ", new { 閿欒淇℃伅 = ex.Message, 鏁版嵁 = str }, LogState.Error, "WMS", UserContext.Current.UserName);
+            }
+            return content;
+            //return base.Update(saveModel);
+        }
+        /// <summary>
+        /// 鍒犻櫎搴撳瓨
+        /// </summary>
+        /// <param name="keys"></param>
+        /// <param name="delList"></param>
+        /// <returns></returns>
         public override WebResponseContent Del(object[] keys, bool delList = true)
         {
             WebResponseContent content = new WebResponseContent();
@@ -49,17 +228,70 @@
             try
             {
                 List<string> KeyList = new List<string>();
-                foreach ( string key in keys )
+                foreach (string key in keys)
                 {
                     KeyList.Add(key);
                 }
-                var inventoryList= _repository.Find(x=>KeyList.Contains(x.ID.ToString())).ToList();
-                 str = $"{string.Join('銆�', inventoryList.Select(t => t.SN).ToArray())}";
-                content = base.Del(keys, delList);
-                WriteDBLog.Write($"鎵嬪姩鍒犻櫎搴撳瓨 ", str, LogState.Sucess, "WMS", UserContext.Current.UserName);
+                var inventoryList = _repository.Find(x => KeyList.Contains(x.ID.ToString())).ToList();
+                //str = $"{string.Join('銆�', inventoryList.Select(t => t.SN).ToArray())}";
+                foreach (var inventorys in inventoryList.GroupBy(x => x.stationCode))
+                {
+                    try
+                    {
+                        List<detail> lists = new List<detail>();
+                        foreach (var inventory in inventorys)
+                        {
+                            detail detail = new detail();
+                            detail.sn = inventory.SN;
+                            lists.Add(detail);
+                            str = str == "" ? inventory.SN : "," + inventory.SN;
+                        }
+                        agvInWarehousePara outWarehousePara = new agvInWarehousePara()
+                        {
+                            //WorkOrder = task.jobID,
+                            zoneID = inventorys.Key,
+                            //processCode = task.agv_worktype.ToString(),
+                            details = lists,
+                            layerNo = 1,
+                            stackID = "1",
+                            warehouseName = "Agv搴�",
+                            Operator = UserContext.Current.UserName,
+                        };
+                        var postJson = JsonConvert.SerializeObject(outWarehousePara);
+                        var mesData = Request.RequestData(postJson, MESAPIAddress.IPAddress_MES + "agvOutWarehouse");
+                        if (mesData.Contains("杩炴帴灏濊瘯澶辫触")) throw new Exception(mesData);
+                        MES_Response requestMes = JsonConvert.DeserializeObject<MES_Response>(mesData);
+                        if (requestMes.code == "200" && requestMes.Type == "success")
+                        {
+                            //鏃ュ織璁板綍涓婁紶鏁版嵁鎴愬姛
+                            WriteWMSLog.LogAdd("", "鎴愬姛", "MES", "WMS", postJson, mesData, "浜哄伐鍚屾MES杞﹁疆鍑哄簱", "agvOutWarehouse", requestMes.message);
+
+                            foreach (var inventory in inventorys)
+                            {
+                                _repository.Delete(inventory, true);
+                            }
+                            WriteDBLog.Write($"鎵嬪姩鍒犻櫎搴撳瓨 ", $"璐т綅缂栧彿锛歿inventorys.Key}锛汼N鍙凤細{str}", LogState.Sucess, "WMS", UserContext.Current.UserName);
+                        }
+                        else
+                        {
+                            WriteWMSLog.LogAdd("", "澶辫触", "MES", "WMS", postJson, mesData, "浜哄伐鍚屾MES杞﹁疆鍑哄簱", "agvOutWarehouse", requestMes.message);
+                            throw new Exception("浜哄伐鍚屾MES杞﹁疆鍑哄簱澶辫触锛�" + requestMes.message);
+                        }
+                    }
+                    catch (Exception ex)
+                    {
+                        content.Message = ex.Message;
+                        WriteDBLog.Write($"鎵嬪姩鍒犻櫎搴撳瓨 ", new { 閿欒淇℃伅 = ex.Message, 鏁版嵁 = str }, LogState.Error, "WMS", UserContext.Current.UserName);
+                    }
+
+                }
+                content.OK();
+                //content = base.Del(keys, delList);
+                //WriteDBLog.Write($"鎵嬪姩鍒犻櫎搴撳瓨 ", str, LogState.Sucess, "WMS", UserContext.Current.UserName);
             }
             catch (Exception ex)
             {
+                content.Message = ex.Message;
                 WriteDBLog.Write($"鎵嬪姩鍒犻櫎搴撳瓨 ", new { 閿欒淇℃伅 = ex.Message, 鏁版嵁 = str }, LogState.Error, "WMS", UserContext.Current.UserName);
             }
 
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WMS_Server/WIDESEA_WMS/ToMes/AddToFloat3.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WMS_Server/WIDESEA_WMS/ToMes/AddToFloat3.cs"
index f281e92..f6c14a3 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WMS_Server/WIDESEA_WMS/ToMes/AddToFloat3.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WMS_Server/WIDESEA_WMS/ToMes/AddToFloat3.cs"
@@ -3,10 +3,13 @@
 using WIDESEA_Comm;
 using WIDESEA_Comm.LogInfo;
 using WIDESEA_Common;
+using WIDESEA_Core.EFDbContext;
 using WIDESEA_Core.ManageUser;
 using WIDESEA_Core.Utilities;
 using WIDESEA_Entity.DomainModels;
 using WIDESEA_Entity.DomainModels.Mes;
+using WIDESEA_WMS.IRepositories;
+using WIDESEA_WMS.Repositories;
 
 namespace WIDESEA_WMS
 {
@@ -73,5 +76,36 @@
             }
             return content;
         }
+
+        /// <summary>
+        /// 澶栧崗璐т綅鎵爜纭鐗╂枡宸茶鍙栬蛋
+        /// </summary>
+        /// <param name="saveModel"></param>
+        /// <returns></returns>
+        public WebResponseContent Confirmedcut(SaveModel saveModel)
+        {
+            WebResponseContent content = new WebResponseContent();
+            try
+            {
+                VOLContext context = new VOLContext();
+                Idt_stationinfoRepository stationinfoRepository = new dt_stationinfoRepository(context);
+                string sn = saveModel.MainData["from_address"].ToString();
+                var station = stationinfoRepository.Find(x => x.bindSN.Contains(sn) && (x.stationCode.Contains("W01001001") || x.stationCode.Contains("W01001002") || x.stationCode.Contains("W01001003"))).FirstOrDefault();
+                if (station == null) throw new Exception($"鏈壘鍒拌溅杞甋N鍙�:{sn}鐨勫鍗忚揣浣嶄俊鎭紒");
+                station.Number = string.Empty;
+                station.billetID = string.Empty;
+                station.heatNumber = string.Empty;
+                station.stationType = string.Empty;
+                station.tray_status = "EmptyTray";
+                station.lastUpdateTime = DateTime.Now;
+                stationinfoRepository.Update(station, true);
+                content.OK();
+            }
+            catch (Exception ex)
+            {
+                content.Message = ex.Message;
+            }
+            return content;
+        }
     }
 }

--
Gitblit v1.9.3