已添加1个文件
已修改18个文件
515 ■■■■ 文件已修改
项目代码/WIDESEA_WMSClient/config/buttons.js 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WIDESEA_WMSClient/src/extension/outbound/outboundOrder.js 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WIDESEA_WMSClient/src/router/viewGird.js 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WIDESEA_WMSClient/src/views/outbound/printForm.vue 247 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_AllocateService/AllocateService.cs 50 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_AllocateService/WIDESEA_AllocateService.csproj 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_BasicService/InvokeMESService.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_BasicService/LocationInfoService.cs 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_CheckService/ReCheckOrderService.cs 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_CheckService/WIDESEA_CheckService.csproj 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_InboundService/InboundOrderService.cs 43 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_Model/Models/Allocate/Dt_AllocateOrderDetail.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_Model/Models/Check/Dt_ReCheckOrder.cs 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_OutboundService/OutboundBatchPickingService.cs 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_OutboundService/OutboundOrderService.cs 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_OutboundService/OutboundPickingService.cs 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_StockService/StockInfoDetailService.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs 58 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_WMSServer/Program.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ÏîÄ¿´úÂë/WIDESEA_WMSClient/config/buttons.js
@@ -226,6 +226,15 @@
    onClick: function () {
    }
},
{
    name: "条码打印",
    // icon: 'el-icon-upload2',
    class: '',
    value: 'printForm',
    type: 'primary',
    onClick: function () {
    }
},
]
export default buttons
ÏîÄ¿´úÂë/WIDESEA_WMSClient/src/extension/outbound/outboundOrder.js
@@ -367,6 +367,8 @@
        }
      }
      var EmptyTrayOutboundBtn = this.buttons.find(x => x.value == "EmptyTrayOutbound");
        if (EmptyTrayOutboundBtn != null) {
          EmptyTrayOutboundBtn.onClick = () => {
ÏîÄ¿´úÂë/WIDESEA_WMSClient/src/router/viewGird.js
@@ -223,6 +223,11 @@
    name: 'StockDetailByMateriel',
    component: () => import('@/views/stock/stockInfoDetailByMaterielSum.vue')
  }
  ,{
    path:'/printForm',
    name: 'printForm',
    component: () => import('@/views/outbound/printForm.vue')
  },
]
export default viewgird   
ÏîÄ¿´úÂë/WIDESEA_WMSClient/src/views/outbound/printForm.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,247 @@
<template>
  <div class="print-input-container">
    <!-- é¡µé¢æ ‡é¢˜ -->
    <div class="page-title">物料标识卡打印参数输入</div>
    <!-- è¡¨å•区域 -->
    <el-card class="input-card">
      <el-form
        ref="printFormRef"
        :model="printForm"
        :rules="formRules"
        label-width="100px"
        size="default"
      >
        <!-- åŒåˆ—布局 -->
        <el-row :gutter="20">
          <!-- ç¬¬ä¸€åˆ— -->
          <el-col :span="12">
            <el-form-item label="料号" prop="materialCode">
              <el-input
                v-model="printForm.materialCode"
                placeholder="请输入物料编码"
                clearable
              />
            </el-form-item>
            <el-form-item label="品名" prop="materialName">
              <el-input
                v-model="printForm.materialName"
                placeholder="请输入物料名称"
                clearable
              />
            </el-form-item>
            <el-form-item label="规格" prop="specification">
              <el-input
                v-model="printForm.specification"
                placeholder="请输入物料规格"
                clearable
              />
            </el-form-item>
            <el-form-item label="批号" prop="batchNumber">
              <el-input
                v-model="printForm.batchNumber"
                placeholder="请输入批号(生成二维码用)"
                clearable
              />
            </el-form-item>
            <el-form-item label="厂区" prop="factory">
              <el-input
                v-model="printForm.factory"
                placeholder="请输入厂区名称"
                clearable
              />
            </el-form-item>
          </el-col>
          <!-- ç¬¬äºŒåˆ— -->
          <el-col :span="12">
            <el-form-item label="供应商编码" prop="supplierCode">
              <el-input
                v-model="printForm.supplierCode"
                placeholder="请输入供应商编码"
                clearable
              />
            </el-form-item>
            <el-form-item label="采购单号" prop="purchaseOrderNo">
              <el-input
                v-model="printForm.purchaseOrderNo"
                placeholder="请输入采购单号"
                clearable
              />
            </el-form-item>
            <el-form-item label="数量/总数" prop="quantityTotal">
              <el-input
                v-model="printForm.quantityTotal"
                placeholder="例:100/5000"
                clearable
              />
            </el-form-item>
            <el-form-item label="批次" prop="batch">
              <el-input
                v-model="printForm.batch"
                placeholder="请输入批次号"
                clearable
              />
            </el-form-item>
            <el-form-item label="日期" prop="date">
              <el-date-picker
                v-model="printForm.date"
                type="date"
                placeholder="选择日期"
                format="YYYY-MM-DD"
                value-format="YYYY-MM-DD"
                clearable
              />
            </el-form-item>
          </el-col>
        </el-row>
        <!-- æ‰¹é‡æ·»åŠ ï¼ˆå¯é€‰ï¼‰ -->
        <el-form-item label="打印份数">
          <el-input-number
            v-model="printCopyCount"
            :min="1"
            :max="50"
            label="份数"
            placeholder="请输入打印份数"
          />
        </el-form-item>
        <!-- æ“ä½œæŒ‰é’® -->
        <el-form-item class="form-actions">
          <el-button type="primary" @click="submitForm">确认并打开打印弹窗</el-button>
          <el-button @click="resetForm">重置表单</el-button>
        </el-form-item>
      </el-form>
    </el-card>
    <!-- å¼•入打印弹窗组件 -->
    <print-view ref="printViewRef" />
  </div>
</template>
<script>
// å¼•入打印弹窗组件
import printView from "@/extension/outbound/extend/printView.vue";
import { ElMessage } from "element-plus";
export default {
  name: "PrintInputPage",
  components: { printView },
  data() {
    return {
      // è¡¨å•数据(对应printView所需的参数)
      printForm: {
        materialCode: "", // æ–™å·
        supplierCode: "", // ä¾›åº”商编码
        materialName: "", // å“å
        purchaseOrderNo: "", // é‡‡è´­å•号
        specification: "", // è§„æ ¼
        quantityTotal: "", // æ•°é‡/总数
        batchNumber: "", // æ‰¹å·ï¼ˆäºŒç»´ç å†…容)
        batch: "", // æ‰¹æ¬¡
        factory: "", // åŽ‚åŒº
        date: "", // æ—¥æœŸï¼ˆé»˜è®¤å½“前日期)
      },
      // æ‰“印份数(支持批量生成多条相同数据)
      printCopyCount: 1,
      // è¡¨å•验证规则
      formRules: {
        materialCode: [{ required: true, message: "请输入料号", trigger: "blur" }],
        materialName: [{ required: true, message: "请输入品名", trigger: "blur" }],
        batchNumber: [{ required: true, message: "请输入批号", trigger: "blur" }],
        date: [{ required: true, message: "请选择日期", trigger: "change" }],
      },
    };
  },
  mounted() {
    // åˆå§‹åŒ–默认日期为当天
    const today = new Date();
    this.printForm.date = `${today.getFullYear()}-${(today.getMonth() + 1).toString().padStart(2, "0")}-${today.getDate().toString().padStart(2, "0")}`;
  },
  methods: {
    // æäº¤è¡¨å•,打开打印弹窗
    submitForm() {
      this.$refs.printFormRef.validate((valid) => {
        if (!valid) {
          ElMessage.warning("请完善必填项后提交");
          return;
        }
        try {
          // æž„造打印数据(支持多份)
          const printData = [];
          for (let i = 0; i < this.printCopyCount; i++) {
            printData.push({ ...this.printForm });
          }
          // è°ƒç”¨printView的open方法,传递参数并打开弹窗
          this.$refs.printViewRef.open(printData);
          ElMessage.success(`已生成 ${this.printCopyCount} ä»½æ‰“印数据,即将打开打印弹窗`);
        } catch (error) {
          console.error("打开打印弹窗失败:", error);
          ElMessage.error("打开打印弹窗失败,请重试");
        }
      });
    },
    // é‡ç½®è¡¨å•
    resetForm() {
      this.$refs.printFormRef.resetFields();
      // é‡ç½®åŽæ¢å¤é»˜è®¤æ—¥æœŸ
      const today = new Date();
      this.printForm.date = `${today.getFullYear()}-${(today.getMonth() + 1).toString().padStart(2, "0")}-${today.getDate().toString().padStart(2, "0")}`;
      this.printCopyCount = 1;
    },
  },
};
</script>
<style scoped>
.print-input-container {
  padding: 20px;
  max-width: 1000px;
  margin: 0 auto;
}
.page-title {
  font-size: 20px;
  font-weight: bold;
  color: #303133;
  margin-bottom: 20px;
  text-align: center;
}
.input-card {
  box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
}
.form-actions {
  text-align: center;
  margin-top: 20px;
}
.form-actions .el-button {
  margin: 0 10px;
  padding: 10px 20px;
}
/* é€‚配小屏幕 */
@media (max-width: 768px) {
  .print-input-container {
    padding: 10px;
  }
  .el-form-item {
    margin-bottom: 15px;
  }
}
</style>
ÏîÄ¿´úÂë/WMSÎÞ²Ö´¢°æ/WIDESEA_WMSServer/WIDESEA_AllocateService/AllocateService.cs
@@ -1,15 +1,5 @@
using Autofac.Core;
using MailKit.Search;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging;
using SqlSugar;
using SqlSugar.Extensions;
using System;
using System.Collections.Generic;
using System.Dynamic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using WIDESEA_Common.AllocateEnum;
using WIDESEA_Common.OrderEnum;
using WIDESEA_Core;
@@ -17,10 +7,10 @@
using WIDESEA_Core.BaseServices;
using WIDESEA_Core.CodeConfigEnum;
using WIDESEA_Core.DB;
using WIDESEA_Core.Enums;
using WIDESEA_Core.Helper;
using WIDESEA_Core.Seed;
using WIDESEA_IAllocateService;
using WIDESEA_IBasicService;
using WIDESEA_IInboundService;
using WIDESEA_IOutboundService;
using WIDESEA_Model.Models;
@@ -36,7 +26,7 @@
        public readonly IOutboundService _outboundService;
        public readonly IRepository<Dt_AllocateOrder> _allocateOrderRepository;
        public readonly IRepository<Dt_AllocateOrderDetail> _allocateOrderDetailRepository;
        private readonly IMaterielInfoService _materielInfoService;
        public readonly IRepository<Dt_InboundOrderDetail> _inboundOrderDetailRepository;
        private readonly ILogger<AllocateService> _logger;
@@ -47,7 +37,8 @@
            IRepository<Dt_AllocateOrder> allocateOrderRepository,
            IRepository<Dt_AllocateOrderDetail> allocateOrderDetailRepository,
            IRepository<Dt_InboundOrderDetail> inboundOrderDetailRepository,
            ILogger<AllocateService> logger) : base(BaseDal)
            ILogger<AllocateService> logger,
            IMaterielInfoService materielInfoService) : base(BaseDal)
        {
            _unitOfWorkManage = unitOfWorkManage;
            _inboundService = inboundService;
@@ -56,6 +47,7 @@
            _allocateOrderDetailRepository = allocateOrderDetailRepository;
            _logger = logger;
            _inboundOrderDetailRepository = inboundOrderDetailRepository;
            _materielInfoService = materielInfoService;
        }
        public IRepository<Dt_AllocateOrder> Repository => BaseDal;
@@ -86,9 +78,18 @@
            {
                if (BaseDal.QueryFirst(x => x.UpperOrderNo == allocateOrder.UpperOrderNo) != null)
                {
                    return WebResponseContent.Instance.Error($"调拨单号重复");
                    return WebResponseContent.Instance.Error($"{allocateOrder.UpperOrderNo}调拨单号重复");
                }
                allocateOrder.OrderNo = CreateCodeByRule(nameof(RuleCodeEnum.AllocateOrderCodeRule));
                var materielCodes = allocateOrder.Details.Select(x => x.MaterielCode).Distinct().ToList();
                var materielInfos = _materielInfoService.Db.Queryable<Dt_MaterielInfo>().Where(x => materielCodes.Contains(x.MaterielCode)).ToList();
                foreach (var item in allocateOrder.Details)
                {
                    if (materielInfos.Any())
                    {
                        item.MaterielName = materielInfos.FirstOrDefault(x => x.MaterielCode == item.MaterielCode)?.MaterielName ?? "";
                    }
                }
                Db.InsertNav(allocateOrder).Include(x => x.Details).ExecuteCommand();
                await AddInOutData(allocateOrder);
                return WebResponseContent.Instance.OK();
@@ -148,13 +149,13 @@
                List<Dt_AllocateOrderDetail> allocateOrderDetails = new List<Dt_AllocateOrderDetail>();
                List<Dt_AllocateOrderDetail> updateAllocateOrderDetails = new List<Dt_AllocateOrderDetail>();
                List<int> detailIds = new List<int>();
                var materielCodes = allocateOrder.Details.Select(x => x.MaterielCode).Distinct().ToList();
                var materielInfos = _materielInfoService.Db.Queryable<Dt_MaterielInfo>().Where(x => materielCodes.Contains(x.MaterielCode)).ToList();
                foreach (var item in model.Details)
                {
                    if (string.IsNullOrEmpty(item.Barcode))
                    {
                    }
                    else
                    if (!string.IsNullOrEmpty(item.Barcode))
                    {
                        Dt_AllocateOrderDetail? allocateOrderDetail = allocateOrder.Details.FirstOrDefault(x => x.Barcode == item.Barcode);
                        if (allocateOrderDetail == null)
@@ -172,6 +173,10 @@
                                BarcodeQty = (decimal)item.BarcodeQty,
                                OrderQuantity = item.OrderQuantity
                            };
                            if (materielInfos.Any())
                            {
                                allocateOrderDetail.MaterielName = materielInfos.FirstOrDefault(x => x.MaterielCode == item.MaterielCode)?.MaterielName ?? "";
                            }
                            allocateOrderDetails.Add(allocateOrderDetail);
                        }
                        else
@@ -185,7 +190,10 @@
                            allocateOrderDetail.BarcodeUnit = item.BarcodeUnit;
                            allocateOrderDetail.BarcodeQty = item.BarcodeQty;
                            allocateOrderDetail.OrderQuantity = item.OrderQuantity;
                            if (materielInfos.Any())
                            {
                                allocateOrderDetail.MaterielName = materielInfos.FirstOrDefault(x => x.MaterielCode == item.MaterielCode)?.MaterielName ?? "";
                            }
                            updateAllocateOrderDetails.Add(allocateOrderDetail);
                            detailIds.Add(allocateOrderDetail.Id);
ÏîÄ¿´úÂë/WMSÎÞ²Ö´¢°æ/WIDESEA_WMSServer/WIDESEA_AllocateService/WIDESEA_AllocateService.csproj
@@ -9,6 +9,7 @@
  <ItemGroup>
    <ProjectReference Include="..\WIDESEA_Core\WIDESEA_Core.csproj" />
    <ProjectReference Include="..\WIDESEA_IAllocateService\WIDESEA_IAllocateService.csproj" />
    <ProjectReference Include="..\WIDESEA_IBasicService\WIDESEA_IBasicService.csproj" />
    <ProjectReference Include="..\WIDESEA_IInboundService\WIDESEA_IInboundService.csproj" />
    <ProjectReference Include="..\WIDESEA_IOutboundService\WIDESEA_IOutboundService.csproj" />
    <ProjectReference Include="..\WIDESEA_Model\WIDESEA_Model.csproj" />
ÏîÄ¿´úÂë/WMSÎÞ²Ö´¢°æ/WIDESEA_WMSServer/WIDESEA_BasicService/InvokeMESService.cs
@@ -288,7 +288,7 @@
                                            {
                                                ReqCode = Guid.NewGuid().ToString(),
                                                ReqTime = DateTime.Now.ToString(),
                                                BusinessType = "2",
                                                BusinessType = "3",
                                                FactoryArea = inboundOrder.FactoryArea,
                                                OperationType = 1,
                                                Operator = inboundOrder.Operator,
ÏîÄ¿´úÂë/WMSÎÞ²Ö´¢°æ/WIDESEA_WMSServer/WIDESEA_BasicService/LocationInfoService.cs
@@ -116,7 +116,7 @@
        private readonly static object _locker = new object();
        static List<LocationCache> locationCaches = new List<LocationCache>();
        private int locationCacheTime = 10;
        private int locationCacheTime = 20;
        /// <summary>
        /// 
        /// </summary>
@@ -164,7 +164,6 @@
                if (first != null)
                {
                    locationCaches.Add(new LocationCache { LocationCode = first?.LocationCode, DateTime = DateTime.Now });
                    using (var sugarClient = new SqlSugarClient(new ConnectionConfig
                    {
ÏîÄ¿´úÂë/WMSÎÞ²Ö´¢°æ/WIDESEA_WMSServer/WIDESEA_CheckService/ReCheckOrderService.cs
@@ -14,6 +14,7 @@
using WIDESEA_Core.CodeConfigEnum;
using WIDESEA_Core.Enums;
using WIDESEA_Core.Helper;
using WIDESEA_IBasicService;
using WIDESEA_ICheckService;
using WIDESEA_IOutboundService;
using WIDESEA_Model.Models;
@@ -27,15 +28,16 @@
        private readonly IUnitOfWorkManage _unitOfWorkManage;
        private readonly WebSocketServer _webSocketServer;
        private readonly ILogger<ReCheckOrderService> _logger;
        private readonly IMaterielInfoService _materielInfoService;
        public readonly IOutboundService _outboundService;
        public IRepository<Dt_ReCheckOrder> Repository => BaseDal;
        public ReCheckOrderService(IRepository<Dt_ReCheckOrder> BaseDal, IUnitOfWorkManage unitOfWorkManage, WebSocketServer webSocketServer, ILogger<ReCheckOrderService> logger, IOutboundService outboundService) : base(BaseDal)
        public ReCheckOrderService(IRepository<Dt_ReCheckOrder> BaseDal, IUnitOfWorkManage unitOfWorkManage, WebSocketServer webSocketServer, ILogger<ReCheckOrderService> logger, IOutboundService outboundService, IMaterielInfoService materielInfoService) : base(BaseDal)
        {
            _unitOfWorkManage = unitOfWorkManage;
            _webSocketServer = webSocketServer;
            _logger = logger;
            _outboundService = outboundService;
            _materielInfoService = materielInfoService;
        }
        public async Task<WebResponseContent> ReceiveReCheckOrder(Dt_ReCheckOrder models, int operateType)
@@ -65,11 +67,14 @@
                if (BaseDal.QueryFirst(x => x.OrderNo == model.OrderNo) != null)
                {
                    return WebResponseContent.Instance.Error($"单号重复");
                    return WebResponseContent.Instance.Error($"{model.OrderNo}单号重复");
                }
                var materielInfo = _materielInfoService.Db.Queryable<Dt_MaterielInfo>().First(x => model.MaterielCode.Equals(x.MaterielCode));
                model.Creater = "MES";
                model.CreateDate = DateTime.Now;
                model.MaterielName = materielInfo?.MaterielName ?? "";
                BaseDal.AddData(model);
                var outboundOrders = ConvertToOutboundOrders(model);
             
@@ -109,7 +114,8 @@
                recheckOrder.FactoryArea = model.FactoryArea;
                recheckOrder.Modifier = "MES";
                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_CheckService/WIDESEA_CheckService.csproj
@@ -7,6 +7,7 @@
  </PropertyGroup>
  <ItemGroup>
    <ProjectReference Include="..\WIDESEA_IBasicService\WIDESEA_IBasicService.csproj" />
    <ProjectReference Include="..\WIDESEA_ICheckService\WIDESEA_ICheckService.csproj" />
    <ProjectReference Include="..\WIDESEA_IOutboundService\WIDESEA_IOutboundService.csproj" />
  </ItemGroup>
ÏîÄ¿´úÂë/WMSÎÞ²Ö´¢°æ/WIDESEA_WMSServer/WIDESEA_InboundService/InboundOrderService.cs
@@ -34,6 +34,7 @@
        private IStockService _stockService;
        private readonly IMaterialUnitService _materialUnitService;
        private readonly IMaterielInfoService _materielInfoService;
        private readonly IInboundOrderDetailService _inboundOrderDetailService;
        private readonly IRepository<Dt_InboundOrderDetail> _inboundOrderDetailRepository;
        private readonly IRepository<Dt_StockInfoDetail> _stockDetailRepository;
@@ -43,7 +44,7 @@
        private readonly IRepository<Dt_StockInfo> _stockRepository;
        public IRepository<Dt_InboundOrder> Repository => BaseDal;
        public InboundOrderService(IRepository<Dt_InboundOrder> BaseDal, IMapper mapper, IUnitOfWorkManage unitOfWorkManage, IRepository<Dt_InboundOrderDetail> inboundOrderDetailRepository, IRepository<Dt_Task> taskRepository, IStockService stockService, IInboundOrderDetailService inboundOrderDetailService, IMaterialUnitService materialUnitService, IRepository<Dt_StockInfoDetail> stockDetailRepository, IRepository<Dt_InboundOrder> inboundOrderRepository, IRepository<Dt_WarehouseArea> warehouseAreaRepository, IRepository<Dt_StockInfo> stockRepository, IRepository<Dt_LocationType> locationTypeRepository) : base(BaseDal)
        public InboundOrderService(IRepository<Dt_InboundOrder> BaseDal, IMapper mapper, IUnitOfWorkManage unitOfWorkManage, IRepository<Dt_InboundOrderDetail> inboundOrderDetailRepository, IRepository<Dt_Task> taskRepository, IStockService stockService, IInboundOrderDetailService inboundOrderDetailService, IMaterialUnitService materialUnitService, IRepository<Dt_StockInfoDetail> stockDetailRepository, IRepository<Dt_InboundOrder> inboundOrderRepository, IRepository<Dt_WarehouseArea> warehouseAreaRepository, IRepository<Dt_StockInfo> stockRepository, IRepository<Dt_LocationType> locationTypeRepository, IMaterielInfoService materielInfoService) : base(BaseDal)
        {
            _mapper = mapper;
            _unitOfWorkManage = unitOfWorkManage;
@@ -57,6 +58,7 @@
            _warehouseAreaRepository = warehouseAreaRepository;
            _stockRepository = stockRepository;
            _locationTypeRepository = locationTypeRepository;
            _materielInfoService = materielInfoService;
        }
        public async Task<WebResponseContent> ReceiveInboundOrder(List<Dt_InboundOrder> models, int operateType)
@@ -86,17 +88,24 @@
                {
                    if (BaseDal.QueryFirst(x => x.UpperOrderNo == model.UpperOrderNo) != null)
                    {
                        return WebResponseContent.Instance.Error($"入库单号重复");
                        return WebResponseContent.Instance.Error($"{model.UpperOrderNo}入库单号重复");
                    }
                }
                foreach (var model in models)
                {
                    var materielCodes = model.Details.Select(x => x.MaterielCode).Distinct().ToList();
                    var materielInfos = _materielInfoService.Db.Queryable<Dt_MaterielInfo>().Where(x => materielCodes.Contains(x.MaterielCode)).ToList();
                    foreach (var item in model.Details)
                    {
                        var purchaseToStockResult = await _materialUnitService.ConvertPurchaseToStockAsync(item.MaterielCode, item.BarcodeQty);
                        item.Unit = purchaseToStockResult.Unit;
                        item.OrderQuantity = purchaseToStockResult.Quantity;
                        if (materielInfos.Any())
                        {
                            item.MaterielName = materielInfos.FirstOrDefault(x => x.MaterielCode == item.MaterielCode)?.MaterielName ?? "";
                        }
                    }
                    if (model.OrderType != InOrderTypeEnum.AllocatInbound.ObjToInt())
                    {
@@ -134,13 +143,12 @@
                    List<Dt_InboundOrderDetail> inboundOrderDetails = new List<Dt_InboundOrderDetail>();
                    List<Dt_InboundOrderDetail> updateInboundOrderDetails = new List<Dt_InboundOrderDetail>();
                    List<int> detailIds = new List<int>();
                    var materielCodes = model.Details.Select(x => x.MaterielCode).Distinct().ToList();
                    var materielInfos = _materielInfoService.Db.Queryable<Dt_MaterielInfo>().Where(x => materielCodes.Contains(x.MaterielCode)).ToList();
                    foreach (var item in model.Details)
                    {
                        if (string.IsNullOrEmpty(item.Barcode))
                        {
                        }
                        else
                        if (!string.IsNullOrEmpty(item.Barcode))
                        {
                            Dt_InboundOrderDetail? inboundOrderDetail = inboundOrder.Details.FirstOrDefault(x => x.Barcode == item.Barcode);
                            if (inboundOrderDetail == null)
@@ -163,11 +171,18 @@
                                var purchaseToStockResult = await _materialUnitService.ConvertPurchaseToStockAsync(item.MaterielCode, item.BarcodeQty);
                                inboundOrderDetail.Unit = purchaseToStockResult.Unit;
                                inboundOrderDetail.OrderQuantity = purchaseToStockResult.Quantity;
                                if (materielInfos.Any())
                                {
                                    inboundOrderDetail.MaterielName = materielInfos.FirstOrDefault(x => x.MaterielCode == item.MaterielCode)?.MaterielName ?? "";
                                }
                                inboundOrderDetails.Add(inboundOrderDetail);
                            }
                            else
                            {
                                if (materielInfos.Any())
                                {
                                    inboundOrderDetail.MaterielName = materielInfos.FirstOrDefault(x => x.MaterielCode == item.MaterielCode)?.MaterielName ?? "";
                                }
                                inboundOrderDetail.lineNo = item.lineNo;
                                inboundOrderDetail.MaterielCode = item.MaterielCode;
                                inboundOrderDetail.SupplyCode = item.SupplyCode;
@@ -649,16 +664,16 @@
        public WebResponseContent UndoPalletGroup(string palletCode, string barcode = "")
        {
            if (string.IsNullOrWhiteSpace(palletCode))
            {
                return WebResponseContent.Instance.Error("托盘号不能为空");
            }
            try
            {
                _unitOfWorkManage.BeginTran();
                _unitOfWorkManage.BeginTran();
                // 2. æŸ¥è¯¢æ‰˜ç›˜åº“存主记录(避免无数据抛异常)
                var stock = _stockRepository.Db.Queryable<Dt_StockInfo>()
@@ -682,7 +697,7 @@
                        return WebResponseContent.Instance.Error($"托盘{palletCode}下未找到条码{barcode}的明细记录");
                    }
                    ResetInboundOrderStatus(new List<string> { targetDetail.OrderNo},new List<string> { targetDetail.Barcode});
                    ResetInboundOrderStatus(new List<string> { targetDetail.OrderNo }, new List<string> { targetDetail.Barcode });
                    // åˆ é™¤æŒ‡å®šæ˜Žç»†
                    _stockDetailRepository.DeleteData(targetDetail);
@@ -735,7 +750,7 @@
            }
            catch (Exception ex)
            {
                _unitOfWorkManage.RollbackTran();
                _unitOfWorkManage.RollbackTran();
                return WebResponseContent.Instance.Error($"托盘撤销失败:{ex.Message}");
            }
        }
@@ -801,7 +816,7 @@
            if (!string.IsNullOrEmpty(options.Wheres))
            {
                try
                {
                {
                    searchParametersList = options.Wheres.DeserializeObject<List<SearchParameters>>();
                    if (searchParametersList.Count > 0)
                    {
ÏîÄ¿´úÂë/WMSÎÞ²Ö´¢°æ/WIDESEA_WMSServer/WIDESEA_Model/Models/Allocate/Dt_AllocateOrderDetail.cs
@@ -35,6 +35,7 @@
        public string MaterielCode { get; set; }
        public string MaterielName { get; set; }
        /// <summary>
        /// æ‰¹æ¬¡å·
        /// </summary>
ÏîÄ¿´úÂë/WMSÎÞ²Ö´¢°æ/WIDESEA_WMSServer/WIDESEA_Model/Models/Check/Dt_ReCheckOrder.cs
@@ -38,6 +38,11 @@
        public string MaterielCode { get; set; } = null!;
        /// <summary>
        ///
        /// </summary>
        public string MaterielName { get; set; }
        /// <summary>
        /// å¤‡  æ³¨:
        /// é»˜è®¤å€¼:
        ///</summary>
ÏîÄ¿´úÂë/WMSÎÞ²Ö´¢°æ/WIDESEA_WMSServer/WIDESEA_OutboundService/OutboundBatchPickingService.cs
@@ -339,17 +339,7 @@
                _unitOfWorkManage.CommitTran();
                return WebResponseContent.Instance.OK("分拣成功", new
                {
                    PickedQuantity = actualPickedQty,
                    Barcode = barcode,
                    MaterialCode = lockInfo.MaterielCode,
                    AutoSplitted = autoSplitResult != null,
                    RemainingStock = stockDetail.StockQuantity,
                    CurrentOutbound = stockDetail.OutboundQuantity,
                    // å¦‚果是自动拆包,返回相关信息
                    UnallocatedCreated = autoSplitResult != null ? "是" : "否"
                });
                return WebResponseContent.Instance.OK("分拣成功", autoSplitResult);
            }
            catch (Exception ex)
            {
@@ -1852,8 +1842,8 @@
                    catch (Exception ex)
                    {
                        _unitOfWorkManage.RollbackTran();
                        _logger.LogError($"空箱回库失败: {ex.Message}");
                        return WebResponseContent.Instance.Error($"空箱回库失败:{ex.Message}");
                        _logger.LogError($"空箱回库ExecutePalletReturn失败: {ex.Message}");
                        return WebResponseContent.Instance.Error($"空箱回库ExecutePalletReturn失败:{ex.Message}");
                    }
                }
@@ -1883,7 +1873,7 @@
                }
                catch (Exception taskEx)
                {
                    _logger.LogError($"回库任务创建失败: {taskEx.Message}");
                    _logger.LogError($"回库任务CreateReturnTaskWithoutESS创建失败: {taskEx.Message}");
                    // ä»»åŠ¡åˆ›å»ºå¤±è´¥ä¸å½±å“æ•°æ®å›žåº“
                }
                _unitOfWorkManage.CommitTran();
@@ -1908,8 +1898,8 @@
            catch (Exception ex)
            {
                _unitOfWorkManage.RollbackTran();
                _logger.LogError($"回库失败: {ex.Message}");
                return WebResponseContent.Instance.Error($"回库失败:{ex.Message}");
                _logger.LogError($"ExecutePalletReturn å›žåº“失败: {ex.Message}");
                return WebResponseContent.Instance.Error($"ExecutePalletReturn å›žåº“失败:{ex.Message}");
            }
        }
@@ -2687,12 +2677,12 @@
                // åˆ›å»ºå›žåº“任务(不发送ESS命令)
                var returnTaskInfo = await CreateEmptyPalletReturnTask(orderNo, palletCode, emptyStockInfo, currentTask);
                return WebResponseContent.Instance.OK("空托盘回库成功");
                return WebResponseContent.Instance.OK("空托盘回库成功", returnTaskInfo);
            }
            catch (Exception ex)
            {
                _logger.LogError($"空托盘回库失败: {ex.Message}");
                return WebResponseContent.Instance.Error($"空托盘回库失败: {ex.Message}");
                _logger.LogError($"空托盘回库失败 HandleEmptyPalletReturn: {ex.Message}");
                return WebResponseContent.Instance.Error($"空托盘回库失败 HandleEmptyPalletReturn: {ex.Message}");
            }
        }
@@ -2893,7 +2883,7 @@
      
        /// <summary>
        /// å–走空箱 - ä¿®æ­£ç‰ˆï¼Œæ­£ç¡®å¤„理未分配锁定记录
        /// å–走空箱 -正确处理未分配锁定记录
        /// </summary>
        public async Task<WebResponseContent> RemoveEmptyPallet(string orderNo, string palletCode)
        {
ÏîÄ¿´úÂë/WMSÎÞ²Ö´¢°æ/WIDESEA_WMSServer/WIDESEA_OutboundService/OutboundOrderService.cs
@@ -3,6 +3,7 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using SqlSugar;
using WIDESEA_BasicService;
using WIDESEA_Common.AllocateEnum;
using WIDESEA_Common.OrderEnum;
using WIDESEA_Core;
@@ -23,17 +24,19 @@
    {
        private readonly IMapper _mapper;
        private readonly IUnitOfWorkManage _unitOfWorkManage;
        private readonly IMaterielInfoService _materielInfoService;
        public IRepository<Dt_OutboundOrder> Repository => BaseDal;
        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) : base(BaseDal)
        public OutboundOrderService(IRepository<Dt_OutboundOrder> BaseDal, IMapper mapper, IUnitOfWorkManage unitOfWorkManage, IRepository<Dt_OutboundOrderDetail> outboundOrderDetailRepository, ILogger<OutboundOrderService> logger, IMaterialUnitService materialUnitService, IMaterielInfoService materielInfoService) : base(BaseDal)
        {
            _mapper = mapper;
            _unitOfWorkManage = unitOfWorkManage;
            _outboundOrderDetailRepository = outboundOrderDetailRepository;
            _logger = logger;
            _materialUnitService = materialUnitService;
            _materielInfoService = materielInfoService;
        }
        private int[] OrderTypes = new int[] { (int)InOrderTypeEnum.AllocatOutbound, (int)InOrderTypeEnum.InternalAllocat, (int)InOrderTypeEnum.ReCheck };
@@ -63,8 +66,12 @@
                if (BaseDal.QueryFirst(x => x.UpperOrderNo == model.UpperOrderNo) != null)
                {
                    return WebResponseContent.Instance.Error($"出库单号重复");
                    return WebResponseContent.Instance.Error($"{model.UpperOrderNo}出库单号重复");
                }
                var materielCodes = model.Details.Select(x => x.MaterielCode).Distinct().ToList();
                var materielInfos = _materielInfoService.Db.Queryable<Dt_MaterielInfo>().Where(x => materielCodes.Contains(x.MaterielCode)).ToList();
                foreach (var item in model.Details)
                {
                    var issueoStockResult = await _materialUnitService.ConvertFromToStockAsync(item.MaterielCode, item.BarcodeUnit, item.BarcodeQty);
@@ -72,6 +79,11 @@
                    item.OrderQuantity = issueoStockResult.Quantity;
                    var moveissueoStockResult = await _materialUnitService.ConvertFromToStockAsync(item.MaterielCode, item.BarcodeUnit, item.BarcodeMoveQty);
                    item.MoveQty = moveissueoStockResult.Quantity;
                    if (materielInfos.Any())
                    {
                        item.MaterielName = materielInfos.FirstOrDefault(x => x.MaterielCode == item.MaterielCode)?.MaterielName ?? "";
                    }
                }
                if (!OrderTypes.Contains(model.OrderType))
                {
@@ -108,6 +120,11 @@
                List<Dt_OutboundOrderDetail> outboundOrderDetails = new List<Dt_OutboundOrderDetail>();
                List<Dt_OutboundOrderDetail> updateoutboundOrderDetails = new List<Dt_OutboundOrderDetail>();
                List<int> detailIds = new List<int>();
                var materielCodes = model.Details.Select(x => x.MaterielCode).Distinct().ToList();
                var materielInfos = _materielInfoService.Db.Queryable<Dt_MaterielInfo>().Where(x => materielCodes.Contains(x.MaterielCode)).ToList();
                foreach (var item in model.Details)
                {
@@ -135,6 +152,11 @@
                        var moveissueoStockResult = await _materialUnitService.ConvertFromToStockAsync(item.MaterielCode, item.BarcodeUnit, item.BarcodeMoveQty);
                        item.MoveQty = moveissueoStockResult.Quantity;
                        if (materielInfos.Any())
                        {
                            outboundOrderDetail.MaterielName = materielInfos.FirstOrDefault(x => x.MaterielCode == item.MaterielCode)?.MaterielName ?? "";
                        }
                        outboundOrderDetails.Add(outboundOrderDetail);
                    }
                    else
@@ -155,7 +177,10 @@
                        outboundOrderDetail.OrderQuantity = issueoStockResult.Quantity;
                        var moveissueoStockResult = await _materialUnitService.ConvertFromToStockAsync(item.MaterielCode, item.BarcodeUnit, item.BarcodeMoveQty);
                        outboundOrderDetail.MoveQty = moveissueoStockResult.Quantity;
                        if (materielInfos.Any())
                        {
                            outboundOrderDetail.MaterielName = materielInfos.FirstOrDefault(x => x.MaterielCode == item.MaterielCode)?.MaterielName ?? "";
                        }
                        updateoutboundOrderDetails.Add(outboundOrderDetail);
                        detailIds.Add(outboundOrderDetail.Id);
ÏîÄ¿´úÂë/WMSÎÞ²Ö´¢°æ/WIDESEA_WMSServer/WIDESEA_OutboundService/OutboundPickingService.cs
@@ -34,6 +34,7 @@
    /// </summary>
    public class OutboundPickingService : ServiceBase<Dt_PickingRecord, IRepository<Dt_PickingRecord>>, IOutboundPickingService
    {
        #region æž„造函数
        private readonly IUnitOfWorkManage _unitOfWorkManage;
        public IRepository<Dt_PickingRecord> Repository => BaseDal;
@@ -100,6 +101,7 @@
            _interfaceLog = interfaceLog;
        }
        #endregion
        #region æŸ¥è¯¢æ–¹æ³•
        // èŽ·å–æœªæ‹£é€‰åˆ—è¡¨
@@ -2055,8 +2057,6 @@
        }
        #endregion
        #region è¾…助方法
        /// <summary>
        /// ç»Ÿä¸€åˆ†æžæ‰˜ç›˜çŠ¶æ€ - è¿”回托盘的完整状态信息
@@ -2144,7 +2144,6 @@
            return result;
        }
        private async Task<string> GenerateNewBarcode()
        {
@@ -2282,7 +2281,7 @@
            }
            return WebResponseContent.Instance.OK("拣选确认成功", new { SplitResults = new List<SplitResult>() });
        }
        #endregion
        #region è™šæ‹Ÿå‡ºå…¥åº“
@@ -2934,7 +2933,7 @@
        }
        #endregion
    }
    #region æ”¯æŒç±»å®šä¹‰
ÏîÄ¿´úÂë/WMSÎÞ²Ö´¢°æ/WIDESEA_WMSServer/WIDESEA_StockService/StockInfoDetailService.cs
@@ -109,7 +109,7 @@
            return new PageGridData<StockInfoDetailWithPalletDto>
            {
                Rows = dtoList,
                Rows = dtoList.Where(x=>x.PalletCode != "无托盘编号").ToList(),
                Total = pageData.Total,
                Summary = pageData.Summary
            };
ÏîÄ¿´úÂë/WMSÎÞ²Ö´¢°æ/WIDESEA_WMSServer/WIDESEA_TaskInfoService/TaskService.cs
@@ -297,10 +297,17 @@
            {
                await Db.Deleteable(task).ExecuteCommandAsync();
            }
            _locationStatusChangeRecordService.AddLocationStatusChangeRecord(locationInfo, beforeStatus, StockChangeType.Inbound.ObjToInt(), "", task.TaskNum);
            _recordService.StockQuantityChangeRecordService.AddStockChangeRecord(stockInfo, stockInfo.Details, beforeQuantity, stockInfo.Details.Sum(x => x.StockQuantity) + beforeQuantity, WIDESEA_Common.StockEnum.StockChangeType.MaterielGroup);
            try
            {
                _locationStatusChangeRecordService.AddLocationStatusChangeRecord(locationInfo, beforeStatus, StockChangeType.Inbound.ObjToInt(), "", task.TaskNum);
                _recordService.StockQuantityChangeRecordService.AddStockChangeRecord(stockInfo, stockInfo.Details, beforeQuantity, stockInfo.Details.Sum(x => x.StockQuantity) + beforeQuantity, WIDESEA_Common.StockEnum.StockChangeType.MaterielGroup);
            }
            catch(Exception ex)
            {
                _logger.LogInformation($"InboundTaskCompleted AddLocationStatusChangeRecord : {ex.Message} " );
            }
                try
            {
                foreach (var inboundOrder in inboundOrders)
                {
@@ -568,8 +575,14 @@
                {
                    await Db.Deleteable(task).ExecuteCommandAsync();
                }
                _locationStatusChangeRecordService.AddLocationStatusChangeRecord(locationInfo, beforelocationStatus, StockChangeType.Inbound.ObjToInt(), "", task.TaskNum);
                try
                {
                    _locationStatusChangeRecordService.AddLocationStatusChangeRecord(locationInfo, beforelocationStatus, StockChangeType.Inbound.ObjToInt(), "", task.TaskNum);
                }
                catch(Exception ex)
                {
                    _logger.LogInformation($"InEmptyTaskCompleted AddLocationStatusChangeRecord : {ex.Message} ");
                }
                if (outboundOrder != null)
                {
@@ -683,16 +696,23 @@
                {
                    await Db.Deleteable(task).ExecuteCommandAsync();
                }
                // è®°å½•货位状态变更
                _locationStatusChangeRecordService.AddLocationStatusChangeRecord(
                    locationInfo,
                    beforelocationStatus,
                    StockChangeType.Inbound.ObjToInt(),
                    "",
                    task.TaskNum
                );
                await RecalculateOrderStatus(task.OrderNo);
                try
                {
                    // è®°å½•货位状态变更
                    _locationStatusChangeRecordService.AddLocationStatusChangeRecord(
                        locationInfo,
                        beforelocationStatus,
                        StockChangeType.Inbound.ObjToInt(),
                        "",
                        task.TaskNum
                    );
                }
                catch (Exception ex)
                {
                    _logger.LogInformation($"InPickTaskCompleted AddLocationStatusChangeRecord : {ex.Message} ");
                }
                _logger.LogInformation($"托盘回库完成处理成功 - ä»»åŠ¡å·: {task.TaskNum}, æ‰˜ç›˜: {task.PalletCode}, è®¢å•: {task.OrderNo}");
                _ = Task.Run(async () =>
@@ -1284,8 +1304,14 @@
                    _stockRepository.Db.Deleteable(stockInfo).ExecuteCommand();
                }
                _stockService.StockInfoService.DeleteData(stockInfo);
                _locationStatusChangeRecordService.AddLocationStatusChangeRecord(locationInfo, beforeStatus, StockChangeType.Outbound.ObjToInt(), stockInfo.Details.FirstOrDefault()?.OrderNo ?? "", task.TaskNum);
                try
                {
                    _locationStatusChangeRecordService.AddLocationStatusChangeRecord(locationInfo, beforeStatus, StockChangeType.Outbound.ObjToInt(), stockInfo?.Details.FirstOrDefault()?.OrderNo ?? "", task.TaskNum);
                }
                catch (Exception ex)
                {
                    _logger.LogError($"TaskService OutEmptyTaskCompleted AddLocationStatusChangeRecord:  {ex.Message} ");
                }
                return await Task.FromResult(WebResponseContent.Instance.OK());
            }
ÏîÄ¿´úÂë/WMSÎÞ²Ö´¢°æ/WIDESEA_WMSServer/WIDESEA_WMSServer/Program.cs
@@ -49,7 +49,7 @@
    .WriteTo.File( // é…ç½®è¾“出到文件
        path: "logs/log-.txt", // æ—¥å¿—文件路径,会自动创建 logs æ–‡ä»¶å¤¹
        rollingInterval: RollingInterval.Day, // æŒ‰å¤©æ»šåŠ¨æ—¥å¿—æ–‡ä»¶
        retainedFileCountLimit: 7, // æœ€å¤šä¿ç•™7天的日志
        retainedFileCountLimit: 365, // æœ€å¤šä¿ç•™7天的日志
        outputTemplate: "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level:u3}] {Message:lj}{NewLine}{Exception}"
    )
    .CreateLogger();