From 2d2d6bf8565f5b89fc9ee054bf6e62f9592f8673 Mon Sep 17 00:00:00 2001
From: huangxiaoqiang <huangxiaoqiang@hnkhzn.com>
Date: 星期一, 23 六月 2025 08:37:37 +0800
Subject: [PATCH] 1

---
 项目代码/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/TaskInfo/WMSTaskDTO.cs                |    2 
 项目代码/WCS/WIDESEAWCS_Client/src/extension/taskinfo/extend/HandInbound.vue        |   86 ++++++++++++++++++++++++++++
 项目代码/WCS/WIDESEAWCS_Server/WIDESEAWCS_ITaskInfoService/ITaskService.cs          |    4 +
 项目代码/WCS/WIDESEAWCS_Client/config/buttons.js                                    |   11 +++
 项目代码/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs            |   46 +++++++++++++++
 项目代码/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/Task/TaskController.cs |    5 +
 项目代码/WCS/WIDESEAWCS_Client/src/extension/taskinfo/task.js                       |   11 +++
 7 files changed, 160 insertions(+), 5 deletions(-)

diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Client/config/buttons.js" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Client/config/buttons.js"
index 50c4dfd..e8a3296 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Client/config/buttons.js"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Client/config/buttons.js"
@@ -136,7 +136,16 @@
     onClick: function () {
         this.export();
     }
-}
+},
+{
+    name: "鎵� 鍔� 鎼� 杩�",
+    // icon: 'el-icon-plus',
+    value: 'HandInbound',
+    type: 'success',
+    onClick: function () {
+
+    }
+},
 
 ]
 
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Client/src/extension/taskinfo/extend/HandInbound.vue" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Client/src/extension/taskinfo/extend/HandInbound.vue"
new file mode 100644
index 0000000..fb2c52d
--- /dev/null
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Client/src/extension/taskinfo/extend/HandInbound.vue"
@@ -0,0 +1,86 @@
+<template>
+  <vol-box v-model="show" title="鎵嬪姩鍏ュ簱" :width="900" :height="600">
+    <template #content>
+      <el-form ref="form" :model="form" label-width="90px">
+        <el-form-item label="鎼繍鍖哄煙" prop="Area">
+          <el-select v-model="form.Area" placeholder="璇烽�夋嫨鎼繍鍖哄煙">
+            <el-option label="鍖哄煙涓�" value="1" />
+            <el-option label="鍖哄煙浜�" value="2" />
+            <el-option label="鍖哄煙涓�" value="3" />
+            <el-option label="鍖哄煙鍥�" value="4" />
+          </el-select>
+        </el-form-item>
+        <el-form-item label="璧风偣">
+          <el-input type="text" v-model="form.SourceAddress"></el-input>
+        </el-form-item>
+        <el-form-item label="缁堢偣">
+          <el-input type="text" v-model="form.TargetAddress"></el-input>
+        </el-form-item>
+      </el-form>
+    </template>
+    <template #footer>
+      <div>
+        <el-button type="danger" size="small" plain @click="submit">
+          <i class="el-icon-check">鎼繍</i>
+        </el-button>
+        <el-button size="small" type="primary" plain @click="() => {
+            this.show = false;
+          }
+          ">
+          <i class="el-icon-close">鍏抽棴</i>
+        </el-button>
+      </div>
+    </template>
+  </vol-box>
+</template>
+
+<script>
+import VolBox from "@/components/basic/VolBox.vue";
+export default {
+  components: {
+    "vol-box": VolBox,
+  },
+  data() {
+    return {
+      form:{
+        Area:"",
+        SourceAddress:"",
+        TargetAddress:"",
+      },
+      show: false,
+    };
+  },
+  methods: {
+    open() {
+      this.show = true;
+    },
+    submit() {
+      this.$emit("parentCall", ($vue) => {
+        if (
+          !this.form.TargetAddress ||
+          !this.form.Area ||
+          !this.form.SourceAddress||
+          this.form.Area==""||
+          this.form.SourceAddress==""||
+          this.form.TargetAddress==""
+        ) {
+          this.$message.error("鍙傛暟閿欒");
+          return;
+        }
+        this.http.post("api/Task/AddTask", this.form, "").then((x) => {
+          if (!x.status) {
+            this.$message.error(x.message);
+          } else {
+            this.$Message.success("鏂板缓鍏ュ簱浠诲姟");
+            // $vue.success("鎴愬姛.");
+            this.show = false;
+            this.form='';
+            $vue.refresh();
+          }
+        });
+      });
+    },
+  },
+
+};
+</script>
\ No newline at end of file
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Client/src/extension/taskinfo/task.js" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Client/src/extension/taskinfo/task.js"
index 8a02afb..94357cc 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Client/src/extension/taskinfo/task.js"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Client/src/extension/taskinfo/task.js"
@@ -1,10 +1,11 @@
 
 //姝s鏂囦欢鏄敤鏉ヨ嚜瀹氫箟鎵╁睍涓氬姟浠g爜锛屽彲浠ユ墿灞曚竴浜涜嚜瀹氫箟椤甸潰鎴栬�呴噸鏂伴厤缃敓鎴愮殑浠g爜
 import gridBody from './extend/taskExecuteDetail.vue'
+import gridHeader from "./extend/HandInbound.vue"
 let extension = {
     components: {
         //鏌ヨ鐣岄潰鎵╁睍缁勪欢
-        gridHeader: '',
+        gridHeader: gridHeader,
         gridBody: gridBody,
         gridFooter: '',
         //鏂板缓銆佺紪杈戝脊鍑烘鎵╁睍缁勪欢
@@ -42,6 +43,14 @@
                     this.$refs.gridBody.open(row);
                 }
             });
+            var btnHandInbound = this.buttons.find(x => x.value == "HandInbound");
+            if (btnHandInbound != null) {
+              btnHandInbound.onClick = () => {
+                this.$refs.gridHeader.open();
+                this.refresh();
+              }
+      
+            }
         },
         onInited() {
             //妗嗘灦鍒濆鍖栭厤缃悗
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/TaskInfo/WMSTaskDTO.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/TaskInfo/WMSTaskDTO.cs"
index f29527c..cf91e4f 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/TaskInfo/WMSTaskDTO.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_DTO/TaskInfo/WMSTaskDTO.cs"
@@ -26,7 +26,7 @@
         /// <summary>
         /// 宸烽亾鍙�
         /// </summary>
-        public string RoadWay { get; set; }
+        public string Area { get; set; }
 
         /// <summary>
         /// 浠诲姟绫诲瀷
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_ITaskInfoService/ITaskService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_ITaskInfoService/ITaskService.cs"
index bd99071..0e5f3e7 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_ITaskInfoService/ITaskService.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_ITaskInfoService/ITaskService.cs"
@@ -55,7 +55,9 @@
         /// <param name="taskDTOs">WMS浠诲姟瀵硅薄闆嗗悎</param>
         /// <returns>杩斿洖澶勭悊缁撴灉</returns>
         WebResponseContent ReceiveWMSTask([NotNull] List<Dt_Task> taskDTOs);
-        
+
+        WebResponseContent AddTask(WMSTaskDTO WMSDTO);
+
         /// <summary>
         /// 鏍规嵁璁惧缂栧彿銆佸綋鍓嶅湴鍧�鏌ヨ杈撻�佺嚎鏈墽琛岀殑浠诲姟
         /// </summary>
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/Task/TaskController.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/Task/TaskController.cs"
index 66281e3..5021626 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/Task/TaskController.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Controllers/Task/TaskController.cs"
@@ -25,6 +25,11 @@
         {
             return Service.ReceiveWMSTask(taskDTOs);
         }
+        [HttpPost, HttpGet, Route("AddTask"), AllowAnonymous]
+        public WebResponseContent AddTask([FromBody] WMSTaskDTO WMSDTO)
+        {
+            return Service.AddTask(WMSDTO);
+        }
 
         [HttpPost, HttpGet, Route("UpdateTaskExceptionMessage")]
         public WebResponseContent UpdateTaskExceptionMessage(int taskNum, string message)
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs"
index 9a3b574..51a7022 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs"
@@ -46,11 +46,15 @@
 using WIDESEAWCS_Core.Utilities;
 using WIDESEAWCS_DTO.Enum;
 using WIDESEAWCS_DTO.TaskInfo;
+using WIDESEAWCS_IBasicInfoRepository;
+using WIDESEAWCS_IBasicInfoService;
 using WIDESEAWCS_ITaskInfoRepository;
 using WIDESEAWCS_ITaskInfoService;
 using WIDESEAWCS_Model.Models;
+using WIDESEAWCS_QuartzJob;
 using WIDESEAWCS_QuartzJob.Models;
 using WIDESEAWCS_QuartzJob.Service;
+using WIDESEAWCS_TaskInfoRepository;
 using static Microsoft.IO.RecyclableMemoryStreamManager;
 
 namespace WIDESEAWCS_TaskInfoService
@@ -62,6 +66,7 @@
         private readonly ITaskExecuteDetailRepository _taskExecuteDetailRepository;
         private readonly ITask_HtyService _task_HtyService;
         private readonly IMapper _mapper;
+        private readonly IDt_StationManagerRepository _stationManagerRepository;
 
 
         private Dictionary<string, OrderByType> _taskOrderBy = new()
@@ -77,13 +82,14 @@
         public List<int> TaskOutboundTypes => typeof(TaskOutboundTypeEnum).GetEnumIndexList();
         public List<int> AGVTaskTypes => typeof(AGVTaskTypeEnum).GetEnumIndexList();
 
-        public TaskService(ITaskRepository BaseDal, IRouterService routerService, ITaskExecuteDetailService taskExecuteDetailService, ITaskExecuteDetailRepository taskExecuteDetailRepository, IMapper mapper, ITask_HtyService task_HtyService) : base(BaseDal)
+        public TaskService(ITaskRepository BaseDal, IRouterService routerService, ITaskExecuteDetailService taskExecuteDetailService, ITaskExecuteDetailRepository taskExecuteDetailRepository, IMapper mapper, ITask_HtyService task_HtyService, IDt_StationManagerRepository stationManagerRepository) : base(BaseDal)
         {
             _routerService = routerService;
             _taskExecuteDetailService = taskExecuteDetailService;
             _taskExecuteDetailRepository = taskExecuteDetailRepository;
             _task_HtyService = task_HtyService;
             _mapper = mapper;
+            _stationManagerRepository = stationManagerRepository;
         }
 
         /// <summary>
@@ -117,6 +123,44 @@
             return content;
         }
 
+        public WebResponseContent AddTask(WMSTaskDTO WMSDTO)
+        {
+            var SourceAddress= _stationManagerRepository.QueryFirst(x=>x.stationCode == WMSDTO.SourceAddress&&x.stationArea==int.Parse( WMSDTO.Area));
+            var TargetAddress = _stationManagerRepository.QueryFirst(x=>x.stationCode == WMSDTO.TargetAddress && x.stationArea == int.Parse(WMSDTO.Area));
+            if(SourceAddress == null || TargetAddress == null)
+            {
+                return WebResponseContent.Instance.Error($"鏈壘鍒拌捣鐐规垨缁堢偣绔欏彴淇℃伅,璧风偣:銆恵WMSDTO.SourceAddress}銆�,缁堢偣:銆恵WMSDTO.TargetAddress}銆�");
+            }
+            if (QueryConveyorLineTask(SourceAddress.stationName) != null)
+            {
+                return WebResponseContent.Instance.Error($"璧风偣:銆恵WMSDTO.SourceAddress}銆戝瓨鍦ㄤ换鍔�"); ;
+            }
+            if (QueryConveyorLineTask(TargetAddress.stationName) != null)
+            {
+                return WebResponseContent.Instance.Error($"缁堢偣:銆恵WMSDTO.TargetAddress}銆戝瓨鍦ㄤ换鍔�"); ;
+            }
+            Dt_Task taskDTO = new Dt_Task()
+            {
+                TaskNum = BaseDal.GetTaskNo().Result,
+                Grade = 1,
+                Roadway = SourceAddress.stationArea.ToString(),
+                SourceAddress = SourceAddress.stationName,
+                CurrentAddress = SourceAddress.stationName,
+                TargetAddress = TargetAddress.stationName,
+                NextAddress = TargetAddress.stationName,
+                TaskState = (int)AGVTaskStatusEnum.AGVNew,
+                TaskType = (int)AGVTaskTypeEnum.AGVCarry,
+                AGVName = SourceAddress.stationArea switch
+                {
+                    1 => "AGV01",
+                    4 => "AGV03",
+                    _ => "AGV02",
+                }
+            };
+            ReceiveWMSTask(new List<Dt_Task> { taskDTO });
+            return WebResponseContent.Instance.OK("浠诲姟娣诲姞鎴愬姛");
+        }
+
         /// <summary>
         /// 鏌ユ壘璇ョ珯鍙版槸鍚︽湁浠诲姟
         /// </summary>

--
Gitblit v1.9.3