肖洋
2025-01-07 e61bb0e26530b2aa9055737fade9e77ccb1feebf
更新多个文件,优化逻辑与配置

主要改动包括:
- 更新 HTTP.js 中生产环境的 baseURL。
- 修改 Staticlibrary.vue 的设备名称检测逻辑,使其更通用。
- 新增和删除 CateGoryConst.cs 与 SysConfigKeyConst.cs 中的常量定义。
- 在 TaskService.cs 中添加了站台地址的读取逻辑,改善任务源地址处理。
- 优化 CommonConveyorLineJob.cs 的构造函数,增加了新参数。
- 增强设备异步处理错误捕获的逻辑。
- 改进任务完成日志输出的可读性。
- 更新 RequestInbound.cs 的任务查询逻辑。
- 修改 CommonStackerCraneJob.cs 中的常量配置与处理逻辑。
- 提升代码注释质量,增加可读性与可维护性。
- 改善 UI 组件 Dt_BillGroupStock.jsx 的事件处理和显示效果。
- 更新 SQL 操作相关文件中的数据库连接字符串。
- 在 LocationInfoService.cs 与 Dt_TaskService.cs 中更新了数据库操作指向,确保指向 WMS 数据库。
- 改进区域代码查询逻辑,处理未找到区域的情况并记录错误信息。
- 更新 appsettings.json 中的连接字符串配置。
- 在 WIDESEA_WMSServer.MvcApplicationPartsAssemblyInfo.cs 中增加代码生成的注释说明。
- 对 Dt_BillGroupStock.jsx 文件进行了重构或清理。
已修改21个文件
已添加1个文件
213 ■■■■ 文件已修改
Code Management/WCS/WIDESEAWCS_Client/src/api/http.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WCS/WIDESEAWCS_Client/src/views/Devicestatus/Craftlibrary/Staticlibrary.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/Const/CateGoryConst.cs 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/Const/SysConfigKeyConst.cs 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs 24 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/Task/RequestInbound.cs 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_GW/CommonConveyorLine_GWJob.cs 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_GW/GWTask/RequestInbound.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSClient/Dt_BillGroupStock.jsx 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSClient/src/api/http.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSClient/src/extension/widesea_wms/stock/Dt_BillGroupStock.jsx 37 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSClient/src/views/widesea_wms/stock/Dt_BillGroupStock.vue 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Core/DB/MainDb.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Core/Helper/SqlSugarHelper.cs 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Core/HostedService/SeedDataHostedService.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/MOM/ProcessApply/ProcessApplyService.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/Location/LocationInfoService.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs 54 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/appsettings.json 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/obj/Debug/net6.0/WIDESEA_WMSServer.MvcApplicationPartsAssemblyInfo.cs 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Code Management/WCS/WIDESEAWCS_Client/src/api/http.js
@@ -20,7 +20,7 @@
}
else if (process.env.NODE_ENV == 'production') {
    axios.defaults.baseURL = 'http://192.168.20.251:9291/';
    axios.defaults.baseURL = 'http://192.168.5.251:9291/';
}
if (!axios.defaults.baseURL.endsWith('/')) {
    axios.defaults.baseURL+="/";
Code Management/WCS/WIDESEAWCS_Client/src/views/Devicestatus/Craftlibrary/Staticlibrary.vue
@@ -53,7 +53,7 @@
    }
  });
  eventBus.on('stackerData', eventData => {
    if (eventData.deviceName == "静置1号堆垛机") {
    if (eventData.deviceName.indexOf("静置") != -1) {
      if (Stackers.length == 0) {
        Stackers.push({ deviceName: eventData.deviceName, data: eventData.data });
      }
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/Const/CateGoryConst.cs
@@ -15,5 +15,10 @@
        /// IP接口地址
        /// </summary>
        public const string CONFIG_SYS_IPAddress = "SYS_IPAddress";
        /// <summary>
        /// 入库站台
        /// </summary>
        public const string CONFIG_SYS_InStation = "SYS_InStation";
    }
}
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Common/Const/SysConfigKeyConst.cs
@@ -48,9 +48,7 @@
        /// </summary>
        public const string RequestTrayOutTask = "RequestTrayOutTask";
        public const string RequestInTask = "RequestInTask";
        public const string RequestFlow = "RequestFlow";
@@ -73,5 +71,10 @@
        /// 静置NG入库
        /// </summary>
        public const string RequestInBoundTaskNG = "RequestInBoundTaskNG";
        /// <summary>
        /// 静置NG入库站台
        /// </summary>
        public const string JZNGInBoundStation = "JZNGInBoundStation";
    }
}
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs
@@ -139,8 +139,11 @@
                    // 判断任务类型是否为入库任务
                    else if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.InboundGroup)
                    {
                        var value = _sys_ConfigService.GetByConfigKey(CateGoryConst.CONFIG_SYS_InStation, SysConfigKeyConst.JZNGInBoundStation).ConfigValue;
                        var valueList = value.Split(',').ToList();
                        // 判断源地址是否不等于"1359-4"
                        if (task.SourceAddress != "1359-4")
                        //if (task.SourceAddress != "1359-4" && task.SourceAddress != "1357-4")
                        if (!valueList.Contains(task.SourceAddress))
                        {
                            // 查询从源地址到目标地址的路由
                            List<Dt_Router> routers = _routerService.QueryNextRoutes(item.SourceAddress, item.TargetAddress);
@@ -156,6 +159,11 @@
                        }
                        else
                        {
                            task.CurrentAddress = string.Empty;
                            if (task.SourceAddress == "1325-6")
                                // 设置当前地址为"001-021-001"
                                task.CurrentAddress = "001-021-001";
                            else
                            // 设置当前地址为"002-021-001"
                            task.CurrentAddress = "002-021-001";
                            // 设置下一个地址为目标地址
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs
@@ -51,7 +51,6 @@
        private static List<string>? userTokenIds;
        private static List<int>? userIds;
        public CommonConveyorLineJob(ITaskService taskService, ITaskExecuteDetailService taskExecuteDetailService, IRouterService routerService, IMapper mapper, ITaskRepository taskRepository, IPlatFormRepository platFormRepository, ISys_ConfigService sys_ConfigService, IDt_StationManagerService stationManagerService, IDt_StationManagerRepository stationManagerRepository, ICacheService cacheService, INoticeService noticeService, IDeviceInfoRepository deviceInfoRepository,ITask_HtyRepository task_HtyRepository)
        {
            _taskService = taskService;
@@ -84,7 +83,6 @@
                    // 并行处理每个子设备
                    var tasks = childDeviceCodes.Select(childDeviceCode => ProcessDeviceAsync(conveyorLine, childDeviceCode)).ToList();
                    await Task.WhenAll(tasks);
                    // 获取所有站点管理器
                    List<Dt_StationManager> stationManagers = _stationManagerService.GetAllStationByDeviceCode(conveyorLine.DeviceCode);
@@ -156,7 +154,6 @@
        {
            try
            {
                // 读取任务命令和设备命令
                ConveyorLineTaskCommand command = conveyorLine.ReadCustomer<ConveyorLineTaskCommand>(childDeviceCode);
                ConveyorLineTaskCommandWrite commandWrite = conveyorLine.ReadCustomer<ConveyorLineTaskCommandWrite>(childDeviceCode, "DeviceCommand");
@@ -245,7 +242,6 @@
            }
            catch (Exception ex)
            {
            }
            return Task.CompletedTask;
        }
@@ -365,7 +361,6 @@
        {
            try
            {
                ConsoleHelper.WriteWarningLine($"【{conveyorLine._deviceName}】任务号:【{command.TaskNum}】,托盘条码:【{command.Barcode}】已到达【{childDeviceCode}】输送线入库完成");
                var task = _taskService.QueryExecutingConveyorLineTask(command.TaskNum, childDeviceCode);
                if (task != null && task.TaskState != (int)TaskInStatusEnum.Line_InFinish)
@@ -401,7 +396,6 @@
            }
            catch (Exception ex)
            {
            }
        }
@@ -420,7 +414,6 @@
        {
            try
            {
                // 查询输送线任务,根据输送线设备和子设备代码获取任务信息
                var task = _taskService.QueryConveyorLineTask(conveyorLine.DeviceCode, childDeviceCode);
@@ -460,7 +453,6 @@
            }
            catch (Exception ex)
            {
            }
        }
@@ -522,7 +514,6 @@
        {
            try
            {
                // 打印成功信息,表示托盘已到达指定输送线并完成出库
                ConsoleHelper.WriteSuccessLine($"【{conveyorLine.DeviceName}】任务号:【{command.TaskNum}】,托盘条码:【{command.Barcode}】已到达【{childDeviceCode}】输送线出库完成");
@@ -585,7 +576,6 @@
            }
            catch (Exception ex)
            {
            }
        }
@@ -731,7 +721,7 @@
                EquipmentCode = stationManager.stationEquipMOM,
                SessionId = Guid.NewGuid().ToString(),
                EmployeeNo = "MITest",
                SceneType = "2",
                SceneType = "4",
                RequestTime = TimeZoneInfo.ConvertTimeToUtc(DateTime.Now).ToString("yyyy-MM-ddTHH:mm:ss.fffZ")
            };
@@ -762,34 +752,32 @@
                        ConsoleHelper.WriteWarningLine("1000");
                        conveyorLine.SetValue(ConveyorLineDBName.WriteConveyorLineTaskNum, 5, stationManager.stationChildCode);
                        conveyorLine.SetValue(ConveyorLineDBName.WriteConveyorLineTargetAddress, 1000, stationManager.stationChildCode);
                        ConveyorLineSendFinish(conveyorLine, stationManager.stationChildCode, ProtocalDetailValue, true);
                    }
                    else
                    {
                        ConsoleHelper.WriteWarningLine("2");
                        ConsoleHelper.WriteWarningLine(stationManager.stationLocation);
                        conveyorLine.SetValue(ConveyorLineDBName.WriteConveyorLineTaskNum, 5, stationManager.stationChildCode);
                        conveyorLine.SetValue(ConveyorLineDBName.WriteConveyorLineTargetAddress, stationManager.stationLocation, stationManager.stationChildCode);
                    }
                    ConveyorLineSendFinish(conveyorLine, stationManager.stationChildCode, ProtocalDetailValue, true);
                }
                else
                {
                    if (result1.SerialNos.Count <= 0)
                    {
                        ConsoleHelper.WriteWarningLine("2");
                        ConsoleHelper.WriteWarningLine(stationManager.stationLocation);
                        conveyorLine.SetValue(ConveyorLineDBName.WriteConveyorLineTaskNum, 5, stationManager.stationChildCode);
                        conveyorLine.SetValue(ConveyorLineDBName.WriteConveyorLineTargetAddress, stationManager.stationLocation, stationManager.stationChildCode);
                    }
                    else
                    {
                        ConsoleHelper.WriteWarningLine("1000");
                        conveyorLine.SetValue(ConveyorLineDBName.WriteConveyorLineTaskNum, 5, stationManager.stationChildCode);
                        conveyorLine.SetValue(ConveyorLineDBName.WriteConveyorLineTargetAddress, 1000, stationManager.stationChildCode);
                        ConveyorLineSendFinish(conveyorLine, stationManager.stationChildCode, ProtocalDetailValue, true);
                    }
                    ConveyorLineSendFinish(conveyorLine, stationManager.stationChildCode, ProtocalDetailValue, true);
                }
            }
            else
@@ -798,6 +786,6 @@
            }
        }
        #endregion 化成NG口入库
        #endregion 设备NG口入库
    }
}
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/Task/RequestInbound.cs
@@ -209,7 +209,9 @@
                var task = _taskService.QueryBarCodeConveyorLineTask(command.Barcode, childDeviceCode);
                if (task != null)
                {
                    if (task.SourceAddress == "1059-4")
                    var value = _sys_ConfigService.GetByConfigKey(CateGoryConst.CONFIG_SYS_InStation, SysConfigKeyConst.JZNGInBoundStation).ConfigValue;
                    var valueList = value.Split(',').ToList();
                    if (valueList.Contains(task.SourceAddress))
                    {
                        conveyorLine.SetValue(ConveyorLineDBName.WriteConveyorLineTargetAddress, "1000", childDeviceCode);
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_GW/CommonConveyorLine_GWJob.cs
@@ -140,7 +140,8 @@
                                    MethodInfo? method = GetType().GetMethod(platform.ExecutionMethod);
                                    if (method != null)
                                    {
                                        int count = string.IsNullOrEmpty(platform.Location) ? 0 + 1 : platform.Location.Split(',').Count() + 1;
                                        //var strings = platform.Location.Split(',').ToList();
                                        int count = 1;
                                        method.Invoke(this, new object[] { conveyorLine, command, childDeviceCode, count, platform });
                                    }
                                }
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob_GW/GWTask/RequestInbound.cs
@@ -61,7 +61,7 @@
                case 9:
                case 11:
                case 12:
                    var task = _taskService.QueryExecutingConveyorLineTask(command.ConveyorLineTaskNum, childDeviceCode);
                    var task = _taskService.QueryExecutingTaskByBarcode(command.ConveyorLineBarcode, childDeviceCode);
                    if (task != null)
                    {
                        ExecuteStationAction(stationManager, conveyorLine, command, childDeviceCode);
Code Management/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/StackerCraneJob/CommonStackerCraneJob.cs
@@ -4,11 +4,13 @@
using System.Diagnostics.CodeAnalysis;
using System.Text;
using WIDESEAWCS_BasicInfoRepository;
using WIDESEAWCS_Common;
using WIDESEAWCS_Common.TaskEnum;
using WIDESEAWCS_Core.Caches;
using WIDESEAWCS_Core.Helper;
using WIDESEAWCS_Core.HttpContextUser;
using WIDESEAWCS_IProcessRepository;
using WIDESEAWCS_ISystemServices;
using WIDESEAWCS_ITaskInfo_HtyRepository;
using WIDESEAWCS_ITaskInfoRepository;
using WIDESEAWCS_ITaskInfoService;
@@ -36,8 +38,9 @@
        private readonly INoticeService _noticeService;
        private readonly IDt_StationManagerRepository _stationManagerRepository;
        private readonly ITask_HtyRepository _htyRepository;
        private readonly ISys_ConfigService _sys_ConfigService;
        public CommonStackerCraneJob(ITaskService taskService, ITaskExecuteDetailService taskExecuteDetailService, ITaskRepository taskRepository, IRouterService routerService, IProcessRepository processRepository, ICacheService cacheService, INoticeService noticeService, IDt_StationManagerRepository stationManagerRepository, ITask_HtyRepository htyRepository)
        public CommonStackerCraneJob(ITaskService taskService, ITaskExecuteDetailService taskExecuteDetailService, ITaskRepository taskRepository, IRouterService routerService, IProcessRepository processRepository, ICacheService cacheService, INoticeService noticeService, IDt_StationManagerRepository stationManagerRepository, ITask_HtyRepository htyRepository, ISys_ConfigService sys_ConfigService)
        {
            _taskService = taskService;
            _taskExecuteDetailService = taskExecuteDetailService;
@@ -48,6 +51,7 @@
            _noticeService = noticeService;
            _stationManagerRepository = stationManagerRepository;
            _htyRepository = htyRepository;
            _sys_ConfigService = sys_ConfigService;
        }
        public Task Execute(IJobExecutionContext context)
@@ -381,7 +385,9 @@
            stackerCraneTaskCommand.StartCommand = 1;
            if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.InboundGroup)//判断是否是入库任务
            {
                if (task.SourceAddress == "1359-4" && task.Roadway.Contains("JZ"))
                var value = _sys_ConfigService.GetByConfigKey(CateGoryConst.CONFIG_SYS_InStation, SysConfigKeyConst.JZNGInBoundStation).ConfigValue;
                var valueList = value.Split(',').ToList();
                if ((valueList.Contains(task.SourceAddress)) && task.Roadway.Contains("JZ"))
                {
                    string[] souredCodes = task.CurrentAddress.Split("-");
                    if (souredCodes.Length == 3)
Code Management/WMS/WIDESEA_WMSClient/Dt_BillGroupStock.jsx
Code Management/WMS/WIDESEA_WMSClient/src/api/http.js
@@ -19,7 +19,7 @@
}
else if (process.env.NODE_ENV == 'production') {
  // axios.defaults.baseURL = 'http://127.0.0.1:5000/';
  axios.defaults.baseURL = 'http://192.168.20.251:5000/';
  axios.defaults.baseURL = 'http://192.168.5.251:5000/';
}
//axios.defaults.baseURL = 'http://api.volcore.xyz/';
Code Management/WMS/WIDESEA_WMSClient/src/extension/widesea_wms/stock/Dt_BillGroupStock.jsx
@@ -26,7 +26,7 @@
    //下面这些方法可以保留也可以删除
    onInit() {
      //框架初始化配置前,
      let OutBoundBtn=this.buttons.find(x=>x.value=='OutBound');
      let OutBoundBtn = this.buttons.find((x) => x.value == 'OutBound')
      if(OutBoundBtn){
        OutBoundBtn.onClick=function(){
          this.$Message.success('点击了按钮')
@@ -38,7 +38,13 @@
          }
          let locationCode = row[0].locationCode
          let palletCode = row[0].palletCode
          this.http.get(`/api/Task/CreateAndSendOutboundTask?locationCode=${locationCode}&palletCode=${palletCode}`, {}, "正在创建任务").then((res) => {
          this.http
            .get(
              `/api/Task/CreateAndSendOutboundTask?locationCode=${locationCode}&palletCode=${palletCode}`,
              {},
              '正在创建任务'
            )
            .then((res) => {
            //示例:调用后台接口
            if (res.status) {
              this.$Message.success('创建任务成功')
@@ -100,6 +106,33 @@
      //     );
      //   },
      // });
      this.columns.forEach((column) => {
        //修改颜色
        if (column.field == 'roadwayNo') {
          column.formatter = (row) => {
            return '<span style="color: #2d8cf0;">' + row.locationInfo.roadwayNo + '</span>'
          }
        }
        //格式化日期
        // 检查当前列的字段是否为 'locationStatus'
        if (column.field == 'locationStatus') {
          // 使用对象字面量来映射 'locationStatus' 的值和对应的文本
          const statusMap = {
            '-1': '全部',
            '0': '空闲',
            '1': '锁定',
            '2': '有货',
            '3': '有货禁用',
            '4': '无货禁用'
          };
          // 定义一个格式化函数,根据 'locationStatus' 的值返回相应的文本
          column.formatter = (row) => {
            // 使用 statusMap 对象来获取对应的文本,如果没有匹配则返回 '未知状态'
            return statusMap[row.locationInfo.locationStatus] || '未知状态';
          }
        }
      })
    },
    onInited() {
      //框架初始化配置后
Code Management/WMS/WIDESEA_WMSClient/src/views/widesea_wms/stock/Dt_BillGroupStock.vue
@@ -51,15 +51,17 @@
        ]);
        const columns = ref(
            [{ field: 'id', title: '库存ID', type: 'int', width: 110, hidden: true, readonly: true, require: true, align: 'left' },
            { field: 'locationCode', title: '库位', type: 'string', width: 110, align: 'left',  },
            { field: 'locationCode', title: '库位', type: 'string', width: 100, align: 'left',  },
            { field: 'palletCode', title: '托盘条码', type: 'string', width: 110, align: 'left', },
            { field: 'isFull', title: '库存类型', type: 'bool', width: 110, align: 'left', bind: { key: "isFull", data: [{ key: false, value: '空盘'},{ key: true, value: '实盘'}] }, },
            { field: 'isFull', title: '库存类型', type: 'bool', width: 80, align: 'left', bind: { key: "isFull", data: [{ key: false, value: '空盘'},{ key: true, value: '实盘'}] }, },
            { field: 'linedProcessFeedbackTime', title: '工艺开始时间', type: 'string', width: 110, align: 'left',},
            { field: 'specialParameterDuration', title: '工艺时长', type: 'string', width: 110, align: 'left', sort: true },
            { field: 'roadwayNo', title: '巷道', type: 'string', width: 60, align: 'left', sort: true  },
            { field: 'locationStatus', title: '货位状态', type: 'int', width: 60, align: 'left', bind: { key: "LocationState", data: [] } },
            { field: 'specialParameterDuration', title: '工艺时长', type: 'string', width: 60, align: 'left', sort: true },
            { field: 'outboundTime', title: '应出库时间', type: 'string', width: 110, align: 'left', sort: true  },
            { field: 'productionLine', title: '生产产线', type: 'string', width: 110, align: 'left',  },
            { field: 'areaCode', title: '库区', type: 'string', width: 110, align: 'left', bind: { key: "AreaType", data: [] } },
            { field: 'remark', title: '电芯数量', type: 'string', width: 120, align: 'left',  },
            { field: 'productionLine', title: '生产产线', type: 'string', width: 60, align: 'left',  },
            { field: 'areaCode', title: '库区', type: 'string', width: 60, align: 'left', bind: { key: "AreaType", data: [] } },
            { field: 'remark', title: '电芯数量', type: 'string', width: 60, align: 'left',  },
            { field: 'creater', title: '创建人', type: 'string', sort: true, width: 110, align: 'left', hidden: true },
            { field: 'createDate', title: '创建时间', type: 'datetime', sort: true, width: 150, align: 'left',  },
            { field: 'modifier', title: '最后修改人', type: 'string', sort: true, width: 100, hidden: true, align: 'left' },
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Core/DB/MainDb.cs
@@ -11,6 +11,7 @@
    {
        public const string CurrentDbConnId = "WIDESEA";
        public const string ConnectionString = "ConnectionString";
        public const string ConnectionStringWCS = "ConnectionStringWCS";
        public const string TenantTableName = "Sys_Tenant";
        public const string TenantStatus = "Status";
        public const string TenantId = "TenantId";
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Core/Helper/SqlSugarHelper.cs
@@ -4,6 +4,7 @@
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEA_Core.DB;
using WIDESEA_Core.Seed;
namespace WIDESEA_Core.Helper
@@ -14,9 +15,21 @@
        //如果是固定多库可以传 new SqlSugarScope(List<ConnectionConfig>,db=>{}) 文档:多租户
        //如果是不固定多库 可以看文档Saas分库
        //用单例模式
        public static SqlSugarScope Db = new SqlSugarScope(new ConnectionConfig()
        public static SqlSugarScope DbWCS = new SqlSugarScope(new ConnectionConfig()
        {
            //ConnectionString = DBContext.GetMainConnectionDb().Connection,
            ConnectionString = AppSettings.app(MainDb.ConnectionStringWCS),
            DbType = DbType.SqlServer,//数据库类型
            IsAutoCloseConnection = true //不设成true要手动close
        },
      db =>
          {
          });
        public static SqlSugarScope DbWMS = new SqlSugarScope(new ConnectionConfig()
        {
            ConnectionString = DBContext.GetMainConnectionDb().Connection,
            //ConnectionString = AppSettings.app(MainDb.ConnectionStringWCS),
            DbType = DbType.SqlServer,//数据库类型
            IsAutoCloseConnection = true //不设成true要手动close
        },
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_Core/HostedService/SeedDataHostedService.cs
@@ -49,7 +49,7 @@
                {
                    // 使用 myScopedService 执行任务
                    await DBSeed.SeedAsync(_dbContext, _webRootPath);
                    //await DBSeed.SeedAsync(_dbContext, _webRootPath);
                    //多租户 同步
                    //await DBSeed.TenantSeedAsync(_dbContext);
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StoragIntegrationServices/MOM/ProcessApply/ProcessApplyService.cs
@@ -100,7 +100,7 @@
            var result = JsonConvert.DeserializeObject<ResultTrayCellsStatus>(content.Data.ToString());
            if (result.SerialNos.Count > 0)
            {
                var stockHty = await SqlSugarHelper.Db.Queryable<DtStockInfo>().IncludesAllFirstLayer().FirstAsync();
                var stockHty = await SqlSugarHelper.DbWMS.Queryable<DtStockInfo>().IncludesAllFirstLayer().FirstAsync();
                if (stockHty != null)
                {
                    var parameterInfo = JsonConvert.DeserializeObject<List<ParameterInfo>>(stockHty.ParameterInfos).FirstOrDefault(y => y.Description.Contains("时间"));
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageBasicServices/Location/LocationInfoService.cs
@@ -400,7 +400,7 @@
    private async Task AddStockInfoHtyAsync(DtStockInfo_Hty dtStock)
    {
        var isStockAdd = await SqlSugarHelper.Db.InsertNav(dtStock).IncludesAllFirstLayer().ExecuteCommandAsync();
        var isStockAdd = await SqlSugarHelper.DbWMS.InsertNav(dtStock).IncludesAllFirstLayer().ExecuteCommandAsync();
        if (!isStockAdd)
        {
            throw new Exception("库存历史信息添加失败");
@@ -419,7 +419,7 @@
    private void AddStockInfoDetailHty(List<DtStockInfoDetail_Hty> details)
    {
        var isStockAdd = SqlSugarHelper.Db.Insertable(details).ExecuteCommand();
        var isStockAdd = SqlSugarHelper.DbWMS.Insertable(details).ExecuteCommand();
        if (isStockAdd==0)
        {
            throw new Exception("库存明细历史信息添加失败");
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs
@@ -14,6 +14,7 @@
using WIDESEA_StorageBasicRepository;
using WIDESEA_StoragIntegrationServices;
using WIDESEAWCS_BasicInfoRepository;
using WIDESEAWCS_QuartzJob.Models;
namespace WIDESEA_StorageTaskServices;
@@ -300,7 +301,7 @@
    private async Task AddStockInfoHtyAsync(DtStockInfo_Hty dtStock)
    {
        var isStockAdd = await SqlSugarHelper.Db.InsertNav(dtStock).IncludesAllFirstLayer().ExecuteCommandAsync();
        var isStockAdd = await SqlSugarHelper.DbWMS.InsertNav(dtStock).IncludesAllFirstLayer().ExecuteCommandAsync();
        if (!isStockAdd)
        {
            throw new Exception("库存历史信息添加失败");
@@ -1229,14 +1230,19 @@
    /// </summary>
    private async Task<DtStockInfo> QueryStockInfoForRealTrayCWAsync(List<string> areaCodes, string productionLine)
    {
        var area = await _areaInfoRepository.QueryFirstAsync(x => x.AreaCode == "CWSC1");
        var areaId = (await _areaInfoRepository.QueryDataAsync(x => areaCodes.Contains(x.AreaCode))).Select(x => x.AreaID).ToList();
        if (areaId.Count == 0)
        {
            ConsoleHelper.WriteErrorLine($"查询常温实盘库存信息时,未找到区域代码为{JsonConvert.SerializeObject(areaCodes)}的数据");
            return null;
        }
        var result = await _stockInfoRepository.Db.Queryable<DtStockInfo>()
            .Includes(x => x.LocationInfo) // 预加载LocationInfo
            .Includes(x => x.StockInfoDetails) // 预加载StockInfoDetails
            .Where(x => areaCodes.Contains(x.AreaCode) && x.OutboundTime < DateTime.Now && x.IsFull == true) // 过滤条件
            .WhereIF(!productionLine.IsNullOrEmpty(), x => x.ProductionLine == productionLine)
            .Where(x => x.LocationInfo.LocationStatus == (int)LocationEnum.InStock && x.LocationInfo.AreaId == area.AreaID && x.LocationInfo.EnalbeStatus == (int)EnableEnum.Enable) // 过滤条件
            .Where(x => x.LocationInfo.LocationStatus == (int)LocationEnum.InStock && areaId.Contains(x.LocationInfo.AreaId) && x.LocationInfo.EnalbeStatus == (int)EnableEnum.Enable) // 过滤条件
            .OrderBy(x => x.OutboundTime) // 排序
            .FirstAsync(); // 获取第一个元素
@@ -1669,7 +1675,39 @@
                    content.OK(data: taskDTO);
                }
                else
                    content.Error(result.MOMMessage);
                {
                    var location = await GetLocationDistributeAsync(station.Roadway);
                    var task = new Dt_Task
                    {
                        CurrentAddress = station.stationLocation,
                        Grade = 1,
                        Roadway = station.Roadway,
                        TargetAddress = location.LocationCode,
                        Dispatchertime = DateTime.Now,
                        MaterialNo = "",
                        NextAddress = location.LocationCode,
                        OrderNo = null,
                        PalletCode = palletCode,
                        SourceAddress = position,
                        TaskState = (int)TaskInStatusEnum.Line_InFinish,
                        TaskType = (int)TaskInboundTypeEnum.InTray,
                        TaskNum = await BaseDal.GetTaskNo(),
                        Creater = "Systeam"
                    };
                    // 创建WMS任务
                    WMSTaskDTO taskDTO = CreateWMSTaskDTO(task);
                    await _unitOfWorkManage.UseTranAsync(async () =>
                    {
                        // 添加任务到数据库
                        await BaseDal.AddDataAsync(task);
                        // 更新库存位置状态为不可用
                        location.LocationStatus = (int)LocationEnum.Lock;
                        await _locationRepository.UpdateDataAsync(location);
                    });
                    content.OK(data: taskDTO);
                }
            }
            else
            {
@@ -1697,7 +1735,7 @@
                Grade = 1,
                PalletCode = taskOld.PalletCode,
                RoadWay = taskOld.Roadway,
                SourceAddress = taskOld.CurrentAddress,
                SourceAddress = taskOld.SourceAddress,
                TargetAddress = taskOld.TargetAddress,
                TaskState = taskOld.TaskState.Value,
                Id = 0,
@@ -2259,7 +2297,11 @@
    /// <returns></returns>
    public async Task<string> GetRoadWayAsync(List<string> process)
    {
        var minGroup = _locationRepository.QueryData(x => process.Contains(x.RoadwayNo) && x.LocationStatus == (int)LocationEnum.Free)
        var deviceCode = await SqlSugarHelper.DbWCS.Queryable<Dt_DeviceInfo>()
             .Where(x => x.DeviceStatus == 1.ToString() && process.Contains(x.DeviceCode))
             .Select(x => x.DeviceCode).ToListAsync();
        var minGroup = _locationRepository.QueryData(x => deviceCode.Contains(x.RoadwayNo) && x.LocationStatus == (int)LocationEnum.Free)
             .GroupBy(x => x.RoadwayNo)
             .OrderByDescending(g => g.Count()) // 根据每个组的元素数量排序
             .ToList(); // 取出数量最多的组
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/appsettings.json
@@ -10,11 +10,11 @@
  "MainDB": "DB_WIDESEA", //当前项目的主库,所对应的连接字符串的Enabled必须为true
  //连接字符串
  //"ConnectionString": "HTI6FB1H05Krd07mNm9yBCNhofW6edA5zLs9TY~MNthRYW3kn0qKbMIsGp~3yyPDF1YZUCPBQx8U0Jfk4PH~ajNFXVIwlH85M3F~v_qKYQ3CeAz3q1mLVDn8O5uWt1~3Ut2V3KRkEwYHvW2oMDN~QIDXPxDgXN0R2oTIhc9dNu7QNaLEknblqmHhjaNSSpERdDVZIgHnMKejU_SL49tralBkZmDNi0hmkbL~837j1NWe37u9fJKmv91QPb~16JsuI9uu0EvNZ06g6PuZfOSAeFH9GMMIZiketdcJG3tHelo=",
  //"ConnectionString": "Data Source=192.168.5.251;Initial Catalog=WIDESEA_WMSDB_BBMain;User ID=sa;Password=P@ssw0rd;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False",
  "ConnectionString": "Data Source=192.168.5.251;Initial Catalog=WIDESEA_WMSDB_BBMain;User ID=sa;Password=P@ssw0rd;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False",
  //"ConnectionString": "Data Source=127.0.0.1;Initial Catalog=WIDESEA_WMS2F08;User ID=sa;Password=P@ssw0rd;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False",
  "ConnectionString": "Data Source=.\\LIULEI;Initial Catalog=WIDESEA_WMSDB_BBMain;User ID=sa;Password=123456;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False",
  //"ConnectionString": "Data Source=.\\LIULEI;Initial Catalog=WIDESEA_WMSDB_BBMain;User ID=sa;Password=123456;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False",
  //"ConnectionString": "Data Source=192.168.20.251;Initial Catalog=WIDESEA_WMSDB;User ID=sa;Password=123456@gy;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False",
  "ConnectionStringWCS": "Data Source=192.168.5.251;Initial Catalog=WIDESEAWCS_TEST;User ID=sa;Password=P@ssw0rd;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False",
  //跨域
  "Cors": {
    "PolicyName": "CorsIpAccess", //策略名称
Code Management/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/obj/Debug/net6.0/WIDESEA_WMSServer.MvcApplicationPartsAssemblyInfo.cs
@@ -1,9 +1,10 @@
//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//     此代码由工具生成。
//     运行时版本:4.0.30319.42000
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
//     对此文件的更改可能会导致不正确的行为,并且如果
//     重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------