647556386
2026-02-06 3fb6a51a60230f42be4db54cc4371a7106b322a4
Merge branch 'htq20251215' of http://115.159.85.185:8098/r/ZhongRui/ALDbanyunxiangmu into htq20251215
已添加1个文件
已修改18个文件
570 ■■■■■ 文件已修改
项目代码/WIDESEA_WMSClient/config/buttons.js 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WIDESEA_WMSClient/src/extension/check/extend/ReCheckGroupPallet.vue 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WIDESEA_WMSClient/src/extension/inbound/extend/AllcatedPallet.vue 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WIDESEA_WMSClient/src/extension/inbound/extend/Pallet.vue 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WIDESEA_WMSClient/src/extension/inbound/extend/StockTakeGroupPallet.vue 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WIDESEA_WMSClient/src/extension/stock/extend/CalculateStock.vue 250 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WIDESEA_WMSClient/src/extension/stock/stockInfoDetailByMaterielSum.js 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WIDESEA_WMSClient/src/views/inbound/inboundOrder.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WIDESEA_WMSClient/src/views/outbound/outPicking.vue 66 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WIDESEA_WMSClient/src/views/outbound/outboundOrder.vue 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_IInboundService/IInboundOrderService.cs 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_IOutboundService/IOutboundOrderService.cs 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_IStockService/IStockDetailByMaterielService.cs 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_InboundService/InboundOrderService.cs 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_OutboundService/OutboundOrderService.cs 34 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_StockService/StockDetailByMaterielService.cs 26 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Inbound/InboundOrderController.cs 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Outbound/OutboundOrderController.cs 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Stock/StockDetailByMaterielController.cs 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ÏîÄ¿´úÂë/WIDESEA_WMSClient/config/buttons.js
@@ -347,6 +347,14 @@
    type: 'warning',
    onClick: function () {
    }
},{
    name: "计算库存总和",
    icon: '',
    class: '',
    value: 'CalculateStock',
    type: 'warning',
    onClick: function () {
    }
}
]
ÏîÄ¿´úÂë/WIDESEA_WMSClient/src/extension/check/extend/ReCheckGroupPallet.vue
@@ -19,8 +19,8 @@
      <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-select v-model="form.locationType" placeholder="自动获取仓库区域" clearable filterable
              @change="handleLocationChange" style="width: 100%" :loading="locationLoading" size="medium" :disabled="true">
              <el-option v-for="item in locationTypes" :key="item.locationType" :label="item.locationTypeDesc"
                :value="item.locationType" />
            </el-select>
@@ -282,6 +282,7 @@
      }
    },
    
    visible(newVal, oldVal) {
      this.palletVisible = newVal;
@@ -412,6 +413,33 @@
      }
    },
    fetchLocationByWarehouse(warehouseCode) {
      if (!warehouseCode) {
        this.form.locationType = null;
        return;
      }
      this.locationLoading = true;
      http.post(`/api/InboundOrder/GetLocationType?code=${warehouseCode}`)
        .then(({ data }) => {
          if (data) {
            this.form.locationType = data.locationType || data;
            if (!this.locationTypes.find(item => item.locationType === this.form.locationType)) {
              this.locationTypes.push({
                locationType: this.form.locationType,
                locationTypeDesc: this.form.locationType
              });
            }
          }
        })
        .catch((err) => {
          console.error("获取仓库区域失败:", err);
          this.$message.error("获取仓库区域失败,请重试");
          this.form.locationType = null;
        })
        .finally(() => {
          this.locationLoading = false;
        });
    },
    async fetchStockStatistics(orderNo) {
      // å•据号为空时不查询
      if (!orderNo) {
@@ -860,6 +888,7 @@
      this.barcode = '';
      this.materials = [];
      this.error = '';
      this.fetchLocationByWarehouse(this.form.warehouseType);
    },
    
    // åŒºåŸŸåˆ‡æ¢äº‹ä»¶
ÏîÄ¿´úÂë/WIDESEA_WMSClient/src/extension/inbound/extend/AllcatedPallet.vue
@@ -19,8 +19,8 @@
      <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-select v-model="form.locationType" placeholder="自动获取仓库区域" clearable filterable
              @change="handleLocationChange" style="width: 100%" :loading="locationLoading" size="medium" :disabled="true">
              <el-option v-for="item in locationTypes" :key="item.locationType" :label="item.locationTypeDesc"
                :value="item.locationType" />
            </el-select>
@@ -446,6 +446,34 @@
        })
        .finally(() => {
          this.warehouseLoading = false;
        });
    },
    fetchLocationByWarehouse(warehouseCode) {
      if (!warehouseCode) {
        this.form.locationType = null;
        return;
      }
      this.locationLoading = true;
      http.post(`/api/InboundOrder/GetLocationType?code=${warehouseCode}`)
        .then(({ data }) => {
          if (data) {
            this.form.locationType = data.locationType || data;
            if (!this.locationTypes.find(item => item.locationType === this.form.locationType)) {
              this.locationTypes.push({
                locationType: this.form.locationType,
                locationTypeDesc: this.form.locationType
              });
            }
          }
        })
        .catch((err) => {
          console.error("获取仓库区域失败:", err);
          this.$message.error("获取仓库区域失败,请重试");
          this.form.locationType = null;
        })
        .finally(() => {
          this.locationLoading = false;
        });
    },
@@ -937,6 +965,7 @@
      this.barcode = '';
      this.materials = [];
      this.error = '';
      this.fetchLocationByWarehouse(this.form.warehouseType);
    },
    // åŒºåŸŸåˆ‡æ¢äº‹ä»¶
ÏîÄ¿´úÂë/WIDESEA_WMSClient/src/extension/inbound/extend/Pallet.vue
@@ -57,13 +57,14 @@
          >
            <el-select
              v-model="form.locationType"
              placeholder="请先选择仓库"
              placeholder="自动获取仓库区域"
              clearable
              filterable
              @change="handleLocationChange"
              style="width: 100%"
              :loading="locationLoading"
              size="medium"
              :disabled="true"
            >
              <el-option
                v-for="item in locationTypes"
@@ -752,6 +753,33 @@
        });
    },
    fetchLocationByWarehouse(warehouseCode) {
      if (!warehouseCode) {
        this.form.locationType = null;
        return;
      }
      this.locationLoading = true;
      http.post(`/api/InboundOrder/GetLocationType?code=${warehouseCode}`)
        .then(({ data }) => {
          if (data) {
            this.form.locationType = data.locationType || data;
            if (!this.locationTypes.find(item => item.locationType === this.form.locationType)) {
              this.locationTypes.push({
                locationType: this.form.locationType,
                locationTypeDesc: this.form.locationType
              });
            }
          }
        })
        .catch((err) => {
          console.error("获取仓库区域失败:", err);
          this.$message.error("获取仓库区域失败,请重试");
          this.form.locationType = null;
        })
        .finally(() => {
          this.locationLoading = false;
        });
    },
    // èŽ·å–åº“å­˜ç»Ÿè®¡
    fetchStockStatistics(orderNo) {
      if (!orderNo) {
@@ -1249,6 +1277,7 @@
      this.barcode = "";
      this.materials = [];
      this.error = "";
      this.fetchLocationByWarehouse(this.form.warehouseType);
    },
    // åŒºåŸŸåˆ‡æ¢äº‹ä»¶
ÏîÄ¿´úÂë/WIDESEA_WMSClient/src/extension/inbound/extend/StockTakeGroupPallet.vue
@@ -19,8 +19,8 @@
      <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-select v-model="form.locationType" placeholder="自动获取仓库区域" clearable filterable
              @change="handleLocationChange" style="width: 100%" :loading="locationLoading" size="medium" :disabled="true">
              <el-option v-for="item in locationTypes" :key="item.locationType" :label="item.locationTypeDesc"
                :value="item.locationType" />
            </el-select>
@@ -412,6 +412,33 @@
      }
    },
    fetchLocationByWarehouse(warehouseCode) {
      if (!warehouseCode) {
        this.form.locationType = null;
        return;
      }
      this.locationLoading = true;
      http.post(`/api/InboundOrder/GetLocationType?code=${warehouseCode}`)
        .then(({ data }) => {
          if (data) {
            this.form.locationType = data.locationType || data;
            if (!this.locationTypes.find(item => item.locationType === this.form.locationType)) {
              this.locationTypes.push({
                locationType: this.form.locationType,
                locationTypeDesc: this.form.locationType
              });
            }
          }
        })
        .catch((err) => {
          console.error("获取仓库区域失败:", err);
          this.$message.error("获取仓库区域失败,请重试");
          this.form.locationType = null;
        })
        .finally(() => {
          this.locationLoading = false;
        });
    },
    async fetchStockStatistics(orderNo) {
      // å•据号为空时不查询
      if (!orderNo) {
@@ -860,6 +887,7 @@
      this.barcode = '';
      this.materials = [];
      this.error = '';
      this.fetchLocationByWarehouse(this.form.warehouseType);
    },
    
    // åŒºåŸŸåˆ‡æ¢äº‹ä»¶
ÏîÄ¿´úÂë/WIDESEA_WMSClient/src/extension/stock/extend/CalculateStock.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,250 @@
<template>
    <vol-box v-model="show" title="物料库存查询" :width="800" :height="600">
        <template #content>
            <el-form ref="form" :model="form" :rules="rules" label-width="90px">
                <!-- ä»“库号输入框 -->
                <el-form-item label="仓库号:" prop="warehouseCode">
                    <el-input
                        v-model="form.warehouseCode"
                        placeholder="请输入仓库号(如:5053)"
                        clearable
                        @input="handleWarehouseInput"
                        @keyup.enter="focusMaterielInput"
                        ref="warehouseCodeInput"
                        :disabled="loading"
                    />
                </el-form-item>
                <!-- ç‰©æ–™æ¡ç è¾“入框 -->
                <el-form-item label="物料条码:" prop="materielBarcode">
                    <el-input
                        v-model="form.materielBarcode"
                        placeholder="请扫描/输入物料条码(如:100401-01211)"
                        @keyup.enter="getStockTotal"
                        clearable
                        @paste="handlePaste"
                        @input="handleInput"
                        ref="materielCodeInput"
                        :disabled="loading"
                    />
                    <!-- åº“存查询加载状态 -->
                    <el-icon class="ml-2" v-if="loading"><loading /></el-icon>
                </el-form-item>
                <!-- åº“存总和显示区域 -->
                <el-form-item label="库存总和:" prop="totalStockQuantity">
                    <el-input
                        v-model="form.totalStockQuantity"
                        placeholder="请输入仓库号和物料条码查询"
                        disabled
                        prefix-icon="el-icon-s-data"
                    />
                    <!-- æ— æ•°æ®æç¤º -->
                    <span v-if="form.totalStockQuantity === 0 && !loading && form.materielBarcode && form.warehouseCode" class="text-gray-500 ml-2">
                        è¯¥ç‰©æ–™åœ¨å½“前仓库暂无库存
                    </span>
                </el-form-item>
            </el-form>
        </template>
        <template #footer>
            <div class="dialog-footer">
                <el-button @click="resetForm">重置</el-button>
                <el-button @click="show = false">关闭</el-button>
            </div>
        </template>
    </vol-box>
</template>
<script>
import VolBox from '@/components/basic/VolBox.vue'
import { Loading } from '@element-plus/icons-vue'
export default {
    components: { VolBox, Loading },
    props: {
        value: { type: Boolean, default: false }
    },
    data() {
        // ä»“库号验证规则
        const validateWarehouseCode = (rule, value, callback) => {
            if (!value) {
                return callback(new Error('请输入仓库号'));
            }
            callback();
        };
        // ç‰©æ–™æ¡ç éªŒè¯è§„则
        const validateMaterielBarcode = (rule, value, callback) => {
            if (!value) {
                return callback(new Error('请输入物料条码'));
            }
            callback();
        };
        return {
            show: false,
            loading: false, // åº“存查询加载状态
            form: {
                warehouseCode: '', // ä»“库号
                materielBarcode: '', // ç‰©æ–™æ¡ç 
                totalStockQuantity: 0 // åº“存总和
            },
            // è¡¨å•验证规则
            rules: {
                warehouseCode: [
                    { validator: validateWarehouseCode, trigger: ['blur', 'change'] }
                ],
                materielBarcode: [
                    { validator: validateMaterielBarcode, trigger: ['blur', 'change'] }
                ]
            }
        }
    },
    methods: {
        // æ‰“开弹窗初始化
        open() {
            this.show = true
            this.$nextTick(() => {
                this.focusWarehouseInput()
            })
        },
        async getStockTotal() {
            // è¡¨å•验证
            try {
                await this.$refs.form.validate();
            } catch (error) {
                if (!this.form.warehouseCode) {
                    this.focusWarehouseInput();
                } else {
                    this.focusAndSelectInput();
                }
                return;
            }
            this.loading = true;
            try {
                const res = await this.http.post('/api/StockDetailByMateriel/CalculateStock?warehouseCode=' + this.form.warehouseCode.trim() + '&materielCode=' + this.form.materielBarcode.trim());
                if (res.status && res.code === 0) {
                    this.form.totalStockQuantity = Number(res.data) || 0;
                    this.$message.success('库存查询成功');
                } else {
                    this.form.totalStockQuantity = 0;
                    this.$message.error(res.message || '库存查询失败:接口返回异常');
                }
            } catch (error) {
                this.form.totalStockQuantity = 0;
                const errorMsg = error.response
                    ? `接口错误:${error.response.status} - ${error.response.data?.message || '未知错误'}`
                    : `网络异常:${error.message}`;
                this.$message.error(`库存查询失败:${errorMsg}`);
            } finally {
                this.loading = false;
            }
        },
        // ä»“库号输入过滤
        handleWarehouseInput(value) {
            this.form.warehouseCode = value.replace(/[^a-zA-Z0-9]/g, '').toUpperCase();
            this.$nextTick(() => {
                this.$refs.form.validateField('warehouseCode');
            });
        },
        // ç‰©æ–™æ¡ç è¾“入过滤
        handleInput(value) {
            this.form.materielBarcode = value.replace(/[^-a-zA-Z0-9]/g, '');
            this.$nextTick(() => {
                this.$refs.form.validateField('materielBarcode');
            });
        },
        // ç²˜è´´ç‰©æ–™æ¡ç è‡ªåŠ¨æŸ¥è¯¢
        handlePaste(e) {
            const clipboardData = e.clipboardData || window.clipboardData;
            const pastedText = clipboardData.getData('text');
            const cleanedText = pastedText.replace(/[^-a-zA-Z0-9]/g, '');
            if (cleanedText) {
                this.form.materielBarcode = cleanedText;
                setTimeout(() => {
                    this.getStockTotal();
                }, 50);
            }
            e.preventDefault();
        },
        // ä»“库号回车聚焦物料条码
        focusMaterielInput() {
            this.$nextTick(() => {
                const inputRef = this.$refs.materielCodeInput;
                if (inputRef) {
                    const inputEl = inputRef.$el ? inputRef.$el.querySelector('input') : inputRef;
                    inputEl?.focus();
                }
            });
        },
        // èšç„¦ä»“库号输入框
        focusWarehouseInput() {
            this.$nextTick(() => {
                const inputRef = this.$refs.warehouseCodeInput;
                if (inputRef) {
                    const inputEl = inputRef.$el ? inputRef.$el.querySelector('input') : inputRef;
                    inputEl?.focus();
                }
            });
        },
        // èšç„¦å¹¶é€‰ä¸­ç‰©æ–™æ¡ç è¾“入框
        focusAndSelectInput() {
            this.$nextTick(() => {
                setTimeout(() => {
                    const inputRef = this.$refs.materielCodeInput;
                    if (inputRef) {
                        const inputEl = inputRef.$el ? inputRef.$el.querySelector('input') : inputRef;
                        if (inputEl) {
                            inputEl.focus();
                            inputEl.select();
                        }
                    }
                }, 100);
            });
        },
        // é‡ç½®è¡¨å•
        resetForm() {
            this.form = {
                warehouseCode: '',
                materielBarcode: '',
                totalStockQuantity: 0
            };
            this.$refs.form.clearValidate();
            this.focusWarehouseInput();
        }
    },
    watch: {
        show(val) {
            if (val) {
                this.$nextTick(() => {
                    this.focusWarehouseInput()
                })
            } else {
                this.resetForm();
            }
        }
    }
}
</script>
<style scoped>
.dialog-footer {
    text-align: right;
}
.text-gray-500 {
    color: #909399;
    font-size: 12px;
}
.ml-2 {
    margin-left: 8px;
}
</style>
ÏîÄ¿´úÂë/WIDESEA_WMSClient/src/extension/stock/stockInfoDetailByMaterielSum.js
@@ -1,10 +1,10 @@
//此js文件是用来自定义扩展业务代码,可以扩展一些自定义页面或者重新配置生成的代码
import gridHeader from "./extend/CalculateStock.vue";
let extension = {
    components: {
      //查询界面扩展组件
      gridHeader: '',
      gridHeader: gridHeader,
      gridBody: '',
      gridFooter: '',
      //新建、编辑弹出框扩展组件
@@ -17,7 +17,14 @@
    methods: {
       //下面这些方法可以保留也可以删除
      onInit() {  
        console.log(this)
        var EmptyTrayInboundBtn = this.buttons.find(
        (x) => x.value == "CalculateStock"
      );
      if (EmptyTrayInboundBtn != null) {
        EmptyTrayInboundBtn.onClick = () => {
          this.$refs.gridHeader.open();
        };
      }
      },
      onInited() {
        //框架初始化配置后
ÏîÄ¿´úÂë/WIDESEA_WMSClient/src/views/inbound/inboundOrder.vue
@@ -70,7 +70,7 @@
          title: "业务类型",
          field: "businessType",
          type: "select",
          dataKey: "documentTypeEmun",
          dataKey: "inboundbusinessType",
          data: [],
        },
        {
ÏîÄ¿´úÂë/WIDESEA_WMSClient/src/views/outbound/outPicking.vue
@@ -9,6 +9,8 @@
                    <i class="el-icon-document"></i>
                    <span class="order-label">订单号:</span>
                    <span class="order-value">{{ orderNo }}</span>
                    <span class="order-label" style="margin-left: 20px;">产线名称:</span>
                    <span class="order-value">{{ orderInfo?.departmentName || '' }}</span>
                </div>
                <div class="order-status">
                    <el-tag v-if="orderInfo" :type="getStatusType(orderInfo.orderStatus)" size="medium"
@@ -409,6 +411,42 @@
                }
            }
        },
        // ============== æ–°å¢žï¼šæ ¹æ®æ‰˜ç›˜å·èŽ·å–è®¢å•å·ï¼ˆæ ¸å¿ƒåŠŸèƒ½ï¼‰ ==============
        async getOrderNoByPallet(palletCode) {
            if (!palletCode) {
                this.$message.warning('托盘号不能为空');
                return null;
            }
            try {
                this.showFullScreenLoading();
                // è°ƒç”¨èŽ·å–è®¢å•å·çš„æŽ¥å£
                const response = await this.http.get(`/api/OutboundOrder/GetOrderNoByPalletCode?palletCode=${palletCode}`);
                if (response.status && response.data) {
                    const validOrderNo = response.data;
                    this.playSuccessAudio();
                    this.$message.success(`成功获取订单号:${validOrderNo}`);
                    return validOrderNo;
                } else {
                    this.playErrorAudio();
                    const errorMsg = response.message || '该托盘号未关联任何订单';
                    this.$message.error(errorMsg);
                    return null;
                }
            } catch (error) {
                this.playErrorAudio();
                const errorMsg = `获取订单号异常:${error.message || '网络错误'}`;
                this.$message.error(errorMsg);
                console.error("【托盘号查订单号接口异常】", error);
                return null;
            } finally {
                this.hideFullScreenLoading();
            }
        },
        // ============== æ–°å¢žç»“束 ==============
        // æ’­æ”¾æˆåŠŸéŸ³é¢‘
        playSuccessAudio() {
            try {
@@ -435,11 +473,13 @@
        initPage() {
            // ä»Žè·¯ç”±å‚数获取订单号
            this.orderNo = this.$route.query.orderNo || ''
            if (!this.orderNo) {
                this.$message.error('订单号不能为空')
                this.$router.back()
                return
            }
            // ============== å¾®è°ƒï¼šæ³¨é‡Šå¼ºåˆ¶è¿”回逻辑,兼容托盘号查订单号 ==============
            // if (!this.orderNo) {
            //     this.$message.error('订单号不能为空')
            //     this.$router.back()
            //     return
            // }
            // ============== å¾®è°ƒç»“束 ==============
            // åŠ è½½è®¢å•ä¿¡æ¯
            this.loadOrderInfo()
@@ -619,10 +659,20 @@
        },
        handlePalletScan(flag = true) {
            if (this.scanForm.palletCode) {
                this.loadPalletData(flag)
            } else {
            const palletCode = this.scanForm.palletCode.trim();
            if (!palletCode) {
                return;
            }
            // å…ˆæ ¹æ®æ‰˜ç›˜å·èŽ·å–è®¢å•å·
            this.getOrderNoByPallet(palletCode).then((orderNo) => {
                if (orderNo) {
                    // èµ‹å€¼è®¢å•号,供后续逻辑使用
                    this.orderNo = orderNo;
                    // åˆ·æ–°è®¢å•信息
                    this.loadOrderInfo();
                }
                this.loadPalletData(flag);
            });
        },
        handleMaterialScan() {
ÏîÄ¿´úÂë/WIDESEA_WMSClient/src/views/outbound/outboundOrder.vue
@@ -104,7 +104,7 @@
          title: "业务类型",
          field: "businessType",
          type: "select",
          dataKey: "documentTypeEmun",
          dataKey: "outboundbusinessType",
          data: [],
        },
        {
@@ -124,6 +124,7 @@
          data: [],
        },
        { title: "物料编号", field: "materielCode", type: "like" },
        { title: "拉线名称", field: "departmentName", type: "like" },
        { title: "创建时间", field: "createDate", type: "datetime" },
      ],
    ]);
ÏîÄ¿´úÂë/WMSÎÞ²Ö´¢°æ/WIDESEA_WMSServer/WIDESEA_IInboundService/IInboundOrderService.cs
@@ -29,5 +29,7 @@
        WebResponseContent UnPalletGroupBarcode(string orderNo);
        WebResponseContent HandCloseOrder(List<string> orderIds);
        WebResponseContent GetLocationType(string code);
    }
}
ÏîÄ¿´úÂë/WMSÎÞ²Ö´¢°æ/WIDESEA_WMSServer/WIDESEA_IOutboundService/IOutboundOrderService.cs
@@ -19,5 +19,7 @@
        Task<WebResponseContent> ReceiveOutboundOrder(Dt_OutboundOrder model, int operateType);
        Task<WebResponseContent> GetById(int id);
        WebResponseContent GetOrderNoByPalletCode(string palletCode);
    }
}
ÏîÄ¿´úÂë/WMSÎÞ²Ö´¢°æ/WIDESEA_WMSServer/WIDESEA_IStockService/IStockDetailByMaterielService.cs
@@ -14,5 +14,7 @@
    public interface IStockDetailByMaterielService : IDependency
    {
        PageGridData<StockDetailByMateriel> GetPageGridData(PageDataOptions options);
        WebResponseContent CalculateStock(string warehouseCode, string materielCode);
    }
}
ÏîÄ¿´úÂë/WMSÎÞ²Ö´¢°æ/WIDESEA_WMSServer/WIDESEA_InboundService/InboundOrderService.cs
@@ -987,6 +987,18 @@
            return content.OK(data: details);
        }
        public WebResponseContent GetLocationType(string code)
        {
           var warehouseAreaName = _warehouseAreaRepository.QueryFirst(x => x.Code == code);
            if(string.IsNullOrWhiteSpace(warehouseAreaName.ToString()))
            {
                return WebResponseContent.Instance.Error("未找到仓库名称");
            }
            var locationTypeDesc = _locationTypeRepository.Db.Queryable<Dt_LocationType>().Where(x => string.Equals(x.LocationTypeDesc, warehouseAreaName.Name, StringComparison.OrdinalIgnoreCase)).First();
            return WebResponseContent.Instance.OK(data:locationTypeDesc.LocationType);
        }
        public WebResponseContent HandCloseOrder(List<string> orderNos)
        {
            try
ÏîÄ¿´úÂë/WMSÎÞ²Ö´¢°æ/WIDESEA_WMSServer/WIDESEA_OutboundService/OutboundOrderService.cs
@@ -29,7 +29,8 @@
        private readonly ILogger<OutboundOrderService> _logger;
        private readonly IRepository<Dt_OutboundOrderDetail> _outboundOrderDetailRepository;
        private readonly IMaterialUnitService _materialUnitService;
        public OutboundOrderService(IRepository<Dt_OutboundOrder> BaseDal, IMapper mapper, IUnitOfWorkManage unitOfWorkManage, IRepository<Dt_OutboundOrderDetail> outboundOrderDetailRepository, ILogger<OutboundOrderService> logger, IMaterialUnitService materialUnitService, IMaterielInfoService materielInfoService) : base(BaseDal)
        private readonly IRepository<Dt_OutStockLockInfo> _outStockLockInfoRepository;
        public OutboundOrderService(IRepository<Dt_OutboundOrder> BaseDal, IMapper mapper, IUnitOfWorkManage unitOfWorkManage, IRepository<Dt_OutboundOrderDetail> outboundOrderDetailRepository, ILogger<OutboundOrderService> logger, IMaterialUnitService materialUnitService, IMaterielInfoService materielInfoService, IRepository<Dt_OutStockLockInfo> outStockLockInfoRepository) : base(BaseDal)
        {
            _mapper = mapper;
            _unitOfWorkManage = unitOfWorkManage;
@@ -37,6 +38,7 @@
            _logger = logger;
            _materialUnitService = materialUnitService;
            _materielInfoService = materielInfoService;
            _outStockLockInfoRepository = outStockLockInfoRepository;
        }
        private int[] OrderTypes = new int[] { (int)InOrderTypeEnum.AllocatOutbound, (int)InOrderTypeEnum.InternalAllocat, (int)InOrderTypeEnum.ReCheck };
@@ -301,6 +303,19 @@
        }
        /// <summary>
        /// æ ¹æ®æ‰˜ç›˜å·èŽ·å–å•æ®ç¼–å·
        /// </summary>
        public WebResponseContent GetOrderNoByPalletCode(string palletCode)
        {
           var orderNo = _outStockLockInfoRepository.QueryData(x => x.PalletCode == palletCode).Select(x=>x.OrderNo).FirstOrDefault();
            if(string.IsNullOrWhiteSpace(orderNo))
            {
                return WebResponseContent.Instance.Error($"该托盘{palletCode}已拣选完");
            }
            return WebResponseContent.Instance.OK(data: orderNo);
        }
        static object lock_code = new object();
        public string CreateCodeByRule(string ruleCode)
        {
@@ -425,6 +440,23 @@
                            sugarQueryable1 = sugarQueryable1.Where(x => x.ReturnToMESStatus.Equals(returnToMESStatus));
                        }
                        var businessTypeParam = searchParametersList.FirstOrDefault(x =>
                            x.Name.Equals(nameof(Dt_OutboundOrder.BusinessType).FirstLetterToLower(), StringComparison.OrdinalIgnoreCase));
                        if (businessTypeParam != null && !string.IsNullOrEmpty(businessTypeParam.Value?.ToString()))
                        {
                            string businessType = businessTypeParam.Value.ToString().Trim();
                            sugarQueryable1 = sugarQueryable1.Where(x => x.BusinessType.Equals(businessType));
                        }
                        var departmentNameParam = searchParametersList.FirstOrDefault(x =>
                   x.Name.Equals("departmentName", StringComparison.OrdinalIgnoreCase));
                        if (departmentNameParam != null && !string.IsNullOrEmpty(departmentNameParam.Value?.ToString()))
                        {
                            string departmentName = departmentNameParam.Value.ToString().Trim();
                            sugarQueryable1 = sugarQueryable1.Where(x =>
                                x.DepartmentName.Contains(departmentName));
                        }
                        var createDateParams = searchParametersList
                    .Where(x => x.Name.Equals("createDate", StringComparison.OrdinalIgnoreCase)
                                && !string.IsNullOrEmpty(x.Value?.ToString()))
ÏîÄ¿´úÂë/WMSÎÞ²Ö´¢°æ/WIDESEA_WMSServer/WIDESEA_StockService/StockDetailByMaterielService.cs
@@ -18,11 +18,13 @@
    {
        private readonly IUnitOfWorkManage _unitOfWorkManage;
        private readonly SqlSugarClient _dbBase;
        private readonly IRepository<Dt_StockInfoDetail> _stockInfoDetailRepository;
        public StockDetailByMaterielService(IUnitOfWorkManage unitOfWorkManage)
        public StockDetailByMaterielService(IUnitOfWorkManage unitOfWorkManage, IRepository<Dt_StockInfoDetail> stockInfoDetailRepository)
        {
            _unitOfWorkManage = unitOfWorkManage;
            _dbBase = unitOfWorkManage.GetDbClient();
            _stockInfoDetailRepository = stockInfoDetailRepository;
        }
@@ -146,7 +148,12 @@
                    }
                }
                decimal totalStockQuantity = 0;
                if (groupedData.Count > 0)
                {
                    totalStockQuantity = groupedData.Values.Sum(x => x.StockQuantity);
                }
                materielnfoStatistics = groupedData.Values.ToList();
                int startIndex = (options.Page - 1) * options.Rows;
                int endIndex = Math.Min(startIndex + options.Rows, materielnfoStatistics.Count);
@@ -160,12 +167,25 @@
                }
                int count = groupedData.Count;
                return new PageGridData<StockDetailByMateriel>(count, materielnfoStatistics);
                return new PageGridData<StockDetailByMateriel>(count, materielnfoStatistics)
                {
                    TotalStockQuantity = totalStockQuantity
                };
            }
            catch (Exception ex)
            {
                return new PageGridData<StockDetailByMateriel>();
            }
        }
        public WebResponseContent CalculateStock(string warehouseCode,string materielCode)
        {
           var calculateStock =_stockInfoDetailRepository.QueryData(x => x.WarehouseCode == warehouseCode && x.MaterielCode == materielCode).Sum(x => x.StockQuantity);
           if(calculateStock == 0)
            {
                return WebResponseContent.Instance.Error("未找到库存");
            }
            return WebResponseContent.Instance.OK(data: calculateStock);
        }
    }
}
ÏîÄ¿´úÂë/WMSÎÞ²Ö´¢°æ/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Inbound/InboundOrderController.cs
@@ -269,5 +269,11 @@
        {
            return Service.HandCloseOrder(orderIds);
        }
        [HttpPost, Route("GetLocationType"), AllowAnonymous, MethodParamsValidate]
        public WebResponseContent GetLocationType(string code)
        {
            return Service.GetLocationType(code);
        }
    }
}
ÏîÄ¿´úÂë/WMSÎÞ²Ö´¢°æ/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Outbound/OutboundOrderController.cs
@@ -85,5 +85,11 @@
            }
            return WebResponseContent.Instance.OK(null, order);
        }
        [HttpGet, Route("GetOrderNoByPalletCode"), AllowAnonymous, MethodParamsValidate]
        public WebResponseContent GetOrderNoByPalletCode(string palletCode)
        {
            return Service.GetOrderNoByPalletCode(palletCode);
        }
    }
}
ÏîÄ¿´úÂë/WMSÎÞ²Ö´¢°æ/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Stock/StockDetailByMaterielController.cs
@@ -1,4 +1,5 @@
using Microsoft.AspNetCore.Authorization;
using Autofac.Core;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using WIDESEA_Core;
using WIDESEA_DTO.Stock;
@@ -22,5 +23,11 @@
        {
            return _stockDetailByMaterielService.GetPageGridData(options);
        }
        [HttpPost, Route("CalculateStock"), AllowAnonymous]
        public WebResponseContent CalculateStock(string warehouseCode,string materielCode)
        {
            return _stockDetailByMaterielService.CalculateStock(warehouseCode,materielCode);
        }
    }
}