From 1e8ca092e08494e78c398c6262aff94ac5a5bb22 Mon Sep 17 00:00:00 2001
From: heshaofeng <heshaofeng@hnkhzn.com>
Date: 星期四, 04 十二月 2025 10:42:58 +0800
Subject: [PATCH] Merge branch 'master' of http://115.159.85.185:8098/r/ZhongRui/ALDbanyunxiangmu

---
 项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_CheckService/ReCheckOrderService.cs                                |   20 
 项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Inbound/InboundOrderController.cs            |   24 
 项目代码/WIDESEA_WMSClient/src/views/outbound/BatchPickingConfirm.vue                                         |  608 ++++++++++++++++++++---------------
 项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_OutboundService/OutboundPickingService.cs                          |    7 
 项目代码/WMS无仓储版/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.878.3237/CodeChunks.db-shm      |    0 
 项目代码/WMS无仓储版/WIDESEA_WMSServer/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.878.3237/SemanticSymbols.db-shm |    0 
 项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_Core/BaseRepository/RepositoryBase.cs                              |  327 +++++++++++++++----
 7 files changed, 637 insertions(+), 349 deletions(-)

diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/views/outbound/BatchPickingConfirm.vue" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/views/outbound/BatchPickingConfirm.vue"
index b73d987..c98438a 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/views/outbound/BatchPickingConfirm.vue"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WIDESEA_WMSClient/src/views/outbound/BatchPickingConfirm.vue"
@@ -92,7 +92,7 @@
     </div>
 
     <!-- 鎷嗗寘寮圭獥 -->
-    <div v-if="showCustomSplitDialog" class="custom-dialog-overlay">
+    <div  v-show="showCustomSplitDialog" class="custom-dialog-overlay">
       <div class="custom-dialog-wrapper">
         <div class="custom-dialog">
           <div class="custom-dialog-header">
@@ -154,7 +154,7 @@
     </div>
 
     <!-- 鎾ら攢鎷嗗寘寮圭獥 -->
-    <div v-if="showRevertSplitDialog" class="custom-dialog-overlay">
+    <div  v-show="showRevertSplitDialog" class="custom-dialog-overlay">
       <div class="custom-dialog-wrapper">
         <div class="custom-dialog">
           <div class="custom-dialog-header">
@@ -214,7 +214,7 @@
     </div>
 
     <!-- 鎷嗗寘閾句俊鎭脊绐� -->
-<div v-if="showSplitChainDialog" class="custom-dialog-overlay">
+<div v-show="showSplitChainDialog" class="custom-dialog-overlay">
   <div class="custom-dialog-wrapper">
     <div class="custom-dialog" style="width: 750px;">
       <div class="custom-dialog-header">
@@ -501,11 +501,87 @@
           { required: true, message: '璇疯緭鍏ユ墭鐩樼爜', trigger: 'blur' }
         ]
       },
+       // 寮圭獥鐘舵�� - 鏀逛负浣跨敤瀵硅薄绠$悊锛岄伩鍏嶅悓鏃舵墦寮�澶氫釜寮圭獥
+      dialogs: {
+        customSplit: false,
+        revertSplit: false,
+        splitChain: false,
+        batchReturn: false,
+        emptyPallet: false
+      },
       
+      // 鍔犺浇鐘舵��
+      loading: {
+        split: false,
+        revertSplit: false,
+        batchReturn: false,
+        emptyPallet: false,
+        splitChain: false
+      },
+      
+      // 褰撳墠娲诲姩鐨勫脊绐楃被鍨�
+      activeDialog: null,
       isProcessing: false
     }
   },
   computed: {
+     // 璁$畻灞炴�ф槧灏勫埌dialogs瀵硅薄
+    showCustomSplitDialog: {
+      get() { return this.dialogs.customSplit; },
+      set(val) { 
+        this.dialogs.customSplit = val;
+        this.activeDialog = val ? 'customSplit' : null;
+      }
+    },
+    showRevertSplitDialog: {
+      get() { return this.dialogs.revertSplit; },
+      set(val) { 
+        this.dialogs.revertSplit = val;
+        this.activeDialog = val ? 'revertSplit' : null;
+      }
+    },
+    showSplitChainDialog: {
+      get() { return this.dialogs.splitChain; },
+      set(val) { 
+        this.dialogs.splitChain = val;
+        this.activeDialog = val ? 'splitChain' : null;
+      }
+    },
+    showBatchReturnDialog: {
+      get() { return this.dialogs.batchReturn; },
+      set(val) { 
+        this.dialogs.batchReturn = val;
+        this.activeDialog = val ? 'batchReturn' : null;
+      }
+    },
+    showEmptyPalletDialog: {
+      get() { return this.dialogs.emptyPallet; },
+      set(val) { 
+        this.dialogs.emptyPallet = val;
+        this.activeDialog = val ? 'emptyPallet' : null;
+      },
+    },
+     // 鍔犺浇鐘舵�佹槧灏�
+    splitLoading: {
+      get() { return this.loading.split; },
+      set(val) { this.loading.split = val; }
+    },
+    revertSplitLoading: {
+      get() { return this.loading.revertSplit; },
+      set(val) { this.loading.revertSplit = val; }
+    },
+    batchReturnLoading: {
+      get() { return this.loading.batchReturn; },
+      set(val) { this.loading.batchReturn = val; }
+    },
+    emptypalletOutLoading: {
+      get() { return this.loading.emptyPallet; },
+      set(val) { this.loading.emptyPallet = val; }
+    },
+    splitChainLoading: {
+      get() { return this.loading.splitChain; },
+      set(val) { this.loading.splitChain = val; }
+    },
     // 鏄惁鍙互鍙栨秷鏁翠釜鎷嗗寘閾�
     canCancelWholeChain() {
       return this.splitChainInfo.splitChain && 
@@ -574,10 +650,23 @@
         this.$message.warning('璇峰厛鎵弿鎵樼洏鐮�');
         return;
       }
-      this.showCustomSplitDialog = true;
-      this.resetSplitForm();
-      this.splitForm.orderNo = this.scanData.orderNo;
-      this.splitForm.palletCode = this.scanData.palletCode;
+         // 鍏抽棴鍏朵粬鎵�鏈夊脊绐�
+      this.closeAllDialogs();
+        // 寤惰繜鎵撳紑鏂板脊绐楋紝纭繚鍏朵粬寮圭獥瀹屽叏鍏抽棴
+      this.$nextTick(() => {
+        this.showCustomSplitDialog = true;
+        this.resetSplitForm();
+        this.splitForm.orderNo = this.scanData.orderNo;
+        this.splitForm.palletCode = this.scanData.palletCode;
+        
+        // 纭繚杈撳叆妗嗚幏寰楃劍鐐�
+        this.$nextTick(() => {
+          const inputs = document.querySelectorAll('.custom-dialog input');
+          if (inputs.length > 0) {
+            inputs[0].focus();
+          }
+        });
+      });
     },
 
     async onSplitBarcodeScan() {
@@ -608,30 +697,29 @@
 
     async handleSplitPackage() {
       if (this.$refs.splitFormRef) {
-        this.$refs.splitFormRef.validate(async (valid) => {
-          if (valid) {
-            this.splitLoading = true;
-            try {
-              const res = await http.post('/api/OutboundBatchPicking/split-package', {
-                orderNo: this.splitForm.orderNo,
-                palletCode: this.splitForm.palletCode,
-                originalBarcode: this.splitForm.originalBarcode,
-                splitQuantity: this.splitForm.splitQuantity
-              });
-              if (res.status) {
-                this.$message.success('鎷嗗寘鎴愬姛');
-                this.showCustomSplitDialog = false;
-                await this.loadPalletData();
-              } else {
-                this.$message.error(res.message || '鎷嗗寘澶辫触');
-              }
-            } catch (error) {
-              this.$message.error('鎷嗗寘澶辫触');
-            } finally {
-              this.splitLoading = false;
-            }
+        const valid = await this.$refs.splitFormRef.validate();
+        if (!valid) return;
+        
+        this.splitLoading = true;
+        try {
+          const res = await http.post('/api/OutboundBatchPicking/split-package', {
+            orderNo: this.splitForm.orderNo,
+            palletCode: this.splitForm.palletCode,
+            originalBarcode: this.splitForm.originalBarcode,
+            splitQuantity: this.splitForm.splitQuantity
+          });
+          if (res.status) {
+            this.$message.success('鎷嗗寘鎴愬姛');
+            this.showCustomSplitDialog = false;
+            await this.loadPalletData();
+          } else {
+            this.$message.error(res.message || '鎷嗗寘澶辫触');
           }
-        });
+        } catch (error) {
+          this.$message.error('鎷嗗寘澶辫触: ' + (error.message || '缃戠粶閿欒'));
+        } finally {
+          this.splitLoading = false;
+        }
       }
     },
 // 鍦ㄦ媶鍖呭脊绐椾腑鏌ョ湅鎷嗗寘閾�
@@ -651,38 +739,34 @@
 },
     // 鎾ら攢鎷嗗寘
     async onRevertSplitBarcodeScan() {
-      if (!this.revertSplitForm.newBarcode) return;
+        if (!this.revertSplitForm.newBarcode) return;
       this.revertSplitForm.newBarcode = this.revertSplitForm.newBarcode.replace(/\n/g, '').trim();
-      
-      // 鏂板锛氭壂鎻忓悗鑷姩鏄剧ず鎷嗗寘閾句俊鎭�
-      await this.viewSplitChain(this.revertSplitForm.newBarcode);
     },
 
     async handleRevertSplit() {
-      if (this.$refs.revertSplitFormRef) {
-        this.$refs.revertSplitFormRef.validate(async (valid) => {
-          if (valid) {
-            this.revertSplitLoading = true;
-            try {
-              const res = await http.post('/api/OutboundBatchPicking/cancel-split', {
-                orderNo: this.scanData.orderNo,
-                palletCode: this.scanData.palletCode,
-                newBarcode: this.revertSplitForm.newBarcode
-              });
-              if (res.status) {
-                this.$message.success('鎾ら攢鎷嗗寘鎴愬姛');
-                this.showRevertSplitDialog = false;
-                await this.loadPalletData();
-              } else {
-                this.$message.error(res.message || '鎾ら攢鎷嗗寘澶辫触');
-              }
-            } catch (error) {
-              this.$message.error('鎾ら攢鎷嗗寘澶辫触');
-            } finally {
-              this.revertSplitLoading = false;
-            }
+       if (this.$refs.revertSplitFormRef) {
+        const valid = await this.$refs.revertSplitFormRef.validate();
+        if (!valid) return;
+        
+        this.revertSplitLoading = true;
+        try {
+          const res = await http.post('/api/OutboundBatchPicking/cancel-split', {
+            orderNo: this.scanData.orderNo,
+            palletCode: this.scanData.palletCode,
+            newBarcode: this.revertSplitForm.newBarcode
+          });
+          if (res.status) {
+            this.$message.success('鎾ら攢鎷嗗寘鎴愬姛');
+            this.showRevertSplitDialog = false;
+            await this.loadPalletData();
+          } else {
+            this.$message.error(res.message || '鎾ら攢鎷嗗寘澶辫触');
           }
-        });
+        } catch (error) {
+          this.$message.error('鎾ら攢鎷嗗寘澶辫触: ' + (error.message || '缃戠粶閿欒'));
+        } finally {
+          this.revertSplitLoading = false;
+        }
       }
     },
 // 鏌ユ壘瀹屾暣鎷嗗寘閾撅紙浠庢牴鏉$爜寮�濮嬶級
@@ -709,39 +793,45 @@
     // 鎷嗗寘閾剧浉鍏虫柟娉�
    // 鏌ョ湅鎷嗗寘閾句俊鎭�
 async viewSplitChain(barcode) {
-  if (!barcode) {
-    this.$message.warning('璇峰厛杈撳叆鏉$爜');
-    return;
-  }
-  
-  this.splitChainLoading = true;
-  try {
-    const res = await http.post('/api/OutboundBatchPicking/split-package-chain-info', {
-      orderNo: this.scanData.orderNo,
-      barcode: barcode
-    });
-    
-    if (res.status) {
-      this.splitChainInfo = res.data;
-      
-      // 鏄剧ず鎻愮ず淇℃伅锛屽憡璇夌敤鎴疯繖鏄粈涔堢被鍨嬬殑鎷嗗寘閾�
-      let chainType = "褰撳墠鏉$爜鐨勬媶鍖呴摼";
-      if (this.splitChainInfo.chainType === 'root') {
-        chainType = "瀹屾暣鎷嗗寘閾撅紙浠庡師濮嬫潯鐮佸紑濮嬶級";
-      } else if (this.splitChainInfo.chainType === 'branch') {
-        chainType = "鍒嗘敮鎷嗗寘閾�";
+   if (!barcode) {
+        this.$message.warning('璇峰厛杈撳叆鏉$爜');
+        return;
       }
       
-      this.$message.info(`宸插姞杞�${chainType}锛屽叡${this.splitChainInfo.totalSplitTimes}娆℃媶鍖卄);
-      this.showSplitChainDialog = true;
-    } else {
-      this.$message.error(res.message || '鑾峰彇鎷嗗寘閾句俊鎭け璐�');
-    }
-  } catch (error) {
-    this.$message.error('鑾峰彇鎷嗗寘閾句俊鎭け璐�');
-  } finally {
-    this.splitChainLoading = false;
-  }
+      this.splitChainLoading = true;
+      try {
+        const res = await http.post('/api/OutboundBatchPicking/split-package-chain-info', {
+          orderNo: this.scanData.orderNo,
+          barcode: barcode
+        });
+        
+        if (res.status) {
+          this.splitChainInfo = res.data;
+          
+          // 鍏抽棴鍏朵粬寮圭獥鍚庡啀鎵撳紑鎷嗗寘閾惧脊绐�
+          this.closeAllDialogs();
+          
+          await this.$nextTick(() => {
+            this.showSplitChainDialog = true;
+            
+            // 鏄剧ず鎻愮ず淇℃伅
+            let chainType = "褰撳墠鏉$爜鐨勬媶鍖呴摼";
+            if (this.splitChainInfo.chainType === 'root') {
+              chainType = "瀹屾暣鎷嗗寘閾撅紙浠庡師濮嬫潯鐮佸紑濮嬶級";
+            } else if (this.splitChainInfo.chainType === 'branch') {
+              chainType = "鍒嗘敮鎷嗗寘閾�";
+            }
+            
+            this.$message.info(`宸插姞杞�${chainType}锛屽叡${this.splitChainInfo.totalSplitTimes}娆℃媶鍖卄);
+          });
+        } else {
+          this.$message.error(res.message || '鑾峰彇鎷嗗寘閾句俊鎭け璐�');
+        }
+      } catch (error) {
+        this.$message.error('鑾峰彇鎷嗗寘閾句俊鎭け璐�: ' + (error.message || '缃戠粶閿欒'));
+      } finally {
+        this.splitChainLoading = false;
+      }
 },
 
     // 鍏抽棴鎷嗗寘閾句俊鎭脊绐�
@@ -788,112 +878,86 @@
 },
     // 鍙栨秷鍗曚釜鎷嗗寘璁板綍
 async cancelSingleSplit(newBarcode) {
-  // 鍏堣褰曞綋鍓嶄俊鎭紝鐒跺悗鍏抽棴寮圭獥
-  const originalBarcode = this.splitChainInfo.originalBarcode;
-  this.closeSplitChainDialog();
-  
-  await this.$nextTick();
-  
-  try {
-    await this.$confirm(
-      `纭畾瑕佸彇娑堟潯鐮� ${newBarcode} 鐨勬媶鍖呮搷浣滃悧锛焋, 
-      '鍙栨秷鍗曚釜鎷嗗寘', 
-      {
-        confirmButtonText: '纭畾鍙栨秷',
-        cancelButtonText: '鍐嶆兂鎯�',
-        type: 'warning'
+   try {
+        await ElMessageBox.confirm(
+          `纭畾瑕佸彇娑堟潯鐮� ${newBarcode} 鐨勬媶鍖呮搷浣滃悧锛焋, 
+          '鍙栨秷鍗曚釜鎷嗗寘', 
+          {
+            confirmButtonText: '纭畾鍙栨秷',
+            cancelButtonText: '鍐嶆兂鎯�',
+            type: 'warning',
+            customClass: 'message-box-top'
+          }
+        );
+        
+        this.revertSplitLoading = true;
+        
+        const res = await http.post('/api/OutboundBatchPicking/cancel-split', {
+          orderNo: this.scanData.orderNo,
+          palletCode: this.scanData.palletCode,
+          newBarcode: newBarcode
+        });
+        
+        if (res.status) {
+          this.$message.success('鍙栨秷鎷嗗寘鎴愬姛');
+          await this.loadPalletData();
+          
+          // 閲嶆柊鍔犺浇鎷嗗寘閾句俊鎭�
+          if (this.splitChainInfo.originalBarcode) {
+            await this.viewSplitChain(this.splitChainInfo.originalBarcode);
+          }
+        } else {
+          this.$message.error(res.message || '鍙栨秷鎷嗗寘澶辫触');
+        }
+      } catch (error) {
+        if (error !== 'cancel') {
+          this.$message.error('鍙栨秷鎷嗗寘澶辫触: ' + error.message);
+        }
+      } finally {
+        this.revertSplitLoading = false;
       }
-    );
-    
-    this.revertSplitLoading = true;
-    
-    const res = await http.post('/api/OutboundBatchPicking/cancel-split', {
-      orderNo: this.scanData.orderNo,
-      palletCode: this.scanData.palletCode,
-      newBarcode: newBarcode
-    });
-    
-    if (res.status) {
-      this.$message.success('鍙栨秷鎷嗗寘鎴愬姛');
-      await this.loadPalletData();
-      // 閲嶆柊鎵撳紑寮圭獥鏄剧ず鏇存柊鍚庣殑鐘舵��
-      await this.viewSplitChain(originalBarcode);
-    } else {
-      this.$message.error(res.message || '鍙栨秷鎷嗗寘澶辫触');
-      await this.viewSplitChain(originalBarcode);
-    }
-  } catch (error) {
-    if (error === 'cancel') {
-      // 鐢ㄦ埛鍙栨秷鍚庨噸鏂版墦寮�寮圭獥
-      await this.viewSplitChain(originalBarcode);
-    } else {
-      this.$message.error('鍙栨秷鎷嗗寘澶辫触');
-      await this.viewSplitChain(originalBarcode);
-    }
-  } finally {
-    this.revertSplitLoading = false;
-  }
 },
 
 // 鍙栨秷鏁翠釜鎷嗗寘閾�  
 async cancelWholeSplitChain() {
-  // 鍏堣褰曞綋鍓嶆媶鍖呴摼淇℃伅锛岀劧鍚庡叧闂脊绐�
-  const originalBarcode = this.splitChainInfo.originalBarcode;
-  this.closeSplitChainDialog();
-  
-  // 缁欎竴鐐规椂闂磋寮圭獥瀹屽叏鍏抽棴
-  await this.$nextTick();
-  
-  try {
-    // 鐜板湪鏄剧ず纭瀵硅瘽妗嗭紝纭繚瀹冨湪鏈�鍓嶉潰
-    await this.$confirm(
-      `纭畾瑕佸彇娑堟暣涓媶鍖呴摼鍚楋紵\n杩欏皢鍙栨秷浠庢潯鐮� ${originalBarcode} 寮�濮嬬殑鎵�鏈夋媶鍖呮搷浣溿�俙, 
-      '鍙栨秷鎷嗗寘閾剧‘璁�', 
-      {
-        confirmButtonText: '纭畾鍙栨秷',
-        cancelButtonText: '鍐嶆兂鎯�',
-        type: 'warning',
-        center: true,
-        closeOnClickModal: false
+  if (!this.canCancelWholeChain) return;
+      
+      try {
+        await ElMessageBox.confirm(
+          `纭畾瑕佸彇娑堟暣涓媶鍖呴摼鍚楋紵\n杩欏皢鍙栨秷浠庢潯鐮� ${this.splitChainInfo.originalBarcode} 寮�濮嬬殑鎵�鏈夋媶鍖呮搷浣溿�俙, 
+          '鍙栨秷鎷嗗寘閾剧‘璁�', 
+          {
+            confirmButtonText: '纭畾鍙栨秷',
+            cancelButtonText: '鍐嶆兂鎯�',
+            type: 'warning',
+            center: true,
+            closeOnClickModal: false,
+            customClass: 'message-box-top'
+          }
+        );
+        
+        this.revertSplitLoading = true;
+        
+        const res = await http.post('/api/OutboundBatchPicking/cancel-split-chain', {
+          orderNo: this.scanData.orderNo,
+          palletCode: this.scanData.palletCode,
+          startBarcode: this.splitChainInfo.originalBarcode
+        });
+        
+        if (res.status) {
+          this.$message.success('鍙栨秷鎷嗗寘閾炬垚鍔�');
+          this.closeSplitChainDialog();
+          await this.loadPalletData();
+        } else {
+          this.$message.error(res.message || '鍙栨秷鎷嗗寘閾惧け璐�');
+        }
+      } catch (error) {
+        if (error !== 'cancel') {
+          this.$message.error('鍙栨秷鎷嗗寘閾惧け璐�: ' + error.message);
+        }
+      } finally {
+        this.revertSplitLoading = false;
       }
-    );
-    
-    // 鐢ㄦ埛纭鍚庢墽琛屽彇娑堟搷浣�
-    this.revertSplitLoading = true;
-    
-    const res = await http.post('/api/OutboundBatchPicking/cancel-split-chain', {
-      orderNo: this.scanData.orderNo,
-      palletCode: this.scanData.palletCode,
-      startBarcode: originalBarcode
-    });
-    
-    console.log('鍙栨秷鎷嗗寘閾惧搷搴�:', res);
-    
-    if (res.status) {
-      this.$message.success('鍙栨秷鎷嗗寘閾炬垚鍔�');
-      await this.loadPalletData();
-      // 鍙�夛細閲嶆柊鎵撳紑鎷嗗寘閾句俊鎭脊绐楁樉绀烘洿鏂板悗鐨勭姸鎬�
-      // await this.viewSplitChain(originalBarcode);
-    } else {
-      this.$message.error(res.message || '鍙栨秷鎷嗗寘閾惧け璐�');
-      // 澶辫触鍚庨噸鏂版墦寮�寮圭獥
-      await this.viewSplitChain(originalBarcode);
-    }
-  } catch (error) {
-    // 鐢ㄦ埛鍙栨秷鎿嶄綔
-    if (error === 'cancel') {
-      console.log('鐢ㄦ埛鍙栨秷浜嗘媶鍖呴摼鎿嶄綔');
-      // 鐢ㄦ埛鍙栨秷鍚庨噸鏂版墦寮�寮圭獥
-      await this.viewSplitChain(originalBarcode);
-    } else {
-      console.error('鍙栨秷鎷嗗寘閾鹃敊璇�:', error);
-      this.$message.error('鍙栨秷鎷嗗寘閾惧け璐�: ' + error.message);
-      // 鍑洪敊鍚庨噸鏂版墦寮�寮圭獥
-      await this.viewSplitChain(originalBarcode);
-    }
-  } finally {
-    this.revertSplitLoading = false;
-  }
 },
 
     // 妫�鏌ユ潯鐮佹槸鍚﹀凡琚垎鎷�
@@ -907,18 +971,31 @@
       const date = new Date(dateTime);
       return `${date.getFullYear()}-${(date.getMonth() + 1).toString().padStart(2, '0')}-${date.getDate().toString().padStart(2, '0')} ${date.getHours().toString().padStart(2, '0')}:${date.getMinutes().toString().padStart(2, '0')}:${date.getSeconds().toString().padStart(2, '0')}`;
     },
-
+ closeAllDialogs() {
+      this.showCustomSplitDialog = false;
+      this.showRevertSplitDialog = false;
+      this.showSplitChainDialog = false;
+      this.showBatchReturnDialog = false;
+      this.showEmptyPalletDialog = false;
+      this.activeDialog = null;
+    },
     // 鍥炲簱鐩稿叧鏂规硶
     openBatchReturnDialog() {
-      if (!this.scanData.palletCode) {
+     if (!this.scanData.palletCode) {
         this.$message.warning('璇峰厛鎵弿鎵樼洏鐮�');
         return;
       }
-      this.showBatchReturnDialog = true;
-      this.batchReturnForm.orderNo = this.scanData.orderNo;
-      this.batchReturnForm.palletCode = this.scanData.palletCode;
-      this.batchReturnForm.unpickedCount = this.summary.unpickedCount;
-      this.batchReturnForm.unpickedQuantity = this.summary.unpickedQuantity;
+      
+      // 鍏抽棴鍏朵粬寮圭獥
+      this.closeAllDialogs();
+      
+      this.$nextTick(() => {
+        this.showBatchReturnDialog = true;
+        this.batchReturnForm.orderNo = this.scanData.orderNo;
+        this.batchReturnForm.palletCode = this.scanData.palletCode;
+        this.batchReturnForm.unpickedCount = this.summary.unpickedCount;
+        this.batchReturnForm.unpickedQuantity = this.summary.unpickedQuantity;
+      });
     },
 
     async handleBatchReturnConfirm() {
@@ -936,7 +1013,7 @@
           this.$message.error(res.message || '鍥炲簱澶辫触');
         }
       } catch (error) {
-        this.$message.error('鍥炲簱澶辫触');
+        this.$message.error('鍥炲簱澶辫触: ' + (error.message || '缃戠粶閿欒'));
       } finally {
         this.batchReturnLoading = false;
       }
@@ -944,9 +1021,14 @@
 
     // 鍙栫┖绠辨柟娉�
     handleEmptyPallet() {
-      this.showEmptyPalletDialog = true;
-      this.emptypalletOutForm.orderNo = this.scanData.orderNo;
-      this.emptypalletOutForm.palletCode = '';
+      // 鍏抽棴鍏朵粬寮圭獥
+      this.closeAllDialogs();
+      
+      this.$nextTick(() => {
+        this.showEmptyPalletDialog = true;
+        this.emptypalletOutForm.orderNo = this.scanData.orderNo;
+        this.emptypalletOutForm.palletCode = '';
+      });
     },
 
     async handleEmptyPalletConfirm() {
@@ -964,7 +1046,7 @@
           this.$message.error(res.message || '鍙栬蛋绌虹澶辫触');
         }
       } catch (error) {
-        this.$message.error('鍙栬蛋绌虹澶辫触');
+        this.$message.error('鍙栬蛋绌虹澶辫触: ' + (error.message || '缃戠粶閿欒'));
       } finally {
         this.emptypalletOutLoading = false;
       }
@@ -972,26 +1054,32 @@
 
     // 鏁版嵁鍔犺浇鏂规硶
     async loadPalletData() {
-      if (!this.scanData.orderNo || !this.scanData.palletCode) return;
+       if (!this.scanData.orderNo || !this.scanData.palletCode) return;
       
-      await this.loadUnpickedList();
-      await this.loadPickedList();
-      await this.loadPalletStatus();
+      try {
+        await Promise.all([
+          this.loadUnpickedList(),
+          this.loadPickedList(),
+          this.loadPalletStatus()
+        ]);
+      } catch (error) {
+        console.error('鍔犺浇鎵樼洏鏁版嵁澶辫触:', error);
+      }
     },
 
     async loadUnpickedList() {
-      try {
+       try {
         const res = await http.post('/api/OutboundBatchPicking/pallet-locks', {
           orderNo: this.scanData.orderNo,
           palletCode: this.scanData.palletCode
         });
         if (res.status) {
-          //this.unpickedList = res.data || [];
           this.unpickedList = (res.data || []).filter(item => item.canPick === true);
           this.summary.unpickedCount = this.unpickedList.length;
           this.summary.unpickedQuantity = this.unpickedList.reduce((sum, item) => sum + (item.remainQuantity || 0), 0);
         }
       } catch (error) {
+        console.error('鍔犺浇鏈嫞閫夊垪琛ㄥけ璐�:', error);
         this.$message.error('鍔犺浇鏈嫞閫夊垪琛ㄥけ璐�');
       }
     },
@@ -1003,25 +1091,20 @@
           palletCode: this.scanData.palletCode
         });
         if (res.status) {
-          this.pickedList = res.data || [];
-          
-          this.pickedList = res.data.map(item => {
-  // 鏂瑰紡1锛氫繚鐣欏師barcode瀛楁锛屾柊澧瀋urrentBarcode
-  return {
-    ...item,
-    currentBarcode: item.barcode
-  };
-});
-
+          this.pickedList = res.data.map(item => ({
+            ...item,
+            currentBarcode: item.barcode
+          }));
           this.summary.pickedCount = this.pickedList.length;
         }
       } catch (error) {
+        console.error('鍔犺浇宸叉嫞閫夊垪琛ㄥけ璐�:', error);
         this.$message.error('鍔犺浇宸叉嫞閫夊垪琛ㄥけ璐�');
       }
     },
 
     async loadPalletStatus() {
-      try {
+          try {
         const res = await http.post('/api/OutboundBatchPicking/pallet-status', {
           orderNo: this.scanData.orderNo,
           palletCode: this.scanData.palletCode
@@ -1030,13 +1113,14 @@
           this.palletStatus = res.data.statusText || '鏈煡';
         }
       } catch (error) {
+        console.error('鍔犺浇鎵樼洏鐘舵�佸け璐�:', error);
         this.palletStatus = '鏈煡';
       }
     },
 
     // 鎵爜鐩稿叧鏂规硶
     onPalletScan() {
-      this.scanData.palletCode = this.scanData.palletCode.replace(/\n/g, '').trim();
+       this.scanData.palletCode = this.scanData.palletCode.replace(/\n/g, '').trim();
       if (!this.scanData.palletCode) return;
       
       this.loadPalletData();
@@ -1046,7 +1130,7 @@
     },
 
     onBarcodeScan() {
-      this.scanData.barcode = this.scanData.barcode.replace(/\n/g, '').trim();
+       this.scanData.barcode = this.scanData.barcode.replace(/\n/g, '').trim();
       if (!this.scanData.barcode) return;
       this.confirmPicking();
     },
@@ -1074,33 +1158,40 @@
         return;
       }
 
-      this.$confirm(`纭畾瑕佸彇娑堥�変腑鐨� ${this.selectedPickedRows.length} 椤瑰悧锛焋, '鎻愮ず', {
-        confirmButtonText: '纭畾',
-        cancelButtonText: '鍙栨秷',
-        type: 'warning'
-      }).then(async () => {
-        try {
-          for (const row of this.selectedPickedRows) {
-            try {
-              const res = await http.post('/api/OutboundBatchPicking/cancel-picking', {
-                orderNo: this.scanData.orderNo,
-                palletCode: this.scanData.palletCode,
-                barcode: row.currentBarcode
-              });
-              if (!res.status) {
-                this.$message.warning(`鍙栨秷鎷i�夊け璐�: ${row.currentBarcode} - ${res.message}`);
-              }
-            } catch (error) {
-              this.$message.warning(`鍙栨秷鎷i�夊け璐�: ${row.currentBarcode} - ${error.message}`);
+      try {
+        await ElMessageBox.confirm(
+          `纭畾瑕佸彇娑堥�変腑鐨� ${this.selectedPickedRows.length} 椤瑰悧锛焋, 
+          '鎻愮ず', 
+          {
+            confirmButtonText: '纭畾',
+            cancelButtonText: '鍙栨秷',
+            type: 'warning',
+            customClass: 'message-box-top'
+          }
+        );
+        
+        for (const row of this.selectedPickedRows) {
+          try {
+            const res = await http.post('/api/OutboundBatchPicking/cancel-picking', {
+              orderNo: this.scanData.orderNo,
+              palletCode: this.scanData.palletCode,
+              barcode: row.currentBarcode
+            });
+            if (!res.status) {
+              this.$message.warning(`鍙栨秷鎷i�夊け璐�: ${row.currentBarcode} - ${res.message}`);
             }
-          }        
-          this.$message.success('鎵归噺鍙栨秷瀹屾垚');
-          await this.loadPalletData();
-          this.selectedPickedRows = [];
-        } catch (error) {
+          } catch (error) {
+            this.$message.warning(`鍙栨秷鎷i�夊け璐�: ${row.currentBarcode} - ${error.message}`);
+          }
+        }        
+        this.$message.success('鎵归噺鍙栨秷瀹屾垚');
+        await this.loadPalletData();
+        this.selectedPickedRows = [];
+      } catch (error) {
+        if (error !== 'cancel') {
           this.$message.error('鎵归噺鍙栨秷鎿嶄綔澶辫触');
         }
-      });
+      }
     },
 
     // 閲嶇疆鏂规硶
@@ -1117,8 +1208,13 @@
     },
 
     openRevertSplitDialog() {
-      this.showRevertSplitDialog = true;
-      this.revertSplitForm.newBarcode = '';
+       // 鍏抽棴鍏朵粬寮圭獥
+      this.closeAllDialogs();
+      
+      this.$nextTick(() => {
+        this.showRevertSplitDialog = true;
+        this.revertSplitForm.newBarcode = '';
+      });
     },
 
     closeRevertSplitDialog() {
@@ -1184,15 +1280,20 @@
 
 /* 鑷畾涔夊脊绐楁牱寮� */
 :deep(.el-message-box) {
-  z-index: 10010 !important;
+  z-index: 9999 !important;
 }
 
 :deep(.el-overlay) {
-  z-index: 10009 !important;
+  z-index: 9998 !important;
 }
 
 :deep(.el-message) {
-  z-index: 10011 !important;
+  z-index: 10000 !important;
+}
+
+/* 纭繚纭瀵硅瘽妗嗗湪鏈�鍓嶉潰 */
+:deep(.message-box-top) {
+  z-index: 10001 !important;
 }
 
 .custom-dialog-overlay {
@@ -1205,7 +1306,7 @@
   display: flex;
   align-items: center;
   justify-content: center;
-  z-index: 2000; /* 淇濇寔涓�涓悎鐞嗙殑 z-index */
+  z-index: 2000;
 }
 
 .custom-dialog-wrapper {
@@ -1276,14 +1377,7 @@
     flex-direction: column;
     align-items: stretch;
   }
-  /* 纭繚纭瀵硅瘽妗嗗湪鏈�鍓嶉潰 */
-.el-message-box__wrapper {
-  z-index: 10001 !important;
-}
-
-.el-message {
-  z-index: 10002 !important;
-}
+  
   .scanner-form .el-input {
     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/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.878.3237/CodeChunks.db-shm" "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/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.878.3237/CodeChunks.db-shm"
index fae3bf5..afba870 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/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.878.3237/CodeChunks.db-shm"
+++ "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/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.878.3237/CodeChunks.db-shm"
Binary files differ
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/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.878.3237/SemanticSymbols.db-shm" "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/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.878.3237/SemanticSymbols.db-shm"
index 332c120..a06ba36 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/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.878.3237/SemanticSymbols.db-shm"
+++ "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/.vs/WIDESEA_WMSServer/CopilotIndices/17.14.878.3237/SemanticSymbols.db-shm"
Binary files differ
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_CheckService/ReCheckOrderService.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_CheckService/ReCheckOrderService.cs"
index 2177e5a..3822dee 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_CheckService/ReCheckOrderService.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_CheckService/ReCheckOrderService.cs"
@@ -92,6 +92,11 @@
                 {
                     return WebResponseContent.Instance.Error($"鏈壘鍒板崟淇℃伅");
                 }
+                var isupdate = false;
+                if (recheckOrder.SignSeq == model.SignSeq)
+                {
+                    isupdate = true;    
+                }
                 recheckOrder.OrderNo = model.OrderNo;
                 recheckOrder.MaterielCode = model.MaterielCode;
                 recheckOrder.BatchNo = model.BatchNo;
@@ -107,14 +112,15 @@
 
                 BaseDal.UpdateData(recheckOrder);
 
-                _outboundService.OutboundOrderService.Db.Deleteable<Dt_OutboundOrder>().Where(x => x.OrderNo == model.OrderNo).ExecuteCommand();
-                _outboundService.OutboundOrderDetailService.Db.Deleteable<Dt_OutboundOrderDetail>()
-                 .Where(p => SqlFunc.Subqueryable<Dt_OutboundOrder>().Where(s => s.Id == p.OrderId && s.OrderNo == model.OrderNo).Any()).ExecuteCommand();
+                if (isupdate)
+                {
+                    _outboundService.OutboundOrderService.Db.Deleteable<Dt_OutboundOrder>().Where(x => x.OrderNo == model.OrderNo).ExecuteCommand();
+                    _outboundService.OutboundOrderDetailService.Db.Deleteable<Dt_OutboundOrderDetail>()
+                     .Where(p => SqlFunc.Subqueryable<Dt_OutboundOrder>().Where(s => s.Id == p.OrderId && s.OrderNo == model.OrderNo).Any()).ExecuteCommand();
 
-                var outboundOrders = ConvertToOutboundOrders(model);
-
-                await _outboundService.OutboundOrderService.ReceiveOutboundOrder(outboundOrders, 1);
-                              
+                    var outboundOrders = ConvertToOutboundOrders(model);
+                    await _outboundService.OutboundOrderService.ReceiveOutboundOrder(outboundOrders, 1);
+                }         
                 return WebResponseContent.Instance.OK();
             }
             catch (Exception ex)
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_Core/BaseRepository/RepositoryBase.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_Core/BaseRepository/RepositoryBase.cs"
index 171d380..dc57ad4 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_Core/BaseRepository/RepositoryBase.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_Core/BaseRepository/RepositoryBase.cs"
@@ -869,24 +869,258 @@
              .WhereIF(whereExpression != null, whereExpression).ToListAsync();
         }
 
+        //public bool DeleteAndMoveIntoHty(TEntity entity, OperateTypeEnum operateType)
+        //{
+        //    Type type = entity.GetType();
+        //    Assembly assembly = type.Assembly;
+        //    Type? htyType = assembly.GetType(type.FullName + "_Hty");
+        //    if (htyType != null)
+        //    {
+        //        object? obj = Activator.CreateInstance(htyType);
+        //        PropertyInfo keyPro = typeof(TEntity).GetKeyProperty();
+        //        PropertyInfo? operateTypePro = htyType.GetProperty(nameof(IBaseHistoryEntity.OperateType));
+        //        PropertyInfo? sourceIdPro = htyType.GetProperty(nameof(IBaseHistoryEntity.SourceId));
+        //        if (obj != null && keyPro != null && operateTypePro != null && sourceIdPro != null)
+        //        {
+        //            operateTypePro.SetValue(obj, operateType.ToString());
+        //            sourceIdPro.SetValue(obj, keyPro.GetValue(entity));
+
+        //            List<PropertyInfo> propertyInfos = htyType.GetProperties().Where(x => x.Name != operateTypePro.Name && x.Name != sourceIdPro.Name && x.Name != keyPro.Name).ToList();
+
+        //            for (int i = 0; i < propertyInfos.Count; i++)
+        //            {
+        //                PropertyInfo propertyInfo = propertyInfos[i];
+        //                PropertyInfo? property = type.GetProperty(propertyInfo.Name);
+
+        //                if (property != null)
+        //                {
+        //                    if (propertyInfo.Name == nameof(BaseEntity.Modifier))
+        //                    {
+        //                        propertyInfo.SetValue(obj, App.User.UserId > 0 ? App.User.UserName : "System");
+        //                    }
+        //                    else if (propertyInfo.Name == nameof(BaseEntity.ModifyDate))
+        //                    {
+        //                        propertyInfo.SetValue(obj, DateTime.Now);
+        //                    }                            
+        //                    else
+        //                    {
+        //                        propertyInfo.SetValue(obj, property.GetValue(entity));
+        //                    }
+        //                }
+        //            }
+        //            if (obj != null)
+        //                _db.InsertableByObject(obj).AS(type.Name + "_Hty").ExecuteCommand();
+        //        }
+        //    }
+        //    return DeleteData(entity);
+
+        //}
+
         public bool DeleteAndMoveIntoHty(TEntity entity, OperateTypeEnum operateType)
         {
-            Type type = entity.GetType();
-            Assembly assembly = type.Assembly;
-            Type? htyType = assembly.GetType(type.FullName + "_Hty");
-            if (htyType != null)
+            // 鏍稿績閫昏緫锛氱敤浜嬪姟淇濊瘉鍘熷瓙鎬э紝寮傚父鎹曡幏閬垮厤娴佺▼涓柇锛屾棩蹇楄緟鍔╂帓鏌�
+            bool isSuccess = false;
+            string entityTypeName = entity?.GetType().Name ?? "鏈煡瀹炰綋";
+
+            try
+            {
+                // 鍓嶇疆鏍¢獙锛氬疄浣撲笉鑳戒负绌�
+                if (entity == null)
+                {
+                    return false;
+                }
+
+                Type entityType = entity.GetType();
+                Assembly assembly = entityType.Assembly;
+                string htyTypeName = $"{entityType.FullName}_Hty";
+                Type? htyType = assembly.GetType(htyTypeName);
+
+                // 1. 妫�鏌ュ巻鍙茶〃绫诲瀷鏄惁瀛樺湪
+                if (htyType == null)
+                {
+                 
+                    return false;
+                }
+
+                // 2. 鍒涘缓鍘嗗彶琛ㄥ疄渚嬶紙澶勭悊鏃犲弬鏋勯�犲嚱鏁颁笉瀛樺湪鐨勬儏鍐碉級
+                object? htyObj;
+                try
+                {
+                    htyObj = Activator.CreateInstance(htyType);
+                }
+                catch (Exception ex)
+                {
+                    // _logger.LogError(ex, "DeleteAndMoveIntoHty锛氬垱寤哄巻鍙茶〃瀹炰緥 {HtyTypeName} 澶辫触", htyTypeName);
+                    return false;
+                }
+                if (htyObj == null)
+                {
+                    // _logger.LogWarning("DeleteAndMoveIntoHty锛氬巻鍙茶〃瀹炰緥 {HtyTypeName} 鍒涘缓缁撴灉涓簄ull", htyTypeName);
+                    return false;
+                }
+
+                // 3. 鑾峰彇鏍稿績灞炴�э紙鎸囧畾BindingFlags纭繚鑾峰彇鍏叡瀹炰緥灞炴�э級
+                BindingFlags propFlags = BindingFlags.Public | BindingFlags.Instance;
+                PropertyInfo? keyPro = typeof(TEntity).GetKeyProperty(); // 鑷畾涔夋柟娉曢渶纭繚杩斿洖闈炵┖锛屾澶勫鍔犲垽绌�
+                PropertyInfo? operateTypePro = htyType.GetProperty(nameof(IBaseHistoryEntity.OperateType), propFlags);
+                PropertyInfo? sourceIdPro = htyType.GetProperty(nameof(IBaseHistoryEntity.SourceId), propFlags);
+
+                // 鏍¢獙鏍稿績灞炴�ф槸鍚﹀瓨鍦�
+                if (keyPro == null)
+                {
+                    //_logger.LogError("DeleteAndMoveIntoHty锛氬疄浣� {EntityType} 鏈壘鍒颁富閿睘鎬�", entityType.FullName);
+                    return false;
+                }
+                if (operateTypePro == null)
+                {
+                    //_logger.LogError("DeleteAndMoveIntoHty锛氬巻鍙茶〃 {HtyTypeName} 鏈壘鍒癘perateType灞炴��", htyTypeName);
+                    return false;
+                }
+                if (sourceIdPro == null)
+                {
+                    // _logger.LogError("DeleteAndMoveIntoHty锛氬巻鍙茶〃 {HtyTypeName} 鏈壘鍒癝ourceId灞炴��", htyTypeName);
+                    return false;
+                }
+
+                // 4. 璧嬪�兼牳蹇冨睘鎬э紙鏍¢獙绫诲瀷鍖归厤锛岄伩鍏峉etValue鎶涘紓甯革級
+                try
+                {
+                    // 澶勭悊OperateType绫诲瀷鍖归厤锛氳嫢鍘嗗彶琛ㄥ睘鎬ф槸鏋氫妇绫诲瀷锛岀洿鎺ヤ紶鏋氫妇鑰岄潪瀛楃涓�
+                    if (operateTypePro.PropertyType == typeof(OperateTypeEnum))
+                    {
+                        operateTypePro.SetValue(htyObj, operateType);
+                    }
+                    else if (operateTypePro.PropertyType == typeof(string))
+                    {
+                        operateTypePro.SetValue(htyObj, operateType.ToString());
+                    }
+                    else
+                    {
+                        //_logger.LogError("DeleteAndMoveIntoHty锛氬巻鍙茶〃 {HtyTypeName} 鐨凮perateType灞炴�х被鍨� {PropType} 涓嶅尮閰嶏紙浠呮敮鎸佹灇涓�/瀛楃涓诧級", htyTypeName, operateTypePro.PropertyType.FullName);
+                        return false;
+                    }
+
+                    // 璧嬪�糞ourceId锛堟牎楠岀被鍨嬪尮閰嶏級
+                    object sourceIdValue = keyPro.GetValue(entity)!;
+                    if (sourceIdPro.PropertyType != sourceIdValue.GetType())
+                    {
+                        sourceIdValue = Convert.ChangeType(sourceIdValue, sourceIdPro.PropertyType); // 绫诲瀷杞崲
+                    }
+                    sourceIdPro.SetValue(htyObj, sourceIdValue);
+                }
+                catch (Exception ex)
+                {
+                    // _logger.LogError(ex, "DeleteAndMoveIntoHty锛氬巻鍙茶〃 {HtyTypeName} 鏍稿績灞炴�ц祴鍊煎け璐�", htyTypeName);
+                    return false;
+                }
+
+                // 5. 璧嬪�煎叾浠栧睘鎬э紙鎺掗櫎鏍稿績灞炴�э級
+                List<PropertyInfo> htyProperties = htyType.GetProperties(propFlags)
+                    .Where(x => x.Name != operateTypePro.Name
+                             && x.Name != sourceIdPro.Name
+                             && x.Name != keyPro.Name)
+                    .ToList();
+
+                foreach (PropertyInfo htyProp in htyProperties)
+                {
+                    PropertyInfo? entityProp = entityType.GetProperty(htyProp.Name, propFlags);
+                    if (entityProp == null) continue; // 瀹炰綋鏃犺灞炴�у垯璺宠繃
+
+                    try
+                    {
+                        object propValue;
+                        // 澶勭悊淇敼浜猴細閬垮厤App.User绌哄紩鐢�
+                        if (htyProp.Name == nameof(BaseEntity.Modifier))
+                        {
+                            propValue = App.User?.UserId > 0 ? App.User?.UserName : "System";
+                        }
+                        // 澶勭悊淇敼鏃堕棿
+                        else if (htyProp.Name == nameof(BaseEntity.ModifyDate))
+                        {
+                            propValue = DateTime.Now;
+                        }
+                        // 鍏朵粬灞炴�т粠鍘熷疄浣撳彇鍊�
+                        else
+                        {
+                            propValue = entityProp.GetValue(entity) ?? DBNull.Value; // 澶勭悊null鍊�
+                        }
+
+                        // 绫诲瀷杞崲鍚庤祴鍊硷紙閬垮厤绫诲瀷涓嶅尮閰嶏級
+                        if (propValue != DBNull.Value && propValue != null)
+                        {
+                            propValue = Convert.ChangeType(propValue, htyProp.PropertyType);
+                        }
+                        htyProp.SetValue(htyObj, propValue);
+                    }
+                    catch (Exception ex)
+                    {
+                        // _logger.LogWarning(ex, "DeleteAndMoveIntoHty锛氬巻鍙茶〃 {HtyTypeName} 灞炴�� {PropName} 璧嬪�煎け璐ワ紝璺宠繃璇ュ睘鎬�", htyTypeName, htyProp.Name);
+                    }
+                }
+                try
+                {                   
+                    // 鎵ц鎻掑叆鍘嗗彶琛�
+                    int insertRows = _db.InsertableByObject(htyObj).AS(entityType.Name + "_Hty").ExecuteCommand();
+
+                    if (insertRows <= 0)
+                    {
+                        // _logger.LogError("DeleteAndMoveIntoHty锛氬巻鍙茶〃 {HtyTypeName} 鎻掑叆澶辫触锛堝奖鍝嶈鏁�0锛�", htyTypeName);
+                        _db.InsertableByObject(htyObj).AS(entityType.Name + "_Hty").ExecuteCommand();
+                        return false;
+                    }
+                    // 鎻掑叆鎴愬姛鍚庢墽琛屽垹闄�
+                    bool deleteSuccess = DeleteData(entity);
+                    if (!deleteSuccess)
+                    {
+                        //_logger.LogError("DeleteAndMoveIntoHty锛氬疄浣� {EntityType} 鍒犻櫎澶辫触", entityType.FullName);
+                        DeleteData(entity);
+                        return false;
+                    }
+                    // 鎻愪氦浜嬪姟
+                 
+                    isSuccess = true;
+                    //_logger.LogInformation("DeleteAndMoveIntoHty锛氬疄浣� {EntityType} 宸叉垚鍔熺Щ鍏ュ巻鍙茶〃骞跺垹闄ゅ師鏁版嵁", entityType.FullName);
+                }
+                catch (Exception ex)
+                {
+                   
+                    // _logger.LogError(ex, "DeleteAndMoveIntoHty锛氫簨鍔℃墽琛屽け璐ワ紙鎻掑叆鍘嗗彶琛�/鍒犻櫎鍘熸暟鎹級", entityType.FullName);
+                    return false;
+                }         
+            }
+            catch (Exception ex)
+            {
+                //  _logger.LogError(ex, "DeleteAndMoveIntoHty锛氬鐞嗗疄浣� {EntityTypeName} 鏃跺彂鐢熸湭鎹曡幏寮傚父", entityTypeName);
+                return false;
+            }
+
+            return isSuccess;
+        }
+
+
+
+public bool DeleteAndMoveIntoHty(List<TEntity> entities, OperateTypeEnum operateType)
+{
+    Type type = typeof(TEntity);
+    Assembly assembly = type.Assembly;
+    Type? htyType = assembly.GetType(type.FullName + "_Hty");
+    if (htyType != null)
+    {
+        object? obj2 = Activator.CreateInstance(htyType);
+        PropertyInfo keyPro = typeof(TEntity).GetKeyProperty();
+        PropertyInfo? operateTypePro = htyType.GetProperty(nameof(IBaseHistoryEntity.OperateType));
+        PropertyInfo? sourceIdPro = htyType.GetProperty(nameof(IBaseHistoryEntity.SourceId));
+        if (obj2 != null && keyPro != null && operateTypePro != null && sourceIdPro != null)
+        {
+            List<PropertyInfo> propertyInfos = htyType.GetProperties().Where(x => x.Name != operateTypePro.Name && x.Name != sourceIdPro.Name && x.Name != keyPro.Name).ToList();
+            List<object> list = new List<object>();
+            foreach (var item in entities)
             {
                 object? obj = Activator.CreateInstance(htyType);
-                PropertyInfo keyPro = typeof(TEntity).GetKeyProperty();
-                PropertyInfo? operateTypePro = htyType.GetProperty(nameof(IBaseHistoryEntity.OperateType));
-                PropertyInfo? sourceIdPro = htyType.GetProperty(nameof(IBaseHistoryEntity.SourceId));
-                if (obj != null && keyPro != null && operateTypePro != null && sourceIdPro != null)
+                if (obj != null)
                 {
                     operateTypePro.SetValue(obj, operateType.ToString());
-                    sourceIdPro.SetValue(obj, keyPro.GetValue(entity));
-
-                    List<PropertyInfo> propertyInfos = htyType.GetProperties().Where(x => x.Name != operateTypePro.Name && x.Name != sourceIdPro.Name && x.Name != keyPro.Name).ToList();
-
+                    sourceIdPro.SetValue(obj, keyPro.GetValue(item));
                     for (int i = 0; i < propertyInfos.Count; i++)
                     {
                         PropertyInfo propertyInfo = propertyInfos[i];
@@ -901,74 +1135,23 @@
                             else if (propertyInfo.Name == nameof(BaseEntity.ModifyDate))
                             {
                                 propertyInfo.SetValue(obj, DateTime.Now);
-                            }                            
+                            }
                             else
                             {
-                                propertyInfo.SetValue(obj, property.GetValue(entity));
+                                propertyInfo.SetValue(obj, property.GetValue(item));
                             }
                         }
                     }
-                    if (obj != null)
-                        _db.InsertableByObject(obj).AS(type.Name + "_Hty").ExecuteCommand();
+                    list.Add(obj);
                 }
             }
-            return DeleteData(entity);
-           
+            if (list.Count > 0)
+                _db.InsertableByObject(list).AS(type.Name + "_Hty").ExecuteCommand();
+
         }
-
-        public bool DeleteAndMoveIntoHty(List<TEntity> entities, OperateTypeEnum operateType)
-        {
-            Type type = typeof(TEntity);
-            Assembly assembly = type.Assembly;
-            Type? htyType = assembly.GetType(type.FullName + "_Hty");
-            if (htyType != null)
-            {
-                object? obj2 = Activator.CreateInstance(htyType);
-                PropertyInfo keyPro = typeof(TEntity).GetKeyProperty();
-                PropertyInfo? operateTypePro = htyType.GetProperty(nameof(IBaseHistoryEntity.OperateType));
-                PropertyInfo? sourceIdPro = htyType.GetProperty(nameof(IBaseHistoryEntity.SourceId));
-                if (obj2 != null && keyPro != null && operateTypePro != null && sourceIdPro != null)
-                {
-                    List<PropertyInfo> propertyInfos = htyType.GetProperties().Where(x => x.Name != operateTypePro.Name && x.Name != sourceIdPro.Name && x.Name != keyPro.Name).ToList();
-                    List<object> list = new List<object>();
-                    foreach (var item in entities)
-                    {
-                        object? obj = Activator.CreateInstance(htyType);
-                        if (obj != null)
-                        {
-                            operateTypePro.SetValue(obj, operateType.ToString());
-                            sourceIdPro.SetValue(obj, keyPro.GetValue(item));
-                            for (int i = 0; i < propertyInfos.Count; i++)
-                            {
-                                PropertyInfo propertyInfo = propertyInfos[i];
-                                PropertyInfo? property = type.GetProperty(propertyInfo.Name);
-
-                                if (property != null)
-                                {
-                                    if (propertyInfo.Name == nameof(BaseEntity.Modifier))
-                                    {
-                                        propertyInfo.SetValue(obj, App.User.UserId > 0 ? App.User.UserName : "System");
-                                    }
-                                    else if (propertyInfo.Name == nameof(BaseEntity.ModifyDate))
-                                    {
-                                        propertyInfo.SetValue(obj, DateTime.Now);
-                                    }
-                                    else
-                                    {
-                                        propertyInfo.SetValue(obj, property.GetValue(item));
-                                    }
-                                }
-                            }
-                            list.Add(obj);
-                        }
-                    }
-                    if (list.Count > 0)
-                        _db.InsertableByObject(list).AS(type.Name + "_Hty").ExecuteCommand();
-
-                }
-            }
-            return DeleteData(entities);
-        }
+    }
+    return DeleteData(entities);
+}
         //List<TResult> QueryMuch<T, T2, T3, TResult>(
         //    Expression<Func<T, T2, T3, object[]>> joinExpression,
         //    Expression<Func<T, T2, T3, TResult>> selectExpression,
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_OutboundService/OutboundPickingService.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_OutboundService/OutboundPickingService.cs"
index e8415a6..e8de990 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_OutboundService/OutboundPickingService.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_OutboundService/OutboundPickingService.cs"
@@ -2093,8 +2093,7 @@
             {
                 // 1. 鍒犻櫎搴撳瓨鏁伴噺涓�0鐨勬槑缁嗚褰�
                 var deleteDetailCount = await _stockInfoDetailService.Db.Deleteable<Dt_StockInfoDetail>()
-                    .Where(x => x.StockId == stockId && x.StockQuantity == 0 && (x.Status == StockStatusEmun.鍑哄簱瀹屾垚.ObjToInt() || x.Status ==
-                                          StockStatusEmun.鍏ュ簱瀹屾垚.ObjToInt()))
+                    .Where(x => x.StockId == stockId && x.StockQuantity == 0)
                     .ExecuteCommandAsync();
 
                 await _stockInfoService.Db.Deleteable<Dt_StockInfo>()
@@ -2978,6 +2977,8 @@
                     {
                         return content.Error("鍙湁鎷垮埌閲嶆缁撴灉鎵嶈兘鍏ュ簱锛�");
                     }
+
+
                 }
                 //  Dt_InboundOrder inboundOrder = GetInboundOrder(materielGroupDTO.OrderNo);
 
@@ -3046,7 +3047,7 @@
                         FactoryArea = item.FactoryArea,
                         Status = 0,
                         OrderNo = item.OrderNo,
-                        BusinessType = InOrderTypeEnum.InternalAllocat.ObjToInt().ToString()
+                        BusinessType = materielGroupDTO.orderTypes.ToString()
 
                     });
                     item.WarehouseCode = item.WarehouseCode;
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/Inbound/InboundOrderController.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/Inbound/InboundOrderController.cs"
index 69bc686..cce5ef0 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_WMSServer/Controllers/Inbound/InboundOrderController.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/Inbound/InboundOrderController.cs"
@@ -13,6 +13,8 @@
 using WIDESEA_Core;
 using WIDESEA_Core.Attributes;
 using WIDESEA_Core.BaseController;
+using WIDESEA_Core.BaseRepository;
+using WIDESEA_Core.Enums;
 using WIDESEA_DTO.Allocate;
 using WIDESEA_DTO.Inbound;
 using WIDESEA_DTO.Mes;
@@ -42,8 +44,9 @@
         private readonly IMaterialUnitService _materialUnitService;
         private readonly IOutStockLockInfoService _outStockLockInfoService;
         private readonly IOutboundOrderDetailService _outboundOrderDetailService;
+        private readonly IRepository<Dt_Task> _taskRepository;
         private readonly ILogger<InboundOrderController> _logger;
-        public InboundOrderController(IInboundOrderService service, WIDESEA_IBasicService.IErpApiService erpApiService, WIDESEA_IBasicService.IInvokeMESService invokeMESService, IESSApiService eSSApiService, IDailySequenceService dailySequenceService, ILocationInfoService locationInfoService, ILogger<InboundOrderController> logger, IMaterialUnitService materialUnitService, IInboundService inboundService, IOutStockLockInfoService outStockLockInfoService, IOutboundOrderDetailService outboundOrderDetailService) : base(service)
+        public InboundOrderController(IInboundOrderService service, WIDESEA_IBasicService.IErpApiService erpApiService, WIDESEA_IBasicService.IInvokeMESService invokeMESService, IESSApiService eSSApiService, IDailySequenceService dailySequenceService, ILocationInfoService locationInfoService, ILogger<InboundOrderController> logger, IMaterialUnitService materialUnitService, IInboundService inboundService, IOutStockLockInfoService outStockLockInfoService, IOutboundOrderDetailService outboundOrderDetailService, IRepository<Dt_Task> taskRepository) : base(service)
         {
             this.erpApiService = erpApiService;
             _invokeMESService = invokeMESService;
@@ -55,20 +58,21 @@
             _inboundService = inboundService;
             _outStockLockInfoService = outStockLockInfoService;
             _outboundOrderDetailService = outboundOrderDetailService;
+            _taskRepository = taskRepository;
         }
 
         [HttpPost, Route("Test"), AllowAnonymous, MethodParamsValidate]
         public async Task<WebResponseContent> Test()
         {
-  
-
+            var originalTask = _taskRepository.Db.Queryable<Dt_Task>().First();
+            _taskRepository.DeleteAndMoveIntoHty(originalTask, OperateTypeEnum.鑷姩瀹屾垚);
             // Service.Db.Deleteable<Dt_InboundOrder>().Where(x=>x.UpperOrderNo== "12020251100040").ExecuteCommand();
             //_inboundService.InboundOrderDetailService.Db.Deleteable<Dt_InboundOrderDetail>()
             // .Where(p => SqlFunc.Subqueryable<Dt_InboundOrder>().Where(s => s.Id == p.OrderId && s.UpperOrderNo == "12020251100040").Any()).ExecuteCommand();
 
-            var purchaseToStockResult = await _materialUnitService.ConvertPurchaseToStockAsync("100513-00303", 1);
+            //var purchaseToStockResult = await _materialUnitService.ConvertPurchaseToStockAsync("100513-00303", 1);
 
-            var pdddurchaseToStockResult = await _materialUnitService.ConvertFromToStockAsync("100513-00303", "W013", 1);
+            //var pdddurchaseToStockResult = await _materialUnitService.ConvertFromToStockAsync("100513-00303", "W013", 1);
 
             //var sddd = _locationInfoService.AssignLocation();
             //var code = sddd.LocationCode;
@@ -115,12 +119,12 @@
         [HttpPost, Route("ReceiveInboundOrder"), AllowAnonymous, MethodParamsValidate]
         public async Task<WebResponseContent> ReceiveInboundOrder([FromBody] InboundRequestModel model)
         {
-            if(model.inBounds == null || !model.inBounds.Any())
+            if (model.inBounds == null || !model.inBounds.Any())
             {
                 return WebResponseContent.Instance.Error("鍏ュ簱鍗曚笉鑳戒负绌�");
             }
 
-            _logger.LogInformation("InboundOrderController ReceiveInboundOrder:  " +  JsonConvert.SerializeObject(model));
+            _logger.LogInformation("InboundOrderController ReceiveInboundOrder:  " + JsonConvert.SerializeObject(model));
             List<Dt_InboundOrder> inboundOrders = new List<Dt_InboundOrder>();
 
             foreach (var item in model.inBounds)
@@ -178,7 +182,7 @@
                 inboundOrders.Add(dt_InboundOrder);
             }
 
-            var content =await Service.ReceiveInboundOrder(inboundOrders, model.operationType);
+            var content = await Service.ReceiveInboundOrder(inboundOrders, model.operationType);
 
             if (content.Status) return WebResponseContent.Instance.OK(200);
             else return WebResponseContent.Instance.Error(content.Message);
@@ -224,9 +228,9 @@
         }
 
         [HttpPost, Route("BatchOrderFeedbackToMes"), AllowAnonymous]
-        public async Task<WebResponseContent> BatchOrderFeedbackToMes([FromBody]  BatchOrderFeedbackToMesDto request)
+        public async Task<WebResponseContent> BatchOrderFeedbackToMes([FromBody] BatchOrderFeedbackToMesDto request)
         {
-           return await _invokeMESService.BatchOrderFeedbackToMes(request.orderNos, request.inout);
+            return await _invokeMESService.BatchOrderFeedbackToMes(request.orderNos, request.inout);
         }
 
     }

--
Gitblit v1.9.3