From 51197dd4ca2a95dc86f11261d255b6cba8b21263 Mon Sep 17 00:00:00 2001
From: heshaofeng <heshaofeng@hnkhzn.com>
Date: 星期三, 07 一月 2026 17:28:26 +0800
Subject: [PATCH] 1

---
 项目代码/WIDESEA_WMSClient/src/views/inbound/inboundOrder.vue                                        |    2 
 项目代码/WIDESEA_WMSClient/src/router/viewGird.js                                                    |    4 
 项目代码/WIDESEA_WMSClient/src/views/inbound/Dt_AllocateOrder.vue                                    |    2 
 项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_IRecordService/IRecordService.cs                          |    2 
 项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_RecordService/MesReturnRecordService.cs                   |   21 +
 项目代码/WIDESEA_WMSClient/src/extension/basic/returnRecord.js                                       |   69 ++++++
 项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_AllocateService/AllocateService.cs                        |    2 
 项目代码/WIDESEA_WMSClient/src/views/basic/Dt_MesReturnRecord.vue                                    |  343 +++++++++++++++++++++++++++++++
 项目代码/WMS无仓储版/WIDESEA_WMSServer/BigGreenService/BigGreenService.cs                                |  117 +++++++++-
 项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_IRecordService/IMesReturnRecordService.cs                 |   16 +
 项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_RecordService/RecordService.cs                            |    2 
 项目代码/WIDESEA_WMSClient/src/extension/inbound/extend/UndoPalletGroup.vue                          |    6 
 项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Record/MesReturnRecordController.cs |   16 +
 13 files changed, 581 insertions(+), 21 deletions(-)

diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/basic/returnRecord.js" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/basic/returnRecord.js"
new file mode 100644
index 0000000..852a3cb
--- /dev/null
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/basic/returnRecord.js"
@@ -0,0 +1,69 @@
+
+//姝s鏂囦欢鏄敤鏉ヨ嚜瀹氫箟鎵╁睍涓氬姟浠g爜锛屽彲浠ユ墿灞曚竴浜涜嚜瀹氫箟椤甸潰鎴栬�呴噸鏂伴厤缃敓鎴愮殑浠g爜
+
+let extension = {
+  components: {
+    //鏌ヨ鐣岄潰鎵╁睍缁勪欢
+    gridHeader: '',
+    gridBody: '',
+    gridFooter: '',
+    //鏂板缓銆佺紪杈戝脊鍑烘鎵╁睍缁勪欢
+    modelHeader: '',
+    modelBody: '',
+    modelFooter: ''
+  },
+  tableAction: '', //鎸囧畾鏌愬紶琛ㄧ殑鏉冮檺(杩欓噷濉啓琛ㄥ悕,榛樿涓嶇敤濉啓)
+  buttons: { view: [], box: [], detail: [] }, //鎵╁睍鐨勬寜閽�
+  methods: {
+     //涓嬮潰杩欎簺鏂规硶鍙互淇濈暀涔熷彲浠ュ垹闄�
+    onInit() {  //妗嗘灦鍒濆鍖栭厤缃墠锛�
+        //绀轰緥锛氬湪鎸夐挳鐨勬渶鍓嶉潰娣诲姞涓�涓寜閽�
+        //   this.buttons.unshift({  //涔熷彲浠ョ敤push鎴栬�卻plice鏂规硶鏉ヤ慨鏀筨uttons鏁扮粍
+        //     name: '鎸夐挳', //鎸夐挳鍚嶇О
+        //     icon: 'el-icon-document', //鎸夐挳鍥炬爣vue2鐗堟湰瑙乮view鏂囨。icon锛寁ue3鐗堟湰瑙乪lement ui鏂囨。icon(娉ㄦ剰涓嶆槸element puls鏂囨。)
+        //     type: 'primary', //鎸夐挳鏍峰紡vue2鐗堟湰瑙乮view鏂囨。button锛寁ue3鐗堟湰瑙乪lement ui鏂囨。button
+        //     onClick: function () {
+        //       this.$Message.success('鐐瑰嚮浜嗘寜閽�');
+        //     }
+        //   });
+
+        //绀轰緥锛氳缃慨鏀规柊寤恒�佺紪杈戝脊鍑烘瀛楁鏍囩鐨勯暱搴�
+        // this.boxOptions.labelWidth = 150;
+    },
+    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/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/extend/UndoPalletGroup.vue" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/extend/UndoPalletGroup.vue"
index e5c00d1..7006314 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/extend/UndoPalletGroup.vue"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/extension/inbound/extend/UndoPalletGroup.vue"
@@ -1,11 +1,11 @@
 <template>
   <vol-box v-model="show" title="鎾ら攢缁勭洏" :width="500" :height="300">
     <template #content>
-      <el-form ref="form" :model="form" :rules="rules" label-width="90px">
-        <el-form-item label="鎵樼洏鏉$爜:" prop="code">
+      <el-form ref="form" :model="form" :rules="rules" label-width="100px">
+        <el-form-item label="鎵樼洏鎴栨潯鐮�:" prop="code">
           <el-input
             v-model="form.code"
-            placeholder="璇锋壂鎻�/杈撳叆鎵樼洏鏉$爜"
+            placeholder="璇锋壂鎻�/杈撳叆鎵樼洏鎴栨潯鐮�"
             @keydown.enter.prevent="submit"
             clearable
             @paste="handlePaste"
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/router/viewGird.js" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/router/viewGird.js"
index 78836a8..d718159 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/router/viewGird.js"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/router/viewGird.js"
@@ -251,6 +251,10 @@
     path: '/wms-dashboard',
     name: 'wms-dashboard',
     component: () => import('@/views/charts/wms-dashboard.vue')
+  }, {
+    path: '/Dt_MesReturnRecord',
+    name: 'Dt_MesReturnRecord',
+    component: () => import('@/views/basic/Dt_MesReturnRecord.vue')
   }
 ]
 
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/views/basic/Dt_MesReturnRecord.vue" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/views/basic/Dt_MesReturnRecord.vue"
new file mode 100644
index 0000000..7c56a14
--- /dev/null
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/views/basic/Dt_MesReturnRecord.vue"
@@ -0,0 +1,343 @@
+<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/basic/warehouse.js"; // 娉ㄦ剰锛氳嫢鏈変笓灞炵殑鍥炰紶璁板綍鎵╁睍鏂囦欢锛岄渶鏇挎崲姝よ矾寰�
+import { ref, defineComponent } from "vue";
+
+export default defineComponent({
+  setup() {
+    // 1. 琛ㄦ牸鍩虹閰嶇疆锛氶�傞厤鍥炰紶璁板綍瀹炰綋
+    const table = ref({
+      key: "id", // 瀵瑰簲瀹炰綋涓婚敭Id
+      footer: "Foots",
+      cnName: "鎺ュ彛鍥炰紶璁板綍", // 鏇挎崲鍘熶粨搴撲俊鎭�
+      name: "returnRecord", // 鑷畾涔夎〃鍚嶆爣璇�
+      url: "/MesReturnRecord/", // 瀵瑰簲鍚庣鎺ュ彛璺緞锛堥渶鏍规嵁瀹為檯鍚庣璺敱璋冩暣锛�
+      sortName: "id",
+    });
+
+    // 2. 缂栬緫琛ㄥ崟瀛楁锛氬搴斿疄浣撴墍鏈夊瓧娈�
+    const editFormFields = ref({
+      id: "",
+      orderId: "",
+      orderNo: "",
+      returnType: "",
+      interfaceType: "",
+      requestData: "",
+      apiUrl: "",
+      responseData: "",
+      httpStatusCode: "",
+      returnCount: "",
+      requestCode: "",
+      returnStatus: "",
+      lastReturnTime: "",
+      successTime: "",
+      failureReason: "",
+    });
+
+    // 3. 缂栬緫琛ㄥ崟閰嶇疆锛氬尯鍒嗗繀濉」锛岄�傞厤瀛楁绫诲瀷
+    const editFormOptions = ref([
+      [
+        {
+          title: "鍗曟嵁涓昏〃ID",
+          required: true,
+          field: "orderId",
+          type: "int",
+        },
+        {
+          title: "鍗曟嵁缂栧彿",
+          required: true,
+          field: "orderNo",
+          type: "string",
+        },
+        {
+          title: "鍥炰紶绫诲瀷",
+          required: true,
+          field: "returnType",
+          type: "select", // 鏋氫妇绫诲瀷鐢ㄤ笅鎷夋
+          data: [
+            { label: "鏁村崟", value: 1 },
+            { label: "鍒嗘壒", value: 2 },
+          ],
+        },
+      ],
+      [
+        {
+          title: "鍥炰紶鎺ュ彛绫诲瀷",
+          required: true,
+          field: "interfaceType",
+          type: "select",
+          data: [
+            { label: "鍑哄簱", value: 1 },
+            { label: "鍏ュ簱", value: 2 },
+            { label: "璋冩嫧", value: 3 },
+          ],
+        },
+        {
+          title: "API鍦板潃",
+          required: true,
+          field: "apiUrl",
+          type: "string",
+        },
+        {
+          title: "璇锋眰浠g爜",
+          required: true,
+          field: "requestCode",
+          type: "string",
+        },
+      ],
+      [
+        {
+          title: "鍥炰紶娆℃暟",
+          required: true,
+          field: "returnCount",
+          type: "int",
+        },
+        {
+          title: "鍥炰紶鐘舵��",
+          required: true,
+          field: "returnStatus",
+          type: "select",
+          data: [
+            { label: "鍥炰紶鎴愬姛", value: 1 },
+            { label: "鍥炰紶澶辫触", value: 2 },
+          ],
+        },
+        {
+          title: "HTTP鐘舵�佺爜",
+          field: "httpStatusCode",
+          type: "int",
+        },
+      ],
+      [
+        {
+          title: "鍥炰紶鏁版嵁(JSON)",
+          required: true,
+          field: "requestData",
+          type: "textarea", // 澶ф枃鏈敤鏂囨湰鍩�
+          rows: 4,
+        },
+        {
+          title: "杩斿洖鎶ユ枃(JSON)",
+          field: "responseData",
+          type: "textarea",
+          rows: 4,
+        },
+      ],
+      [
+        {
+          title: "鏈�鍚庡洖浼犳椂闂�",
+          field: "lastReturnTime",
+          type: "datetime",
+        },
+        {
+          title: "鍥炰紶鎴愬姛鏃堕棿",
+          field: "successTime",
+          type: "datetime",
+        },
+        {
+          title: "澶辫触鍘熷洜",
+          field: "failureReason",
+          type: "textarea",
+          rows: 3,
+        },
+      ],
+    ]);
+
+    // 4. 鎼滅储琛ㄥ崟瀛楁锛氶厤缃父鐢ㄦ悳绱㈤」
+    const searchFormFields = ref({
+      orderNo: "",
+      returnType: "",
+      interfaceType: "",
+      returnStatus: "",
+      requestCode: "",
+    });
+
+    // 5. 鎼滅储琛ㄥ崟閰嶇疆锛氶�傞厤鎼滅储绫诲瀷
+    const searchFormOptions = ref([
+      [
+        { title: "鍗曟嵁缂栧彿", field: "orderNo", type: "like" },
+        {
+          title: "鍥炰紶绫诲瀷",
+          field: "returnType",
+          type: "select",
+          data: [
+            { label: "鏁村崟", value: 1 },
+            { label: "鍒嗘壒", value: 2 },
+          ],
+        },
+        {
+          title: "鍥炰紶鎺ュ彛绫诲瀷",
+          field: "interfaceType",
+          type: "select",
+          data: [
+            { label: "鍑哄簱", value: 1 },
+            { label: "鍏ュ簱", value: 2 },
+            { label: "璋冩嫧", value: 3 },
+          ],
+        },
+      ],
+      [
+        {
+          title: "鍥炰紶鐘舵��",
+          field: "returnStatus",
+          type: "select",
+          data: [
+            { label: "鍥炰紶鎴愬姛", value: 1 },
+            { label: "鍥炰紶澶辫触", value: 2 },
+          ],
+        },
+        { title: "璇锋眰浠g爜", field: "requestCode", type: "like" },
+      ],
+    ]);
+
+    // 6. 琛ㄦ牸鍒楅厤缃細瀹屽叏鍖归厤C#瀹炰綋瀛楁
+    const columns = ref([
+      {
+        field: "id",
+        title: "涓婚敭ID",
+        type: "int",
+        width: 80,
+        hidden: true, // 涓婚敭榛樿闅愯棌
+        readonly: true,
+        align: "left",
+      },
+      {
+        field: "orderId",
+        title: "鍗曟嵁涓昏〃ID",
+        type: "int",
+        width: 100,
+        align: "left",
+      },
+      {
+        field: "orderNo",
+        title: "鍗曟嵁缂栧彿",
+        type: "string",
+        width: 120,
+        align: "left",
+      },
+      
+      {
+        field: "interfaceType",
+        title: "鎺ュ彛绫诲瀷",
+        type: "int",
+        width: 90,
+        align: "left",
+        formatter: (row) => {
+          const map = { 1: "鍑哄簱", 2: "鍏ュ簱", 3: "璋冩嫧" };
+          return map[row.interfaceType] || "-";
+        },
+      },
+      {
+        field: "apiUrl",
+        title: "API鍦板潃",
+        type: "string",
+        width: 200,
+        align: "left",
+      },
+      {
+        field: "returnCount",
+        title: "鍥炰紶娆℃暟",
+        type: "int",
+        width: 80,
+        align: "center",
+      },
+      {
+        field: "returnStatus",
+        title: "鍥炰紶鐘舵��",
+        type: "int",
+        width: 90,
+        align: "center",
+        formatter: (row) => {
+          return row.returnStatus === 1 
+            ? '<span style="color: green;">鎴愬姛</span>' 
+            : '<span style="color: red;">澶辫触</span>';
+        },
+      },
+      {
+        field: "httpStatusCode",
+        title: "HTTP鐘舵�佺爜",
+        type: "int",
+        width: 100,
+        align: "center",
+      },
+      {
+        field: "lastReturnTime",
+        title: "鏈�鍚庡洖浼犳椂闂�",
+        type: "datetime",
+        width: 180,
+        align: "left",
+      },
+      {
+        field: "successTime",
+        title: "鎴愬姛鏃堕棿",
+        type: "datetime",
+        width: 180,
+        align: "left",
+      },
+      {
+        field: "requestCode",
+        title: "璇锋眰浠g爜",
+        type: "string",
+        width: 100,
+        align: "left",
+      },
+      {
+        field: "failureReason",
+        title: "澶辫触鍘熷洜",
+        type: "string",
+        width: 200,
+        align: "left",
+        
+      },
+      {
+        field: "requestData",
+        title: "鍥炰紶鏁版嵁",
+        type: "string",
+        width: 150,
+        align: "left",
+        hidden: true, // 澶ф枃鏈粯璁ら殣钘忥紝鍙�氳繃鍒楅厤缃樉绀�
+      },
+      {
+        field: "responseData",
+        title: "杩斿洖鎶ユ枃",
+        type: "string",
+        width: 150,
+        align: "left",
+      },
+    ]);
+
+    // 7. 璇︽儏閰嶇疆锛氶�傞厤鏂板疄浣�
+    const detail = ref({
+      cnName: "鎺ュ彛鍥炰紶璁板綍璇︽儏",
+      table: "returnRecord",
+      columns: [],
+      sortName: "id",
+    });
+
+    return {
+      table,
+      extend,
+      editFormFields,
+      editFormOptions,
+      searchFormFields,
+      searchFormOptions,
+      columns,
+      detail,
+    };
+  },
+});
+</script>
\ No newline at end of file
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/views/inbound/Dt_AllocateOrder.vue" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/views/inbound/Dt_AllocateOrder.vue"
index ccad4ca..e1cb806 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/views/inbound/Dt_AllocateOrder.vue"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/views/inbound/Dt_AllocateOrder.vue"
@@ -293,7 +293,7 @@
         align: "left",
       },
       {
-        field: "modifier",
+        field: "operator",
         title: "淇敼浜�",
         type: "string",
         width: 100,
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/views/inbound/inboundOrder.vue" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/views/inbound/inboundOrder.vue"
index 06a8a53..7591b62 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/views/inbound/inboundOrder.vue"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/views/inbound/inboundOrder.vue"
@@ -193,7 +193,7 @@
         align: "left",
       },
       {
-        field: "modifier",
+        field: "operator",
         title: "淇敼浜�",
         type: "string",
         width: 100,
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/BigGreenService/BigGreenService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/BigGreenService/BigGreenService.cs"
index 3ed522c..2c3797e 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/BigGreenService/BigGreenService.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/BigGreenService/BigGreenService.cs"
@@ -1,5 +1,6 @@
 锘縰sing IBigBreenService;
 using Microsoft.IdentityModel.Tokens;
+using OfficeOpenXml.FormulaParsing.Excel.Functions.DateTime;
 using SqlSugar;
 using System;
 using System.Collections.Generic;
@@ -14,6 +15,7 @@
 using WIDESEA_Core.BaseRepository;
 using WIDESEA_Core.Helper;
 using WIDESEA_Model.Models;
+using WIDESEA_Model.Models.Basic;
 
 namespace BigGreenService
 {
@@ -27,8 +29,9 @@
         private readonly IRepository<Dt_Task_Hty> _taskHtyRepository;
         private readonly IRepository<Dt_Task> _taskRepository;
         private readonly IRepository<Dt_StockInfo> _stockInfoRepository;
+        private readonly IRepository<Dt_MaterialExpirationDate> _materialExpirationDateRepository;
 
-        public BigGreenService(IRepository<Dt_StockInfoDetail> stockInfoDetailRepository, IRepository<Dt_OutboundOrder> outBoundOrderRepository, IRepository<Dt_LocationInfo> locationInfoRepository,IRepository<Dt_OutboundOrderDetail> outBoundOrderDetailRepository, IRepository<Dt_InboundOrderDetail> inboundOrderDetailRepository,IRepository<Dt_Task> taskRepository,IRepository<Dt_Task_Hty> taskHtyRepository, IRepository<Dt_StockInfo> stockInfoRepository)
+        public BigGreenService(IRepository<Dt_StockInfoDetail> stockInfoDetailRepository, IRepository<Dt_OutboundOrder> outBoundOrderRepository, IRepository<Dt_LocationInfo> locationInfoRepository, IRepository<Dt_OutboundOrderDetail> outBoundOrderDetailRepository, IRepository<Dt_InboundOrderDetail> inboundOrderDetailRepository, IRepository<Dt_Task> taskRepository, IRepository<Dt_Task_Hty> taskHtyRepository, IRepository<Dt_StockInfo> stockInfoRepository, IRepository<Dt_MaterialExpirationDate> materialExpirationDateRepository)
         {
             _stockInfoDetailRepository = stockInfoDetailRepository;
             _outBoundOrderRepository = outBoundOrderRepository;
@@ -38,6 +41,7 @@
             _taskRepository = taskRepository;
             _taskHtyRepository = taskHtyRepository;
             _stockInfoRepository = stockInfoRepository;
+            _materialExpirationDateRepository = materialExpirationDateRepository;
         }
         public WebResponseContent GetBigGreenData()
         {
@@ -50,27 +54,28 @@
                 (int)OutOrderStatusEnum.鍑哄簱涓�,
                 (int)OutOrderStatusEnum.鏈紑濮�
             };
-            var unOutBound =_outBoundOrderRepository.Db.Queryable<Dt_OutboundOrder>().Where(x =>targetStatus.Contains(x.OrderStatus)).Count();
+            var unOutBound = _outBoundOrderRepository.Db.Queryable<Dt_OutboundOrder>().Where(x => targetStatus.Contains(x.OrderStatus)).Count();
 
             //璁$畻搴撲綅鍒╃敤鐜�
-            var freeLocation =_locationInfoRepository.Db.Queryable<Dt_LocationInfo>().Where(x=>x.LocationStatus==(int)LocationStatusEnum.Free).Count();
-            var inStockLocation =_locationInfoRepository.Db.Queryable<Dt_LocationInfo>().Where(x => x.LocationStatus == (int)LocationStatusEnum.InStock || x.LocationStatus == (int)LocationStatusEnum.Pallet).Count();
+            var freeLocation = _locationInfoRepository.Db.Queryable<Dt_LocationInfo>().Where(x => x.LocationStatus == (int)LocationStatusEnum.Free).Count();
+            var inStockLocation = _locationInfoRepository.Db.Queryable<Dt_LocationInfo>().Where(x => x.LocationStatus == (int)LocationStatusEnum.InStock || x.LocationStatus == (int)LocationStatusEnum.Pallet).Count();
             int totalLocation = freeLocation + inStockLocation;
             decimal locationUtilizationRate = totalLocation == 0
                 ? 0
-                : Math.Round((decimal)inStockLocation / totalLocation, 4)*100;
+                : Math.Round((decimal)inStockLocation / totalLocation, 4) * 100;
 
             //璁$畻鍏ュ簱浠诲姟鍜屽嚭搴撲换鍔″畬鎴愭暟閲�
-            var inboundCount =_taskHtyRepository.Db.Queryable<Dt_Task_Hty>().Where(x => x.TaskType >= 500 && x.TaskType < 900 && x.CreateDate.ToString("yyyy-MM-dd") == DateTime.Now.ToString("yyyy-MM-dd")).Count();
-            var outboundCount =_taskHtyRepository.Db.Queryable<Dt_Task_Hty>().Where(x => x.TaskType >= 100 && x.TaskType < 500 && x.CreateDate.ToString("yyyy-MM-dd") == DateTime.Now.ToString("yyyy-MM-dd")).Count();
+            var inboundCount = _taskHtyRepository.Db.Queryable<Dt_Task_Hty>().Where(x => x.TaskType >= 500 && x.TaskType < 900 && x.CreateDate.ToString("yyyy-MM-dd") == DateTime.Now.ToString("yyyy-MM-dd")).Count();
+            var outboundCount = _taskHtyRepository.Db.Queryable<Dt_Task_Hty>().Where(x => x.TaskType >= 100 && x.TaskType < 500 && x.CreateDate.ToString("yyyy-MM-dd") == DateTime.Now.ToString("yyyy-MM-dd")).Count();
 
             //璁$畻鏈夎揣鏂欑鏁伴噺
-            var inStockPallet = _stockInfoRepository.Db.Queryable<Dt_StockInfo>().Where(x => x.PalletType ==(int) PalletTypeEnum.None && !string.IsNullOrEmpty(x.LocationCode)).Count();
+            var inStockPallet = _stockInfoRepository.Db.Queryable<Dt_StockInfo>().Where(x => x.PalletType == (int)PalletTypeEnum.None && !string.IsNullOrEmpty(x.LocationCode)).Count();
             //璁$畻绌虹鏁伴噺
             var freeStockPallet = _stockInfoRepository.Db.Queryable<Dt_StockInfo>().Where(x => x.PalletType == (int)PalletTypeEnum.Empty && !string.IsNullOrEmpty(x.LocationCode)).Count();
             // 4. 鑾峰彇杩�7鏃ユ瘡鏃ュ嚭鍏ュ簱鏄庣粏锛堟牳蹇冧慨鏀癸細璋冪敤涓婇潰鐨勬柟娉曪級
             var dailyInOutBoundList = Get7DaysDailyInOutBound();
 
+            var nearExpirationList = GetMaterialsNearExpiration();
             //鑾峰彇浣滀笟缁熻
             var completeTask = SimpleStatistics();
             //浠诲姟
@@ -78,7 +83,7 @@
 
             var bigGreenData = new BigGreenDataDto
             {
-                TotalStockQuantity=totalStockQuantity,
+                TotalStockQuantity = totalStockQuantity,
                 UnOutBoundOrderCount = unOutBound,
                 LocationUtilizationRate = locationUtilizationRate,
                 DailyInOutBoundList = dailyInOutBoundList,
@@ -87,7 +92,8 @@
                 OutboundCount = outboundCount,
                 InStockPallet = inStockPallet,
                 FreeStockPallet = freeStockPallet,
-                CompleteTask = completeTask
+                CompleteTask = completeTask,
+                NearExpirationList = nearExpirationList
             };
             return WebResponseContent.Instance.OK(data: bigGreenData);
         }
@@ -120,13 +126,12 @@
                 })
                 .ToList()
                 .GroupBy(x => x.Date)
-                .ToDictionary(k => k.Key , g => g.Sum(x => (decimal?)x.OverOutQuantity) ?? 0); // 杞负瀛楀吀鏂逛究鍖归厤
+                .ToDictionary(k => k.Key, g => g.Sum(x => (decimal?)x.OverOutQuantity) ?? 0); // 杞负瀛楀吀鏂逛究鍖归厤
 
             // 3. 鏌ヨ姣忔棩鍏ュ簱鏄庣粏锛堟寜鏃ユ湡鍒嗙粍锛�
             var dailyInboundList = _inboundOrderDetailRepository.Db
                 .Queryable<Dt_InboundOrderDetail>()
-                .Where(x => x.CreateDate != null // 杩囨护绌烘棩鏈�
-                         && x.CreateDate >= startDate
+                .Where(x => x.CreateDate >= startDate
                          && x.CreateDate < endDate.AddDays(1))
                 .Select(x => new
                 {
@@ -134,7 +139,7 @@
                     x.OverInQuantity
                 })
                 .ToList()
-                .GroupBy(x=>x.Date)
+                .GroupBy(x => x.Date)
                 .ToDictionary(k => k.Key, g => g.Sum(x => (decimal?)x.OverInQuantity) ?? 0); // 杞负瀛楀吀鏂逛究鍖归厤
 
             // 4. 鍚堝苟姣忔棩鏁版嵁锛堢‘淇�7澶╂棩鏈熷畬鏁达紝鏃犳暟鎹ˉ0锛�
@@ -143,7 +148,7 @@
                 Date = date,
                 DailyOutboundQuantity = dailyOutboundList.ContainsKey(date) ? dailyOutboundList[date] : 0,
                 DailyInboundQuantity = dailyInboundList.ContainsKey(date) ? dailyInboundList[date] : 0,
-               
+
             }).ToList();
 
             return dailyInOutBoundList;
@@ -159,7 +164,7 @@
                     (int)t.TaskType >= 100 && (int)t.TaskType <= 299 ? "鍑哄簱" :
                     (int)t.TaskType >= 500 && (int)t.TaskType <= 699 ? "鍏ュ簱" : "鍏朵粬"
                 )
-                .Where(g => g.Key == "鍑哄簱" || g.Key == "鍏ュ簱") 
+                .Where(g => g.Key == "鍑哄簱" || g.Key == "鍏ュ簱")
                 .Select(g => new SimpleStatisticsDTO
                 {
                     TaskType = g.Key,
@@ -233,6 +238,8 @@
             public int FreeStockPallet { get; set; }
 
             public List<SimpleStatisticsDTO> CompleteTask { get; set; }
+
+            public NearExpirationDTO NearExpirationList { get; set; }
         }
 
         /// <summary>
@@ -263,6 +270,84 @@
             public int Count { get; set; }
         }
 
+        public class NearExpirationDTO
+        {
+            public int DaysToExpiration { get; set; }
 
+            public List<Dt_StockInfoDetail> Details { get; set; }
+
+            public string LocationCode { get; set; }
+
+            public string PalletCode { get; set; }
+        }
+
+        ///<summary>
+        ///鑾峰彇杩�30澶╄杩囨湡鐨勭墿鏂�
+        /// </summary>
+        public NearExpirationDTO GetMaterialsNearExpiration()
+        {
+            // 鍒濆鍖栬繑鍥濪TO
+            var resultDTO = new NearExpirationDTO
+            {
+                Details = new List<Dt_StockInfoDetail>(),
+                LocationCode = string.Empty,
+                PalletCode = string.Empty,
+                DaysToExpiration = 0 // 鍒濆鍖栧ぉ鏁�
+            };
+
+            DateTime currentTime = DateTime.Now;
+            DateTime thirtyDaysLater = currentTime.AddDays(30);
+
+            // 绛涢��30澶╁唴杩囨湡鐨勫簱瀛樻槑缁�
+            var nearExpirationList = _stockInfoDetailRepository.Db.Queryable<Dt_StockInfoDetail>()
+                .Where(x => (x.ValidDate.Value - x.CreateDate).TotalDays <= 30)
+                .ToList();
+
+            // 鏃犵鍚堟潯浠剁殑鏄庣粏锛岀洿鎺ヨ繑鍥�
+            if (!nearExpirationList.Any())
+            {
+                return resultDTO;
+            }
+
+            
+            var firstStockId = nearExpirationList.First().StockId;
+           
+            var stock = _stockInfoRepository.Db.Queryable<Dt_StockInfo>()
+                .First(x => x.Id == firstStockId);
+
+            
+            if (stock == null)
+            {
+                return resultDTO;
+            }
+
+            
+            resultDTO.LocationCode = stock.LocationCode;
+            resultDTO.PalletCode = stock.PalletCode;
+
+           
+            int minDaysToExpiration = int.MaxValue; 
+            foreach (var detail in nearExpirationList)
+            {
+                
+                TimeSpan totalDaysToExpiration = detail.ValidDate.Value - detail.CreateDate;
+                double remainingDays = totalDaysToExpiration.TotalDays;
+                int daysToExpiration = (int)Math.Ceiling(Math.Max(0, remainingDays));
+
+               
+                if (daysToExpiration < minDaysToExpiration)
+                {
+                    minDaysToExpiration = daysToExpiration;
+                }
+
+                
+                resultDTO.Details.Add(detail);
+            }
+
+           
+            resultDTO.DaysToExpiration = minDaysToExpiration;
+
+            return resultDTO;
+        }
     }
 }
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_AllocateService/AllocateService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_AllocateService/AllocateService.cs"
index c9948d3..1f0a7d0 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_AllocateService/AllocateService.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_AllocateService/AllocateService.cs"
@@ -525,10 +525,12 @@
                 {
                     item.OrderStatus = _InboundOrder.OrderStatus;
                     item.OrderType = _InboundOrder.OrderType;
+                    item.Modifier = _InboundOrder.Operator;
                 }else if (OutboundOrder!=null)
                 {
                     item.OrderStatus = OutboundOrder.OrderStatus;
                     item.OrderType = OutboundOrder.OrderType;
+                    item.Modifier = OutboundOrder.Operator;
                 }
             }
             return new PageGridData<Dt_AllocateOrder>(totalCount, data);
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_IRecordService/IMesReturnRecordService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_IRecordService/IMesReturnRecordService.cs"
new file mode 100644
index 0000000..3357ed4
--- /dev/null
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_IRecordService/IMesReturnRecordService.cs"
@@ -0,0 +1,16 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using WIDESEA_Core.BaseRepository;
+using WIDESEA_Core.BaseServices;
+using WIDESEA_Model.Models;
+
+namespace WIDESEA_IRecordService
+{
+    public interface IMesReturnRecordService : IService<Dt_MesReturnRecord>
+    {
+        IRepository<Dt_MesReturnRecord> Repository { get; }
+    }
+}
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_IRecordService/IRecordService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_IRecordService/IRecordService.cs"
index 5c9e120..dcd6bdb 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_IRecordService/IRecordService.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_IRecordService/IRecordService.cs"
@@ -12,5 +12,7 @@
         ILocationStatusChangeRecordService LocationStatusChangeRecordSetvice { get; }
 
         IStockQuantityChangeRecordService StockQuantityChangeRecordService { get; }
+
+        IMesReturnRecordService MesReturnRecordService { get; }
     }
 }
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_RecordService/MesReturnRecordService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_RecordService/MesReturnRecordService.cs"
new file mode 100644
index 0000000..77c7198
--- /dev/null
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_RecordService/MesReturnRecordService.cs"
@@ -0,0 +1,21 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using WIDESEA_Core.BaseRepository;
+using WIDESEA_Core.BaseServices;
+using WIDESEA_IRecordService;
+using WIDESEA_Model.Models;
+
+namespace WIDESEA_RecordService
+{
+    public class MesReturnRecordService : ServiceBase<Dt_MesReturnRecord, IRepository<Dt_MesReturnRecord>>, IMesReturnRecordService
+    {
+        public MesReturnRecordService(IRepository<Dt_MesReturnRecord> BaseDal) : base(BaseDal)
+        {
+        }
+
+        public IRepository<Dt_MesReturnRecord> Repository => BaseDal;
+    }
+}
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_RecordService/RecordService.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_RecordService/RecordService.cs"
index 5b98765..1b24af3 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_RecordService/RecordService.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_RecordService/RecordService.cs"
@@ -13,6 +13,8 @@
 
         public IStockQuantityChangeRecordService StockQuantityChangeRecordService { get; }
 
+        public IMesReturnRecordService MesReturnRecordService { get; }
+
         public RecordService(ILocationStatusChangeRecordService locationStatusChangeRecordSetvice, IStockQuantityChangeRecordService stockQuantityChangeRecordService)
         {
             LocationStatusChangeRecordSetvice = locationStatusChangeRecordSetvice;
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Record/MesReturnRecordController.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Record/MesReturnRecordController.cs"
new file mode 100644
index 0000000..4b333f4
--- /dev/null
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS\346\227\240\344\273\223\345\202\250\347\211\210/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Record/MesReturnRecordController.cs"
@@ -0,0 +1,16 @@
+锘縰sing Microsoft.AspNetCore.Mvc;
+using WIDESEA_Core.BaseController;
+using WIDESEA_IRecordService;
+using WIDESEA_Model.Models;
+
+namespace WIDESEA_WMSServer.Controllers.Record
+{
+    [Route("api/MesReturnRecord")]
+    [ApiController]
+    public class MesReturnRecordController : ApiBaseController<IMesReturnRecordService, Dt_MesReturnRecord>
+    {
+        public MesReturnRecordController(IMesReturnRecordService service) : base(service)
+        {
+        }
+    }
+}

--
Gitblit v1.9.3