647556386
2026-01-13 3386c4e2a11ed345986a0b4af28e4a8630f84b41
重检,盘点优化
已添加1个文件
已修改12个文件
1658 ■■■■■ 文件已修改
项目代码/WIDESEA_WMSClient/config/buttons.js 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WIDESEA_WMSClient/src/extension/check/extend/ReCheckGroupPallet.vue 1124 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WIDESEA_WMSClient/src/extension/check/recheckOrder.js 34 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_BasicService/MESOperation/FeedbackMesService.cs 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_CheckService/ReCheckOrderService.cs 54 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_IInboundService/IInboundService.cs 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_InboundService/InboundService.cs 115 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_InboundService/TakeStockOrderService.cs 80 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_OutboundService/OutboundService.cs 47 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_StockService/StockInfoService.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs 138 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Inbound.cs 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Inbound/InboundController.cs 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ÏîÄ¿´úÂë/WIDESEA_WMSClient/config/buttons.js
@@ -339,6 +339,14 @@
    type: 'warning',
    onClick: function () {
    }
},{
    name: "重检组盘操作",
    icon: '',
    class: '',
    value: 'ReCheckGroupPallet',
    type: 'warning',
    onClick: function () {
    }
}
]
ÏîÄ¿´úÂë/WIDESEA_WMSClient/src/extension/check/extend/ReCheckGroupPallet.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,1124 @@
<template>
  <vol-box v-model="show" :title="'组盘操作 - å•据号:' + orderNo" :height="1000" :width="1100" :padding="20" :modal="true">
    <div class="barcode-scanner-container">
      <!-- ä»“库选择 - ç´§å‡‘布局 -->
      <div class="location-section compact">
        <el-form :model="form" :rules="rules" ref="locationForm" class="compact-form">
          <el-form-item label="入库仓库" prop="warehouseType" class="location-select compact-item">
            <el-select v-model="form.warehouseType" placeholder="请选择仓库" clearable filterable
              @change="handleWarehouseChange" style="width: 100%" :loading="warehouseLoading" size="medium">
              <el-option v-for="item in warehouseTypes" :key="item.warehouseType" :label="item.warehouseTypeDesc"
                :value="item.warehouseType" />
            </el-select>
          </el-form-item>
        </el-form>
      </div>
      <!-- ä»“库区域选择 - ç´§å‡‘布局 -->
      <div class="location-section compact">
        <el-form :model="form" :rules="rules" ref="locationForm" class="compact-form">
          <el-form-item label="仓库区域" prop="locationType" class="location-select compact-item">
            <el-select v-model="form.locationType" placeholder="请先选择仓库" clearable filterable
              @change="handleLocationChange" style="width: 100%" :loading="locationLoading" size="medium">
              <el-option v-for="item in locationTypes" :key="item.locationType" :label="item.locationTypeDesc"
                :value="item.locationType" />
            </el-select>
          </el-form-item>
        </el-form>
      </div>
      <!-- æ‰˜ç›˜ä¿¡æ¯æ˜¾ç¤º - ç´§å‡‘布局 -->
      <div class="tray-info compact" v-if="trayBarcode">
        <i class="el-icon-s-management"></i> å½“前料箱: {{ trayBarcode }}
        <span class="location-info" v-if="form.warehouseType">
          | ä»“库: {{ currentWarehouseName }}
        </span>
        <span class="location-info" v-if="form.locationType">
          | ä»“库区域: {{ currentLocationDesc }}
        </span>
      </div>
      <!-- æ‰«ç åŒºåŸŸ - ç´§å‡‘布局 -->
      <div class="input-section compact">
        <el-card shadow="hover" class="compact-card">
          <div slot="header" class="compact-header">
            <span><i class="el-icon-scanner"></i> æ‰«ç åŒºåŸŸ</span>
            <span class="scan-status">
              <span class="scan-indicator"></span>
              {{ form.locationType && form.warehouseType ? '扫码就绪' : '请先选择仓库和仓库区域' }}
            </span>
          </div>
          <!-- æ‰˜ç›˜æ¡ç è¾“å…¥ -->
          <div class="input-wrapper custom-input-group compact-input">
            <div class="input-label">托盘条码</div>
            <el-input ref="trayInput" v-model="trayBarcode" placeholder="请扫描或输入料箱码后按回车键" clearable
              :disabled="!form.locationType || !form.warehouseType" @keyup.enter.native="handleTraySubmit"
              @clear="handleTrayClear" @input="handleTrayInput" class="custom-input" size="medium">
              <template slot="append">
                <el-button @click="handleTraySubmit" type="primary" icon="el-icon-position"
                  :disabled="!form.locationType || !trayBarcode || !form.warehouseType" size="medium">
                  ç¡®è®¤
                </el-button>
              </template>
            </el-input>
          </div>
          <!-- ç‰©æ–™æ¡ç è¾“å…¥ -->
          <div class="input-wrapper custom-input-group compact-input">
            <div class="input-label">物料条码</div>
            <el-input ref="barcodeInput" v-model="barcode" placeholder="请扫描或输入物料条码后按回车键" clearable
              :disabled="!form.locationType || !trayBarcode || !form.warehouseType"
              @keyup.enter.native="handleBarcodeSubmit" @clear="handleClear" @input="handleBarcodeInput"
              class="custom-input" size="medium">
              <template slot="append">
                <el-button :loading="loading" @click="handleBarcodeSubmit" type="primary" icon="el-icon-search"
                  :disabled="!form.locationType || !trayBarcode || !barcode || !from.warehouseType" size="medium">
                  {{ loading ? '查询中...' : '查询' }}
                </el-button>
              </template>
            </el-input>
          </div>
          <div class="input-tips compact-tips">
            <p>提示:请先选择仓库 â†’ é€‰æ‹©ä»“库区域 â†’ è¾“入料箱码 â†’ è¾“入物料条码</p>
            <p v-if="!form.warehouseType" class="warning-text">⚠️ è¯·å…ˆé€‰æ‹©ä»“库</p>
            <p v-if="!form.locationType && !form.warehouseType" class="warning-text">⚠️ è¯·å…ˆé€‰æ‹©ä»“库区域</p>
            <p v-if="form.warehouseType && form.locationType && !trayBarcode" class="warning-text">⚠️ è¯·å…ˆè¾“入料箱码</p>
          </div>
        </el-card>
      </div>
      <!-- åŠ è½½çŠ¶æ€ -->
      <div v-if="loading" class="loading compact">
        <el-progress :percentage="100" status="success" :show-text="false" />
        <p>正在查询物料信息...</p>
      </div>
      <!-- é”™è¯¯æç¤º -->
      <div v-if="error" class="error-message compact">
        <el-alert :title="error" type="error" show-icon closable @close="error = ''" />
      </div>
      <!-- æœªç»„盘列表 -->
      <div class="unpallet-section compact">
        <el-card shadow="hover" class="compact-card unpallet-card">
          <div slot="header" class="compact-header">
            <span><i class="el-icon-tickets"></i> æœªç»„盘条码</span>
            <span class="list-actions">
              <el-tag type="primary" size="small">未组盘 {{ totalStockCount }}</el-tag>
            </span>
          </div>
          <div class="table-container">
            <el-table :data="unpalletMaterials" stripe style="width: 100%" height="100%" size="small"
              v-loading="unpalletBarcodesLoading">
              <el-table-column type="index" label="序号" width="60" align="center"></el-table-column>
              <el-table-column prop="barcode" label="条码" min-width="140" show-overflow-tooltip></el-table-column>
              <el-table-column prop="materielCode" label="物料编码" min-width="150" show-overflow-tooltip></el-table-column>
              <el-table-column prop="batchNo" label="批次" min-width="150" show-overflow-tooltip></el-table-column>
              <el-table-column prop="orderQuantity" label="数量" min-width="130" align="right"></el-table-column>
              <el-table-column prop="unit" label="单位" width="80" align="center"></el-table-column>
              <el-table-column prop="supplyCode" label="供应商" min-width="130" show-overflow-tooltip></el-table-column>
            </el-table>
          </div>
        </el-card>
      </div>
      <!-- ç‰©æ–™åˆ—表 - å›ºå®šé«˜åº¦å¸¦æ»šåŠ¨æ¡ -->
      <div class="material-list compact">
        <el-card shadow="hover" class="compact-card">
          <div slot="header" class="compact-header">
            <span><i class="el-icon-tickets"></i> ç»„盘数据</span>
            <span class="list-actions">
              <el-tag type="primary" size="small">共 {{ materials.length }} æ¡</el-tag>
              <el-tag type="primary" size="small">未入库数量 {{ totalStockSum }}{{ uniqueUnit }}</el-tag>
              <el-tag v-if="trayBarcode" type="success" size="small">托盘: {{ trayBarcode }}</el-tag>
              <el-tag v-if="form.warehouseType" type="info" size="small">仓库: {{ currentWarehouseName }}</el-tag>
              <el-tag v-if="form.locationType" type="info" size="small">区域: {{ currentLocationDesc }}</el-tag>
            </span>
          </div>
          <div v-if="materials.length === 0" class="empty-state compact">
            <i class="el-icon-document"></i>
            <p v-if="!form.warehouseType">请先选择仓库</p>
            <p v-if="!form.locationType">请先选择仓库区域</p>
            <p v-else-if="!trayBarcode">请先输入料箱条码</p>
            <p v-else>暂无物料数据,请扫描或输入物料条码</p>
          </div>
          <div class="table-container" v-else>
            <el-table :data="materials" stripe style="width: 100%" height="100%" size="small">
              <el-table-column type="index" label="序号" width="60" align="center"></el-table-column>
              <el-table-column prop="barcode" label="条码" min-width="140" show-overflow-tooltip></el-table-column>
              <el-table-column prop="materielCode" label="物料编码" min-width="150" show-overflow-tooltip></el-table-column>
              <el-table-column prop="batchNo" label="批次" min-width="150" show-overflow-tooltip></el-table-column>
              <el-table-column prop="stockQuantity" label="数量" min-width="130" align="right"></el-table-column>
              <el-table-column prop="unit" label="单位" width="80" align="center"></el-table-column>
              <el-table-column prop="supplyCode" label="供应商" min-width="130" show-overflow-tooltip></el-table-column>
              <el-table-column prop="warehouseType" label="仓库" min-width="120" show-overflow-tooltip></el-table-column>
            </el-table>
          </div>
        </el-card>
      </div>
    </div>
    <template #footer>
      <el-button type="danger" size="small" @click="handleDialogClose()">关闭</el-button>
    </template>
  </vol-box>
</template>
<script>
import http from '@/api/http.js';
import VolBox from '@/components/basic/VolBox.vue';
export default {
  components: { VolBox },
  data() {
    return {
      show: false,
      orderNo: "",
      palletVisible: this.visible,
      trayBarcodeReg: /^[A-Z]\d{9}$/,
      trayBarcode: '',
      barcode: '',
      materials: [],
      loading: false,
      error: '',
      debugMode: false,
      currentFocus: 'warehouse',
      unpalletBarcodes: [],
      unpalletBarcodesLoading: false,
      unpalletMaterials: [], // æœªç»„盘详细数据列表
      // æ‰«ç æžªç›¸å…³å˜é‡
      scanCode: '',
      lastKeyTime: null,
      isManualInput: false,
      isScanning: false,
      scanTimer: null,
      manualInputTimer: null,
      scanTarget: 'tray', // å½“前扫码目标: tray æˆ– material
      // åº“存统计相关变量
      totalStockSum: 0,
      totalStockCount: 0,
      uniqueUnit: '',
      sumLoading: false,
      sumError: '',
      // ä»“库相关变量
      warehouseTypes: [],
      warehouseLoading: false,
      // ä»“库区域相关变量
      locationTypes: [],
      locationLoading: false,
      form: {
        warehouseType: null,
        locationType: null
      },
      rules: {
        locationType: [
          {
            validator: this.validateLocationType,
            trigger: 'change'
          }
        ],
        trayBarcode: [
          {
            pattern: this.trayBarcodeReg,
            message: '托盘号格式错误(需为1个大写字母+9个数字,如A000008024)',
            trigger: 'blur'
          }
        ],
        warehouseType: [
          {
            message: '请选择仓库',
            trigger: 'change'
          }
        ]
      }
    }
  },
  computed: {
    // å½“前选择的仓库名称
    currentWarehouseName() {
      const warehouse = this.warehouseTypes.find(item => item.warehouseType === this.form.warehouseType);
      return warehouse ? warehouse.warehouseTypeDesc : '';
    },
    // å½“前选择的仓库区域描述
    currentLocationDesc() {
      const location = this.locationTypes.find(item => item.locationType === this.form.locationType)
      return location ? location.locationTypeDesc : ''
    }
  },
  watch: {
    visible(newVal, oldVal) {
      this.palletVisible = newVal;
      // å½“从 false å˜ä¸º true æ—¶ï¼Œè¡¨ç¤ºå¼¹æ¡†æ‰“å¼€
      if (newVal === true && oldVal === false) {
        console.log('弹框打开,重置数据');
        this.resetData();
        this.$nextTick(() => {
          setTimeout(() => {
            this.fetchUnpalletMaterialDetails();
          }, 300);
        });
      }
      // å½“从 true å˜ä¸º false æ—¶ï¼Œè¡¨ç¤ºå¼¹æ¡†å…³é—­
      if (newVal === false && oldVal === true) {
        console.log('弹框关闭,重置数据');
        this.resetData();
      }
    },
    palletVisible(newVal) {
      this.$emit('update:visible', newVal);
    },
    docNo(newVal) {
      if (newVal) {
        this.palletForm = { palletCode: '', barcode: '' };
        this.backData = [];
        this.$refs.palletForm?.reset();
        this.fetchUnpalletMaterialDetails();
      }
    }
  },
  mounted() {
    document.addEventListener('keypress', this.handleKeyPress);
  },
  beforeDestroy() {
    document.removeEventListener('keypress', this.handleKeyPress);
    this.clearAllTimers();
  },
  methods: {
    open() {
      this.show = true;
      this.orderNo = "";
      this.resetData();
      this.initLocationTypes();
      this.initwarehouseTypes();
      this.fetchUnpalletMaterialDetails();
    },
    validateLocationType(rule, value, callback) {
      if (!this.form.warehouseType) {
        callback(new Error('请先选择仓库'));
      } else if (value === null || value === undefined || value === '') {
        callback(new Error('请选择仓库区域'));
      } else {
        callback();
      }
    },
    // æ ¹æ®æ¡ç åˆ—表获取详细数据
    async fetchUnpalletMaterialDetails() {
      try {
        const response = await http.post('/api/InboundOrder/UnPalletGroupBarcode?orderNo=' + this.orderNo, {});
        if (response.status && Array.isArray(response.data)) {
          this.unpalletMaterials = response.data;
          this.unpalletBarcodes = response.data.map(item => item.barcode || '');
          this.totalStockCount = response.data.length;
        } else {
          this.unpalletMaterials = [];
        }
      } catch (err) {
        this.unpalletMaterials = this.unpalletBarcodes.map(barcode => ({
          barcode: barcode,
          materielCode: '-',
          batchNo: '-',
          stockQuantity: '-',
          unit: '-',
          supplyCode: '-',
          warehouseType: '-'
        }));
      }
    },
    async initLocationTypes() {
      try {
        const { data } = await this.http.post("api/LocationInfo/GetLocationTypes")
        this.locationTypes = data
      } catch (e) {
        this.$message.error('获取区域类型失败')
      }
    },
    async initwarehouseTypes() {
      try {
        const { data } = await this.http.post("api/Warehouse/GetwarehouseTypes")
        this.warehouseTypes = data
      } catch (e) {
        this.$message.error('获取区域类型失败')
      }
    },
    async fetchStockStatistics(orderNo) {
      // å•据号为空时不查询
      if (!orderNo) {
        this.sumError = '单据号为空,无法统计';
        return;
      }
      this.sumLoading = true;
      this.sumError = '';
      try {
        const response = await http.post('/api/InboundOrder/UnPalletQuantity?orderNo=' + orderNo, {});
        if (response.data) {
          this.totalStockSum = response.data.stockSumQuantity || 0;
          this.totalStockCount = response.data.stockCount || 0;
          this.uniqueUnit = response.data.uniqueUnit || '';
        }
      } catch (err) {
        this.sumError = '统计加载失败';
        this.totalStockSum = 0;
        this.totalStockCount = 0;
      } finally {
        this.sumLoading = false;
      }
    },
    async validateForm() {
      return new Promise((resolve) => {
        if (!this.$refs.locationForm) {
          this.error = '表单未初始化';
          this.$message.warning('请先选择仓库区域');
          resolve(false);
          return;
        }
        this.$refs.locationForm.validate((valid) => {
          if (valid) {
            this.error = '';
            resolve(true);
          } else {
            if (!this.from.warehouseType) {
              this.error = '请先选择仓库';
            }
            else if (this.form.locationType === null || this.form.locationType === undefined || this.form.locationType === '') {
              this.error = '请先选择仓库区域';
            } else {
              this.error = '请检查表单填写是否正确';
            }
            resolve(false);
          }
        });
      });
    },
    // èšç„¦åˆ°æ‰˜ç›˜è¾“入框
    focusTrayInput() {
      if (this.$refs.trayInput && this.$refs.trayInput.$el) {
        const inputEl = this.$refs.trayInput.$el.querySelector('input');
        if (inputEl) {
          inputEl.focus();
          this.currentFocus = 'tray';
          this.scanTarget = 'tray';
          inputEl.select();
        }
      }
    },
    // èšç„¦åˆ°ç‰©æ–™è¾“入框
    focusBarcodeInput() {
      if (this.$refs.barcodeInput && this.$refs.barcodeInput.$el) {
        const inputEl = this.$refs.barcodeInput.$el.querySelector('input');
        if (inputEl) {
          inputEl.focus();
          this.currentFocus = 'material';
          this.scanTarget = 'material';
          inputEl.select();
        }
      }
    },
    // é‡ç½®æ‰€æœ‰æ•°æ®
    resetData() {
      this.trayBarcode = '';
      this.barcode = '';
      this.materials = [];
      this.unpalletBarcodes = [];
      this.unpalletMaterials = [];
      this.loading = false;
      this.error = '';
      this.scanCode = '';
      this.lastKeyTime = null;
      this.isManualInput = false;
      this.isScanning = false;
      this.currentFocus = 'warehouse';
      this.scanTarget = 'tray';
      this.clearAllTimers();
      this.totalStockSum = 0;
      this.totalStockCount = 0;
      this.sumLoading = false;
      this.sumError = '';
      this.form = {
        warehouseType: null,
        locationType: null
      }
      this.warehouseTypes = [];
      this.locationTypes = [];
      // æ¸…除表单验证状态
      this.$nextTick(() => {
        if (this.$refs.locationForm) {
          this.$refs.locationForm.clearValidate();
        }
      });
    },
    // æ¸…除所有计时器
    clearAllTimers() {
      if (this.manualInputTimer) {
        clearTimeout(this.manualInputTimer);
        this.manualInputTimer = null;
      }
      if (this.scanTimer) {
        clearTimeout(this.scanTimer);
        this.scanTimer = null;
      }
    },
    handleDialogClose() {
      this.show = false;
      this.resetData();
    },
    // ç¡®è®¤æŒ‰é’®
    async handleConfirm() {
      if (!await this.validateForm()) return;
      if (this.materials.length === 0) {
        this.$message.warning('请至少添加一个物料');
        return;
      }
      if (!this.trayBarcode) {
        this.$message.warning('请输入托盘条码');
        return;
      }
      const result = {
        warehouseType: this.form.warehouseType,
        warehouseName: this.currentWarehouseName,
        locationType: this.form.locationType,
        locationDesc: this.currentLocationDesc,
        trayBarcode: this.trayBarcode,
        materials: this.materials,
        docNo: this.docNo
      };
      // è§¦å‘父组件的 back-success äº‹ä»¶
      this.$emit('back-success', result);
      this.palletVisible = false;
    },
    // å¤„理托盘输入
    handleTrayInput() {
      // æ ‡è®°ä¸ºæ‰‹åŠ¨è¾“å…¥æ¨¡å¼
      this.isManualInput = true;
      this.isScanning = false;
      // æ¸…除之前的计时器
      if (this.manualInputTimer) {
        clearTimeout(this.manualInputTimer);
      }
      // è®¾ç½®è®¡æ—¶å™¨ï¼Œå¦‚果一段时间内没有输入,则重置为扫码模式
      this.manualInputTimer = setTimeout(() => {
        this.isManualInput = false;
      }, 1000);
    },
    // å¤„理物料输入
    handleBarcodeInput() {
      // æ ‡è®°ä¸ºæ‰‹åŠ¨è¾“å…¥æ¨¡å¼
      this.isManualInput = true;
      this.isScanning = false;
      // æ¸…除之前的计时器
      if (this.manualInputTimer) {
        clearTimeout(this.manualInputTimer);
      }
      // è®¾ç½®è®¡æ—¶å™¨ï¼Œå¦‚果一段时间内没有输入,则重置为扫码模式
      this.manualInputTimer = setTimeout(() => {
        this.isManualInput = false;
      }, 1000);
    },
    // å¤„理托盘条码提交
    async handleTraySubmit() {
      // å…ˆç›´æŽ¥æ£€æŸ¥locationType,避免表单验证的异步问题
      if (!this.form.warehouseType) {
        this.error = '请先选择仓库';
        return;
      }
      if (!this.form.locationType) {
        this.error = '请先选择仓库区域';
        //this.$message.warning('请先选择仓库区域');
        return;
      }
      // ç„¶åŽå†è¿›è¡Œå®Œæ•´çš„表单验证
      if (!await this.validateForm()) return;
      const currentTrayBarcode = this.trayBarcode.trim();
      if (!currentTrayBarcode) {
        this.error = '请输入或扫描托盘条码';
        return;
      }
      this.error = '';
      if (!this.trayBarcodeReg.test(currentTrayBarcode)) {
        // ElMessage.warning({
        //   message: '托盘号格式错误',
        //   type: 'warning',
        //   duration: 3000
        // })
        this.$message("托盘号格式错误");
        this.focusTrayInput();
        return;
      }
      // è®¾ç½®æ‰˜ç›˜æ¡ç åŽï¼Œè‡ªåŠ¨èšç„¦åˆ°ç‰©æ–™è¾“å…¥æ¡†
      this.focusBarcodeInput();
      // this.$message({
      //   message: `托盘条码已设置: ${currentTrayBarcode}`,
      //   type: 'success',
      //   duration: 2000
      // });
      this.$message.success(`托盘条码已设置: ${currentTrayBarcode}`);
    },
    // æ¸…除托盘
    clearTray() {
      this.trayBarcode = '';
      this.materials = [];
      this.focusTrayInput();
      this.$message({
        message: '托盘条码已清除',
        type: 'info',
        duration: 2000
      });
    },
    // æ¸…空托盘输入
    handleTrayClear() {
      this.error = '';
    },
    // æ¸…空输入
    handleClear() {
      this.error = '';
      this.scanCode = '';
      this.isManualInput = false;
      this.isScanning = false;
    },
    // å¤„理物料条码提交
    async handleBarcodeSubmit() {
      if (!await this.validateForm()) return;
      const currentBarcode = this.barcode.trim();
      if (!this.trayBarcode) {
        this.error = '请先输入托盘条码';
        this.focusTrayInput();
        return;
      }
      if (!currentBarcode) {
        this.error = '请输入或扫描物料条码';
        return;
      }
      this.focusBarcodeInput();
      this.error = '';
      this.loading = true;
      try {
        // è°ƒç”¨API查询物料信息
        const materialData = await this.fetchMaterialData(currentBarcode);
        if (!materialData || materialData.length === 0) {
          return;
        }
        this.materials = [];
        materialData.forEach(item => {
          this.materials.push({
            ...item,
            trayCode: this.trayBarcode,
            locationType: this.form.locationType,
            locationDesc: this.currentLocationDesc,
            scanTime: this.formatTime(new Date())
          });
        });
        this.orderNo = materialData[0].orderNo;
        await this.fetchStockStatistics(materialData[0].orderNo);
        await this.fetchUnpalletMaterialDetails();
        // æ¸…空物料输入框并保持聚焦
        this.barcode = '';
        this.scanCode = ''; // æ¸…空扫码缓存
        this.isScanning = false;
        setTimeout(() => {
          this.focusBarcodeInput();
        }, 100);
      } catch (err) {
        this.error = err.message || '查询条码信息失败,请重试';
        this.focusBarcodeInput();
        setTimeout(() => {
          // é€‰ä¸­è¾“入框内的错误内容(确保focus完成后执行)
          const inputEl = this.$refs.barcodeInput?.$el?.querySelector('input');
          if (inputEl) inputEl.select();
        }, 100);
      } finally {
        this.loading = false;
      }
    },
    // API请求 - æ›¿æ¢ä¸ºå®žé™…çš„API调用
    async fetchMaterialData(barcode) {
      try {
        const response = await http.post('/api/Inbound/ReCheckGroupPallet',
          {
            palletCode: this.trayBarcode,
            barcode: barcode,
            locationTypeDesc: this.currentLocationDesc,
            locationType: this.form.locationType, // æ·»åŠ ä»“åº“åŒºåŸŸä¿¡æ¯
            warehouseType: this.form.warehouseType
          }
        );
        let materialData;
        if (typeof response.data === 'string') {
          try {
            materialData = JSON.parse(response.data);
          } catch (e) {
          }
        } else {
          materialData = response.data;
        }
        if (!response.status) {
          this.error = response.message || '查询条码信息失败,请重试';
        }
        return materialData;
      } catch (error) {
        console.error('API调用失败:', error);
      }
    },
    // å¤„理扫码枪输入
    handleKeyPress(event) {
      // å¦‚果是手动输入模式,不处理扫码枪逻辑
      if (this.isManualInput) {
        return;
      }
      const key = event.key;
      const currentTime = new Date().getTime();
      // å¿½ç•¥ç›´æŽ¥æŒ‰ä¸‹çš„回车键(由handleBarcodeSubmit处理)
      if (key === 'Enter') {
        if (this.scanCode.length > 0) {
          // é˜»æ­¢é»˜è®¤å›žè½¦è¡Œä¸ºï¼Œé¿å…è¡¨å•提交
          event.preventDefault();
          // æ‰«ç å®Œæˆï¼Œè‡ªåŠ¨è§¦å‘æŸ¥è¯¢
          this.isScanning = false;
          // æ ¹æ®å½“前扫码目标设置相应的输入框值
          if (this.scanTarget === 'tray') {
            this.trayBarcode = this.scanCode;
            this.handleTraySubmit();
          } else if (this.scanTarget === 'material') {
            this.barcode = this.scanCode;
            this.handleBarcodeSubmit();
          }
        }
        this.scanCode = '';
        this.lastKeyTime = null;
        return;
      }
      // æž„建扫码内容(快速连续输入视为扫码)
      if (this.lastKeyTime && currentTime - this.lastKeyTime < 50) {
        this.scanCode += key;
        this.isScanning = true;
      } else {
        this.scanCode = key;
        this.isScanning = true;
      }
      // è®¾ç½®è®¡æ—¶å™¨ï¼Œå¦‚果一段时间内没有输入,则重置扫描状态
      if (this.scanTimer) {
        clearTimeout(this.scanTimer);
      }
      this.scanTimer = setTimeout(() => {
        this.isScanning = false;
      }, 100);
      this.lastKeyTime = currentTime;
    },
    // æ ¼å¼åŒ–æ—¶é—´
    formatTime(date) {
      const year = date.getFullYear();
      const month = String(date.getMonth() + 1).padStart(2, '0');
      const day = String(date.getDate()).padStart(2, '0');
      const hours = String(date.getHours()).padStart(2, '0');
      const minutes = String(date.getMinutes()).padStart(2, '0');
      const seconds = String(date.getSeconds()).padStart(2, '0');
      return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
    }
  }
}
</script>
<style scoped>
.barcode-scanner-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  height: 100%;
  gap: 8px;
}
/* ç´§å‡‘布局样式 */
.compact {
  margin-bottom: 0;
}
.compact-form {
  margin-bottom: 0;
}
.compact-item {
  margin-bottom: 0;
}
.compact-card {
  margin-bottom: 0;
}
.compact-card>>>.el-card__body {
  padding: 12px;
}
.compact-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 !important;
}
.compact-header>>>.el-card__header {
  padding: 8px 12px;
}
.compact-input {
  margin: 8px 0;
}
.compact-tips {
  margin-top: 8px;
  font-size: 11px;
}
/* ä»“库区域选择 - ç´§å‡‘ */
.location-section.compact {
  margin-bottom: 8px;
}
.location-section.compact>>>.el-form-item {
  margin-bottom: 0;
}
/* æ‰˜ç›˜ä¿¡æ¯ - ç´§å‡‘ */
.tray-info.compact {
  padding: 6px 10px;
  margin-bottom: 8px;
  font-size: 13px;
}
/* æ‰«ç åŒºåŸŸ - ç´§å‡‘ */
.input-section.compact {
  margin-bottom: 8px;
  flex-shrink: 0;
}
/* ç‰©æ–™åˆ—表 - å›ºå®šé«˜åº¦å¸¦æ»šåЍ */
.material-list.compact {
  flex: 1;
  min-height: 0;
  /* é‡è¦ï¼šå…è®¸flex子项收缩 */
  display: flex;
  flex-direction: column;
}
.material-list.compact>>>.el-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.material-list.compact>>>.el-card__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 0;
  min-height: 0;
}
.table-container {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.material-list.compact>>>.el-table {
  flex: 1;
}
.material-list.compact>>>.el-table__body-wrapper {
  overflow-y: auto;
}
/* ç´§å‡‘的空状态 */
.empty-state.compact {
  padding: 20px 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}
.empty-state.compact i {
  font-size: 36px;
  margin-bottom: 8px;
}
.empty-state.compact p {
  font-size: 13px;
}
/* å…¶ä»–原有样式调整 */
.page-title {
  text-align: center;
  margin-bottom: 15px;
}
.scan-status {
  font-size: 12px;
  color: #67C23A;
}
.scan-indicator {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #67C23A;
  margin-right: 5px;
  animation: pulse 1.5s infinite;
}
@keyframes pulse {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0.4;
  }
  100% {
    opacity: 1;
  }
}
.input-wrapper {
  position: relative;
}
.input-tips {
  margin-top: 6px;
  color: #909399;
}
.warning-text {
  color: #E6A23C;
  font-weight: bold;
}
.loading.compact {
  text-align: center;
  margin: 10px 0;
  padding: 5px;
}
.loading.compact p {
  margin-top: 5px;
  color: #409EFF;
  font-size: 12px;
}
.error-message.compact {
  margin: 5px 0;
}
.error-message.compact>>>.el-alert {
  padding: 6px 12px;
}
.list-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}
.list-actions>>>.el-tag {
  height: 24px;
  line-height: 22px;
  padding: 0 6px;
}
.clear-all-btn {
  margin-left: 8px;
}
.material-code {
  font-family: 'Courier New', monospace;
  font-weight: bold;
  color: #409EFF;
}
.location-info {
  color: #606266;
  font-weight: normal;
}
.debug-info {
  background: #f5f7fa;
  padding: 8px;
  border-radius: 4px;
  margin-top: 8px;
  font-size: 11px;
  color: #909399;
}
.small-button {
  padding: 6px 8px;
  font-size: 11px;
}
/* è¾“入框组样式调整 */
.custom-input-group {
  display: flex;
  align-items: center;
  width: 100%;
  margin: 8px 0;
  border: 1px solid #DCDFE6;
  border-radius: 4px;
  overflow: hidden;
  background: #fff;
}
.input-label {
  padding: 0 12px;
  background: #F5F7FA;
  border-right: 1px solid #DCDFE6;
  color: #606266;
  font-size: 13px;
  white-space: nowrap;
  height: 36px;
  line-height: 36px;
  flex-shrink: 0;
  min-width: 70px;
  text-align: center;
}
.input-container {
  display: flex;
  flex: 1;
  align-items: center;
}
.custom-input {
  flex: 1;
}
.custom-input>>>.el-input__inner {
  border: none;
  border-radius: 0;
  height: 36px;
  line-height: 36px;
  font-size: 13px;
}
/* å“åº”式调整 */
@media (max-width: 768px) {
  .barcode-scanner-container {
    padding: 5px;
  }
  .custom-input-group {
    flex-direction: column;
    border: none;
  }
  .input-label {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid #DCDFE6;
    margin-bottom: 5px;
  }
  .input-container {
    width: 100%;
    border: 1px solid #DCDFE6;
    border-radius: 4px;
  }
  .unpallet-section.compact {
    margin-bottom: 8px;
    flex-shrink: 0;
  }
  .unpallet-card {
    flex-shrink: 0;
  }
  .unpallet-barcode-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 0;
    max-height: 180px;
    overflow-y: auto;
  }
  .unpallet-barcode-list>>>.el-tag {
    cursor: pointer;
    max-width: calc(33.333% - 4px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  @media (max-width: 768px) {
    .unpallet-barcode-list>>>.el-tag {
      max-width: calc(50% - 4px);
    }
  }
}
</style>
ÏîÄ¿´úÂë/WIDESEA_WMSClient/src/extension/check/recheckOrder.js
@@ -1,5 +1,6 @@
//此js文件是用来自定义扩展业务代码,可以扩展一些自定义页面或者重新配置生成的代码
import gridBody from './extend/StockSelect.vue'
import gridBody from './extend/StockSelect.vue';
import gridFooter from "./extend/ReCheckGroupPallet.vue";
import http from '@/api/http.js'
import { h, createVNode, render, reactive, ref } from 'vue';
import { ElDialog, ElForm, ElFormItem, ElInput, ElButton, ElMessage, ElSelect, ElOption } from 'element-plus'; // å¼•å…¥ElMessage,解决提示无反应
@@ -8,7 +9,7 @@
    //查询界面扩展组件
    gridHeader: '',
    gridBody: gridBody,
    gridFooter: '',
    gridFooter: gridFooter,
    //新建、编辑弹出框扩展组件
    modelHeader: '',
    modelBody: '',
@@ -48,30 +49,13 @@
  methods: {
    //下面这些方法可以保留也可以删除
    onInit() {  //框架初始化配置前,
      let ReCheckGroupPalletBtn = this.buttons.find(x => x.value === 'ReCheckGroupPallet');
            if (ReCheckGroupPalletBtn) {
              // é‡å†™æŒ‰é’®ç‚¹å‡»äº‹ä»¶
              ReCheckGroupPalletBtn.onClick = function () {
      let EmptyTrayOutboundBtn = this.buttons.find(x => x.value == 'BatchOrder');
      if (EmptyTrayOutboundBtn) {
        EmptyTrayOutboundBtn.onClick = function () {
          let rows = this.$refs.table.getSelected();
          if (rows.length == 0) return this.$error("请选择数据!");
          if (rows.length > 1) return this.$error("请选择一条数据!");
          this.$router.push({
            path: '/outbound/picking',
            query: { orderId: rows[0].id,orderNo:rows[0].orderNo}
          })
        }
      }
      let GroupPalletBtn = this.buttons.find(x=>x.value =='GroupPallet')
      if(GroupPalletBtn){
        GroupPalletBtn.onClick = function(){
          let rows  = this.$refs.table.getSelected();
          if(rows.length ==0 || rows.length>1) return ElMessage.warning('请选择一条单据');
          const targetRow = rows[0];
          this.$emit('openPalletDialog', targetRow.orderNo);
        }
                this.$refs.gridFooter.open();
              };
      }
    },
    onInited() {
ÏîÄ¿´úÂë/WMSÎÞ²Ö´¢°æ/WIDESEA_WMSServer/WIDESEA_BasicService/MESOperation/FeedbackMesService.cs
@@ -98,7 +98,23 @@
                    if (returnDTO.Details.Count <= 0)
                    {
                        if (returnRecords.Count() == returnRecords.Count(x => x.ReturnStatus == 1))
                        {
                            outboundOrder.ReturnToMESStatus = 1;
                        }
                        else if (returnRecords.Count(x => x.ReturnStatus == 2) > 0)
                        {
                            outboundOrder.ReturnToMESStatus = 4;
                        }
                        else if (returnRecords.Count() == returnRecords.Count(x => x.ReturnStatus == 2))
                        {
                            outboundOrder.ReturnToMESStatus = 2;
                        }
                        _outboundOrderRepository.UpdateData(outboundOrder);
                        return webResponse = WebResponseContent.Instance.OK($"该单据没有需要回传明细,失败数据回传{returnRecords.Count()}条,回传成功{returnRecords.Count(x=>x.ReturnStatus == 1)}条,回传失败{returnRecords.Count(x => x.ReturnStatus == 2)}条");
                    }
                    string apiUrl = AppSettings.GetValue("MaterialOutboundFeedbackUrl");
@@ -129,6 +145,21 @@
                    if (returnDTO.Details.Count <= 0)
                    {
                        if(returnRecords.Count() == returnRecords.Count(x => x.ReturnStatus == 1))
                        {
                            outboundOrder.ReturnToMESStatus = 1;
                        }
                        else if(returnRecords.Count(x => x.ReturnStatus == 2)>0)
                        {
                            outboundOrder.ReturnToMESStatus = 4;
                        }
                        else if (returnRecords.Count() == returnRecords.Count(x => x.ReturnStatus == 2))
                        {
                            outboundOrder.ReturnToMESStatus = 2;
                        }
                        _outboundOrderRepository.UpdateData(outboundOrder);
                        return webResponse = WebResponseContent.Instance.OK($"该单据没有需要回传明细,失败数据回传{returnRecords.Count()}条,回传成功{returnRecords.Count(x => x.ReturnStatus == 1)}条,回传失败{returnRecords.Count(x => x.ReturnStatus == 2)}条");
                    }
ÏîÄ¿´úÂë/WMSÎÞ²Ö´¢°æ/WIDESEA_WMSServer/WIDESEA_CheckService/ReCheckOrderService.cs
@@ -8,6 +8,7 @@
using System.Text;
using System.Threading.Tasks;
using WIDESEA_Common.OrderEnum;
using WIDESEA_Common.StockEnum;
using WIDESEA_Core;
using WIDESEA_Core.BaseRepository;
using WIDESEA_Core.BaseServices;
@@ -18,6 +19,7 @@
using WIDESEA_ICheckService;
using WIDESEA_IOutboundService;
using WIDESEA_Model.Models;
using WIDESEA_Model.Models.Basic;
using WIDESEA_Model.Models.Check;
namespace WIDESEA_CheckService
@@ -75,6 +77,18 @@
                model.Creater = "MES";
                model.CreateDate = DateTime.Now;
                model.MaterielName = materielInfo?.MaterielName ?? "";
                var stockDetailIds = BaseDal.Db.Queryable<Dt_StockInfoDetail>()
                .Where(x => x.MaterielCode == model.MaterielCode && x.BatchNo == model.BatchNo && x.ValidDate !=null)
                .Select(x => x.Id)
                .ToList();
                if (stockDetailIds.Count > 0)
                {
                    BaseDal.Db.Updateable<Dt_StockInfoDetail>()
                        .SetColumns(x => x.Status == StockStatusEmun.手动冻结.ObjToInt())
                        .Where(x => stockDetailIds.Contains(x.Id))
                        .ExecuteCommand();
                }
                BaseDal.AddData(model);
                var outboundOrders = ConvertToOutboundOrders(model);
             
@@ -102,6 +116,45 @@
                {
                    isupdate = true;    
                }
                if (model.Result != 0 && recheckOrder.SignSeq != model.SignSeq)
                {
                    var stockDetailIds = BaseDal.Db.Queryable<Dt_StockInfoDetail>()
                    .Where(x => x.MaterielCode == model.MaterielCode && x.BatchNo == model.BatchNo && x.ValidDate != null)
                    .Select(x => x.Id)
                    .ToList();
                    if (stockDetailIds.Count > 0)
                    {
                        var datevaliDate = BaseDal.Db.Queryable<Dt_MaterialExpirationDate>().Where(x => x.MaterialCode.Contains(model.MaterielCode.Substring(0, 6))).First();
                        BaseDal.Db.Updateable<Dt_StockInfoDetail>()
                            .SetColumns(x => x.Status == StockStatusEmun.入库完成.ObjToInt())
                            .Where(x => stockDetailIds.Contains(x.Id))
                            .ExecuteCommand();
                        if (model.InspectionNumber == 1)
                        {
                            BaseDal.Db.Updateable<Dt_StockInfoDetail>()
                            .SetColumns(x => x.ValidDate == Convert.ToDateTime(x.ValidDate).AddDays(Convert.ToDouble(datevaliDate.OneExtensionDays)))
                            .Where(x => stockDetailIds.Contains(x.Id))
                            .ExecuteCommand();
                        }
                        else if (model.InspectionNumber == 2)
                        {
                            BaseDal.Db.Updateable<Dt_StockInfoDetail>()
                            .SetColumns(x => x.ValidDate == Convert.ToDateTime(x.ValidDate).AddDays(Convert.ToDouble(datevaliDate.TwoExtensionDays)))
                            .Where(x => stockDetailIds.Contains(x.Id))
                            .ExecuteCommand();
                        }
                        else
                        {
                            BaseDal.Db.Updateable<Dt_StockInfoDetail>()
                            .SetColumns(x => x.ValidDate == Convert.ToDateTime(x.ValidDate).AddDays(Convert.ToDouble(datevaliDate.ThreeExtensionDays)))
                            .Where(x => stockDetailIds.Contains(x.Id))
                            .ExecuteCommand();
                        }
                    }
                }
                recheckOrder.OrderNo = model.OrderNo;
                recheckOrder.MaterielCode = model.MaterielCode;
                recheckOrder.BatchNo = model.BatchNo;
@@ -116,6 +169,7 @@
                recheckOrder.ModifyDate = DateTime.Now;
                var materielInfo = _materielInfoService.Db.Queryable<Dt_MaterielInfo>().First(x => model.MaterielCode.Equals(x.MaterielCode));
                recheckOrder.MaterielName= materielInfo?.MaterielName??"";
                BaseDal.UpdateData(recheckOrder);
                if (isupdate)
ÏîÄ¿´úÂë/WMSÎÞ²Ö´¢°æ/WIDESEA_WMSServer/WIDESEA_IInboundService/IInboundService.cs
@@ -37,6 +37,13 @@
        Task<WebResponseContent> StockTakeGroupPallet(GroupPalletDto palletDto);
        /// <summary>
        /// é‡æ£€ç»„盘
        /// </summary>
        /// <param name="palletDto"></param>
        /// <returns></returns>
        Task<WebResponseContent> ReCheckGroupPallet(GroupPalletDto palletDto);
        /// <summary>
        /// å…¥åº“分批回传
        /// </summary>
        /// <param name="OrderNo"></param>
ÏîÄ¿´úÂë/WMSÎÞ²Ö´¢°æ/WIDESEA_WMSServer/WIDESEA_InboundService/InboundService.cs
@@ -31,6 +31,7 @@
using WIDESEA_IStockService;
using WIDESEA_Model.Models;
using WIDESEA_Model.Models.Basic;
using WIDESEA_Model.Models.Check;
namespace WIDESEA_InboundService
{
@@ -443,6 +444,19 @@
                    if (allocatefeedmodel.Details.Count <= 0)
                    {
                        if (returnRecords.Count() == returnRecords.Count(x => x.ReturnStatus == 1))
                        {
                            inboundOrder.ReturnToMESStatus = 1;
                        }
                        else if (returnRecords.Count(x => x.ReturnStatus == 2) > 0)
                        {
                            inboundOrder.ReturnToMESStatus = 4;
                        }
                        else if (returnRecords.Count() == returnRecords.Count(x => x.ReturnStatus == 2))
                        {
                            inboundOrder.ReturnToMESStatus = 2;
                        }
                        _inboundOrderRepository.UpdateData(inboundOrder);
                        return WebResponseContent.Instance.OK($"该单据没有需要回传明细,失败数据回传{returnRecords.Count()}条,回传成功{returnRecords.Count(x => x.ReturnStatus == 1)}条,回传失败{returnRecords.Count(x => x.ReturnStatus == 2)}条");
                    }
@@ -477,6 +491,19 @@
                    if (feedmodel.details.Count<=0)
                    {
                        if (returnRecords.Count() == returnRecords.Count(x => x.ReturnStatus == 1))
                        {
                            inboundOrder.ReturnToMESStatus = 1;
                        }
                        else if (returnRecords.Count(x => x.ReturnStatus == 2) > 0)
                        {
                            inboundOrder.ReturnToMESStatus = 4;
                        }
                        else if (returnRecords.Count() == returnRecords.Count(x => x.ReturnStatus == 2))
                        {
                            inboundOrder.ReturnToMESStatus = 2;
                        }
                        _inboundOrderRepository.UpdateData(inboundOrder);
                        return WebResponseContent.Instance.OK($"该单据没有需要回传明细,失败数据回传{returnRecords.Count()}条,回传成功{returnRecords.Count(x => x.ReturnStatus == 1)}条,回传失败{returnRecords.Count(x => x.ReturnStatus == 2)}条");
                    }
                    var response = responseModel(inboundOrder, 3, feedmodel);
@@ -716,5 +743,93 @@
                return content.Error(ex.Message);
            }
        }
        public async Task<WebResponseContent> ReCheckGroupPallet(GroupPalletDto palletDto)
        {
            WebResponseContent content = new WebResponseContent();
            try
            {
                (bool, string, object?) result2 = ModelValidate.ValidateModelData(palletDto);
                if (!result2.Item1) return content.Error(result2.Item2);
                var code = _warehouseAreaRepository.Db.Queryable<Dt_WarehouseArea>().Where(x => x.Code == palletDto.WarehouseType).Select(x => x.Code).First();
                if (string.IsNullOrEmpty(code))
                {
                    return content.Error($"仓库中没有该{palletDto.WarehouseType}编号。");
                }
                Dt_StockInfo? stockInfo = await _stockInfoRepository.Db.Queryable<Dt_StockInfo>().Includes(x => x.Details).Where(x => x.PalletCode == palletDto.PalletCode).FirstAsync();
                if (_taskRepository.QueryFirst(x => x.PalletCode == palletDto.PalletCode) != null)
                {
                    return content.Error($"该托盘已生成任务");
                }
                if (stockInfo != null && !string.IsNullOrEmpty(stockInfo.LocationCode) && stockInfo.StockStatus != (int)StockStatusEmun.组盘暂存)
                {
                    return content.Error("已上架的托盘不能再次组盘");
                }
                if (stockInfo == null)
                {
                    stockInfo = new Dt_StockInfo() { PalletType = (int)PalletTypeEnum.None, LocationType = Convert.ToInt32(palletDto.locationType) };
                    stockInfo.Details = new List<Dt_StockInfoDetail>();
                }
                if (stockInfo != null && stockInfo.Details.Count > 0 && stockInfo.Details.FirstOrDefault()?.WarehouseCode != palletDto.WarehouseType)
                {
                    return content.Error($"该托盘组盘仓库为{stockInfo.Details.FirstOrDefault()?.WarehouseCode}与当前仓库{palletDto.WarehouseType}不一致,不允许组盘");
                }
                Dt_StockInfoDetail stockInfoDetail = _stockInfoRepository.Db.Queryable<Dt_StockInfoDetail>().Where(x => x.Barcode == palletDto.Barcode && x.Status == StockStatusEmun.手动冻结.ObjToInt()).First();
                if(stockInfoDetail == null)
                {
                    return content.Error("未找到库存中重检冻结的条码");
                }
                Dt_ReCheckOrder reCheckOrder = _stockInfoRepository.Db.Queryable<Dt_ReCheckOrder>().Where(x => x.MaterielCode == stockInfoDetail.MaterielCode && x.BatchNo == stockInfoDetail.BatchNo && x.Result == 0).First();
                if(reCheckOrder != null)
                {
                    return content.Error($"该重检条码的批次在重检单中未拿到重检结果,请检测重检单{reCheckOrder.OrderNo}状态");
                }
                stockInfo.Details.Add(new Dt_StockInfoDetail
                {
                    StockId = stockInfo == null ? 0 : stockInfo.Id,
                    Barcode = stockInfoDetail.Barcode,
                    MaterielCode = stockInfoDetail.MaterielCode,
                    MaterielName = stockInfoDetail.MaterielName,
                    BatchNo = stockInfoDetail.BatchNo,
                    Unit = stockInfoDetail.Unit,
                    SupplyCode = stockInfoDetail.SupplyCode,
                    WarehouseCode = stockInfoDetail.WarehouseCode,
                    StockQuantity = stockInfoDetail.StockQuantity,
                    BarcodeQty = stockInfoDetail.BarcodeQty,
                    BarcodeUnit = stockInfoDetail.BarcodeUnit,
                    FactoryArea = stockInfoDetail.FactoryArea,
                    Status = stockInfoDetail.Status,
                    OrderNo = stockInfoDetail.OrderNo,
                    BusinessType = "30",
                    ValidDate = stockInfoDetail.ValidDate
                });
                _stockInfoRepository.Db.Deleteable<Dt_StockInfoDetail>().Where(x => x.Barcode == stockInfoDetail.Barcode).ExecuteCommand();
                if (stockInfo.Id == 0)
                {
                    stockInfo.PalletCode = palletDto.PalletCode;
                    stockInfo.StockStatus = (int)StockStatusEmun.送检库存完成;
                }
                stockInfo.PalletType = (int)PalletTypeEnum.None;
                _unitOfWorkManage.BeginTran();
                _stockService.StockInfoService.AddMaterielGroup(stockInfo);
                _unitOfWorkManage.CommitTran();
                Dt_StockInfo? NewstockInfo = await _stockInfoRepository.Db.Queryable<Dt_StockInfo>().Includes(x => x.Details).Where(x => x.PalletCode == palletDto.PalletCode).FirstAsync();
                return WebResponseContent.Instance.OK(data: NewstockInfo.Details.OrderByDescending(x => x.Id));
            }
            catch (Exception ex)
            {
                _unitOfWorkManage.RollbackTran();
                LogFactory.GetLog($"组盘信息").Info(true, $"【异常】:【{ex.Message}】{Environment.NewLine}【{ex.StackTrace}】{Environment.NewLine}{Environment.NewLine}");
                return content.Error(ex.Message);
            }
        }
    }
}
ÏîÄ¿´úÂë/WMSÎÞ²Ö´¢°æ/WIDESEA_WMSServer/WIDESEA_InboundService/TakeStockOrderService.cs
@@ -399,83 +399,6 @@
                {
                    return WebResponseContent.Instance.Error("未找到该盘点差异数据");
                }
                //if(takeStockOrderDetail.Remark == "盘盈")
                //{
                //    Dt_InboundOrderDetail inboundOrderDetail = _inboundOrderDetailRepository.QueryFirst(x => x.Id == orderId);
                //    if(inboundOrderDetail == null)
                //    {
                //        return WebResponseContent.Instance.Error("未找到选择的杂收平账单据");
                //    }
                //    Dt_InboundOrder inboundOrder = _inboundOrderRepository.Db.Queryable<Dt_InboundOrder>().Where(x=>x.Id == inboundOrderDetail.OrderId).Includes(x=>x.Details).First();
                //    Dt_StockInfo  stockInfo = _stockInfoRepository.Db.Queryable<Dt_StockInfo>().Where(x=>x.PalletCode == takeStockOrderDetail.TakePalletCode && x.StockStatus == StockStatusEmun.盘点库存完成.ObjToInt()).Includes(x=>x.Details).First();
                //    if(stockInfo== null)
                //    {
                //        return WebResponseContent.Instance.Error($"盘点托盘{takeStockOrderDetail.TakePalletCode}的库存信息未找到,或托盘状态不正确");
                //    }
                //    var datevaliDate = _inboundOrderRepository.Db.Queryable<Dt_MaterialExpirationDate>().Where(x => x.MaterialCode.Contains(inboundOrderDetail.MaterielCode.Substring(0, 6))).First();
                //    var newStockDetail = new Dt_StockInfoDetail
                //    {
                //        StockId = stockInfo == null ? 0 : stockInfo.Id,
                //        Barcode = inboundOrderDetail.Barcode,
                //        MaterielCode = inboundOrderDetail.MaterielCode,
                //        MaterielName = inboundOrderDetail.MaterielName,
                //        BatchNo = inboundOrderDetail.BatchNo,
                //        Unit = inboundOrderDetail.Unit,
                //        InboundOrderRowNo = inboundOrderDetail.lineNo,
                //        SupplyCode = inboundOrderDetail.SupplyCode,
                //        WarehouseCode = inboundOrderDetail.WarehouseCode,
                //        StockQuantity = inboundOrderDetail.OrderQuantity,
                //        BarcodeQty = inboundOrderDetail.BarcodeQty,
                //        BarcodeUnit = inboundOrderDetail.BarcodeUnit,
                //        FactoryArea = inboundOrder.FactoryArea,
                //        Status = 0,
                //        OrderNo = inboundOrder.InboundOrderNo,
                //        BusinessType = inboundOrder.BusinessType,
                //        ValidDate = inboundOrder.BusinessType == BusinessTypeEnum.外部仓库调智仓.ToString() ? inboundOrderDetail.ValidDate : datevaliDate == null ? null : Convert.ToDateTime(DateTime.Now).AddDays(Convert.ToDouble(datevaliDate.ValidityDays)),
                //    };
                //    stockInfo.Details.Add(newStockDetail);
                //    inboundOrderDetail.ReceiptQuantity = inboundOrderDetail.OrderQuantity;
                //    inboundOrderDetail.OverInQuantity = inboundOrderDetail.OrderQuantity;
                //    inboundOrderDetail.OrderDetailStatus = OrderDetailStatusEnum.Over.ObjToInt();
                //    int overCount = 1;
                //    int moreOverCount = inboundOrder.Details.Count(x => x.OrderDetailStatus == OrderDetailStatusEnum.Over.ObjToInt());
                //    if (inboundOrder.Details.Count() == overCount + moreOverCount)
                //    {
                //        inboundOrder.OrderStatus = InOrderStatusEnum.入库完成.ObjToInt();
                //    }
                //    else
                //    {
                //        inboundOrder.OrderStatus = InOrderStatusEnum.入库中.ObjToInt();
                //    }
                //    takeStockOrderDetail.DifferenceQty -= inboundOrderDetail.OrderQuantity;
                //    if(takeStockOrderDetail.DifferenceQty > 0)
                //    {
                //        takeStockOrderDetail.TakeDetalStatus = TakeStockDetailStatusEnum.杂收杂发平账处理中.ObjToInt();
                //    }
                //    else if (takeStockOrderDetail.DifferenceQty == 0)
                //    {
                //        takeStockOrderDetail.TakeDetalStatus = TakeStockDetailStatusEnum.杂收杂发平账处理.ObjToInt();
                //    }
                //    else
                //    {
                //        return WebResponseContent.Instance.Error("该杂收单据明细条码数量大于待平账数量,请另选其他单据平账");
                //    }
                //    _unitOfWorkManage.BeginTran();
                //    _inboundOrderRepository.UpdateData(inboundOrder);
                //    _inboundOrderDetailRepository.UpdateData(inboundOrderDetail);
                //    _takeStockOrderDetail.UpdateData(takeStockOrderDetail);
                //    BaseDal.Db.Insertable(newStockDetail).ExecuteCommand();
                //    _unitOfWorkManage.CommitTran();
                //    List<string> barcodes = new List<string>();
                //    barcodes.Add(inboundOrderDetail.Barcode);
                //    _outboundPickingService.NoStockOutBatchInOrderFeedbackToMes(inboundOrder.Id, barcodes);
                //}
                //else
                //{
                Dt_OutboundOrderDetail outboundOrderDetail = _outboundOrderDetailRepository.QueryFirst(x => x.Remark == takeStockOrderDetail.TakeStockNo && (x.OrderQuantity-x.LockQuantity-x.MoveQty)>0);
                if (outboundOrderDetail == null)
                {
@@ -711,10 +634,11 @@
                    List<Dt_OutboundOrderDetail> details = _outboundOrderDetailRepository.QueryData(x => x.OrderId == outboundOrder.Id);
                    if(details.All(x => x.OverOutQuantity >= x.OrderQuantity - x.MoveQty))
                    {
                        _feedbackMesService.OutboundFeedback(outboundOrder.OrderNo);
                        outboundOrder.OrderStatus = OutOrderStatusEnum.出库完成.ObjToInt();
                        _outboundOrderRepository.UpdateData(outboundOrder);
                    }
                    _feedbackMesService.OutboundFeedback(outboundOrder.OrderNo);
                }
                catch (Exception ex)
ÏîÄ¿´úÂë/WMSÎÞ²Ö´¢°æ/WIDESEA_WMSServer/WIDESEA_OutboundService/OutboundService.cs
@@ -193,8 +193,14 @@
                    UpdateStockStatus(pickedDetails.Select(x => x.PalletCode).ToList(), StockStatusEmun.出库锁定.ObjToInt());
                    UpdateLocationStatus(pickedDetails.Select(x => x.LocationCode).ToList(), LocationStatusEnum.Lock.ObjToInt());
                }
                //重检单不拣选,去掉锁定记录回库,再次组盘时扣除原条码
                if (outboundOrder.OrderType != InOrderTypeEnum.ReCheck.ObjToInt())
                {
                UpdateOutStockLockInfo(outStockLockInfos);
                }
                if (tasks.Any()) _taskRepository.AddData(tasks);
                _unitOfWorkManage.CommitTran();
@@ -484,7 +490,7 @@
                x => request.StockDetailIds.Contains(x.Id)
                && x.MaterielCode == materielCalc.MaterielCode
                && x.StockQuantity > 0
                && (x.Status == (int)StockStatusEmun.入库完成 || x.Status == (int)StockStatusEmun.手动解锁));
                && (x.Status == (int)StockStatusEmun.入库完成 || x.Status == (int)StockStatusEmun.手动冻结)|| x.Status == (int)StockStatusEmun.手动解锁);
            if (!specifiedStockDetails.Any())
            {
@@ -670,15 +676,13 @@
                    decimal totalAllocatedQuantity = CalcTotalAllocatedQuantity(lockInfos, stockInfo.Id, detail.MaterielCode);
                    lockInfo.AssignQuantity += actualAllocatedQuantity;
                    lockInfo.AllocatedQuantity = totalAllocatedQuantity;
                    // å­˜é‡é”å®šè®°å½•也更新OriginalQuantity为托盘总库存(可选,保持数据一致)
                    if (palletMaterielTotalStock > 0)
                        lockInfo.OriginalQuantity = palletMaterielTotalStock;
                    lockInfoList.Add(lockInfo);
                }
                else
                {
                    // ===== æ ¸å¿ƒä¼˜åŒ–2:OriginalQuantity赋值为托盘物料总库存 =====
                    decimal originalQuantity = palletMaterielTotalStock; // æ›¿ä»£åŽŸæœ‰å±€éƒ¨æ˜Žç»†æ•°é‡
                    decimal originalQuantity = palletMaterielTotalStock;
                    List<string> allDetailIds = outboundOrder.Details.Where(x =>
                        x.OrderId == outboundOrder.Id && x.MaterielCode == detail.MaterielCode
@@ -978,7 +982,7 @@
                    // æ•´ç®±å‡ºåº“无需拆包
                    PerformFullOutboundOperation(stockInfo, request, lockInfo.TaskNum.GetValueOrDefault());
                    if (outboundOrder.OrderType != 0)
                    if (outboundOrder.OrderType == InOrderTypeEnum.InternalAllocat.ObjToInt())
                    {
                        Dt_AllocateOrder allocateOrder = _allocateOrderRepository.QueryFirst(x => x.OrderNo == outboundOrder.OrderNo);
                        if (allocateOrder != null)
@@ -1004,6 +1008,29 @@
                            }
                            _allocateMaterialInfoRepository.AddData(allocateMaterialInfos);
                        }
                    }
                    else if(outboundOrder.OrderType == InOrderTypeEnum.ReCheck.ObjToInt())
                    {
                        List<Dt_AllocateMaterialInfo> allocateMaterialInfos = new List<Dt_AllocateMaterialInfo>();
                        foreach (var item in stockInfo.Details)
                        {
                            Dt_AllocateMaterialInfo allocateMaterialInfo = new Dt_AllocateMaterialInfo()
                            {
                                Barcode = item.Barcode??"",
                                BatchNo = item.BatchNo,
                                FactoryArea = item.FactoryArea,
                                MaterialCode = item.MaterielCode,
                                MaterialName = item.MaterielName,
                                OrderId = outboundOrder.Id,
                                OrderNo = outboundOrder.OrderNo,
                                Quantity = item.StockQuantity,
                                SupplyCode = item.SupplyCode??"",
                                Unit = item.Unit,
                                WarehouseCode = item.WarehouseCode??""
                            };
                            allocateMaterialInfos.Add(allocateMaterialInfo);
                        }
                        _allocateMaterialInfoRepository.AddData(allocateMaterialInfos);
                    }
                    decimal allocatedQuantity = actualOutboundQuantity;
@@ -1364,7 +1391,7 @@
                        MaterialCodeReturnDTO returnDTO = returnDTOs.First(x => x.Barcode == newBarcode);
                        if (outboundOrder.OrderType != 0)
                        if (outboundOrder.OrderType == InOrderTypeEnum.ReCheck.ObjToInt()||outboundOrder.OrderType == InOrderTypeEnum.InternalAllocat.ObjToInt())
                        {
                            allocateMaterialInfo = new Dt_AllocateMaterialInfo()
                            {
@@ -1386,7 +1413,7 @@
                    {
                        PerformFullOutboundOperation(stockDetail, stockInfo, actualOutboundQuantity, request, beforeQuantity, lockInfo.TaskNum.GetValueOrDefault());
                        if (outboundOrder.OrderType != 0)
                        if (outboundOrder.OrderType == InOrderTypeEnum.ReCheck.ObjToInt() || outboundOrder.OrderType == InOrderTypeEnum.InternalAllocat.ObjToInt())
                        {
                            allocateMaterialInfo = new Dt_AllocateMaterialInfo()
                            {
@@ -1405,8 +1432,8 @@
                    }
                    // åˆ¤æ–­æ˜¯å¦æ˜¯è°ƒæ‹¨å•
                    if (outboundOrder.OrderType != 0)
                    // åˆ¤æ–­æ˜¯å¦æ˜¯æ™ºä»“调智仓单
                    if ( outboundOrder.OrderType == InOrderTypeEnum.InternalAllocat.ObjToInt())
                    {
                        Dt_AllocateOrder allocateOrder = _allocateOrderRepository.QueryFirst(x => x.OrderNo == outboundOrder.OrderNo);
                        if (allocateOrder != null)
@@ -1523,7 +1550,6 @@
                        _feedbackMesService.BarcodeFeedback(newBarcode);
                    }
                    // åˆ é™¤é”å®šè®°å½•(如果出库明细全部完成) ä¸ŽCalculateActualOutboundQuantity方法里面注释代码2选1使用
                    if (CheckOutboundOrderDetailCompletedByMatCode(request.OrderNo, lockInfo.MaterielCode, outboundOrderDetails.First()))
                    {
                        Func<Dt_OutStockLockInfo, bool> supWhere = x => string.IsNullOrEmpty(outboundOrderDetails.First().SupplyCode) ? true : x.SupplyCode == outboundOrderDetails.First().SupplyCode;
@@ -1539,6 +1565,7 @@
                        }
                    }
                    // æ£€æŸ¥å‡ºåº“单是否完成
                    if (CheckOutboundOrderCompleted(request.OrderNo))
                    {
ÏîÄ¿´úÂë/WMSÎÞ²Ö´¢°æ/WIDESEA_WMSServer/WIDESEA_StockService/StockInfoService.cs
@@ -492,7 +492,7 @@
                // æž„建查询条件
                var stockQuery = Db.Queryable<Dt_StockInfo>()
                    .Where(x => locationCodes.Contains(x.LocationCode))
                    .Where(x => x.StockStatus == (int)StockStatusEmun.入库完成 || x.StockStatus == (int)StockStatusEmun.过期)
                    .Where(x => x.StockStatus == (int)StockStatusEmun.入库完成)
                    .Includes(x => x.Details);
                // æ‰§è¡ŒæŸ¥è¯¢å¹¶æŒ‰å…ˆè¿›å…ˆå‡ºæŽ’序
ÏîÄ¿´úÂë/WMSÎÞ²Ö´¢°æ/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs
@@ -282,6 +282,23 @@
                    _inboundOrderService.UpdateData(inboundOrder);
                }
            }
            Dt_OutboundOrder outboundOrder = _outboundOrderService.Db.Queryable<Dt_OutboundOrder>().Where(x => x.OrderNo == stockInfo.Details.FirstOrDefault().OrderNo).Includes(x => x.Details).First();
            if (outboundOrder != null)
            {
                foreach (var item in stockInfo.Details.Where(x => x.OrderNo == outboundOrder.OrderNo).ToList())
                {
                    var inbounddetail = _allocateMaterialInfo.QueryFirst(x => x.OrderNo == item.OrderNo && x.Barcode == item.Barcode);
                    if (inbounddetail != null)
                    {
                        var alldelete = _allocateMaterialInfo.DeleteAndMoveIntoHty(inbounddetail, OperateTypeEnum.自动删除);
                        if (!alldelete)
                        {
                            await Db.Deleteable(task).ExecuteCommandAsync();
                        }
                    }
                }
            }
            stockInfo.LocationCode = task.TargetAddress;
            stockInfo.StockStatus = StockStatusEmun.入库完成.ObjToInt();
            stockInfo.Details.ForEach(x =>
@@ -345,8 +362,9 @@
                                Details = new List<AllocateDtoDetail>()
                            };
                            var groupedData = inboundOrder.Details.GroupBy(item => new { item.MaterielCode, item.lineNo, item.BarcodeUnit, item.WarehouseCode })
                            var query = inboundOrder.Details.AsQueryable();
                            query = query.Where(item => item.ReturnToMESStatus == 0);
                            var groupedData = query.GroupBy(item => new { item.MaterielCode, item.lineNo, item.BarcodeUnit, item.WarehouseCode })
                               .Select(group => new AllocateDtoDetail
                               {
                                   MaterialCode = group.Key.MaterielCode,
@@ -403,8 +421,9 @@
                                Details = new List<AllocateDtoDetail>()
                            };
                            var groupedData = inboundOrder.Details.GroupBy(item => new { item.MaterielCode, item.lineNo, item.BarcodeUnit, item.WarehouseCode })
                            var query = inboundOrder.Details.AsQueryable();
                            query = query.Where(item => item.ReturnToMESStatus == 0);
                            var groupedData = query.GroupBy(item => new { item.MaterielCode, item.lineNo, item.BarcodeUnit, item.WarehouseCode })
                               .Select(group => new AllocateDtoDetail
                               {
                                   MaterialCode = group.Key.MaterielCode,
@@ -452,8 +471,9 @@
                                details = new List<FeedbackInboundDetailsModel>()
                            };
                            var groupedData = inboundOrder.Details.GroupBy(item => new { item.MaterielCode, item.SupplyCode, item.BatchNo, item.lineNo, item.BarcodeUnit, item.WarehouseCode })
                            var query = inboundOrder.Details.AsQueryable();
                            query = query.Where(item => item.ReturnToMESStatus == 0);
                            var groupedData = query.GroupBy(item => new { item.MaterielCode, item.SupplyCode, item.BatchNo, item.lineNo, item.BarcodeUnit, item.WarehouseCode })
                               .Select(group => new FeedbackInboundDetailsModel
                               {
                                   materialCode = group.Key.MaterielCode,
@@ -588,7 +608,11 @@
            stock.Details.ForEach(x =>
            {
                if (x.Status != StockStatusEmun.手动冻结.ObjToInt())
                {
                x.Status = StockStatusEmun.出库完成.ObjToInt();
                }
            });
            _stockService.StockInfoService.Db.UpdateNav(stock).IncludesAllFirstLayer().ExecuteCommand();
@@ -737,6 +761,9 @@
                    await Db.Deleteable(task).ExecuteCommandAsync();
                }
                Dt_OutboundOrder outboundOrder = _outboundOrderService.Db.Queryable<Dt_OutboundOrder>().Where(x => x.OrderNo == stockInfo.Details.FirstOrDefault().OrderNo).Includes(x=>x.Details).First();
                if(outboundOrder != null)
                {
                foreach (var item in stockInfo.Details.Where(x => x.OrderNo == outboundOrder.OrderNo).ToList())
                {
                    var inbounddetail = _allocateMaterialInfo.QueryFirst(x => x.OrderNo == item.OrderNo && x.Barcode == item.Barcode);
@@ -746,6 +773,7 @@
                        if (!alldelete)
                        {
                            await Db.Deleteable(task).ExecuteCommandAsync();
                            }
                        }
                    }
                }
@@ -976,7 +1004,10 @@
                {
                    foreach (var detail in stockInfo.Details)
                    {
                        if(detail.Status != StockStatusEmun.手动冻结.ObjToInt())
                        {
                        detail.Status = StockStatusEmun.入库完成.ObjToInt();
                        }
                        detail.OutboundQuantity = 0;
                    }
                    _stockService.StockInfoDetailService.Repository.UpdateData(stockInfo.Details);
@@ -1980,6 +2011,101 @@
                return await Task.FromResult(WebResponseContent.Instance.Error(ex.Message));
            }
        }
        /// <summary>
        /// é‡æ£€å…¥åº“完成
        /// </summary>
        /// <param name="task"></param>
        /// <returns></returns>
        public async Task<WebResponseContent> InQualityTaskCompleted(Dt_Task task)
        {
            WebResponseContent content = new WebResponseContent();
            try
            {
                Dt_StockInfo stockInfo = await _stockRepository.Db.Queryable<Dt_StockInfo>()
                    .Includes(x => x.Details)
                    .Where(x => x.PalletCode == task.PalletCode)
                    .FirstAsync();
                if (stockInfo == null)
                {
                    return WebResponseContent.Instance.Error($"未找到托盘对应的组盘信息");
                }
                if (stockInfo.Details.Count == 0 && stockInfo.PalletType != PalletTypeEnum.Empty.ObjToInt())
                {
                    _logger.LogInformation($"TaskService InPickTaskCompleted: æœªæ‰¾åˆ°è¯¥æ‰˜ç›˜åº“存明细信息.{task.TaskNum}");
                    return WebResponseContent.Instance.Error($"未找到该托盘库存明细信息");
                }
                Dt_LocationInfo locationInfo = _locationInfoService.Repository.QueryFirst(x => x.LocationCode == task.TargetAddress);
                if (locationInfo == null)
                {
                    return content.Error($"未找到对应的终点货位信息");
                }
                if (!string.IsNullOrEmpty(stockInfo.LocationCode))
                {
                    return WebResponseContent.Instance.Error($"该托盘已绑定货位");
                }
                if (locationInfo.LocationStatus == LocationStatusEnum.InStock.ObjToInt())
                {
                    return WebResponseContent.Instance.Error($"货位状态不正确");
                }
                _unitOfWorkManage.BeginTran();
                var beforelocationStatus = locationInfo.LocationStatus;
                locationInfo.LocationStatus = LocationStatusEnum.InStock.ObjToInt();
                _locationInfoService.Repository.UpdateData(locationInfo);
                stockInfo.LocationCode = locationInfo.LocationCode;
                stockInfo.PalletCode = task.PalletCode;
                stockInfo.LocationCode = task.TargetAddress;
                stockInfo.StockStatus = StockStatusEmun.入库完成.ObjToInt();
                _stockRepository.UpdateData(stockInfo);
                task.TaskStatus = TaskStatusEnum.Finish.ObjToInt();
                var result = _task_HtyService.DeleteAndMoveIntoHty(task, OperateTypeEnum.自动完成);
                _unitOfWorkManage.CommitTran();
                if (!result)
                {
                    await Db.Deleteable(task).ExecuteCommandAsync();
                }
                Dt_OutboundOrder outboundOrder = _outboundOrderService.Db.Queryable<Dt_OutboundOrder>().Where(x => x.OrderNo == stockInfo.Details.FirstOrDefault().OrderNo).Includes(x => x.Details).First();
                if (outboundOrder != null)
                {
                    foreach (var item in stockInfo.Details.Where(x => x.OrderNo == outboundOrder.OrderNo).ToList())
                    {
                        var inbounddetail = _allocateMaterialInfo.QueryFirst(x => x.OrderNo == item.OrderNo && x.Barcode == item.Barcode);
                        if (inbounddetail != null)
                        {
                            var alldelete = _allocateMaterialInfo.DeleteAndMoveIntoHty(inbounddetail, OperateTypeEnum.自动删除);
                            if (!alldelete)
                            {
                                await Db.Deleteable(task).ExecuteCommandAsync();
                            }
                        }
                    }
                }
                try
                {
                    _locationStatusChangeRecordService.AddLocationStatusChangeRecord(locationInfo, beforelocationStatus, StockChangeType.Inbound.ObjToInt(), "", task.TaskNum);
                }
                catch (Exception ex)
                {
                    _logger.LogInformation($"InEmptyTaskCompleted AddLocationStatusChangeRecord : {ex.Message} ");
                }
                return content;
            }
            catch (Exception ex)
            {
                _unitOfWorkManage.RollbackTran();
                return await Task.FromResult(WebResponseContent.Instance.Error(ex.Message));
            }
        }
    }
}
ÏîÄ¿´úÂë/WMSÎÞ²Ö´¢°æ/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService_Inbound.cs
@@ -54,7 +54,7 @@
                    return WebResponseContent.Instance.Error($"未找到组盘信息");
                }
                if (stockInfo.StockStatus != StockStatusEmun.组盘暂存.ObjToInt() && stockInfo.StockStatus != StockStatusEmun.手动组盘暂存.ObjToInt() && stockInfo.StockStatus != StockStatusEmun.拣选完成.ObjToInt() && stockInfo.StockStatus != StockStatusEmun.智仓入智仓组盘暂存.ObjToInt())
                if (stockInfo.StockStatus != StockStatusEmun.组盘暂存.ObjToInt() && stockInfo.StockStatus != StockStatusEmun.手动组盘暂存.ObjToInt() && stockInfo.StockStatus != StockStatusEmun.拣选完成.ObjToInt() && stockInfo.StockStatus != StockStatusEmun.智仓入智仓组盘暂存.ObjToInt() && stockInfo.StockStatus != StockStatusEmun.送检库存完成.ObjToInt())
                {
                    return WebResponseContent.Instance.Error($"该托盘状态不正确,不可申请入库");
                }
@@ -85,7 +85,7 @@
                    OrderNo= stockInfo.Details.FirstOrDefault()?.OrderNo,
                };
                //空箱
                if (stockInfo.PalletType == PalletTypeEnum.Empty.ObjToInt()|| stockInfo.StockStatus == StockStatusEmun.智仓入智仓组盘暂存.ObjToInt())
                if (stockInfo.PalletType == PalletTypeEnum.Empty.ObjToInt()|| stockInfo.StockStatus == StockStatusEmun.智仓入智仓组盘暂存.ObjToInt() || stockInfo.StockStatus == StockStatusEmun.送检库存完成.ObjToInt())
                {
                    _unitOfWorkManage.BeginTran();
                    newTask.TaskType = TaskTypeEnum.InEmpty.ObjToInt();
@@ -94,6 +94,10 @@
                    {
                        newTask.TaskType = TaskTypeEnum.AllocateInWarehouse.ObjToInt();
                    }
                    if (stockInfo.StockStatus == StockStatusEmun.送检库存完成.ObjToInt())
                    {
                        newTask.TaskType = TaskTypeEnum.InQuality.ObjToInt();
                    }
                    int taskId = BaseDal.AddData(newTask);
                    newTask.TaskId = taskId;
ÏîÄ¿´úÂë/WMSÎÞ²Ö´¢°æ/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Inbound/InboundController.cs
@@ -52,6 +52,16 @@
        }
        /// <summary>
        /// é‡æ£€ç»„盘
        /// </summary>
        /// <param name="palletDto"></param>
        /// <returns></returns>
        [HttpPost, Route("ReCheckGroupPallet"), AllowAnonymous]
        public async Task<WebResponseContent> ReCheckGroupPallet([FromBody] GroupPalletDto palletDto)
        {
            return await Service.ReCheckGroupPallet(palletDto);
        }
        /// <summary>
        /// å…¥åº“分批回传MES
        /// </summary>
        /// <param name="palletDto"></param>