From e883d7e4bf057f7a2ed7cc001fe27083d82baa22 Mon Sep 17 00:00:00 2001
From: dengjunjie <dengjunjie@hnkhzn.com>
Date: 星期二, 16 四月 2024 19:17:44 +0800
Subject: [PATCH] 优化NG下料位任务触发逻辑

---
 代码管理/WMS/WMS_Client/src/views/dialog/addTask.vue                                               |    9 +
 代码管理/WMS/WMS_Server/WIDESEA_WebApi/Controllers/WIDESEA_WMS/Partial/dt_stationinfoController.cs |   11 ++
 代码管理/WMS/WMS_Server/WIDESEA_WMS/IServices/system/Partial/Idt_stationinfoService.cs             |    1 
 代码管理/PCS/WCS_Server/WIDESEA_WCS/JobsPart/Common/RestockHCJ.cs                                  |   23 ++++
 代码管理/WMS/WMS_Client/src/views/Task/widesea_wms/taskinfo/dt_agvtask.vue                         |   21 +++
 代码管理/PCS/WCS_Server/WIDESEA_WCS/Common/Gantry.cs                                               |   11 +-
 代码管理/WMS/WMS_Server/WIDESEA_WMS/Services/system/Partial/dt_inventoryService.cs                 |   30 +++++
 代码管理/WMS/WMS_Client/src/extension/widesea_wms/system/dt_stationinfo.js                         |   16 +-
 代码管理/WMS/WMS_Client/src/views/widesea_wms/system/dt_stationinfo.vue                            |    2 
 代码管理/WMS/WMS_Client/src/views/extension/widesea_wms/taskinfo/dt_agvtask.js                     |    2 
 代码管理/WMS/WMS_Server/WIDESEA_WMS/Services/Taskinfo/Partial/dt_agvtaskService.cs                 |  142 +++++++++++++++++++--------
 代码管理/WMS/WMS_Server/WIDESEA_WMS/Services/system/Partial/dt_stationinfoService.cs               |   20 +++
 12 files changed, 219 insertions(+), 69 deletions(-)

diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/PCS/WCS_Server/WIDESEA_WCS/Common/Gantry.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/PCS/WCS_Server/WIDESEA_WCS/Common/Gantry.cs"
index c21cc86..db7878e 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/PCS/WCS_Server/WIDESEA_WCS/Common/Gantry.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/PCS/WCS_Server/WIDESEA_WCS/Common/Gantry.cs"
@@ -829,12 +829,11 @@
 
                             if (Stationinfo == null)
                             {
-                                //var stationinfo = Stations.Where(x => x.enable && x.stationCode == NGStation && x.location_state == LocationStateEnum.Stroge.ToString() && x.quantity > 0).FirstOrDefault();
-                                //if (stationinfo != null)
-                                //{
-                                //    agvtask(stationinfoRepository, stationinfo, (wheel == null ? wheel1.e : wheel.e), "TaskType_OutsourceInbound");
-                                //}
-                                Stationinfo = Stations.Where(x => x.enable && x.stationCode == NGStation && x.location_state == LocationStateEnum.Stroge.ToString() && x.quantity == 0).FirstOrDefault();
+                                #region 瑙﹀彂NG浠诲姟
+                                var NG = Stations.Where(x => x.enable && x.stationCode == NGStation && x.location_state == LocationStateEnum.Stroge.ToString() && x.quantity > 0).FirstOrDefault();
+                                if (NG != null)
+                                        agvtask(stationinfoRepository, NG, Work, "TaskType_OutsourceInbound");
+                                #endregion
                             }
                             if (Stationinfo != null)
                             {
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/PCS/WCS_Server/WIDESEA_WCS/JobsPart/Common/RestockHCJ.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/PCS/WCS_Server/WIDESEA_WCS/JobsPart/Common/RestockHCJ.cs"
index 8680c72..863e064 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/PCS/WCS_Server/WIDESEA_WCS/JobsPart/Common/RestockHCJ.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/PCS/WCS_Server/WIDESEA_WCS/JobsPart/Common/RestockHCJ.cs"
@@ -9,12 +9,14 @@
 using WIDESEA_Core.BaseProvider;
 using WIDESEA_Core.EFDbContext;
 using WIDESEA_Entity.DomainModels;
+using WIDESEA_Entity.ToAGV;
 using WIDESEA_WCS.IRepositories;
 using WIDESEA_WCS.Repositories;
 using WIDESEA_WCS.WCSClient;
 using WIDESEA_WMS.IRepositories;
 using WIDESEA_WMS.IServices;
 using WIDESEA_WMS.Repositories;
+using static FreeSql.Internal.GlobalFilter;
 
 namespace WIDESEA_WCS.JobsPart.Common
 {
@@ -100,6 +102,27 @@
                             #endregion
                         }
                     }
+                    else if (task.agv_tasktype == "TaskType_OutsourceInbound")//涓嬫枡鍘诲鍗忓彛
+                    {
+                        if (task.agv_toaddress == "")
+                        {
+                            var TargetLocation = StationTask.GetEmptyLocation(stationinfoRepository);
+                            if (TargetLocation != null)
+                            {
+                                if (agvtaskService.Find(x => x.agv_toaddress == TargetLocation.stationCode).Any()) continue;
+                                var stationinfo = stationinfoRepository.Find(x => x.stationCode == task.agv_fromaddress).FirstOrDefault();
+                                task.agv_taskstate = "Create";
+                                task.agv_toaddress = TargetLocation.stationCode;
+                                TargetLocation.location_state = LocationStateEnum.InBusy.ToString();
+                                TargetLocation.billetID = stationinfo.billetID;
+                                TargetLocation.stationType = task.agv_materielid;
+                                TargetLocation.heatNumber = stationinfo.heatNumber;
+                                TargetLocation.Number = task.jobID;
+                                stationinfoRepository.Update(TargetLocation, true);
+                                agvtaskService.Update(task, true);
+                            }
+                        }
+                    }
                     else if (task.agv_tasktype == "TaskType_OutsourceOutbound" || task.agv_tasktype == "TaskType_Outbound")//澶栧崗搴撳嚭搴�/AB搴撳嚭搴�
                     {
                         if (task.agv_toaddress == "")
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WMS_Client/src/extension/widesea_wms/system/dt_stationinfo.js" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WMS_Client/src/extension/widesea_wms/system/dt_stationinfo.js"
index 203caa8..0f74fbf 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WMS_Client/src/extension/widesea_wms/system/dt_stationinfo.js"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WMS_Client/src/extension/widesea_wms/system/dt_stationinfo.js"
@@ -110,14 +110,14 @@
               });
           }
       })
-        this.buttons.splice(1, 0, {
-          name: "绉诲簱",
-          icon: 'el-icon-document',
-          type: 'danger',
-          onClick: function () {
-              this.$refs.gridHeader.detialBox = true;
-          }
-      })
+      //   this.buttons.splice(1, 0, {
+      //     name: "绉诲簱",
+      //     icon: 'el-icon-document',
+      //     type: 'danger',
+      //     onClick: function () {
+      //         this.$refs.gridHeader.detialBox = true;
+      //     }
+      // })
     },
     onInited() {
       //妗嗘灦鍒濆鍖栭厤缃悗
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WMS_Client/src/views/Task/widesea_wms/taskinfo/dt_agvtask.vue" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WMS_Client/src/views/Task/widesea_wms/taskinfo/dt_agvtask.vue"
index 8dccc18..3904ac0 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WMS_Client/src/views/Task/widesea_wms/taskinfo/dt_agvtask.vue"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WMS_Client/src/views/Task/widesea_wms/taskinfo/dt_agvtask.vue"
@@ -30,10 +30,23 @@
                 sortName: "ID"
             });
             const editFormFields = ref({"agv_fromaddress":"","agv_toaddress":"","agv_tasktype":"","agv_grades":"","agv_code":""});
-            const editFormOptions = ref([[{"title":"璧风偣鍦板潃","field":"agv_fromaddress","type":"text","required":true}],
-                              [{"title":"缁堢偣鍦板潃","field":"agv_toaddress","type":"text","required":true}],
-                              [{"dataKey":"task_grade","data":[],"title":"浠诲姟绛夌骇","required":true,"field":"agv_grade","type":"select"}],
-                              [{"dataKey":"agv_tasktypes","data":[],"title":"浠诲姟绫诲瀷","required":true,"field":"agv_tasktype","type":"select"}]
+            const editFormOptions = ref([[{
+        title: "NG涓嬫枡浣�",
+        required: false,
+        field: "agv_fromaddress",
+        type: "select",
+        data: [
+          { key: "X01001003", value: "1鍗曞厓NG涓嬫枡浣�" },
+          { key: "X02001003", value: "2鍗曞厓NG涓嬫枡浣�" },
+          { key: "X03001002", value: "3鍗曞厓NG涓嬫枡浣�" }
+        ]
+      },
+    //   {"title":"NG涓嬫枡浣�","field":"agv_fromaddress","type":"text","required":true}
+    ],
+            
+                            //   [{"title":"缁堢偣鍦板潃","field":"agv_toaddress","type":"text","required":true}],
+                            //   [{"dataKey":"task_grade","data":[],"title":"浠诲姟绛夌骇","required":true,"field":"agv_grade","type":"select"}],
+                            //   [{"dataKey":"agv_tasktypes","data":[],"title":"浠诲姟绫诲瀷","required":true,"field":"agv_tasktype","type":"select"}]
                             //   [{"dataKey":"agv_code","data":[],"title":"AGV缂栧彿","required":true,"field":"agv_code","type":"select"}]
                             ]);
             const searchFormFields = ref({"agv_tasknum":"","agv_fromaddress":"","agv_toaddress":"","agv_tasktype":[],"agv_taskstate":[],"agv_materielid":"","agv_createtime":"","agv_barcode":"","agv_materbarcode":""});
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WMS_Client/src/views/dialog/addTask.vue" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WMS_Client/src/views/dialog/addTask.vue"
index 69a2208..3af9917 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WMS_Client/src/views/dialog/addTask.vue"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WMS_Client/src/views/dialog/addTask.vue"
@@ -51,8 +51,9 @@
             detialBox: false,
             inType: "handle",
             rules: {
-                from_address: [{ required: true, message: '璇烽�夋嫨璧峰鍦板潃', trigger: 'blur' }],
-                to_address: [{ required: true, message: '璇烽�夋嫨鐩殑鍦板潃', trigger: 'blur' }]
+                from_address: [{ required: true, message: '璇烽�夋嫨NG涓嬫枡浣�', trigger: 'blur' }],
+                // from_address: [{ required: true, message: '璇烽�夋嫨璧峰鍦板潃', trigger: 'blur' }],
+                // to_address: [{ required: true, message: '璇烽�夋嫨鐩殑鍦板潃', trigger: 'blur' }]
             },
             formdata: {
                 from_address: "",
@@ -67,9 +68,9 @@
             var _this = this;
             this.$refs.ruleFormRef.validate((valid) => {
                 if (valid) {
-                    _this.http.post("/api/ToMes/AddToFloat3", _this.formdata, "姝e湪绉诲簱....").then(x => {
+                    _this.http.post("/api/ToMes/AddToFloat3", _this.formdata, "姝e湪娣诲姞....").then(x => {
                         if (!x.status) return _this.$Message.error(x.message);
-                        _this.$Message.success("绉诲簱鎴愬姛!");
+                        _this.$Message.success("娣诲姞鎴愬姛!");
                         _this.refresh();
                     });
                 }
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WMS_Client/src/views/extension/widesea_wms/taskinfo/dt_agvtask.js" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WMS_Client/src/views/extension/widesea_wms/taskinfo/dt_agvtask.js"
index 804e87f..0373480 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WMS_Client/src/views/extension/widesea_wms/taskinfo/dt_agvtask.js"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WMS_Client/src/views/extension/widesea_wms/taskinfo/dt_agvtask.js"
@@ -39,7 +39,7 @@
         this.buttons.forEach(x => {
           if(x.value == 'Add')
           {
-            x.name = '娣诲姞浠诲姟'
+            x.name = 'NG浠诲姟'
           }
         });
         //绀轰緥锛氳缃慨鏀规柊寤恒�佺紪杈戝脊鍑烘瀛楁鏍囩鐨勯暱搴�
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WMS_Client/src/views/widesea_wms/system/dt_stationinfo.vue" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WMS_Client/src/views/widesea_wms/system/dt_stationinfo.vue"
index eb9fe36..7d50a29 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WMS_Client/src/views/widesea_wms/system/dt_stationinfo.vue"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WMS_Client/src/views/widesea_wms/system/dt_stationinfo.vue"
@@ -40,7 +40,7 @@
                               [{"title":"鐐夊彿","field":"heatNumber","type":"text"}],
                               [{"title":"澶囨敞","field":"remark"}]]);
             const searchFormFields = ref({"stationCode":"","stationType":"","area":"","enable":"","location_state":[],"bindSN":""});
-            const searchFormOptions = ref([[{"title":"缂撳瓨鏋剁紪鍙�","field":"stationCode","type":"like"},{"title":"杞﹁疆SN鍙�","field":"bindSN","type":"like"},{"dataKey":"materielinfos","data":[],"title":"鐗╂枡绫诲瀷","field":"stationType","type":"select"}],[{"dataKey":"area_name","data":[],"title":"鍖哄煙","field":"area","type":"select"},{"dataKey":"location_states","data":[],"title":"璐т綅鐘舵��","field":"location_state","type":"selectList"},{"dataKey":"status","data":[],"title":"鏄惁鍚敤","field":"enable","type":"select"}]]);
+            const searchFormOptions = ref([[{"title":"缂撳瓨鏋剁紪鍙�","field":"stationCode","type":"like"},{"title":"杞﹁疆SN鍙�","field":"bindSN","type":"like"},{"dataKey":"materielinfos","data":[],"title":"鐗╂枡绫诲瀷","field":"stationType","type":"select"}],[{"dataKey":"area_name","data":[],"title":"鍖哄煙","field":"area","type":"selectList"},{"dataKey":"location_states","data":[],"title":"璐т綅鐘舵��","field":"location_state","type":"selectList"},{"dataKey":"status","data":[],"title":"鏄惁鍚敤","field":"enable","type":"select"}]]);
             const columns = ref([{field:'id',title:'id',type:'guid',width:110,hidden:true,readonly:true,require:true,align:'left'},
                        {field:'stationCode',title:'缂撳瓨鏋剁紪鍙�',type:'string',width:110,align:'left',sort:true},
                        {field:'stationType',title:'鍥惧彿',type:'string',bind:{ key:'materielinfos',data:[]},width:110,align:'left'},
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WMS_Server/WIDESEA_WMS/IServices/system/Partial/Idt_stationinfoService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WMS_Server/WIDESEA_WMS/IServices/system/Partial/Idt_stationinfoService.cs"
index dca2268..424a750 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WMS_Server/WIDESEA_WMS/IServices/system/Partial/Idt_stationinfoService.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WMS_Server/WIDESEA_WMS/IServices/system/Partial/Idt_stationinfoService.cs"
@@ -10,5 +10,6 @@
     public partial interface Idt_stationinfoService
     {
         WebResponseContent SetStationEnable(object parm);
+        WebResponseContent SendAGVTask(object parm);
     }
 }
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WMS_Server/WIDESEA_WMS/Services/Taskinfo/Partial/dt_agvtaskService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WMS_Server/WIDESEA_WMS/Services/Taskinfo/Partial/dt_agvtaskService.cs"
index 3e52774..8783dc3 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WMS_Server/WIDESEA_WMS/Services/Taskinfo/Partial/dt_agvtaskService.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WMS_Server/WIDESEA_WMS/Services/Taskinfo/Partial/dt_agvtaskService.cs"
@@ -25,6 +25,7 @@
 using WIDESEA_Core.ManageUser;
 using WIDESEA_Comm.LogInfo;
 using StackExchange.Redis;
+using WIDESEA_Comm;
 
 namespace WIDESEA_WMS.Services
 {
@@ -45,63 +46,118 @@
             //澶氱鎴蜂細鐢ㄥ埌杩檌nit浠g爜锛屽叾浠栨儏鍐靛彲浠ヤ笉鐢�
             //base.Init(dbRepository);
         }
-        /// <summary>
-        /// 娣诲姞浠诲姟
-        /// </summary>
-        /// <param name="saveDataModel"></param>
-        /// <returns></returns>
+
+        #region 娣诲姞NG浠诲姟
         public override WebResponseContent Add(SaveModel saveDataModel)
         {
             WebResponseContent content = new WebResponseContent();
             try
             {
+                var fromaddress = saveDataModel.MainData["agv_fromaddress"].ToString();
                 VOLContext context = new VOLContext();
                 Idt_stationinfoRepository stationinfoRepository = new dt_stationinfoRepository(context);
-                var fromaddress = saveDataModel.MainData["agv_fromaddress"].ToString();
-                var toaddress = saveDataModel.MainData["agv_toaddress"].ToString();
-                var tasktype = saveDataModel.MainData["agv_tasktype"].ToString();
-                var grade = saveDataModel.MainData["agv_grade"].ToInt();
-                var worktype = saveDataModel.MainData["agv_worktype"].ToInt();
-                var station1 = stationinfoRepository.FindFirst(x => x.stationCode == fromaddress);
-                var station2 = stationinfoRepository.FindFirst(x => x.stationCode == toaddress);
-                if (station1 == null || station2 == null)
-                    throw new Exception($"璧风偣鍦板潃{fromaddress}鎴栫粓鐐瑰湴鍧�{toaddress}涓嶅瓨鍦紒");
-                if (string.IsNullOrEmpty(station1.stationType))
-                    throw new Exception($"璧风偣{fromaddress}鏈粦瀹氱墿鏂欑被鍨嬶紒");
-                var task = _repository.Find(t => t.agv_fromaddress == fromaddress
-                       || t.agv_fromaddress == toaddress
-                       || t.agv_toaddress == fromaddress
-                       || t.agv_toaddress == toaddress
-                       ).Any();
-                if (task)
-                    throw new Exception("璧峰鎴栫洰鐨勫湴鍧�锛屽凡瀛樺湪浠诲姟涓紒");
-                dt_agvtask agvtask = new dt_agvtask();
-                agvtask.agv_id = Guid.NewGuid();
-                agvtask.agv_fromaddress = fromaddress;
-                agvtask.agv_toaddress = toaddress;
-                agvtask.agv_tasknum = IdenxManager.GetTaskNo("KH-");
-                agvtask.agv_TrayStatus = station1.tray_status;
-                agvtask.agv_Traytype = station1.tray_type;
-                agvtask.agv_taskstate = AGVTaskStateEnum.Create.ToString();
-                agvtask.agv_tasktype = tasktype;
-                agvtask.agv_worktype = worktype;//宸ヤ綔绫诲瀷
-                agvtask.bindSN = station1.bindSN;
-                agvtask.agv_materielid = station1.stationType;//鐗╂枡绫诲瀷
-                agvtask.agv_qty = station1.quantity;
-                agvtask.agv_createtime = DateTime.Now;
-                agvtask.agv_grade = grade;//浠诲姟浼樺厛绾�
-                agvtask.agv_userid = UserContext.Current.UserName;
+                IVV_Mes_WorkinfoRepository workinfoRepository = new VV_Mes_WorkinfoRepository(context);
+                var station = stationinfoRepository.Find(x => x.stationCode == fromaddress).FirstOrDefault();
+                if (_repository.Find(x => x.agv_fromaddress == fromaddress || x.agv_toaddress == fromaddress).Any())
+                    throw new Exception($"璐т綅{fromaddress}宸插瓨鍦ㄤ换鍔★紒");
+                if (station == null) throw new Exception($"鏈壘鍒拌揣浣峽fromaddress}锛�");
+                if (!station.enable) throw new Exception($"璐т綅{fromaddress}鏈惎鐢紒");
+                if (station.quantity < 1) throw new Exception($"璐т綅{fromaddress}鏃犺溅杞紒");
+                var Work = workinfoRepository.Find(x => x.workOrder == station.Number && x.processCode == "17").FirstOrDefault();
+                if (Work == null) throw new Exception($"鏈壘鍒拌揣浣峽fromaddress}鐨勬満鍔犲伐宸ュ崟淇℃伅");
+                dt_agvtask agvtask = new dt_agvtask()
+                {
+                    agv_fromaddress = station.stationCode,
+                    agv_id = Guid.NewGuid(),
+                    agv_tasknum = IdenxManager.GetTaskNo("KH-", "WMS"),
+                    agv_grade = 1,
+                    agv_createtime = DateTime.Now,
+                    agv_taskstate = "Queue",
+                    agv_materielid = station.stationType,
+                    agv_qty = station.quantity,
+                    agv_tasktype = "TaskType_OutsourceInbound",
+                    agv_toaddress = "",
+                    agv_userid = UserContext.Current.UserName,
+                    bindSN = station.bindSN,
+                    agv_worktype = Convert.ToInt32(Work.processCode),
+                    agv_materbarcode = Work.materialCode,
+                    agv_Traytype = station.tray_type,
+                    jobID = station.Number,
+                    agv_TrayStatus = station.tray_status
+                };
                 _repository.Add(agvtask, true);
+                station.location_state = LocationStateEnum.InBusy.ToString();
+                stationinfoRepository.Update(station, true);
                 content.OK();
-                WriteDBLog.Success($"鎵嬪姩娣诲姞浠诲姟", new { 鏁版嵁 = saveDataModel }, "WMS", UserContext.Current.UserName);
             }
             catch (Exception ex)
             {
-                WriteDBLog.Error($"鎵嬪姩娣诲姞浠诲姟", new { 鏁版嵁 = saveDataModel, 寮傚父淇℃伅 = ex.Message }, "WMS", UserContext.Current.UserName);
-                content.Error(ex.Message);
+                content.Message = ex.Message;
             }
-
             return content;
         }
+        #endregion
+
+        #region 娣诲姞浠诲姟
+        /// <summary>
+        /// 娣诲姞浠诲姟
+        /// </summary>
+        /// <param name="saveDataModel"></param>
+        /// <returns></returns>
+        //public override WebResponseContent Add(SaveModel saveDataModel)
+        //{
+        //    WebResponseContent content = new WebResponseContent();
+        //    try
+        //    {
+        //        VOLContext context = new VOLContext();
+        //        Idt_stationinfoRepository stationinfoRepository = new dt_stationinfoRepository(context);
+        //        var fromaddress = saveDataModel.MainData["agv_fromaddress"].ToString();
+        //        var toaddress = saveDataModel.MainData["agv_toaddress"].ToString();
+        //        var tasktype = saveDataModel.MainData["agv_tasktype"].ToString();
+        //        var grade = saveDataModel.MainData["agv_grade"].ToInt();
+        //        var worktype = saveDataModel.MainData["agv_worktype"].ToInt();
+        //        var station1 = stationinfoRepository.FindFirst(x => x.stationCode == fromaddress);
+        //        var station2 = stationinfoRepository.FindFirst(x => x.stationCode == toaddress);
+        //        if (station1 == null || station2 == null)
+        //            throw new Exception($"璧风偣鍦板潃{fromaddress}鎴栫粓鐐瑰湴鍧�{toaddress}涓嶅瓨鍦紒");
+        //        if (string.IsNullOrEmpty(station1.stationType))
+        //            throw new Exception($"璧风偣{fromaddress}鏈粦瀹氱墿鏂欑被鍨嬶紒");
+        //        var task = _repository.Find(t => t.agv_fromaddress == fromaddress
+        //               || t.agv_fromaddress == toaddress
+        //               || t.agv_toaddress == fromaddress
+        //               || t.agv_toaddress == toaddress
+        //               ).Any();
+        //        if (task)
+        //            throw new Exception("璧峰鎴栫洰鐨勫湴鍧�锛屽凡瀛樺湪浠诲姟涓紒");
+        //        dt_agvtask agvtask = new dt_agvtask();
+        //        agvtask.agv_id = Guid.NewGuid();
+        //        agvtask.agv_fromaddress = fromaddress;
+        //        agvtask.agv_toaddress = toaddress;
+        //        agvtask.agv_tasknum = IdenxManager.GetTaskNo("KH-");
+        //        agvtask.agv_TrayStatus = station1.tray_status;
+        //        agvtask.agv_Traytype = station1.tray_type;
+        //        agvtask.agv_taskstate = AGVTaskStateEnum.Create.ToString();
+        //        agvtask.agv_tasktype = tasktype;
+        //        agvtask.agv_worktype = worktype;//宸ヤ綔绫诲瀷
+        //        agvtask.bindSN = station1.bindSN;
+        //        agvtask.agv_materielid = station1.stationType;//鐗╂枡绫诲瀷
+        //        agvtask.agv_qty = station1.quantity;
+        //        agvtask.agv_createtime = DateTime.Now;
+        //        agvtask.agv_grade = grade;//浠诲姟浼樺厛绾�
+        //        agvtask.agv_userid = UserContext.Current.UserName;
+        //        _repository.Add(agvtask, true);
+        //        content.OK();
+        //        WriteDBLog.Success($"鎵嬪姩娣诲姞浠诲姟", new { 鏁版嵁 = saveDataModel }, "WMS", UserContext.Current.UserName);
+        //    }
+        //    catch (Exception ex)
+        //    {
+        //        WriteDBLog.Error($"鎵嬪姩娣诲姞浠诲姟", new { 鏁版嵁 = saveDataModel, 寮傚父淇℃伅 = ex.Message }, "WMS", UserContext.Current.UserName);
+        //        content.Error(ex.Message);
+        //    }
+
+        //    return content;
+        //}
+        #endregion
+
     }
 }
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 a893838..c00277e 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"
@@ -17,6 +17,10 @@
 using Microsoft.Extensions.DependencyInjection;
 using Microsoft.AspNetCore.Http;
 using WIDESEA_WMS.IRepositories;
+using System.Configuration;
+using WIDESEA_Comm.LogInfo;
+using WIDESEA_Core.ManageUser;
+using OfficeOpenXml.FormulaParsing.Excel.Functions.Text;
 
 namespace WIDESEA_WMS.Services
 {
@@ -37,5 +41,29 @@
             //澶氱鎴蜂細鐢ㄥ埌杩檌nit浠g爜锛屽叾浠栨儏鍐靛彲浠ヤ笉鐢�
             //base.Init(dbRepository);
         }
-  }
+
+        public override WebResponseContent Del(object[] keys, bool delList = true)
+        {
+            WebResponseContent content = new WebResponseContent();
+            string str = "";
+            try
+            {
+                List<string> KeyList = new List<string>();
+                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);
+            }
+            catch (Exception ex)
+            {
+                WriteDBLog.Write($"鎵嬪姩鍒犻櫎搴撳瓨 ", new { 閿欒淇℃伅 = ex.Message, 鏁版嵁 = str }, LogState.Error, "WMS", UserContext.Current.UserName);
+            }
+
+            return content;
+        }
+    }
 }
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WMS_Server/WIDESEA_WMS/Services/system/Partial/dt_stationinfoService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WMS_Server/WIDESEA_WMS/Services/system/Partial/dt_stationinfoService.cs"
index ca5afa7..ac501a2 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WMS_Server/WIDESEA_WMS/Services/system/Partial/dt_stationinfoService.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WMS_Server/WIDESEA_WMS/Services/system/Partial/dt_stationinfoService.cs"
@@ -59,7 +59,7 @@
             WebResponseContent webResponse = new WebResponseContent();
             try
             {
-                var Tel = UserContext.Current.UserInfo.Tel;//缂撳瓨鏋舵潈闄�
+                var Tel = UserContext.Current.UserInfo.Tel;
                 var data = JsonConvert.DeserializeObject<Parm>(json.ToString());
                 //var updateList = FreeDB.DB.Select<dt_stationinfo>().Where(t => data.data.Contains(t.id.ToString())).ToList();
                 var updateList = _repository.Find(x => data.data.Contains(x.id.ToString())).ToList();
@@ -95,11 +95,28 @@
             }
             return webResponse;
         }
+
+        public WebResponseContent SendAGVTask(object json)
+        {
+            WebResponseContent webResponse = new WebResponseContent();
+            try
+            {
+
+            }
+            catch (Exception ex)
+            {
+
+            }
+            return webResponse;
+        }
+
         public override WebResponseContent Add(SaveModel saveDataModel)
         {
 
             return base.Add(saveDataModel);
         }
+
+
 
         public override WebResponseContent Update(SaveModel saveModel)
         {
@@ -135,6 +152,7 @@
                 station.stationType = string.Empty;
                 station.heatNumber = string.Empty;
                 station.Number = string.Empty;
+                station.billetID = string.Empty;
                 station.tray_status = string.Empty;
                 station.bindSN = string.Empty;
                 station.quantity = 0;
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WMS_Server/WIDESEA_WebApi/Controllers/WIDESEA_WMS/Partial/dt_stationinfoController.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WMS_Server/WIDESEA_WebApi/Controllers/WIDESEA_WMS/Partial/dt_stationinfoController.cs"
index 60d8fba..e8241c8 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WMS_Server/WIDESEA_WebApi/Controllers/WIDESEA_WMS/Partial/dt_stationinfoController.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WMS_Server/WIDESEA_WebApi/Controllers/WIDESEA_WMS/Partial/dt_stationinfoController.cs"
@@ -41,5 +41,16 @@
         {
             return dt_stationinfoService.Instance.SetStationEnable(parm);
         }
+
+        /// <summary>
+        /// 涓嬪彂NG浠诲姟
+        /// </summary>
+        /// <param name="parm"></param>
+        /// <returns></returns>
+        [HttpPost, Route("SendAGVTask")]
+        public WebResponseContent SendAGVTask([FromBody] object parm)
+        {
+            return dt_stationinfoService.Instance.SendAGVTask(parm);
+        }
     }
 }

--
Gitblit v1.9.3