From cbf06cbb2e7988fdee53507dede034756ebfbf59 Mon Sep 17 00:00:00 2001
From: hutongqing <hutongqing@hnkhzn.com>
Date: 星期二, 14 一月 2025 15:47:40 +0800
Subject: [PATCH] 1

---
 代码管理/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/d4533ff6-1092-4623-9eeb-5bb2576b9496.vsidx |    0 
 代码管理/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/e4b1e0fc-35f7-4429-a875-5134044c30dc.vsidx |    0 
 代码管理/淮安PDA/common/config.js                                                                                  |    2 
 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Outbound/MesOutboundOrderController.cs              |   11 +
 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Common/OrderEnum/MesOutboundOrderType.cs                                  |   12 +
 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_Common/TaskEnum/TaskTypeEnum.cs                                           |   13 +
 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs                                            |    2 
 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/TaskInfo/TaskController.cs                          |   11 +
 代码管理/WMS/WIDESEA_WMSClient/src/extension/outbound/mesOutboundOrder.js                                        |  101 +++++++++++
 /dev/null                                                                                                    |    0 
 代码管理/WMS/WIDESEA_WMSClient/src/views/outbound/mesOutboundOrder.vue                                           |    2 
 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/板材仓/ConveyorLineJob_BC.cs                                        |   11 +
 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_IOutboundService/IMesOutboundOrderService.cs                              |    7 
 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/板材仓/StackerCraneJob_BC.cs                                        |    9 
 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Outbound/OutboundOrderController.cs                 |    6 
 代码管理/WMS/WIDESEA_WMSClient/config/buttons.js                                                                 |    9 +
 代码管理/WMS/WIDESEA_WMSClient/src/extension/outbound/extend/addMesOutOrder.vue                                  |  163 ++++++++++++++++++
 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/MesOutboundOrderService.cs                                |   50 +++++
 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_ITaskInfoService/ITaskService.cs                                          |    9 +
 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/AssignInboundTaskLocation_BC.cs                           |  106 +++++++++++
 20 files changed, 510 insertions(+), 14 deletions(-)

diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/8cc7cbb4-d887-4b48-8514-053a923806f4.vsidx" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/8cc7cbb4-d887-4b48-8514-053a923806f4.vsidx"
deleted file mode 100644
index a94af99..0000000
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/8cc7cbb4-d887-4b48-8514-053a923806f4.vsidx"
+++ /dev/null
Binary files differ
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/d4533ff6-1092-4623-9eeb-5bb2576b9496.vsidx" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/d4533ff6-1092-4623-9eeb-5bb2576b9496.vsidx"
new file mode 100644
index 0000000..15a3364
--- /dev/null
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/.vs/WIDESEAWCS_Server/FileContentIndex/d4533ff6-1092-4623-9eeb-5bb2576b9496.vsidx"
Binary files differ
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\346\235\277\346\235\220\344\273\223/ConveyorLineJob_BC.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\346\235\277\346\235\220\344\273\223/ConveyorLineJob_BC.cs"
index 7f50783..f6d4ff9 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\346\235\277\346\235\220\344\273\223/ConveyorLineJob_BC.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\346\235\277\346\235\220\344\273\223/ConveyorLineJob_BC.cs"
@@ -114,6 +114,13 @@
                                         _taskService.UpdateTask(task, TaskStatusEnum.Line_Execute, deviceCode: item.StationDeviceCode, roadwayNo: responseContent.Data.ToString() ?? "");
                                     }
                                 }
+                                else
+                                {
+                                    if (conveyorLineInfoWrite.Spare2 != 0)
+                                    {
+                                        WriteDebug(device.DeviceName, $"鍚姩淇″彿宸插啓鍏�");
+                                    }
+                                }
                                 #endregion
                             }
 
@@ -173,6 +180,10 @@
                                         device.SetValue(W_ConveyorLineDB.ACK, true, item.StationCode);
                                         _taskService.UpdateTask(task, taskState, currentAddress: currentAddress, nextAddress: nextAddress, targetAddress: targetAddress, deviceCode: deviceCode);
                                     }
+                                    else
+                                    {
+                                        WriteInfo(device.DeviceName, $"鏈壘鍒版墭鐩榹conveyorLineInfoRead.Barcode}瀵瑰簲鐨勪换鍔′俊鎭�");
+                                    }
                                     #endregion
                                 }
                                 else//鐢熶骇閫�搴�
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\346\235\277\346\235\220\344\273\223/StackerCraneJob_BC.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\346\235\277\346\235\220\344\273\223/StackerCraneJob_BC.cs"
index 1725ca9..c498401 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\346\235\277\346\235\220\344\273\223/StackerCraneJob_BC.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/\346\235\277\346\235\220\344\273\223/StackerCraneJob_BC.cs"
@@ -169,16 +169,17 @@
                         Dt_StationManger stationManger = _stationMangerRepository.QueryFirst(x => x.StackerCraneStationCode == task.NextAddress);
                         if (stationManger == null)
                         {
-                            _taskExecuteDetailService.AddTaskExecuteDetail(taskNum, $"杈撻�佺嚎鍑哄簱绔欑偣鏈厤缃�,{task.NextAddress}");
+                            //_taskExecuteDetailService.AddTaskExecuteDetail(taskNum, $"杈撻�佺嚎鍑哄簱绔欑偣鏈厤缃�,{task.NextAddress}");
                             _taskService.UpdateTaskExceptionMessage(taskNum, $"杈撻�佺嚎鍑哄簱绔欑偣鏈厤缃�,{task.NextAddress}");
-                            WriteInfo(deviceCode, $"杈撻�佺嚎鍑哄簱绔欑偣鏈厤缃�,{task.NextAddress}");
+                            WriteError(deviceCode, $"杈撻�佺嚎鍑哄簱绔欑偣鏈厤缃�,{task.NextAddress}");
                             return WebResponseContent.Instance.Error($"杈撻�佺嚎鍑哄簱绔欑偣鏈厤缃�,{task.NextAddress}");
                         }
                         Dt_Router router = _routerRepository.QueryFirst(x => x.InOutType == task.TaskType && x.StartPosi == stationManger.StationCode);
                         if (router == null)
                         {
-                            _taskExecuteDetailService.AddTaskExecuteDetail(taskNum, $"鏈壘鍒拌矾鐢变俊鎭�,{task.NextAddress}");
+                            //_taskExecuteDetailService.AddTaskExecuteDetail(taskNum, $"鏈壘鍒拌矾鐢变俊鎭�,{task.NextAddress}");
                             _taskService.UpdateTaskExceptionMessage(taskNum, $"鏈壘鍒拌矾鐢变俊鎭�,{task.NextAddress}");
+                            WriteError(deviceCode, $"鏈壘鍒拌矾鐢变俊鎭�,{task.NextAddress}");
                             return WebResponseContent.Instance.Error($"鏈壘鍒拌矾鐢变俊鎭�,{task.NextAddress}");
                         }
 
@@ -338,7 +339,7 @@
             stackerCraneTaskCommand.Barcode = task.PalletCode;
             stackerCraneTaskCommand.TaskNum = task.TaskNum;
             stackerCraneTaskCommand.WorkType = 1;
-            stackerCraneTaskCommand.TrayType = (Int16)task.PalletType;
+            stackerCraneTaskCommand.TrayType = (short)task.PalletType;
             if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.InboundGroup)//鍒ゆ柇鏄惁鏄叆搴撲换鍔�
             {
                 string[] startCodes = task.CurrentAddress.Split("-");
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSClient/config/buttons.js" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSClient/config/buttons.js"
index 9e6e9df..67c05e7 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSClient/config/buttons.js"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSClient/config/buttons.js"
@@ -171,6 +171,15 @@
     onClick: function () {
     }
 },
+{
+    name: "鎵ц鍑哄簱",
+    icon: '',
+    class: '',
+    value: 'ExecuteOutbound',
+    type: 'success',
+    onClick: function () {
+    }
+},
 ]
 
 export default buttons
\ No newline at end of file
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSClient/src/extension/outbound/extend/addMesOutOrder.vue" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSClient/src/extension/outbound/extend/addMesOutOrder.vue"
new file mode 100644
index 0000000..26dd254
--- /dev/null
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSClient/src/extension/outbound/extend/addMesOutOrder.vue"
@@ -0,0 +1,163 @@
+<template>
+  <div>
+    <vol-box
+      v-model="showDetailBox"
+      :lazy="true"
+      width="60%"
+      :padding="15"
+      title="Mes鍑哄簱鍗�(鏂板缓)"
+    >
+      <div>
+        <el-form :inline="true" :model="formData" ref="formData">
+          <el-form-item
+            label="鎵�灞炰粨搴�:"
+            style="width: 30%"
+            required
+            prop="warehouseId"
+          >
+            <el-select v-model="formData.warehouseId" placeholder="璇烽�夋嫨浠撳簱">
+              <el-option label="鏉挎潗浠�" value="3"></el-option>
+            </el-select>
+          </el-form-item>
+          <el-form-item
+            label="鐗╂枡缂栫爜:"
+            style="width: 30%"
+            required
+            prop="materialCode"
+          >
+            <el-input
+              v-model="formData.materialCode"
+              placeholder="璇疯緭鍏ョ墿鏂欑紪鐮�"
+            ></el-input>
+          </el-form-item>
+          <el-form-item
+            label="鍑哄簱鏁伴噺:"
+            style="width: 30%"
+            required
+            prop="num"
+          >
+            <el-input-number
+              v-model="formData.num"
+              :min="1"
+              label="璇疯緭鍏ュ嚭搴撴暟閲�"
+            ></el-input-number>
+          </el-form-item>
+          <el-form-item
+            label="鍑哄簱鍦板潃:"
+            style="width: 30%"
+            required
+            prop="outAddress"
+          >
+            <el-select
+              v-model="formData.outAddress"
+              placeholder="璇烽�夋嫨鍑哄簱鍦板潃"
+            >
+              <el-option label="涓�宸烽亾浜屽眰涓婃枡浣�" value="1011"></el-option>
+              <el-option label="SCUTL-001" value="SCUTL-001"></el-option>
+            </el-select>
+          </el-form-item>
+          <!-- <el-form-item label="浠撳簱">
+            <el-col :span="8">
+              <el-select v-model="warehouseId" placeholder="璇烽�夋嫨浠撳簱">
+                <el-option label="鏉挎潗浠�" value="3"></el-option>
+              </el-select>
+            </el-col>
+          </el-form-item> -->
+        </el-form>
+      </div>
+
+      <template #footer>
+        <el-button type="primary" size="small" @click="add">纭畾</el-button>
+        <el-button type="danger" size="small" @click="showDetailBox = false"
+          >鍏抽棴</el-button
+        >
+      </template>
+    </vol-box>
+  </div>
+</template>
+  <script>
+import VolBox from "@/components/basic/VolBox.vue";
+export default {
+  components: { VolBox },
+  data() {
+    return {
+      showDetailBox: false,
+      formData: {
+        warehouseId: "",
+        materialCode: "",
+        num: 1,
+        outAddress: "",
+      },
+    };
+  },
+  methods: {
+    open() {
+      this.showDetailBox = true;
+    },
+    add() {
+      var params = {
+        //warehouseId: this.formData.warehouseId,
+        materialCode: this.formData.materialCode,
+        requiredQuantity: this.formData.num,
+        line: this.formData.outAddress,
+      };
+
+      this.http
+        .post("/api/mesOutboundOrder/AddMesOrder", params, "鏁版嵁澶勭悊涓�...")
+        .then((res) => {
+          if (!res.status) return this.$message.error(x.message);
+          this.$message.success("鎿嶄綔鎴愬姛");
+          this.showDetailBox = false;
+          this.$emit("parentCall", ($vue) => {
+            $vue.refresh();
+          });
+        });
+    },
+  },
+};
+</script>
+  <style scoped>
+.less-style {
+  color: black;
+}
+
+.equle-style {
+  color: green;
+}
+
+.more-style {
+  color: red;
+}
+</style>
+  
+  <style>
+.text-button:hover {
+  background-color: #f0f9eb !important;
+}
+
+.el-table .warning-row {
+  background: oldlace;
+}
+
+.box-table .el-table tbody tr:hover > td {
+  background-color: #d8e0d4 !important;
+  /* color: #ffffff; */
+}
+
+.box-table .el-table tbody tr.current-row > td {
+  background-color: #f0f9eb !important;
+  /* color: #ffffff; */
+}
+
+.el-table .success-row {
+  background: #f0f9eb;
+}
+
+.box-table .el-table {
+  border: 1px solid #ebeef5;
+}
+
+.box-head .el-alert__content {
+  width: 100%;
+}
+</style>
\ No newline at end of file
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSClient/src/extension/outbound/mesOutboundOrder.js" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSClient/src/extension/outbound/mesOutboundOrder.js"
new file mode 100644
index 0000000..4bb4e08
--- /dev/null
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSClient/src/extension/outbound/mesOutboundOrder.js"
@@ -0,0 +1,101 @@
+
+//姝s鏂囦欢鏄敤鏉ヨ嚜瀹氫箟鎵╁睍涓氬姟浠g爜锛屽彲浠ユ墿灞曚竴浜涜嚜瀹氫箟椤甸潰鎴栬�呴噸鏂伴厤缃敓鎴愮殑浠g爜
+import gridBody from './extend/addMesOutOrder.vue'
+let extension = {
+  components: {
+    //鏌ヨ鐣岄潰鎵╁睍缁勪欢
+    gridHeader: '',
+    gridBody: gridBody,
+    gridFooter: '',
+    //鏂板缓銆佺紪杈戝脊鍑烘鎵╁睍缁勪欢
+    modelHeader: '',
+    modelBody: '',
+    modelFooter: ''
+  },
+  tableAction: '', //鎸囧畾鏌愬紶琛ㄧ殑鏉冮檺(杩欓噷濉啓琛ㄥ悕,榛樿涓嶇敤濉啓)
+  buttons: { view: [], box: [], detail: [] }, //鎵╁睍鐨勬寜閽�
+  methods: {
+    //涓嬮潰杩欎簺鏂规硶鍙互淇濈暀涔熷彲浠ュ垹闄�
+    onInit() {
+
+      let addButton = this.buttons.find(item => item.value == 'Add');
+      if (addButton) {
+        addButton.onClick = () => {
+          this.$refs.gridBody.open();
+        }
+      }
+
+      let executeOutbound = this.buttons.find(item => item.value == 'ExecuteOutbound');
+      if (executeOutbound) {
+        executeOutbound.onClick = () => {
+          let rows = this.$refs.table.getSelected();
+          if (rows.length == 0) return this.$error("璇烽�夋嫨鏁版嵁!");
+          if (rows.length > 1) return this.$error("璇烽�夋嫨涓�鏉℃暟鎹�!");
+          var param = rows[0].taskNum;
+          this.http
+            .post("api/Task/HandSubstrateOut?orderId=" + rows[0].id, "鏁版嵁澶勭悊涓�...")
+            .then((x) => {
+              if (x.status) {
+                this.$Message.success('鏁版嵁澶勭悊鎴愬姛.');
+                this.refresh();
+              } else {
+                return this.$error(x.message);
+              }
+            });
+        }
+      }
+
+      //鎵╁睍椤甸潰鍒濆鍖栨搷浣�
+      this.columns.push({
+        field: '鎿嶄綔',
+        title: '鎿嶄綔',
+        width: 90,
+        fixed: 'right',
+        align: 'center',
+        formatter: (row) => {
+          return (
+            '<i style="cursor: pointer;color: #2d8cf0;"class="el-icon-view">鏌ョ湅鏄庣粏</i>'
+          );
+        },
+        click: (row) => {
+          this.$refs.gridBody.open(row);
+        }
+      });
+    },
+    onInited() {
+      //妗嗘灦鍒濆鍖栭厤缃悗
+      //濡傛灉瑕侀厤缃槑缁嗚〃,鍦ㄦ鏂规硶鎿嶄綔
+      //this.detailOptions.columns.forEach(column=>{ });
+    },
+    searchBefore(param) {
+      //鐣岄潰鏌ヨ鍓�,鍙互缁檖aram.wheres娣诲姞鏌ヨ鍙傛暟
+      //杩斿洖false锛屽垯涓嶄細鎵ц鏌ヨ
+      return true;
+    },
+    searchAfter(result) {
+      //鏌ヨ鍚庯紝result杩斿洖鐨勬煡璇㈡暟鎹�,鍙互鍦ㄦ樉绀哄埌琛ㄦ牸鍓嶅鐞嗚〃鏍肩殑鍊�
+      return true;
+    },
+    addBefore(formData) {
+      //鏂板缓淇濆瓨鍓峟ormData涓哄璞★紝鍖呮嫭鏄庣粏琛紝鍙互缁欑粰琛ㄥ崟璁剧疆鍊硷紝鑷繁杈撳嚭鐪媐ormData鐨勫��
+      return true;
+    },
+    updateBefore(formData) {
+      //缂栬緫淇濆瓨鍓峟ormData涓哄璞★紝鍖呮嫭鏄庣粏琛ㄣ�佸垹闄よ鐨処d
+      return true;
+    },
+    rowClick({ row, column, event }) {
+      //鏌ヨ鐣岄潰鐐瑰嚮琛屼簨浠�
+      this.$refs.table.$refs.table.toggleRowSelection(row); //鍗曞嚮琛屾椂閫変腑褰撳墠琛�;
+    },
+    modelOpenAfter(row) {
+      //鐐瑰嚮缂栬緫銆佹柊寤烘寜閽脊鍑烘鍚庯紝鍙互鍦ㄦ澶勫啓閫昏緫锛屽锛屼粠鍚庡彴鑾峰彇鏁版嵁
+      //(1)鍒ゆ柇鏄紪杈戣繕鏄柊寤烘搷浣滐細 this.currentAction=='Add';
+      //(2)缁欏脊鍑烘璁剧疆榛樿鍊�
+      //(3)this.editFormFields.瀛楁='xxx';
+      //濡傛灉闇�瑕佺粰涓嬫媺妗嗚缃粯璁ゅ�硷紝璇烽亶鍘唗his.editFormOptions鎵惧埌瀛楁閰嶇疆瀵瑰簲data灞炴�х殑key鍊�
+      //鐪嬩笉鎳傚氨鎶婅緭鍑虹湅锛歝onsole.log(this.editFormOptions)
+    }
+  }
+};
+export default extension;
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSClient/src/views/outbound/mesOutboundOrder.vue" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSClient/src/views/outbound/mesOutboundOrder.vue"
index bf25d44..e5c696c 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSClient/src/views/outbound/mesOutboundOrder.vue"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSClient/src/views/outbound/mesOutboundOrder.vue"
@@ -14,7 +14,7 @@
     </view-grid>
   </template>
     <script>
-  import extend from "@/extension/outbound/outboundOrderDetail.js";
+  import extend from "@/extension/outbound/mesOutboundOrder.js";
   import { ref, defineComponent } from "vue";
   export default defineComponent({
     setup() {
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/dd0e45d4-3741-49da-b1eb-25a4729fc53f.vsidx" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/dd0e45d4-3741-49da-b1eb-25a4729fc53f.vsidx"
deleted file mode 100644
index 586f76a..0000000
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/dd0e45d4-3741-49da-b1eb-25a4729fc53f.vsidx"
+++ /dev/null
Binary files differ
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/e4b1e0fc-35f7-4429-a875-5134044c30dc.vsidx" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/e4b1e0fc-35f7-4429-a875-5134044c30dc.vsidx"
new file mode 100644
index 0000000..c9c0089
--- /dev/null
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/FileContentIndex/e4b1e0fc-35f7-4429-a875-5134044c30dc.vsidx"
Binary files differ
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Common/OrderEnum/MesOutboundOrderType.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Common/OrderEnum/MesOutboundOrderType.cs"
index d269e16..31f61eb 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Common/OrderEnum/MesOutboundOrderType.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Common/OrderEnum/MesOutboundOrderType.cs"
@@ -23,5 +23,17 @@
         /// </summary>
         [Description("鍩烘澘浣欐枡閫�搴�")]
         SubstrateBack = 200,
+
+        /// <summary>
+        /// 鎵嬪姩鍩烘澘鍑哄簱
+        /// </summary>
+        [Description("鎵嬪姩鍩烘澘鍑哄簱")]
+        HandSubstrateOut = 300,
+
+        /// <summary>
+        /// 鎵嬪姩鍩烘澘鍑哄簱鎷i��
+        /// </summary>
+        [Description("鎵嬪姩鍩烘澘鍑哄簱鎷i��")]
+        HandSubstrateOutPick = 400,
     }
 }
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Common/TaskEnum/TaskTypeEnum.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Common/TaskEnum/TaskTypeEnum.cs"
index 60d5863..1013730 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Common/TaskEnum/TaskTypeEnum.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_Common/TaskEnum/TaskTypeEnum.cs"
@@ -41,6 +41,19 @@
         /// </summary>
         [Description("MES鍑哄簱")]
         MesOutbound = 200,
+
+        /// <summary>
+        /// MES鎵嬪姩鍑哄簱
+        /// </summary>
+        [Description("MES鎵嬪姩鍑哄簱")]
+        MesHandOutbound = 210,
+
+        /// <summary>
+        /// MES鎵嬪姩鎷i�夊嚭搴�
+        /// </summary>
+        [Description("MES鎵嬪姩鎷i�夊嚭搴�")]
+        MesHandPickOutbound = 220,
+
         /// <summary>
         /// 閲囪喘鍏ュ簱
         /// </summary>
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_IOutboundService/IMesOutboundOrderService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_IOutboundService/IMesOutboundOrderService.cs"
index 0704dab..95fb08f 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_IOutboundService/IMesOutboundOrderService.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_IOutboundService/IMesOutboundOrderService.cs"
@@ -37,5 +37,12 @@
         /// <param name="tasks"></param>
         /// <returns></returns>
         WebResponseContent LockOutboundStockDataUpdate(List<Dt_StockInfo> stockInfos, List<Dt_OutStockLockInfo> outStockLockInfos, List<Dt_LocationInfo> locationInfos, LocationStatusEnum locationStatus = LocationStatusEnum.Lock, List<Dt_Task>? tasks = null);
+
+        /// <summary>
+        /// 
+        /// </summary>
+        /// <param name="substrateOutModel"></param>
+        /// <returns></returns>
+        WebResponseContent AddMesOrder(SubstrateOutModel substrateOutModel);
     }
 }
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_ITaskInfoService/ITaskService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_ITaskInfoService/ITaskService.cs"
index b8274e8..a1aab3b 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_ITaskInfoService/ITaskService.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_ITaskInfoService/ITaskService.cs"
@@ -239,11 +239,20 @@
         WebResponseContent AssignRoadway(List<string> roadwayNos);
 
         /// <summary>
+        /// 
+        /// </summary>
+        /// <param name="orderId"></param>
+        /// <returns></returns>
+        WebResponseContent HandSubstrateOut(int orderId);
+
+        /// <summary>
         /// 淇敼浠诲姟鐘舵��
         /// </summary>
         /// <param name="task"></param>
         /// <returns></returns>
         WebResponseContent UpdateTaskInfo(WCSTaskDTO task);
+
+
         WebResponseContent GeneratePKOutboundTask(int orderDetailId, List<StockSelectViewDTO> stockSelectViews);
     }
 }
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/MesOutboundOrderService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/MesOutboundOrderService.cs"
index 26a6b2b..d1a47ae 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/MesOutboundOrderService.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_OutboundService/MesOutboundOrderService.cs"
@@ -21,6 +21,7 @@
 using WIDESEA_Common.LocationEnum;
 using WIDESEA_IRecordService;
 using WIDESEA_Common.StockEnum;
+using WIDESEA_Common.TaskEnum;
 
 namespace WIDESEA_OutboundService
 {
@@ -144,5 +145,54 @@
                 return WebResponseContent.Instance.Error(ex.Message);
             }
         }
+
+        public WebResponseContent AddMesOrder(SubstrateOutModel substrateOutModel)
+        {
+            try
+            {
+                Dt_Warehouse warehouse = _basicRepository.WarehouseRepository.QueryFirst(x => x.WarehouseCode == WarehouseEnum.HA57.ToString());
+                if (warehouse == null)
+                {
+                    return WebResponseContent.Instance.Error($"浠撳簱鍩虹淇℃伅鏈厤缃�");
+                }
+
+                Dt_MaterielInfo materielInfo = _basicRepository.MaterielInfoRepository.QueryFirst(x => x.MaterielCode == substrateOutModel.MaterialCode);
+                if (materielInfo == null)
+                {
+                    return WebResponseContent.Instance.Error($"鏈壘鍒拌鐗╂枡淇℃伅");
+                }
+                int orderType = 0;
+                if(substrateOutModel.Line == "1011")
+                {
+                    orderType = MesOutboundOrderTypeEnum.HandSubstrateOutPick.ObjToInt();
+                }
+                else
+                {
+                    orderType = MesOutboundOrderTypeEnum.HandSubstrateOut.ObjToInt();
+                }
+
+                Dt_MesOutboundOrder mesOutboundOrder = new Dt_MesOutboundOrder()
+                {
+                    CreateType = OrderCreateTypeEnum.CreateInSystem.ObjToInt(),
+                    Line = substrateOutModel.Line,
+                    MaterialCode = substrateOutModel.MaterialCode,
+                    MaterialName = materielInfo.MaterielName,
+                    OrderQuantity = substrateOutModel.RequiredQuantity,
+                    TaskNo = DateTime.Now.ToString("yyyyMMddHHmmss"),
+                    Unit = substrateOutModel.Unit,
+                    OrderType = orderType,
+                    OrderStatus = OutOrderStatusEnum.鏈紑濮�.ObjToInt(),
+                    WarehouseId = warehouse.WarehouseId
+                };
+
+                AddData(mesOutboundOrder);
+                
+                return WebResponseContent.Instance.OK();
+            }
+            catch (Exception ex)
+            {
+                return WebResponseContent.Instance.Error(ex.Message);
+            }
+        }
     }
 }
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/AssignInboundTaskLocation_BC.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/AssignInboundTaskLocation_BC.cs"
index 9dcadff..34f74bb 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/AssignInboundTaskLocation_BC.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/AssignInboundTaskLocation_BC.cs"
@@ -5,9 +5,13 @@
 using System.Text;
 using System.Threading.Tasks;
 using WIDESEA_Common.LocationEnum;
+using WIDESEA_Common.OrderEnum;
+using WIDESEA_Common.StockEnum;
 using WIDESEA_Common.TaskEnum;
 using WIDESEA_Core;
 using WIDESEA_Core.Helper;
+using WIDESEA_DTO;
+using WIDESEA_DTO.MES;
 using WIDESEA_Model.Models;
 
 namespace WIDESEA_TaskInfoService
@@ -20,11 +24,11 @@
         /// <param name="taskNum">浠诲姟鍙�</param>
         /// <param name="roadwayNos">宸烽亾鍙�</param>
         /// <returns></returns>
-        public WebResponseContent AssignRoadway(List<string> roadwayNos, int taskNum,  int heightType = 0)
+        public WebResponseContent AssignRoadway(List<string> roadwayNos, int taskNum, int heightType = 0)
         {
             try
             {
-                if(heightType == 0 || heightType > 3)
+                if (heightType == 0 || heightType > 3)
                 {
                     return WebResponseContent.Instance.Error($"楂樺害閿欒");
                 }
@@ -89,8 +93,8 @@
                 List<LocationCount> locationCounts = Db.Queryable<Dt_LocationInfo>().Where(x => (x.LocationType == task.PalletType || x.LocationType == LocationTypeEnum.Undefined.ObjToInt()) && x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && (x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt() || x.EnableStatus == EnableStatusEnum.Normal.ObjToInt()) && roadwayNos.Contains(x.RoadwayNo)).GroupBy(x => x.RoadwayNo).Select(x => new LocationCount { RoadwayNo = x.RoadwayNo, Count = SqlFunc.AggregateCount(x) }).ToList();
 
                 string roadwayNo = locationCounts.OrderBy(x => x.Count).FirstOrDefault()?.RoadwayNo ?? "";
-                
-                return !string.IsNullOrEmpty(roadwayNo) ? WebResponseContent.Instance.OK(data: roadwayNo): WebResponseContent.Instance.Error("鏈壘鍒板彲鍒嗛厤宸烽亾");
+
+                return !string.IsNullOrEmpty(roadwayNo) ? WebResponseContent.Instance.OK(data: roadwayNo) : WebResponseContent.Instance.Error("鏈壘鍒板彲鍒嗛厤宸烽亾");
             }
             catch (Exception ex)
             {
@@ -121,11 +125,99 @@
             }
         }
 
-        public class LocationCount
+        public WebResponseContent HandSubstrateOut(int orderId)
         {
-            public string RoadwayNo { get; set; }
+            try
+            {
+                Dt_MesOutboundOrder mesOutboundOrder = _outboundService.MesOutboundOrderService.Repository.QueryFirst(x => x.Id == orderId);
+                if (mesOutboundOrder == null)
+                {
+                    return WebResponseContent.Instance.Error($"鏈壘鍒拌璁㈠崟");
+                }
 
-            public int Count { get; set; }
+                if (mesOutboundOrder.OrderStatus != OutOrderStatusEnum.鏈紑濮�.ObjToInt())
+                {
+                    return WebResponseContent.Instance.Error($"璇ヨ鍗曚笉鍙啀鍑哄簱");
+                }
+
+                List<Dt_Task> tasks = new List<Dt_Task>();
+
+                List<Dt_StockInfo>? stockInfos = null;
+                List<Dt_OutStockLockInfo>? outStockLockInfos = null;
+                List<Dt_LocationInfo>? locationInfos = null;
+                {
+                    (List<Dt_StockInfo>, Dt_MesOutboundOrder, List<Dt_OutStockLockInfo>, List<Dt_LocationInfo>) result = _outboundService.MesOutboundOrderService.AssignStockOutbound(mesOutboundOrder);
+                    if (result.Item1 != null && result.Item1.Count > 0)
+                    {
+                        tasks = GetTasks(result.Item1, TaskTypeEnum.MesOutbound);
+                        result.Item2.OrderStatus = OrderDetailStatusEnum.Outbound.ObjToInt();
+                        result.Item3.ForEach(x =>
+                        {
+                            x.Status = OutLockStockStatusEnum.鍑哄簱涓�.ObjToInt();
+                        });
+
+                        stockInfos = result.Item1;
+                        mesOutboundOrder = result.Item2;
+                        outStockLockInfos = result.Item3;
+                        locationInfos = result.Item4;
+                    }
+                    else
+                    {
+                        throw new Exception("鏃犲簱瀛�");
+                    }
+                }
+
+                tasks.ForEach(x =>
+                {
+                    if (mesOutboundOrder.OrderType == MesOutboundOrderTypeEnum.HandSubstrateOut.ObjToInt())
+                    {
+                        x.TaskType = TaskTypeEnum.MesHandOutbound.ObjToInt();
+                    }
+                    else if (mesOutboundOrder.OrderType == MesOutboundOrderTypeEnum.HandSubstrateOutPick.ObjToInt())
+                    {
+                        x.TaskType = TaskTypeEnum.MesHandPickOutbound.ObjToInt();
+                    }
+                });
+
+                mesOutboundOrder.OrderStatus = OutOrderStatusEnum.鍑哄簱涓�.ObjToInt();
+
+                _unitOfWorkManage.BeginTran();
+
+                int id = BaseDal.AddData(tasks);
+                outStockLockInfos.ForEach(x =>
+                {
+                    x.OrderNo = mesOutboundOrder.TaskNo;
+                    x.OrderDetailId = id;
+                });
+                _outboundService.MesOutboundOrderService.Repository.UpdateData(mesOutboundOrder);
+                if (stockInfos != null && stockInfos.Count > 0 && outStockLockInfos != null && outStockLockInfos.Count > 0 && locationInfos != null && locationInfos.Count > 0)
+                {
+                    WebResponseContent content = _outboundService.MesOutboundOrderService.LockOutboundStockDataUpdate(stockInfos, outStockLockInfos, locationInfos, tasks: tasks);
+
+                    if (!content.Status)
+                    {
+                        _unitOfWorkManage.RollbackTran();
+                        return WebResponseContent.Instance.Error(content.Message);
+                    }
+                }
+                _unitOfWorkManage.CommitTran();
+                PushTasksToWCS(tasks);
+
+                return WebResponseContent.Instance.OK();
+            }
+            catch (Exception ex)
+            {
+                return WebResponseContent.Instance.Error(ex.Message);
+            }
         }
+
+
+    }
+
+    public class LocationCount
+    {
+        public string RoadwayNo { get; set; }
+
+        public int Count { get; set; }
     }
 }
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs"
index b3a551d..95b2237 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs"
@@ -422,7 +422,7 @@
                 }
                 if (task.TaskType == TaskTypeEnum.MesOutbound.ObjToInt())
                 {
-                    MesMaterialLotaAceptModel model = GetMesMaterialLotaAceptModel(stockInfo, stockInfo.Details.FirstOrDefault(), mesOutboundOrders.FirstOrDefault().TaskNo, warehouse.WarehouseCode, mesOutboundOrders.FirstOrDefault().OrderQuantity);
+                    MesMaterialLotaAceptModel model = GetMesMaterialLotaAceptModel(stockInfo, stockInfo.Details.FirstOrDefault(), mesOutboundOrders.FirstOrDefault().TaskNo, warehouse.WarehouseCode, stockInfo.Details.Where(x => x.MaterielCode == mesOutboundOrders.FirstOrDefault().MaterialCode).Sum(x => x.StockQuantity));
                     UploadMesMaterialLotaAcept(model);
                 }
                 return WebResponseContent.Instance.OK();
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Outbound/MesOutboundOrderController.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Outbound/MesOutboundOrderController.cs"
index 4ca90b1..8e8e7d7 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Outbound/MesOutboundOrderController.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Outbound/MesOutboundOrderController.cs"
@@ -5,6 +5,7 @@
 using WIDESEA_Core;
 using WIDESEA_Core.BaseController;
 using WIDESEA_DTO.Inbound;
+using WIDESEA_DTO.MES;
 using WIDESEA_DTO.Outbound;
 using WIDESEA_IOutboundService;
 using WIDESEA_Model.Models;
@@ -22,5 +23,15 @@
         {
 
         }
+        /// <summary>
+        /// 
+        /// </summary>
+        /// <param name="substrateOutModel"></param>
+        /// <returns></returns>
+        [HttpPost, Route("AddMesOrder"), AllowAnonymous]
+        public WebResponseContent AddMesOrder([FromBody] SubstrateOutModel substrateOutModel)
+        {
+            return Service.AddMesOrder(substrateOutModel);
+        }
     }
 }
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Outbound/OutboundOrderController.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Outbound/OutboundOrderController.cs"
index c8c8cfe..eaf062b 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Outbound/OutboundOrderController.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Outbound/OutboundOrderController.cs"
@@ -23,6 +23,12 @@
         {
 
         }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        /// <param name="id"></param>
+        /// <returns></returns>
         [HttpPost, Route("TestOutUpload"), AllowAnonymous]
         public WebResponseContent TestOutUpload(int id)
         {
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/TaskInfo/TaskController.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/TaskInfo/TaskController.cs"
index 3b3657b..12659d5 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/TaskInfo/TaskController.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/TaskInfo/TaskController.cs"
@@ -256,6 +256,17 @@
         }
 
         /// <summary>
+        /// 
+        /// </summary>
+        /// <param name="orderId"></param>
+        /// <returns></returns>
+        [HttpPost, Route("HandSubstrateOut")]
+        public WebResponseContent HandSubstrateOut(int orderId)
+        {
+            return Service.HandSubstrateOut(orderId);
+        }
+
+        /// <summary>
         /// 淇敼浠诲姟鐘舵��
         /// </summary>
         /// <param name="task"></param>
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/\346\267\256\345\256\211PDA/common/config.js" "b/\344\273\243\347\240\201\347\256\241\347\220\206/\346\267\256\345\256\211PDA/common/config.js"
index 0e01f92..ee92f58 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/\346\267\256\345\256\211PDA/common/config.js"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/\346\267\256\345\256\211PDA/common/config.js"
@@ -1,5 +1,5 @@
 let config = {
-	baseUrl: 'http://10.30.4.92:9283',
+	baseUrl: 'http://localhost:9293',
 	urls: [
 		'http://10.30.4.92:9283',
 		'http://10.30.4.92:9283'

--
Gitblit v1.9.3