1
647556386
2025-12-18 3b3ff1836b8837ffd541cc7eefde8d5e5d195110
1
已修改6个文件
118 ■■■■■ 文件已修改
项目代码/WIDESEA_WMSClient/src/extension/inbound/Dt_AllocateOrder.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WIDESEA_WMSClient/src/extension/inbound/extend/AllcatedPallet.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WIDESEA_WMSClient/src/extension/inbound/inboundOrder.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_IInboundService/IInboundService.cs 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_InboundService/InboundService.cs 92 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS无仓储版/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Inbound/InboundController.cs 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ÏîÄ¿´úÂë/WIDESEA_WMSClient/src/extension/inbound/Dt_AllocateOrder.js
@@ -4,7 +4,7 @@
import { h,createVNode, render,reactive,ref  } from 'vue';
import { ElDialog , ElForm, ElFormItem, ElInput, ElButton, ElMessage ,ElSelect ,ElOption } from 'element-plus'; // å¼•å…¥ElMessage,解决提示无反应
import gridBody from './extend/allocateOrderDetail.vue'
import gridHeader from './extend/Pallet.vue'
import gridHeader from './extend/AllcatedPallet.vue'
let extension = {
    components: {
      //查询界面扩展组件
ÏîÄ¿´úÂë/WIDESEA_WMSClient/src/extension/inbound/extend/AllcatedPallet.vue
@@ -681,7 +681,7 @@
    // API请求 - æ›¿æ¢ä¸ºå®žé™…çš„API调用
    async fetchMaterialData(barcode) {
      try {
        const response = await http.post('/api/Inbound/GroupPallet',
        const response = await http.post('/api/Inbound/AllGroupPallet',
          {
            palletCode: this.trayBarcode,
            barcode: barcode,
ÏîÄ¿´úÂë/WIDESEA_WMSClient/src/extension/inbound/inboundOrder.js
@@ -1,6 +1,6 @@
//此js文件是用来自定义扩展业务代码,可以扩展一些自定义页面或者重新配置生成的代码
import gridHeader from './extend/EmptyTrayInbound.vue'
import gridBody from './extend/AllcatedPallet.vue'
import gridBody from './extend/Pallet.vue'
let extension = {
  components: {
    //查询界面扩展组件
ÏîÄ¿´úÂë/WMSÎÞ²Ö´¢°æ/WIDESEA_WMSServer/WIDESEA_IInboundService/IInboundService.cs
@@ -20,5 +20,14 @@
        /// <param name="palletDto"></param>
        /// <returns></returns>
        Task<WebResponseContent> GroupPallet(GroupPalletDto palletDto);
        /// <summary>
        /// è°ƒæ‹¨ç»„盘
        /// </summary>
        /// <param name="palletDto"></param>
        /// <returns></returns>
        Task<WebResponseContent> AllcatedGroupPallet(GroupPalletDto palletDto);
    }
}
ÏîÄ¿´úÂë/WMSÎÞ²Ö´¢°æ/WIDESEA_WMSServer/WIDESEA_InboundService/InboundService.cs
@@ -34,8 +34,9 @@
        private readonly IRepository<Dt_InboundOrderDetail> _inboundOrderDetailRepository;
        private readonly IRepository<Dt_Task> _taskRepository;
        private IStockService _stockService;
        private readonly IRepository<Dt_AllocateMaterialInfo> _allocateMaterialInfo;
        public InboundService(IUnitOfWorkManage unitOfWorkManage, IInboundOrderDetailService inboundOrderDetailService, IInboundOrderService inbounOrderService, IRepository<Dt_InboundOrder> inboundOrderRepository, IRepository<Dt_WarehouseArea> warehouseAreaRepository, IRepository<Dt_LocationType> locationTypeRepository, IRepository<Dt_StockInfo> stockInfoRepository, IRepository<Dt_InboundOrderDetail> inboundOrderDetailRepository, IStockService stockService, IRepository<Dt_Task> taskRepository)
        public InboundService(IUnitOfWorkManage unitOfWorkManage, IInboundOrderDetailService inboundOrderDetailService, IInboundOrderService inbounOrderService, IRepository<Dt_InboundOrder> inboundOrderRepository, IRepository<Dt_WarehouseArea> warehouseAreaRepository, IRepository<Dt_LocationType> locationTypeRepository, IRepository<Dt_StockInfo> stockInfoRepository, IRepository<Dt_InboundOrderDetail> inboundOrderDetailRepository, IStockService stockService, IRepository<Dt_Task> taskRepository,IRepository<Dt_AllocateMaterialInfo> allocateMaterialInfo)
        {
            _unitOfWorkManage = unitOfWorkManage;
            InboundOrderDetailService = inboundOrderDetailService;
@@ -47,6 +48,7 @@
            _inboundOrderDetailRepository = inboundOrderDetailRepository;
            _stockService = stockService;
            _taskRepository = taskRepository;
            _allocateMaterialInfo = allocateMaterialInfo;
        }
        public async Task<WebResponseContent> GroupPallet(GroupPalletDto palletDto)
@@ -156,6 +158,94 @@
            return content;
        }
        public async Task<WebResponseContent> AllcatedGroupPallet(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 (_stockService.StockInfoDetailService.ExistBarcodes(palletDto.Barcode))
                {
                    return content.Error($"{palletDto.Barcode} æ¡ç åœ¨åº“存中已存在");
                }
                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_AllocateMaterialInfo allocateMaterialInfo = _allocateMaterialInfo.QueryFirst(x => x.Barcode == palletDto.Barcode);
                if(allocateMaterialInfo == null)
                {
                    return content.Error($"未找到该条码{palletDto.Barcode}需调入智仓的信息");
                }
                stockInfo.Details.Add(new Dt_StockInfoDetail
                {
                    StockId = stockInfo == null ? 0 : stockInfo.Id,
                    Barcode = allocateMaterialInfo.Barcode,
                    MaterielCode = allocateMaterialInfo.MaterialCode,
                    BatchNo = allocateMaterialInfo.BatchNo,
                    Unit = allocateMaterialInfo.Unit,
                    SupplyCode = allocateMaterialInfo.SupplyCode,
                    WarehouseCode = palletDto.WarehouseType,
                    StockQuantity = allocateMaterialInfo.Quantity,
                    BarcodeQty = allocateMaterialInfo.Quantity,
                    BarcodeUnit = allocateMaterialInfo.Unit,
                    FactoryArea = allocateMaterialInfo.FactoryArea,
                    Status = 0,
                    OrderNo = allocateMaterialInfo.OrderNo,
                    BusinessType = "1",
                });
                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);
            }
        }
        /// <summary>
        /// éªŒè¯ç»„盘数据
        /// </summary>
ÏîÄ¿´úÂë/WMSÎÞ²Ö´¢°æ/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Inbound/InboundController.cs
@@ -28,5 +28,16 @@
        {
            return await Service.GroupPallet(palletDto);
        }
        /// <summary>
        /// è°ƒæ‹¨ç»„盘
        /// </summary>
        /// <param name="palletDto"></param>
        /// <returns></returns>
        [HttpPost, Route("AllGroupPallet"), AllowAnonymous]
        public async Task<WebResponseContent> AllGroupPallet([FromBody] GroupPalletDto palletDto)
        {
            return await Service.AllcatedGroupPallet(palletDto);
        }
    }
}