wanshenmean
3 天以前 5e851678cc02257bbbd179446de36082430ca5bc
Code/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Controllers/Stock/StockInfoController.cs
@@ -7,7 +7,6 @@
using WIDESEA_DTO.MES;
using WIDESEA_IStockService;
using WIDESEA_IBasicService;
using WIDESEA_IMesService;
using WIDESEA_ISystemService;
using WIDESEA_Model.Models;
using WIDESEA_Common.StockEnum;
@@ -82,28 +81,22 @@
                    return response.Error($"当前库存状态不允许进站操作,当前状态:{stockInfo.StockStatus}");
                }
                // 4. 获取系统配置 - 直接从数据库查询
                var configs = _sysDictionaryService.GetVueDictionary(new[] { "MES_EquipmentCode", "MES_ResourceCode" });
                string equipmentCode = GetConfigValue(configs, "MES_EquipmentCode", "WCS_001");
                string resourceCode = GetConfigValue(configs, "MES_ResourceCode", "RESOURCE_001");
                // 5. 构造MES请求
                // 4. 构造MES请求
                var mesRequest = new InboundInContainerRequest
                {
                    EquipmentCode = equipmentCode,
                    ResourceCode = resourceCode,
                    EquipmentCode = "STK-GROUP-001",
                    ResourceCode = "STK-GROUP-001",
                    LocalTime = DateTime.Now,
                    ContainerCode = dto.PalletCode
                };
                string requestJson = System.Text.Json.JsonSerializer.Serialize(mesRequest);
                // 6. 调用MES接口(同步方法)
                // 5. 调用MES接口(同步方法)
                var mesResult = _mesService.InboundInContainer(mesRequest);
                stopwatch.Stop();
                // 7. 记录日志
                // 6. 记录日志
                await _mesLogService.LogAsync(new MesApiLogDto
                {
                    ApiType = "InboundInContainer",
@@ -115,7 +108,7 @@
                    Creator = App.User.UserName
                });
                // 8. 返回结果
                // 7. 返回结果
                if (mesResult.IsSuccess)
                {
                    return response.OK("托盘进站成功");
@@ -182,17 +175,11 @@
                    return response.Error($"当前库存状态不允许出站操作,当前状态:{stockInfo.StockStatus}");
                }
                // 4. 获取系统配置
                var configs = _sysDictionaryService.GetVueDictionary(new[] { "MES_EquipmentCode", "MES_ResourceCode" });
                string equipmentCode = GetConfigValue(configs, "MES_EquipmentCode", "WCS_001");
                string resourceCode = GetConfigValue(configs, "MES_ResourceCode", "RESOURCE_001");
                // 5. 构造MES请求
                // 4. 构造MES请求
                var mesRequest = new OutboundInContainerRequest
                {
                    EquipmentCode = equipmentCode,
                    ResourceCode = resourceCode,
                    EquipmentCode = "STK-GROUP-001",
                    ResourceCode = "STK-GROUP-001",
                    LocalTime = DateTime.Now,
                    ContainerCode = dto.PalletCode,
                    ParamList = dto.ParamList?.Select(p => new ParamItem
@@ -205,11 +192,11 @@
                string requestJson = System.Text.Json.JsonSerializer.Serialize(mesRequest);
                // 6. 调用MES接口(同步方法)
                // 5. 调用MES接口(同步方法)
                var mesResult = _mesService.OutboundInContainer(mesRequest);
                stopwatch.Stop();
                // 7. 记录日志
                // 6. 记录日志
                await _mesLogService.LogAsync(new MesApiLogDto
                {
                    ApiType = "OutboundInContainer",
@@ -221,7 +208,7 @@
                    Creator = App.User.UserName
                });
                // 8. 返回结果
                // 7. 返回结果
                if (mesResult.IsSuccess)
                {
                    return response.OK("托盘出站成功");