From 5c238fa340e7a86834c65cf66c514f32d6d28f4a Mon Sep 17 00:00:00 2001
From: helongyang <647556386@qq.com>
Date: 星期五, 26 十二月 2025 19:04:45 +0800
Subject: [PATCH] 1

---
 代码管理/WMS/WIDESEA_WMSClient/src/extension/stock/ToUserProStockView.js                             |  157 +++++++
 代码管理/WMS/WIDESEA_WMSClient/src/router/viewGird.js                                                |    4 
 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_InboundService/ReceiveOrderService.cs                         |   10 
 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Inbound/ReceiveOrderController.cs       |    2 
 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/AssignLocation/LocationInfoService_BC.cs |  146 +++++-
 代码管理/WMS/WIDESEA_WMSClient/src/extension/system/Sys_Role.js                                      |   61 --
 代码管理/WMS/WIDESEA_WMSClient/src/views/stock/ToUserStockView.vue                                   |    2 
 代码管理/WMS/WIDESEA_WMSClient/src/views/stock/ToUserProStockView.vue                                |  484 ++++++++++++++++++++++++
 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_StockService/StockInfoService.cs                              |  287 +++++++++++--
 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoService/AssignInboundTaskLocation_BC.cs               |    2 
 10 files changed, 1,013 insertions(+), 142 deletions(-)

diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSClient/src/extension/stock/ToUserProStockView.js" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSClient/src/extension/stock/ToUserProStockView.js"
new file mode 100644
index 0000000..e81ae04
--- /dev/null
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSClient/src/extension/stock/ToUserProStockView.js"
@@ -0,0 +1,157 @@
+
+//姝s鏂囦欢鏄敤鏉ヨ嚜瀹氫箟鎵╁睍涓氬姟浠g爜锛屽彲浠ユ墿灞曚竴浜涜嚜瀹氫箟椤甸潰鎴栬�呴噸鏂伴厤缃敓鎴愮殑浠g爜
+
+import { el } from "element-plus/es/locales.mjs";
+
+let extension = {
+  components: {
+    //鏌ヨ鐣岄潰鎵╁睍缁勪欢
+    gridHeader: '',
+    gridBody: '',
+    gridFooter: '',
+    //鏂板缓銆佺紪杈戝脊鍑烘鎵╁睍缁勪欢
+    modelHeader: '',
+    modelBody: '',
+    modelFooter: ''
+  },
+  tableAction: '', //鎸囧畾鏌愬紶琛ㄧ殑鏉冮檺(杩欓噷濉啓琛ㄥ悕,榛樿涓嶇敤濉啓)
+  buttons: { view: [], box: [], detail: [] }, //鎵╁睍鐨勬寜閽�
+  methods: {
+    //涓嬮潰杩欎簺鏂规硶鍙互淇濈暀涔熷彲浠ュ垹闄�
+    onInit() {
+      // let InOrder = this.buttons.find(x => x.value == 'StockOutbound');
+      // if (InOrder) {
+      //   InOrder.onClick = function () {
+      //     let rows = this.$refs.table.getSelected();
+      //     if (rows.length == 0) return this.$error("璇烽�夋嫨鏁版嵁!");
+      //     if (rows.length > 1) return this.$error("璇烽�夋嫨鍗曟潯鏁版嵁!");
+      //     var keys = rows.map(x => { return x.stockId });
+      //     this.http
+      //       .post("api/Task/Outbound?id="+keys[0], null, "鏁版嵁澶勭悊涓�")
+      //       .then((x) => {
+      //         if (!x.status) return this.$message.error(x.message);
+      //         this.$message.success("鎿嶄綔鎴愬姛");
+      //         this.refresh();
+      //       });
+      //   }
+      // }
+      this.columns.forEach(column => {
+        if (column.field == 'materielCode') {
+          column.formatter = (row) => {
+            var str = '';
+            var list = row.materielCode.split(',');
+            for (let index = 0; index < list.length; index++) {
+              str += list[index] + '<br>';
+            }
+            return str = list[0] == "" ? "绌虹" : str;
+          }
+        }
+        if (column.field == 'batchNo') {
+          column.formatter = (row) => {
+            var str = '';
+            var list = row.batchNo.split(',');
+            for (let index = 0; index < list.length; index++) {
+              str += list[index] + '<br>';
+            }
+            return str = list[0] == "" ? "鏃�" : str;
+          }
+        }
+        if (column.field == 'materielInfo') {
+          const today = new Date()
+          column.formatter = (row) => {
+            if (row.details.length > 0) {
+              const today = new Date();
+              const closestDate = row.details
+                .map(x => {
+                  const date = new Date(x.effectiveDate);
+                  const diffInDays = Math.ceil(Math.abs((today - date) / (1000 * 60 * 60 * 24)));
+                  return { date, diffInDays };
+                })
+                .reduce((closest, current) => (current.diffInDays < closest.diffInDays ? current : closest))
+                .date;
+
+              const daysSinceClosest = Math.ceil(Math.abs((today - closestDate) / (1000 * 60 * 60 * 24)));
+              return '<span style="color: #F56C6C">' + daysSinceClosest + "澶�" + '</span>';
+            } else {
+              return '<span style="color: #F56C6C">' + "鏃犱繚璐ㄦ湡" + '</span>';
+            }
+
+          }
+        }
+        if (column.field == 'proinventoryage') {
+          const today = new Date()
+          column.formatter = (row) => {
+              if (row.details.length > 0) {
+                  const closestDate = row.details
+                      .map(x => {
+                          const date = new Date(x.createDate);
+                          const ageInDays = Math.ceil((today - date) / (1000 * 60 * 60 * 24));
+                          return { date, ageInDays };
+                      })
+                      .reduce((closest, current) => (current.ageInDays < closest.ageInDays ? current : closest))
+                      .date;
+
+                  const inventoryAge = Math.ceil((today - closestDate) / (1000 * 60 * 60 * 24));
+                  
+                  row.inventoryAge = inventoryAge; 
+                  
+                  return `${inventoryAge} 澶ー;
+              } 
+              // 濡傛灉娌℃湁鏄庣粏锛岃繑鍥炵┖鎴栨彁绀轰俊鎭�
+              return '-';
+          }       
+        }
+        if (column.field == 'sumStock') {
+          column.formatter = (row) => {
+            if (row.details.length > 0) {
+              var sum = 0;
+              const closestDate = row.details
+                .map(x => {
+                  sum += (x.stockQuantity)
+                })
+              return '<span style="color: #F56C6C">' + sum + row.details[0].unit + '</span>';
+            } else {
+              return '<span style="color: #F56C6C">' + "1涓�" + '</span>';
+            }
+
+          }
+        }
+      })
+    },
+    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/extension/system/Sys_Role.js" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSClient/src/extension/system/Sys_Role.js"
index 5ba4845..da94487 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSClient/src/extension/system/Sys_Role.js"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSClient/src/extension/system/Sys_Role.js"
@@ -1,49 +1,22 @@
 
+
 let extension = {
-  components: {//鍔ㄦ�佹墿鍏呯粍浠舵垨缁勪欢璺緞
-    //琛ㄥ崟header銆乧ontent銆乫ooter瀵瑰簲浣嶇疆鎵╁厖鐨勭粍浠�
-    gridHeader: '',
-    gridBody: '',
-    gridFooter: '',
-    //寮瑰嚭妗�(淇敼銆佺紪杈戙�佹煡鐪�)header銆乧ontent銆乫ooter瀵瑰簲浣嶇疆鎵╁厖鐨勭粍浠�
-    modelHeader: '',
-    modelBody: '',
-    modelFooter: ''
-  },
-  buttons: [],//鎵╁睍鐨勬寜閽�
-  tableAction:"Sys_Role",
-  methods: {//浜嬩欢鎵╁睍
-    onInited () {
-      this.height = this.height - 80;
-       this.editFormOptions.forEach(x => {
-        x.forEach(item => {
-          if (item.field == 'ParentId') {
-            item.title = "涓婄骇瑙掕壊";
-            //璁剧疆浠绘剰鑺傜偣閮借兘閫変腑(榛樿鍙兘閫変腑鏈�鍚庝竴涓妭鐐�)
-            item.changeOnSelect = true;
-          }
-        })
-      })
+    components: {//鍔ㄦ�佹墿鍏呯粍浠舵垨缁勪欢璺緞
+        //琛ㄥ崟header銆乧ontent銆乫ooter瀵瑰簲浣嶇疆鎵╁厖鐨勭粍浠�
+        gridHeader:'',
+        gridbody:'',
+        gridFooter: '',
+        //寮瑰嚭妗�(淇敼銆佺紪杈戙�佹煡鐪�)header銆乧ontent銆乫ooter瀵瑰簲浣嶇疆鎵╁厖鐨勭粍浠�
+        modelHeader: '',
+        modelBody: '',
+        modelFooter: ''
     },
-    onInit() {
-      //璁剧疆treetable鐨勫敮涓�鍊煎瓧娈�(杩欎釜瀛楁鐨勫�煎湪琛ㄩ噷闈㈠繀椤绘槸鍞竴鐨�)
-      this.rowKey="Role_Id";
-    },
-    /***鍔犺浇鍚庡彴鏁版嵁瑙丼ys_RoleController.cs鏂囦欢***/
-    loadTreeChildren(tree, treeNode, resolve) { //鍔犺浇瀛愯妭鐐�
-      let url=`api/role/getTreeTableChildrenData?roleId=${tree.Role_Id}`;
-      this.http.post(url,{}).then(result=>{
-        resolve(result.rows)
-      })
-    },
-      /***鍔犺浇鍚庡彴鏁版嵁瑙丼ys_RoleController.cs鏂囦欢***/
-    searchBefore(params){//鍒ゆ柇鍔犺浇鏍硅妭鐐规垨瀛愯妭鐐�
-      //娌℃湁鏌ヨ鏉′欢锛岄粯璁ゆ煡璇㈣繑鍥炴墍鏈夋牴鑺傜偣鏁版嵁
-      if (!params.wheres.length) {
-        params.value=1;
-      }
-      return true;
+    buttons: [],//鎵╁睍鐨勬寜閽�
+    methods: {//浜嬩欢鎵╁睍
+        onInit() {
+        },
+        onInited() {
+        }
     }
-  }
 };
-export default extension;
+export default extension;
\ 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/router/viewGird.js" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSClient/src/router/viewGird.js"
index b142408..73f8840 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSClient/src/router/viewGird.js"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSClient/src/router/viewGird.js"
@@ -310,6 +310,10 @@
     path: '/ToUserStockView',
     name: 'ToUserStockView',
     component: () => import('@/views/stock/ToUserStockView.vue')
+  }, {
+    path: '/ToUserProStockView',
+    name: 'ToUserProStockView',
+    component: () => import('@/views/stock/ToUserProStockView.vue')
   }
 ]
 export default viewgird
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSClient/src/views/stock/ToUserProStockView.vue" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSClient/src/views/stock/ToUserProStockView.vue"
new file mode 100644
index 0000000..9e52e8d
--- /dev/null
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSClient/src/views/stock/ToUserProStockView.vue"
@@ -0,0 +1,484 @@
+
+<template>
+    <view-grid
+      ref="grid"
+      :columns="columns"
+      :detail="detail"
+      :editFormFields="editFormFields"
+      :editFormOptions="editFormOptions"
+      :searchFormFields="searchFormFields"
+      :searchFormOptions="searchFormOptions"
+      :table="table"
+      :extend="extend"
+    >
+    </view-grid>
+  </template>
+      <script>
+  import extend from "@/extension/stock/ToUserProStockView.js";
+  import { ref, defineComponent } from "vue";
+  export default defineComponent({
+    setup() {
+      const table = ref({
+        key: "proStockId",
+        footer: "Foots",
+        cnName: "鎴愬搧搴撳瓨瑙嗗浘",
+        name: "proStockView",
+        url: "/proStockView/",
+        sortName: "proStockId",
+      });
+      const editFormFields = ref({
+        // palletCode: "",
+        // locationCode: "",
+        // locationName: "",
+      });
+      const editFormOptions = ref([
+        
+      ]);
+      const searchFormFields = ref({
+        palletCode: "",
+        // locationCode: "",
+        materielCode:"",
+        batchNo:"",
+        specifyVer:"",
+        warehouseId:"7"
+      });
+      const searchFormOptions = ref([
+        [
+          { title: "鑳舵鍙�", field: "palletCode",type: "like" },
+          { title: "璐т綅鐘舵��", field: "locationStatus" ,type: "selectList",dataKey: "locationStatusEnum",data: [],},
+          { title: "搴撳瓨鐘舵��", field: "stockStatus",type: "selectList",dataKey: "stockStatusEmun",data: [],},
+          { title: "浜у搧缂栫爜", field: "productCode",type: "like"},
+        ],
+        [
+          { title: "鎵规鍙�", field: "lotNumber",type: "like"},
+          { title: "璐т綅缂栧彿", field: "locationCode",type: "like" },
+          { title: "鎸囨淳鐗堟湰", field: "specifyVer",type: "like"},
+          { title: "鎵�灞炰粨搴�", field: "warehouseId",type: "selectList",dataKey: "warehouses",data: [],},
+        ],
+        [
+          { title: "浜у搧鐗堟湰", field: "productVersion",type: "like"},
+          { title: "搴撳瓨鍒涘缓鏃堕棿",field: "createDate",type: "datetime"},
+        ]
+      ]);
+      const columns = ref([
+        {
+          field: "proStockId",
+          title: "Id",
+          type: "int",
+          width: 90,
+          hidden: true,
+          readonly: true,
+          require: true,
+          align: "left",
+        },
+        {
+          field: "palletCode",
+          title: "鑳舵鍙�",
+          type: "string",
+          width: 150,
+          link: true,
+          align: "left",
+        },
+        {
+          field: "locationCode",
+          title: "璐т綅缂栧彿",
+          type: "string",
+          width: 200,
+          align: "left",
+        },
+        {
+          field: "locationName",
+          title: "璐т綅鍚嶇О",
+          type: "string",
+          width: 270,
+          align: "left",
+        },
+        {
+          field: "warehouseId",
+          title: "鎵�灞炰粨搴�",
+          type: "string",
+          width: 120,
+          align: "left",
+          bind: { key: "warehouses", data: [] },
+        },
+        {
+          field: "proStockAttribute",
+          title: "搴撳瓨灞炴��",
+          type: "string",
+          width: 80,
+          align: "left",
+          bind: { key: "proStockAttributeEnum", data: [] },
+        },
+        {
+          field: "isFineWorks",
+          title: "鏄惁绮惧搧",
+          type: "string",
+          width: 80,
+          align: "left",
+          bind: { key: "enableEnum", data: [] },
+        },
+        // {
+        //   field: "roadwayNo",
+        //   title: "宸烽亾缂栧彿",
+        //   type: "decimal",
+        //   width: 100,
+        //   align: "left",
+        //   hidden:true
+        // },
+        {
+          field: "productCode",
+          title: "浜у搧缂栫爜",
+          type: "string",
+          width: 120,
+          align: "left",
+        },
+        {
+          field: "productVersion",
+          title: "鐗堟湰",
+          type: "string",
+          width: 100,
+          align: "left"
+        },
+        {
+          field: "specifyVer",
+          title: "鎸囨淳鐗堟湰",
+          type: "string",
+          width: 100,
+          align: "left"
+        },
+        {
+          field: "dateCode",
+          title: "浜у搧鍛ㄦ湡",
+          type: "string",
+          width: 100,
+          align: "left",
+        },
+        {
+          field: "proinventoryage",
+          title: "鎴愬搧搴撻緞",
+          type: "string",
+          width: 80,
+          align: "left",
+        },
+        {
+          field: "lotNumber",
+          title: "浜у搧鎵瑰彿",
+          type: "string",
+          width: 140,
+          align: "left",
+        },
+        {
+          field: "sumStocks",
+          title: "搴撳瓨鏁伴噺",
+          type: "string",
+          width: 140,
+          align: "left",
+        },
+        {
+          field: "erpOrder",
+          title: "ERP宸ュ崟",
+          type: "string",
+          width: 200,
+          align: "left",
+        },
+        {
+          field: "moNumber",
+          title: "鍒堕�犲伐鍗�",
+          type: "string",
+          width: 180,
+          align: "left",
+        },
+        {
+          field: "saleOrder",
+          title: "閿�鍞鍗�",
+          type: "string",
+          width: 200,
+          align: "left",
+        },
+        {
+          field: "row",
+          title: "璐т綅琛�",
+          type: "string",
+          width: 90,
+          align: "left",
+          hidden: true,
+        },
+        {
+          field: "column",
+          title: "璐т綅鍒�",
+          type: "int",
+          width: 120,
+          align: "left",
+          hidden: true,
+        },
+        {
+          field: "layer",
+          title: "璐т綅灞�",
+          type: "string",
+          width: 200,
+          align: "left",
+          hidden: true,
+        },
+        // {
+        //   field: "depth",
+        //   title: "璐т綅娣卞害",
+        //   type: "string",
+        //   width: 180,
+        //   align: "left",
+        //   hidden: true,
+        // },
+        {
+          field: "stockStatus",
+          title: "搴撳瓨鐘舵��",
+          type: "string",
+          width: 120,
+          align: "left",
+          bind: { key: "stockStatusEmun", data: [] },
+        },
+        // {
+        //   field: "locationType",
+        //   title: "璐т綅绫诲瀷",
+        //   type: "string",
+        //   width: 100,
+        //   align: "left",
+        //   bind:{key: "locationTypeEnum", data: []}
+        // },
+        {
+          field: "locationStatus",
+          title: "璐т綅鐘舵��",
+          type: "string",
+          width: 120,
+          align: "left",
+          bind: { key: "locationStatusEnum", data: [] },
+        },
+        {
+          field: "enalbeStatus",
+          title: "绂佺敤鐘舵��",
+          type: "string",
+          width: 80,
+          align: "left",
+          bind: { key: "enableStatusEnum", data: [] },
+        },
+        {
+          field: "creater",
+          title: "鍒涘缓浜�",
+          type: "string",
+          width: 90,
+          align: "left",
+        },
+        {
+          field: "createDate",
+          title: "鍒涘缓鏃堕棿",
+          type: "datetime",
+          width: 160,
+          align: "left",
+        },
+        {
+          field: "modifier",
+          title: "淇敼浜�",
+          type: "string",
+          width: 100,
+          align: "left",
+        },
+        {
+          field: "modifyDate",
+          title: "淇敼鏃堕棿",
+          type: "datetime",
+          width: 160,
+          align: "left",
+        },
+        {
+          field: "remark",
+          title: "澶囨敞",
+          type: "string",
+          width: 100,
+          align: "left",
+          hidden:true
+        },
+      ]);
+      const detail = ref({
+        cnName: "搴撳瓨鏄庣粏淇℃伅",
+        table: "ProStockInfoDetail",
+        columns: [
+          {
+            field: "id",
+            title: "Id",
+            type: "int",
+            width: 90,
+            hidden: true,
+            readonly: true,
+            require: true,
+            align: "left",
+          },
+          {
+            field: "proStockId",
+            title: "搴撳瓨淇℃伅涓婚敭",
+            type: "string",
+            width: 90,
+            align: "left",
+            hidden: true
+          },
+          {
+            field: "bagNo",
+            title: "鍐呭寘鍙�",
+            type: "string",
+            width: 180,
+            align: "left",
+          },
+          {
+            field: "productCode",
+            title: "浜у搧缂栫爜",
+            type: "string",
+            width: 140,
+            align: "left",
+          },
+          {
+            field: "productVersion",
+            title: "浜у搧鐗堟湰",
+            type: "string",
+            width: 80,
+            align: "left",
+          },
+          {
+            field: "dateCode",
+            title: "鍛ㄦ湡",
+            type: "string",
+            width: 80,
+            align: "left",
+          },
+          {
+            field: "saleOrder",
+            title: "閿�鍞鍗�",
+            type: "string",
+            width: 200,
+            align: "left",
+          },
+          {
+            field: "moNumber",
+            title: "鍒堕�犺鍗�",
+            type: "string",
+            width: 150,
+            align: "left",
+          },
+          {
+            field: "erpOrder",
+            title: "ERP宸ュ崟",
+            type: "string",
+            width: 200,
+            align: "left",
+          },
+          {
+            field: "stockPcsQty",
+            title: "搴撳瓨PCS鏁�",
+            type: "string",
+            width: 90,
+            align: "left",
+          },
+          {
+            field: "lotNumber",
+            title: "浜у搧鎵瑰彿",
+            type: "string",
+            width: 90,
+            align: "left",
+          },
+        //   {
+        //     field: "outboundQuantity",
+        //     title: "鍑哄簱PCS鏁伴噺",
+        //     type: "string",
+        //     width: 90,
+        //     align: "left",
+        //   },
+        //   {
+        //     field: "outSETQty",
+        //     title: "鍑哄簱SET鏁伴噺",
+        //     type: "string",
+        //     width: 90,
+        //     align: "left",
+        //   },
+          {
+            field: "xQty",
+            title: "X鏁�",
+            type: "string",
+            width: 90,
+            align: "left",
+          },
+          {
+            field: "xSite",
+            title: "X浣�",
+            type: "string",
+            width: 100,
+            align: "left",
+          },
+          {
+            field: "proOutDetailStatus",
+            title: "搴撳瓨鐘舵��",
+            type: "int",
+            width: 120,
+            align: "left",
+            bind: { key: "stockStatusEmun", data: [] },
+          },
+          {
+            field: "weight",
+            title: "鍐呭寘閲嶉噺",
+            type: "string",
+            width: 80,
+            align: "left",
+          },
+          {
+            field: "creater",
+            title: "鍒涘缓浜�",
+            type: "string",
+            width: 90,
+            align: "left",
+            hidden: true
+          },
+          {
+            field: "createDate",
+            title: "鍒涘缓鏃堕棿",
+            type: "datetime",
+            width: 130,
+            align: "left",
+            hidden: true
+          },
+          {
+            field: "modifier",
+            title: "淇敼浜�",
+            type: "string",
+            width: 100,
+            align: "left",
+            hidden: true
+          },
+          {
+            field: "modifyDate",
+            title: "淇敼鏃堕棿",
+            type: "datetime",
+            width: 160,
+            align: "left",
+            hidden: true
+          },
+          {
+            field: "remark",
+            title: "澶囨敞",
+            type: "string",
+            width: 100,
+            align: "left",
+            hidden: true
+          },
+        ],
+        sortName: "id",
+        key: "id",
+      });
+      return {
+        table,
+        extend,
+        editFormFields,
+        editFormOptions,
+        searchFormFields,
+        searchFormOptions,
+        columns,
+        detail,
+      };
+    },
+  });
+  </script>
+      
\ 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/views/stock/ToUserStockView.vue" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSClient/src/views/stock/ToUserStockView.vue"
index 89fffce..ce7bfc8 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSClient/src/views/stock/ToUserStockView.vue"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSClient/src/views/stock/ToUserStockView.vue"
@@ -57,8 +57,6 @@
         { title: "搴撳瓨鍒涘缓鏃堕棿",field: "createDate",type: "datetime"},
       ],
       [
-        { title: "鏈夋晥鏈熸煡璇�",field: "effectiveDate",type: "date"},
-        {title: "鐗╂枡鏈夋晥鏈�",field: "expirationlabel",type: "selectList",dataKey:"expirationlabelEnum",data:[]},
         { title: "搴撻緞(灏忎簬)", field: "inventoryage",type: "string"},
         { title: "搴撻緞(澶т簬)", field: "inventoryage1",type: "string"},
       ],
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/AssignLocation/LocationInfoService_BC.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/AssignLocation/LocationInfoService_BC.cs"
index d86369f..63b766d 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/AssignLocation/LocationInfoService_BC.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_BasicService/Service/AssignLocation/LocationInfoService_BC.cs"
@@ -67,36 +67,57 @@
                     }
                 }
 
+                List<Dt_LocationInfo> allDefinedLocations = locationInfos
+                    .Where(x =>
+                        (x.EnableStatus == EnableStatusEnum.Normal.ObjToInt() || x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt()) &&
+                        x.LocationStatus == LocationStatusEnum.Free.ObjToInt() &&
+                        x.LocationType == palletType.ObjToInt() &&
+                        !lockLocationCodes.Contains(x.LocationCode)
+                    )
+                    .OrderByDescending(x => x.Depth)
+                    .ThenBy(x => x.Layer)
+                    .ThenBy(x => x.Column)
+                    .ThenBy(x => x.Row)
+                    .ToList();
 
-                //鏈畾涔夌被鍨嬬殑绌鸿揣浣�
-                List<Dt_LocationInfo> undefinedTypeEmptyLocations = locationInfos.Where(x => (x.EnableStatus == EnableStatusEnum.Normal.ObjToInt() || x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt()) && x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && x.LocationType == LocationTypeEnum.Undefined.ObjToInt() && !lockLocationCodes.Contains(x.LocationCode)).OrderByDescending(x => x.Depth).ThenBy(x => x.Layer).ThenBy(x => x.Column).ThenBy(x => x.Row).ToList();
+                List<Dt_LocationInfo> undefinedTypeEmptyLocations = locationInfos
+                    .Where(x =>
+                        (x.EnableStatus == EnableStatusEnum.Normal.ObjToInt() || x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt()) &&
+                        x.LocationStatus == LocationStatusEnum.Free.ObjToInt() &&
+                        x.LocationType == LocationTypeEnum.Undefined.ObjToInt() &&
+                        !lockLocationCodes.Contains(x.LocationCode)
+                    )
+                    .OrderByDescending(x => x.Depth)
+                    .ThenBy(x => x.Layer)
+                    .ThenBy(x => x.Column)
+                    .ThenBy(x => x.Row)
+                    .ToList();
 
-                List<Dt_LocationInfo> definedTypeEmptyLocations = locationInfos.Where(x => (x.EnableStatus == EnableStatusEnum.Normal.ObjToInt() || x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt()) && x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && x.LocationType == palletType.ObjToInt() && !lockLocationCodes.Contains(x.LocationCode)).OrderByDescending(x => x.Depth).ThenBy(x => x.Layer).ThenBy(x => x.Column).ThenBy(x => x.Row).ToList();
-                List<Dt_LocationInfo> _LocationInfos = definedTypeEmptyLocations;
+                List<Dt_LocationInfo> definedTypeEmptyLocations = new List<Dt_LocationInfo>();
+                List<Dt_LocationInfo> definedLocations1_4 = new List<Dt_LocationInfo>(); // 1-4灞傚凡瀹氫箟璐т綅
+                List<Dt_LocationInfo> definedLocations5 = new List<Dt_LocationInfo>();  // 5灞傚凡瀹氫箟璐т綅
+
                 if (heightType == 1)
                 {
-                    undefinedTypeEmptyLocations = undefinedTypeEmptyLocations.Where(x=>x.Layer <= 4).ToList();
-                    definedTypeEmptyLocations = definedTypeEmptyLocations.Where(x => x.Layer <= 4).ToList();
+                    definedLocations1_4 = allDefinedLocations.Where(x => x.Layer <= 4).ToList();
+                    definedLocations5 = allDefinedLocations.Where(x => x.Layer == 5).ToList();
+                    definedTypeEmptyLocations = definedLocations1_4;
+                    // 鏈畾涔夌被鍨嬩粎淇濈暀1-4灞�
+                    undefinedTypeEmptyLocations = undefinedTypeEmptyLocations.Where(x => x.Layer <= 4).ToList();
                 }
-                //else if(heightType == 2)
-                //{
-                //    undefinedTypeEmptyLocations = undefinedTypeEmptyLocations.Where(x => x.Layer == 4).ToList();
-                //    definedTypeEmptyLocations = definedTypeEmptyLocations.Where(x => x.Layer == 4).ToList();
-                //}
                 else if (heightType == 2)
                 {
+                    // 浠呬繚鐣�5灞�
+                    definedTypeEmptyLocations = allDefinedLocations.Where(x => x.Layer == 5).ToList();
                     undefinedTypeEmptyLocations = undefinedTypeEmptyLocations.Where(x => x.Layer == 5).ToList();
-                    definedTypeEmptyLocations = definedTypeEmptyLocations.Where(x => x.Layer == 5).ToList();
                 }
                 else
                 {
-                    undefinedTypeEmptyLocations = undefinedTypeEmptyLocations.Where(x => false).ToList();
+                    // 鍏朵粬heightType锛氭棤鍙敤璐т綅
                     definedTypeEmptyLocations = definedTypeEmptyLocations.Where(x => false).ToList();
+                    undefinedTypeEmptyLocations = undefinedTypeEmptyLocations.Where(x => false).ToList();
                 }
-                if (heightType==1 && !definedTypeEmptyLocations.Any())
-                {
-                    definedTypeEmptyLocations = _LocationInfos.Where(x => x.Layer == 5).ToList();
-                }
+
                 if (palletTypeInfo.LocaitonCount == 2)
                 {
                     if (roadwayNo != "SC01_BC")
@@ -109,25 +130,70 @@
                 {
                     for (int i = 0; i < definedTypeEmptyLocations.Count; i++)
                     {
-                        Dt_LocationInfo definedTypeEmptyLocation = definedTypeEmptyLocations[i];
-                        Dt_LocationInfo? locationInfo = GetUsableLocation_BC(locationInfos, definedTypeEmptyLocation, palletType, palletTypeInfo);
-                        //鍒ゆ柇璐т綅涓ゆ繁鍙婁互涓婃槸鍚﹀瓨鍦ㄥ嚭搴撻攣瀹氳揣浣�
-                        if (locationInfo?.Depth == 1)
+                        Dt_LocationInfo currentLocation = definedTypeEmptyLocations[i];
+                        Dt_LocationInfo? usableLocation = GetUsableLocation_BC(locationInfos, currentLocation, palletType, palletTypeInfo);
+
+                        if (usableLocation?.Depth == 1)
                         {
-                            Dt_LocationInfo? IsBebusyLocation = locationInfos.Where(x => x.Row == (locationInfo?.Row == 2 ? locationInfo?.Row - 1 : locationInfo?.Row + 1) && x.Column==locationInfo?.Column && x.Layer== locationInfo?.Layer).FirstOrDefault();
-                            if (IsBebusyLocation!=null && (IsBebusyLocation.LocationStatus<LocationStatusEnum.InStock.ObjToInt()))
+                            int oppositeRow = usableLocation.Row == 2 ? usableLocation.Row - 1 : usableLocation.Row + 1;
+                            Dt_LocationInfo? oppositeLocation = locationInfos.FirstOrDefault(x =>
+                                x.Row == oppositeRow &&
+                                x.Column == usableLocation.Column &&
+                                x.Layer == usableLocation.Layer
+                            );
+                            if (oppositeLocation != null && (oppositeLocation.LocationStatus < LocationStatusEnum.InStock.ObjToInt()))
                             {
                                 continue;
                             }
                         }
-                        if (locationInfo != null)
+
+                        if (usableLocation != null)
                         {
-                            locationCaches_BC.Add(new LocationCache { LocationCode = locationInfo.LocationCode, DateTime = DateTime.Now });
-                            return locationInfo;
+                            locationCaches_BC.Add(new LocationCache { LocationCode = usableLocation.LocationCode, DateTime = DateTime.Now });
+                            return usableLocation;
                         }
                     }
                 }
-                if (undefinedTypeEmptyLocations.Any() && palletType!=PalletTypeEnum.SmallPallet.ObjToInt())//濡傛灉宸插畾涔夌被鍨嬭揣浣嶆湭瓒呰繃姣斾緥锛屼笖鏈夋湭瀹氫箟绫诲瀷鐨勮揣浣�
+
+                if (heightType == 1 && definedLocations5.Any())
+                {
+                    List<Dt_LocationInfo> filtered5Locations = definedLocations5;
+                    if (palletTypeInfo.LocaitonCount == 2)
+                    {
+                        if (roadwayNo != "SC01_BC")
+                            filtered5Locations = filtered5Locations.Where(x => x.Column % 2 == 1).ToList();
+                        else
+                            filtered5Locations = filtered5Locations.Where(x => x.Column % 2 == 0).ToList();
+                    }
+
+                    for (int i = 0; i < filtered5Locations.Count; i++)
+                    {
+                        Dt_LocationInfo currentLocation = filtered5Locations[i];
+                        Dt_LocationInfo? usableLocation = GetUsableLocation_BC(locationInfos, currentLocation, palletType, palletTypeInfo);
+
+                        if (usableLocation?.Depth == 1)
+                        {
+                            int oppositeRow = usableLocation.Row == 2 ? usableLocation.Row - 1 : usableLocation.Row + 1;
+                            Dt_LocationInfo? oppositeLocation = locationInfos.FirstOrDefault(x =>
+                                x.Row == oppositeRow &&
+                                x.Column == usableLocation.Column &&
+                                x.Layer == usableLocation.Layer
+                            );
+                            if (oppositeLocation != null && (oppositeLocation.LocationStatus < LocationStatusEnum.InStock.ObjToInt()))
+                            {
+                                continue;
+                            }
+                        }
+
+                        if (usableLocation != null)
+                        {
+                            locationCaches_BC.Add(new LocationCache { LocationCode = usableLocation.LocationCode, DateTime = DateTime.Now });
+                            return usableLocation;
+                        }
+                    }
+                }
+
+                if (undefinedTypeEmptyLocations.Any() && palletType != PalletTypeEnum.SmallPallet.ObjToInt())
                 {
                     if (palletTypeInfo.LocaitonCount == 2)
                     {
@@ -138,26 +204,30 @@
 
                         for (int i = 0; i < undefinedTypeEmptyLocations.Count; i++)
                         {
-                            Dt_LocationInfo undefinedTypeEmptyLocation = undefinedTypeEmptyLocations[i];
-                            Dt_LocationInfo? locationInfo = GetUsableLocation_BC(locationInfos, undefinedTypeEmptyLocation, palletType, palletTypeInfo);
-                            //鍒ゆ柇璐т綅涓ゆ繁鍙婁互涓婃槸鍚﹀瓨鍦ㄥ嚭搴撻攣瀹氳揣浣�
-                            if (locationInfo?.Depth == 1)
+                            Dt_LocationInfo currentLocation = undefinedTypeEmptyLocations[i];
+                            Dt_LocationInfo? usableLocation = GetUsableLocation_BC(locationInfos, currentLocation, palletType, palletTypeInfo);
+
+                            if (usableLocation?.Depth == 1)
                             {
-                                Dt_LocationInfo? IsBebusyLocation = locationInfos.Where(x => x.Row == (locationInfo?.Row == 2 ? locationInfo?.Row - 1 : locationInfo?.Row + 1) && x.Column == locationInfo?.Column && x.Layer == locationInfo?.Layer).FirstOrDefault();
-                                if (IsBebusyLocation != null && (IsBebusyLocation.LocationStatus < LocationStatusEnum.InStock.ObjToInt()))
+                                int oppositeRow = usableLocation.Row == 2 ? usableLocation.Row - 1 : usableLocation.Row + 1;
+                                Dt_LocationInfo? oppositeLocation = locationInfos.FirstOrDefault(x =>
+                                    x.Row == oppositeRow &&
+                                    x.Column == usableLocation.Column &&
+                                    x.Layer == usableLocation.Layer
+                                );
+                                if (oppositeLocation != null && (oppositeLocation.LocationStatus < LocationStatusEnum.InStock.ObjToInt()))
                                 {
                                     continue;
                                 }
                             }
-                            if (locationInfo != null)
+
+                            if (usableLocation != null)
                             {
-                                //UpdateLocationStatus(locationInfo, palletType, LocationStatusEnum.Lock, locationInfo.WarehouseId);
-                                locationCaches_BC.Add(new LocationCache { LocationCode = locationInfo.LocationCode, DateTime = DateTime.Now });
-                                return locationInfo;
+                                locationCaches_BC.Add(new LocationCache { LocationCode = usableLocation.LocationCode, DateTime = DateTime.Now });
+                                return usableLocation;
                             }
                         }
                     }
-                    
                 }
                 return null;
             }
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_InboundService/ReceiveOrderService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_InboundService/ReceiveOrderService.cs"
index 22685c9..08f1072 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_InboundService/ReceiveOrderService.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_InboundService/ReceiveOrderService.cs"
@@ -228,7 +228,15 @@
                     recevieOrderDetails.Add(recevieOrderDetail);
                     if (warehouse.WarehouseCode == WarehouseEnum.HA152.ToString() || warehouse.WarehouseCode == WarehouseEnum.HA58.ToString())
                     {
-                        string lotNo = item.LotNo.Substring(0, item.LotNo.IndexOf("-"));
+                        string lotNo;
+                        if (item.LotNo.Contains("-"))
+                        {
+                            lotNo = item.LotNo.Substring(0, item.LotNo.IndexOf("-"));
+                        }
+                        else
+                        {
+                            lotNo = item.LotNo;
+                        }
                         Dt_CheckOrder? ExistcheckOrder = checkOrders.FirstOrDefault(x => x.LotNo == lotNo && x.MaterielCode == item.MaterielCode && x.PurchaseOrderNo == item.PurchaseOrderNo);
                         if (ExistcheckOrder == null)
                         {
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_StockService/StockInfoService.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_StockService/StockInfoService.cs"
index 458e1d3..2fe284f 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_StockService/StockInfoService.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_StockService/StockInfoService.cs"
@@ -421,37 +421,57 @@
             {
                 if (webhookUrl == null || secret == null)
                 {
-                    webhookUrl = "https://oapi.dingtalk.com/robot/send?access_token=fbc3aaf4133ea650d8116fb86b3ebfd0c5e0d46775966ce87893a41886bdf9dc";
-                    secret = "SECf221842b26356f22ccac84c4e60714e5287408ee8332a8f63503791382c3f5fb";
+                    webhookUrl = "https://oapi.dingtalk.com/robot/send?access_token=c3e05f2c6bcd595383ee02e713446174b9201bad91db216590620fe0acd4e75e";
+                    secret = "SEC617f06140fc7cbd8b91d3e203f270826320637af41e7423d756e62df40f62282";
                 }
-                var warehouseIdToName = new Dictionary<int, string>
-                {
-                    { 2, "娌瑰ⅷ浠�" },
-                    { 3, "鏉挎潗浠�" },
-                    { 4, "PP浠�" },
-                    { 6, "娴嬭瘯鏋朵粨" },
-                    { 11, "骞茶啘浠�" },
-                    { 12, "闃荤剨浠�" }
-                };
 
+                // 1. 瀹氫箟浠撳簱ID涓庝粨搴撳悕绉扮殑鏄犲皠鍏崇郴锛堝鍔犳垚鍝佷粨锛�
+                var warehouseIdToName = new Dictionary<int, string>
+        {
+            { 2, "娌瑰ⅷ浠�" },
+            { 3, "鏉挎潗浠�" },
+            { 4, "PP浠�" },
+            { 6, "娴嬭瘯鏋朵粨" },
+            { 7, "鎴愬搧浠�" }, // 鏂板鎴愬搧浠�
+            { 11, "骞茶啘浠�" },
+            { 12, "闃荤剨浠�" }
+        };
+
+                // 2. 鏃堕棿鐩稿叧閰嶇疆锛岀敤浜庣瓫閫夎秴杩�90澶╃殑鏁版嵁
                 var currentTime = DateTime.Now;
                 var ninetyDaysAgo = currentTime.AddDays(-90);
 
+                // 3. 澶勭悊鍘熸潗鏂欎粨锛堜粨搴揑D 鈮� 7锛�
+                // 3.1 鏌ヨ鏍囪瘑鐮佷负3锛堣繃鏈燂級鐨勪富琛ㄦ暟鎹紙鎺掗櫎浠撳簱ID=5鍜�7锛�
                 var expirationLabel3Stocks = BaseDal.Db.Queryable<Dt_StockInfo>()
-                    .Where(s => s.Expirationlabel == 3 && s.WarehouseId != 5)
+                    .Where(s => s.Expirationlabel == 3 && s.WarehouseId != 5 && s.WarehouseId != 7 && s.LocationCode != "" && s.LocationCode != null)
                     .ToList();
 
+                // 3.2 鏌ヨ瓒呰繃90澶╂湭淇敼锛堟湭浣跨敤锛夌殑涓昏〃鏁版嵁锛堟帓闄や粨搴揑D=5鍜�7锛�
                 var over90DaysStocks = BaseDal.Db.Queryable<Dt_StockInfo>()
-                    .Where(s => s.ModifyDate <= ninetyDaysAgo && s.Expirationlabel != 3 && s.WarehouseId != 5)
+                    .Where(s => s.ModifyDate <= ninetyDaysAgo && s.Expirationlabel != 3 && s.WarehouseId != 5 && s.WarehouseId != 7 && s.LocationCode != "" && s.LocationCode != null)
                     .ToList();
 
-                if (!expirationLabel3Stocks.Any() && !over90DaysStocks.Any())
+                // 4. 澶勭悊鎴愬搧浠擄紙浠撳簱ID = 7锛�
+                var proOver90DaysStocks = new List<Dt_ProStockInfo>();
+                if (warehouseIdToName.ContainsKey(7))
+                {
+                    proOver90DaysStocks = BaseDal.Db.Queryable<Dt_ProStockInfo>()
+                        .Where(s => s.WarehouseId == 7 && s.ModifyDate <= ninetyDaysAgo && s.LocationCode != "" && s.LocationCode != null)
+                        .ToList();
+                }
+
+                // 鏃犵鍚堟潯浠舵暟鎹椂鐩存帴杩斿洖
+                if (!expirationLabel3Stocks.Any() && !over90DaysStocks.Any() && !proOver90DaysStocks.Any())
                 {
                     return;
                 }
 
+                // 5. 鎻愬彇鍘熸潗鏂欎富琛ㄦ暟鎹殑ID
                 var expirationLabel3StockIds = expirationLabel3Stocks.Select(s => s.Id).ToList();
                 var over90DaysStockIds = over90DaysStocks.Select(s => s.Id).ToList();
+
+                // 6. 鍏宠仈鏌ヨ鍘熸潗鏂欐槑缁嗚〃鏁版嵁
                 var expirationLabel3Details = expirationLabel3StockIds.Any()
                     ? BaseDal.Db.Queryable<Dt_StockInfoDetail>()
                         .Where(d => expirationLabel3StockIds.Contains(d.StockId))
@@ -464,107 +484,264 @@
                         .ToList()
                     : new List<Dt_StockInfoDetail>();
 
-                var stockIdToWarehouseId = expirationLabel3Stocks
-                    .Concat(over90DaysStocks)
-                    .ToDictionary(s => s.Id, s => s.WarehouseId);
+                // 7. 澶勭悊鎴愬搧浠撴槑缁嗘暟鎹�
+                var proOver90DaysDetails = new List<Dt_ProStockInfoDetail>();
+                if (proOver90DaysStocks.Any())
+                {
+                    var proStockIds = proOver90DaysStocks.Select(s => s.Id).ToList();
+                    proOver90DaysDetails = BaseDal.Db.Queryable<Dt_ProStockInfoDetail>()
+                        .Where(d => proStockIds.Contains(d.ProStockId))
+                        .ToList();
+                }
 
+                // 8. 寤虹珛涓昏〃ID鍒颁粨搴揑D鐨勬槧灏勶紙鍖呮嫭鎴愬搧浠擄級
+                var stockIdToWarehouseId = new Dictionary<int, int>();
+
+                // 鍘熸潗鏂欎粨鏄犲皠
+                foreach (var stock in expirationLabel3Stocks.Concat(over90DaysStocks))
+                {
+                    if (!stockIdToWarehouseId.ContainsKey(stock.Id))
+                    {
+                        stockIdToWarehouseId[stock.Id] = stock.WarehouseId;
+                    }
+                }
+
+                // 鎴愬搧浠撴槧灏�
+                foreach (var proStock in proOver90DaysStocks)
+                {
+                    if (!stockIdToWarehouseId.ContainsKey(proStock.Id))
+                    {
+                        stockIdToWarehouseId[proStock.Id] = proStock.WarehouseId;
+                    }
+                }
+
+                // 9. 鎸変粨搴撳垎缁勫鐞嗙墿鏂欐暟鎹�
+                // 9.1 鍘熸潗鏂欒繃鏈熺墿鏂�
                 var expirationLabel3Groups = expirationLabel3Details
                     .GroupBy(d => stockIdToWarehouseId[d.StockId])
                     .ToDictionary(g => g.Key, g => g.Select(d => new
                     {
-                        d.MaterielCode,
-                        d.BatchNo
-                    }).ToList());
+                        MaterielCode = d.MaterielCode,
+                        BatchNo = d.BatchNo,
+                        IsProStock = false // 鏍囪涓洪潪鎴愬搧浠�
+                    }).Distinct().ToList());
 
+                // 9.2 鍘熸潗鏂欒秴杩�90澶╂湭浣跨敤鐗╂枡
                 var over90DaysGroups = over90DaysDetails
                     .GroupBy(d => stockIdToWarehouseId[d.StockId])
                     .ToDictionary(g => g.Key, g => g.Select(d => new
                     {
-                        d.MaterielCode,
-                        d.BatchNo
-                    }).ToList());
+                        MaterielCode = d.MaterielCode,
+                        BatchNo = d.BatchNo,
+                        IsProStock = false // 鏍囪涓洪潪鎴愬搧浠�
+                    }).Distinct().ToList());
 
+                // 9.3 鎴愬搧浠撹秴杩�90澶╂湭浣跨敤鐗╂枡
+                if (proOver90DaysDetails.Any())
+                {
+                    var proWarehouseId = 7;
+                    var proGroup = proOver90DaysDetails
+                        .GroupBy(d => stockIdToWarehouseId[d.ProStockId])
+                        .Select(g => new
+                        {
+                            WarehouseId = g.Key,
+                            Materials = g.Select(d => new
+                            {
+                                MaterielCode = d.ProductCode, // 鎴愬搧浠撲娇鐢≒roductCode瀛楁
+                                BatchNo = d.LotNumber,        // 鎴愬搧浠撲娇鐢↙otNumber瀛楁
+                                IsProStock = true             // 鏍囪涓烘垚鍝佷粨
+                            }).Distinct().ToList()
+                        })
+                        .FirstOrDefault();
+
+                    if (proGroup != null)
+                    {
+                        // 娣诲姞鍒皁ver90DaysGroups涓�
+                        if (over90DaysGroups.ContainsKey(proWarehouseId))
+                        {
+                            over90DaysGroups[proWarehouseId].AddRange(proGroup.Materials);
+                        }
+                        else
+                        {
+                            over90DaysGroups[proWarehouseId] = proGroup.Materials;
+                        }
+                    }
+                }
+
+                // 10. 鑾峰彇鎵�鏈夋秹鍙婄殑浠撳簱ID
                 var allWarehouseIds = expirationLabel3Groups.Keys
                     .Union(over90DaysGroups.Keys)
                     .ToList();
 
+                // 11. 鍙戦�侀拤閽夋秷鎭�
                 using (HttpClient httpClient = new HttpClient())
                 {
                     foreach (var warehouseId in allWarehouseIds)
                     {
-                        // 9.1 澶勭悊浠撳簱鍚嶇О鏄剧ず锛氫紭鍏堢敤鏄犲皠鍚嶇О锛屾棤鏄犲皠鏃舵樉绀哄師濮婭D
                         var warehouseName = warehouseIdToName.TryGetValue(warehouseId, out var name)
                             ? name
                             : $"浠撳簱{warehouseId}";
 
-                        var messageParts = new List<string>
-                {
-                    $"銆恵warehouseName}銆戠墿鏂欐彁閱�"
-                };
+                        // 11.1 鏋勫缓markdown鏍煎紡娑堟伅
+                        var markdownContent = new StringBuilder();
+                        markdownContent.AppendLine($"## {warehouseName}鐗╂枡鎻愰啋閫氱煡\n");
 
-                        // 娣诲姞杩囨湡鐗╂枡淇℃伅
-                        if (expirationLabel3Groups.TryGetValue(warehouseId, out var label3Materials) && label3Materials.Any())
+                        // 缁熻淇℃伅
+                        var expiredCount = expirationLabel3Groups.TryGetValue(warehouseId, out var expList) ?
+                            expList.Count : 0;
+
+                        var over90Count = over90DaysGroups.TryGetValue(warehouseId, out var over90List) ?
+                            over90List.Count : 0;
+
+                        // 濡傛灉鏄垚鍝佷粨锛岄渶瑕佽繃婊ゅ嚭鎴愬搧浠撶殑鏁版嵁
+                        if (warehouseId == 7)
                         {
-                            var label3Details = label3Materials
-                                .Select(m => $"鈥� 鐗╂枡缂栫爜锛歿m.MaterielCode} | 鎵规鍙凤細{m.BatchNo}")
-                                .Aggregate((current, next) => $"{current}\n{next}");
-                            messageParts.Add($"涓�銆佽繃鏈熺墿鏂橽n{label3Details}");
+                            over90Count = over90List?.Count(m => m.IsProStock) ?? 0;
                         }
 
-                        // 娣诲姞瓒呰繃90澶╂湭浣跨敤鐗╂枡淇℃伅
-                        if (over90DaysGroups.TryGetValue(warehouseId, out var over90Materials) && over90Materials.Any())
+                        markdownContent.AppendLine($"**缁熻姒傝锛�**");
+                        if (warehouseId == 7)
                         {
-                            var over90Details = over90Materials
-                                .Select(m => $"鈥� 鐗╂枡缂栫爜锛歿m.MaterielCode} | 鎵规鍙凤細{m.BatchNo}")
-                                .Aggregate((current, next) => $"{current}\n{next}");
-                            messageParts.Add($"浜屻�佽秴杩�90澶╂湭浣跨敤鐗╂枡\n{over90Details}");
+                            markdownContent.AppendLine($"- 瓒呰繃90澶╂湭浣跨敤鎴愬搧锛歿over90Count}鏉�");
+                        }
+                        else
+                        {
+                            markdownContent.AppendLine($"- 杩囨湡鐗╂枡锛歿expiredCount}鏉�");
+                            markdownContent.AppendLine($"- 瓒呰繃90澶╂湭浣跨敤鐗╂枡锛歿over90Count}鏉�");
+                        }
+                        markdownContent.AppendLine();
+
+                        // 11.2 娣诲姞杩囨湡鐗╂枡琛ㄦ牸锛堝鏋滄湁鏁版嵁涓斾笉鏄垚鍝佷粨锛�
+                        if (expiredCount > 0 && warehouseId != 7)
+                        {
+                            markdownContent.AppendLine("### 涓�銆佽繃鏈熺墿鏂�");
+                            markdownContent.AppendLine("| 搴忓彿 | 鐗╂枡缂栫爜 | 鎵规鍙� |");
+                            markdownContent.AppendLine("| :--- | :--- | :--- |");
+
+                            int index = 1;
+                            var expiredToShow = expList.Take(200);
+                            foreach (var material in expiredToShow)
+                            {
+                                markdownContent.AppendLine($"| {index} | {material.MaterielCode} | {material.BatchNo} |");
+                                index++;
+                            }
+
+                            if (expiredCount > 200)
+                            {
+                                markdownContent.AppendLine($"| ... | 鍏眥expiredCount}鏉★紝浠呮樉绀哄墠200鏉� | ... |");
+                            }
+                            markdownContent.AppendLine();
                         }
 
-                        var messageContent = string.Join("\n\n", messageParts);
+                        // 11.3 娣诲姞瓒呰繃90澶╂湭浣跨敤鐗╂枡琛ㄦ牸锛堝鏋滄湁鏁版嵁锛�
+                        if (over90Count > 0)
+                        {
+                            if (warehouseId == 7)
+                            {
+                                markdownContent.AppendLine("### 瓒呰繃90澶╂湭浣跨敤鎴愬搧");
+                            }
+                            else
+                            {
+                                markdownContent.AppendLine("### 浜屻�佽秴杩�90澶╂湭浣跨敤鐗╂枡");
+                            }
 
+                            markdownContent.AppendLine("| 搴忓彿 | 鐗╂枡缂栫爜 | 鎵规鍙� |");
+                            markdownContent.AppendLine("| :--- | :--- | :--- |");
+
+                            int index = 1;
+                            var over90ToShow = warehouseId == 7 ?
+                                over90List?.Where(m => m.IsProStock).Take(500) :
+                                over90List?.Take(500);
+
+                            if (over90ToShow != null)
+                            {
+                                foreach (var material in over90ToShow)
+                                {
+                                    markdownContent.AppendLine($"| {index} | {material.MaterielCode} | {material.BatchNo} |");
+                                    index++;
+                                }
+
+                                if (over90Count > (warehouseId == 7 ? 500 : 200))
+                                {
+                                    markdownContent.AppendLine($"| ... | 鍏眥over90Count}鏉★紝浠呮樉绀哄墠{(warehouseId == 7 ? 500 : 200)}鏉� | ... |");
+                                }
+                            }
+                            markdownContent.AppendLine();
+                        }
+
+                        // 11.4 娣诲姞鏃堕棿鎴冲拰鎻愮ず淇℃伅
+                        markdownContent.AppendLine($"**鎶ュ憡鏃堕棿锛�** {currentTime:yyyy-MM-dd HH:mm:ss}");
+                        if (warehouseId == 7)
+                        {
+                            markdownContent.AppendLine("**澶囨敞锛�** 璇锋垚鍝佷粨绠$悊浜哄憳鍙婃椂澶勭悊瓒呰繃90澶╂湭浣跨敤鐨勬垚鍝併��");
+                        }
+                        else
+                        {
+                            markdownContent.AppendLine("**澶囨敞锛�** 璇风浉鍏充粨搴撶鐞嗕汉鍛樺強鏃跺鐞嗕互涓婄墿鏂欍��");
+                        }
+
+                        var messageContent = markdownContent.ToString();
+
+                        // 11.5 鐢熸垚閽夐拤娑堟伅鎵�闇�鐨勬椂闂存埑鍜岀鍚�
                         var timestamp = DateTimeOffset.Now.ToUnixTimeMilliseconds();
                         var sign = GenerateSign(timestamp, secret);
 
-                        var url = $"{webhookUrl.Split('?')[0]}?access_token={new Uri(webhookUrl).Query.Split('=')[1]}&timestamp={timestamp}&sign={sign}";
+                        // 11.6 鏋勫缓閽夐拤璇锋眰URL
+                        var uri = new Uri(webhookUrl);
+                        var token = System.Web.HttpUtility.ParseQueryString(uri.Query)["access_token"];
+                        var baseUrl = uri.GetLeftPart(UriPartial.Path);
+                        var url = $"{baseUrl}?access_token={token}&timestamp={timestamp}&sign={sign}";
 
-                        // 鏋勫缓璇锋眰浣擄紙绗﹀悎閽夐拤text绫诲瀷娑堟伅鏍煎紡锛�
+                        // 11.7 鏋勫缓璇锋眰浣擄紙浣跨敤markdown鏍煎紡锛�
                         var requestBody = new
                         {
-                            msgtype = "text",
-                            text = new { content = messageContent }
+                            msgtype = "markdown",
+                            markdown = new
+                            {
+                                title = $"{warehouseName}鐗╂枡鎻愰啋",
+                                text = messageContent
+                            },
+                            at = new
+                            {
+                                // 鍙互鎸囧畾@鏌愪簺浜猴紝濡傛灉涓嶉渶瑕佸彲浠ュ垹闄よ繖閮ㄥ垎
+                                // atMobiles = new[] { "138xxxx8888" },
+                                // isAtAll = false
+                            }
                         };
+
                         var jsonBody = JsonConvert.SerializeObject(requestBody);
                         var content = new StringContent(jsonBody, Encoding.UTF8, "application/json");
 
+                        // 11.8 鍙戦�丳OST璇锋眰骞跺鐞嗗搷搴�
                         var response = await httpClient.PostAsync(url, content);
                         if (!response.IsSuccessStatusCode)
                         {
                             var errorContent = await response.Content.ReadAsStringAsync();
                             throw new Exception($"銆恵warehouseName}銆戞秷鎭彂閫佸け璐ワ紝鐘舵�佺爜锛歿response.StatusCode}锛岄敊璇俊鎭細{errorContent}");
                         }
+
+                        // 閬垮厤鍙戦�侀鐜囪繃蹇�
+                        await Task.Delay(1000);
                     }
                 }
             }
             catch (Exception ex)
             {
+                // 鎹曡幏寮傚父骞惰ˉ鍏呬笂涓嬫枃锛屼究浜庨棶棰樺畾浣�
                 throw new Exception($"閽夐拤娑堟伅鎺ㄩ�佹暣浣撳け璐ワ紝閿欒璇︽儏锛歿ex.Message}", ex);
             }
         }
 
-
-        /// <summary>
-        /// 鐢熸垚鍔犵绛惧悕
-        /// </summary>
-        /// <param name="timestamp">鏃堕棿鎴�</param>
-        /// <returns>绛惧悕</returns>
-        private string GenerateSign(long timestamp,string secret)
+        // 閽夐拤绛惧悕鐢熸垚鏂规硶
+        private string GenerateSign(long timestamp, string secret)
         {
             var stringToSign = $"{timestamp}\n{secret}";
-            using (var hmacsha256 = new System.Security.Cryptography.HMACSHA256(Encoding.UTF8.GetBytes(secret)))
+            using (var hmac = new System.Security.Cryptography.HMACSHA256(Encoding.UTF8.GetBytes(secret)))
             {
-                var hashBytes = hmacsha256.ComputeHash(Encoding.UTF8.GetBytes(stringToSign));
-                return Convert.ToBase64String(hashBytes).Replace("+", "%2B").Replace("/", "%2F");
+                var hash = hmac.ComputeHash(Encoding.UTF8.GetBytes(stringToSign));
+                return Convert.ToBase64String(hash);
             }
         }
+
     }
 }
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 3d2bf8f..7eb87fc 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"
@@ -212,7 +212,7 @@
                 List<LocationCount> locationCounts = new List<LocationCount>();
                 if (heightType == 1)
                 {
-                    locationCounts = Db.Queryable<Dt_LocationInfo>().Where(x => (x.LocationType == task.PalletType || (IsBCS ? false : x.LocationType == LocationTypeEnum.Undefined.ObjToInt())) && x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && (x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt() || x.EnableStatus == EnableStatusEnum.Normal.ObjToInt()) && (IsBCS ? !IsBCS : ("SC01_BC".Contains(x.RoadwayNo) ? x.Column % 2 == 0 : x.Column % 2 == 1)) && x.Layer <= 4 && roadwayNos.Contains(x.RoadwayNo)).GroupBy(x => x.RoadwayNo).Select(x => new LocationCount { RoadwayNo = x.RoadwayNo, Count = SqlFunc.AggregateCount(x) }).ToList();
+                    locationCounts = Db.Queryable<Dt_LocationInfo>().Where(x => (x.LocationType == task.PalletType || (IsBCS ? false : x.LocationType == LocationTypeEnum.Undefined.ObjToInt())) && x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && (x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt() || x.EnableStatus == EnableStatusEnum.Normal.ObjToInt()) && (IsBCS ? !IsBCS : ("SC01_BC".Contains(x.RoadwayNo) ? x.Column % 2 == 0 : x.Column % 2 == 1)) && x.Layer <= 5 && roadwayNos.Contains(x.RoadwayNo)).GroupBy(x => x.RoadwayNo).Select(x => new LocationCount { RoadwayNo = x.RoadwayNo, Count = SqlFunc.AggregateCount(x) }).ToList();
                 }
                 //else if(heightType == 2)
                 //{
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Inbound/ReceiveOrderController.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Inbound/ReceiveOrderController.cs"
index 8dfca1b..206d63a 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Inbound/ReceiveOrderController.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Inbound/ReceiveOrderController.cs"
@@ -35,7 +35,7 @@
         /// </summary>
         /// <param name="orderId"></param>
         /// <returns></returns>
-        [HttpPost, HttpGet, Route("FeedbackReceiveOrder")]
+        [HttpPost, HttpGet, Route("FeedbackReceiveOrder"),AllowAnonymous]
         public WebResponseContent FeedbackReceiveOrder(int orderId)
         {
             return Service.FeedbackReceiveOrder(orderId);

--
Gitblit v1.9.3