WINDOWS-F96JH03\Kain
2026-03-17 021ec32a095410d28d4552d7365ca64308494fa6
Merge branch 'master' of http://115.159.85.185:8098/r/RuiShiGe/LingPaoCheShenKu
已添加12个文件
已删除1个文件
已修改30个文件
1276 ■■■■ 文件已修改
项目代码/WCS/WCSServer/WIDESEAWCS_Common/Const/SysConfigKeyConst.cs 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCS/WCSServer/WIDESEAWCS_Core/CodeGenerator/CodeGenertors.cs 349 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCS/WCSServer/WIDESEAWCS_DTO/TaskInfo/WMSTaskDTO.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCS/WCSServer/WIDESEAWCS_Model/Models/BasicInfo/Dt_StationManager.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCS/WCSServer/WIDESEAWCS_Model/Models/TaskInfo/Dt_Task.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCS/WCSServer/WIDESEAWCS_Model/Models/TaskInfo/Dt_Task_Hty.cs 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCS/WCSServer/WIDESEAWCS_Server/Controllers/System/Sys_UserController.cs 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCS/WCSServer/WIDESEAWCS_TaskInfoService/Partial/TaskService.cs 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCS/WCSServer/WIDESEAWCS_TaskInfoService/TaskService.cs 37 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCS/WCSServer/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCS/WCSServer/WIDESEAWCS_Tasks/ConveyorLineJobTZ/CommonConveyorLineTZJob.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WCS/WCSServer/WIDESEAWCS_Tasks/SC/SCJob.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS/WMSClient/src/extension/widesea_wms/stock/VV_MesLockInfo.js 60 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS/WMSClient/src/router/tables.js 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS/WMSClient/src/views/widesea_wms/stock/VV_MesLockInfo.vue 95 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS/WMSServer/WIDESEA_Core/BaseModels/WebResponseContent.cs 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS/WMSServer/WIDESEA_Core/Enums/ManageEnum.cs 38 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS/WMSServer/WIDESEA_DTO/WMS/WMSTaskDTO.cs 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS/WMSServer/WIDESEA_IStorageBasicRepository/Stock/IStockInfoRepository - 复制.cs 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS/WMSServer/WIDESEA_IStorageBasicRepository/Stock/IStockInfoRepository.cs 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS/WMSServer/WIDESEA_IStorageBasicRepository/Stock/IVV_MesLockInfoRepository.cs 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS/WMSServer/WIDESEA_IStorageBasicService/Stock/IVV_MesLockInfoService.cs 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS/WMSServer/WIDESEA_Model/Models/Basic/Dt_Task.cs 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS/WMSServer/WIDESEA_Model/Models/BasicModel/Stock/VV_MesLockInfo.cs 53 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS/WMSServer/WIDESEA_Model/Models/BasicModel/Stock/VV_StockInfo.cs 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS/WMSServer/WIDESEA_StoragIntegrationServices/MES/Partial/PassPoint.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS/WMSServer/WIDESEA_StoragIntegrationServices/MES/Partial/bindWorkOrder.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS/WMSServer/WIDESEA_StoragIntegrationServices/MES/Partial/issuedCharacter.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS/WMSServer/WIDESEA_StoragIntegrationServices/MES/Partial/removeWorkOrderInfo.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS/WMSServer/WIDESEA_StoragIntegrationServices/WCS/Partial/HZPassTZ.cs 42 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS/WMSServer/WIDESEA_StoragIntegrationServices/WCS/Partial/RequestEmptyInboundRoadWayNo.cs 100 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS/WMSServer/WIDESEA_StoragIntegrationServices/WCS/Partial/RequestInboundRoadWayNo.cs 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS/WMSServer/WIDESEA_StoragIntegrationServices/WCS/Partial/RequstCarBodyInfo.cs 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS/WMSServer/WIDESEA_StoragIntegrationServices/WCS/Partial/TZPassZZ.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS/WMSServer/WIDESEA_StorageBasicRepository/Stock/VV_MesLockInfoRepository.cs 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS/WMSServer/WIDESEA_StorageBasicServices/Stock/VV_MesLockInfoService.cs 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS/WMSServer/WIDESEA_StorageTaskServices/AutoTask/BackgroundJob.cs 50 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS/WMSServer/WIDESEA_StorageTaskServices/AutoTask/QuartzJobMildd.cs 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS/WMSServer/WIDESEA_StorageTaskServices/AutoTask/WhiteCarAutoOutJob.cs 186 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS/WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS/WMSServer/WIDESEA_StorageTaskServices/Task/Partial/Dt_TaskService.cs 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS/WMSServer/WIDESEA_WMSServer/Controllers/Stock/VV_MesLockInfoController.cs 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WMS/WMSServer/WIDESEA_WMSServer/Program.cs 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ÏîÄ¿´úÂë/WCS/WCSServer/WIDESEAWCS_Common/Const/SysConfigKeyConst.cs
@@ -62,6 +62,8 @@
        public const string RequestWhiteBody = "RequestWhiteBody";
        public const string RequestEmptyInboundRoadWayNo = "RequestEmptyInboundRoadWayNo";
        /// <summary>
        /// æ¨ªç§»æœºå–æ–™
        /// </summary>
ÏîÄ¿´úÂë/WCS/WCSServer/WIDESEAWCS_Core/CodeGenerator/CodeGenertors.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,349 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using SqlSugar;
using WIDESEAWCS_Core.DB;
using WIDESEAWCS_Core.Helper;
namespace WIDESEAWCS_Core.CodeGenerator
{
    public class CodeGenertors
    {
        public static WebResponseContent CreateIRepository(string tableName, string module)
        {
            try
            {
                string startName = "WIDESEA";
                string thisNameSpace = typeof(CodeGenertors).Namespace ?? "WIDESEA_";
                int nameSpaceIndex = thisNameSpace.IndexOf("_");
                if (nameSpaceIndex > -1)
                {
                    startName = thisNameSpace.Substring(0, nameSpaceIndex);
                }
                List<Assembly> assemblies = App.Assemblies.ToList();
                Assembly? assembly = assemblies.FirstOrDefault(x => x.GetName()?.Name?.Contains($"I{module}Repository") ?? false);
                if (assembly == null)
                {
                    return WebResponseContent.Instance.Error($"未找到程序集{startName}_I{module}Repository");
                }
                string? nameSpaceFullName = assembly.GetName()?.Name;
                if (string.IsNullOrEmpty(nameSpaceFullName))
                {
                    return WebResponseContent.Instance.Error($"{nameSpaceFullName} not found.");
                }
                int index = tableName.IndexOf("_");
                string tableShortName = tableName;
                if (index > -1)
                {
                    tableShortName = tableName.Substring(index + 1);
                }
                string rootPath = App.WebHostEnvironment.WebRootPath;
                string templatePath = Path.Combine(rootPath, $"CodeTemplate\\BaseIRepository.txt");
                if (!File.Exists(templatePath))
                {
                    return WebResponseContent.Instance.Error($"未找到模板文件");
                }
                string template = FileHelper.ReadFile(templatePath);
                string classStr = template.Replace("[TableName]", tableName).Replace("[TableShortName]", tableShortName).Replace("[NameSpace]", nameSpaceFullName).Replace("[StartName]", startName).Replace("[Module]", module);
                int rootPathIndex = App.HostEnvironment.ContentRootPath.LastIndexOf("\\");
                string rootPaht = App.HostEnvironment.ContentRootPath.Substring(0, rootPathIndex - 1);
                int rootPathIndex2 = rootPaht.LastIndexOf("\\");
                string projectPath = Path.Combine(rootPaht.Substring(0, rootPathIndex2), nameSpaceFullName);
                string filePath = Path.Combine(projectPath, $"I{tableShortName}Repository.cs");
                FileHelper.WriteFileAndDelOldFile(filePath, classStr);
                return WebResponseContent.Instance.OK();
            }
            catch (Exception ex)
            {
                return WebResponseContent.Instance.Error(ex.Message);
            }
        }
        public static WebResponseContent CreateRepository(string tableName, string module)
        {
            try
            {
                string startName = "WIDESEA";
                string thisNameSpace = typeof(CodeGenertors).Namespace ?? "WIDESEA_";
                int nameSpaceIndex = thisNameSpace.IndexOf("_");
                if (nameSpaceIndex > -1)
                {
                    startName = thisNameSpace.Substring(0, nameSpaceIndex);
                }
                List<Assembly> assemblies = App.Assemblies.ToList();
                Assembly? assembly = assemblies.FirstOrDefault(x => (x.GetName()?.Name?.Contains($"{module}Repository") ?? false) && (!x.GetName()?.Name?.Contains($"I{module}Repository") ?? false));
                if (assembly == null)
                {
                    return WebResponseContent.Instance.Error($"未找到程序集{startName}_{module}Repository");
                }
                string? nameSpaceFullName = assembly.GetName()?.Name;
                if (string.IsNullOrEmpty(nameSpaceFullName))
                {
                    return WebResponseContent.Instance.Error($"{nameSpaceFullName} not found.");
                }
                int index = tableName.IndexOf("_");
                string tableShortName = tableName;
                if (index > -1)
                {
                    tableShortName = tableName.Substring(index + 1);
                }
                string rootPath = App.WebHostEnvironment.WebRootPath;
                string templatePath = Path.Combine(rootPath, $"CodeTemplate\\BaseRepository.txt");
                if (!File.Exists(templatePath))
                {
                    return WebResponseContent.Instance.Error($"未找到模板文件");
                }
                string template = FileHelper.ReadFile(templatePath);
                string classStr = template.Replace("[TableName]", tableName).Replace("[TableShortName]", tableShortName).Replace("[NameSpace]", nameSpaceFullName).Replace("[StartName]", startName).Replace("[Module]", module);
                int rootPathIndex = App.HostEnvironment.ContentRootPath.LastIndexOf("\\");
                string rootPaht = App.HostEnvironment.ContentRootPath.Substring(0, rootPathIndex - 1);
                int rootPathIndex2 = rootPaht.LastIndexOf("\\");
                string projectPath = Path.Combine(rootPaht.Substring(0, rootPathIndex2), nameSpaceFullName);
                string filePath = Path.Combine(projectPath, $"{tableShortName}Repository.cs");
                FileHelper.WriteFileAndDelOldFile(filePath, classStr);
                return WebResponseContent.Instance.OK();
            }
            catch (Exception ex)
            {
                return WebResponseContent.Instance.Error(ex.Message);
            }
        }
        public static WebResponseContent CreateIService(string tableName, string module)
        {
            try
            {
                string startName = "WIDESEA";
                string thisNameSpace = typeof(CodeGenertors).Namespace ?? "WIDESEA_";
                int nameSpaceIndex = thisNameSpace.IndexOf("_");
                if (nameSpaceIndex > -1)
                {
                    startName = thisNameSpace.Substring(0, nameSpaceIndex);
                }
                List<Assembly> assemblies = App.Assemblies.ToList();
                Assembly? assembly = assemblies.FirstOrDefault(x => x.GetName()?.Name?.Contains($"I{module}Service") ?? false);
                if (assembly == null)
                {
                    return WebResponseContent.Instance.Error($"未找到程序集{startName}_I{module}Service");
                }
                string? nameSpaceFullName = assembly.GetName()?.Name;
                if (string.IsNullOrEmpty(nameSpaceFullName))
                {
                    return WebResponseContent.Instance.Error($"{nameSpaceFullName} not found.");
                }
                int index = tableName.IndexOf("_");
                string tableShortName = tableName;
                if (index > -1)
                {
                    tableShortName = tableName.Substring(index + 1);
                }
                string rootPath = App.WebHostEnvironment.WebRootPath;
                string templatePath = Path.Combine(rootPath, $"CodeTemplate\\BaseIService.txt");
                if (!File.Exists(templatePath))
                {
                    return WebResponseContent.Instance.Error($"未找到模板文件");
                }
                string template = FileHelper.ReadFile(templatePath);
                string classStr = template.Replace("[TableName]", tableName).Replace("[TableShortName]", tableShortName).Replace("[NameSpace]", nameSpaceFullName).Replace("[StartName]", startName).Replace("[Module]", module);
                int rootPathIndex = App.HostEnvironment.ContentRootPath.LastIndexOf("\\");
                string rootPaht = App.HostEnvironment.ContentRootPath.Substring(0, rootPathIndex - 1);
                int rootPathIndex2 = rootPaht.LastIndexOf("\\");
                string projectPath = Path.Combine(rootPaht.Substring(0, rootPathIndex2), nameSpaceFullName);
                string filePath = Path.Combine(projectPath, $"I{tableShortName}Service.cs");
                FileHelper.WriteFileAndDelOldFile(filePath, classStr);
                return WebResponseContent.Instance.OK();
            }
            catch (Exception ex)
            {
                return WebResponseContent.Instance.Error(ex.Message);
            }
        }
        public static WebResponseContent CreateService(string tableName, string module)
        {
            try
            {
                string startName = "WIDESEA";
                string thisNameSpace = typeof(CodeGenertors).Namespace ?? "WIDESEA_";
                int nameSpaceIndex = thisNameSpace.IndexOf("_");
                if (nameSpaceIndex > -1)
                {
                    startName = thisNameSpace.Substring(0, nameSpaceIndex);
                }
                List<Assembly> assemblies = App.Assemblies.ToList();
                Assembly? assembly = assemblies.FirstOrDefault(x => (x.GetName()?.Name?.Contains($"{module}Service") ?? false) && (!x.GetName()?.Name?.Contains($"I{module}Service") ?? false));
                if (assembly == null)
                {
                    return WebResponseContent.Instance.Error($"未找到程序集{startName}_{module}Service");
                }
                string? nameSpaceFullName = assembly.GetName()?.Name;
                if (string.IsNullOrEmpty(nameSpaceFullName))
                {
                    return WebResponseContent.Instance.Error($"{nameSpaceFullName} not found.");
                }
                int index = tableName.IndexOf("_");
                string tableShortName = tableName;
                if (index > -1)
                {
                    tableShortName = tableName.Substring(index + 1);
                }
                string rootPath = App.WebHostEnvironment.WebRootPath;
                string templatePath = Path.Combine(rootPath, $"CodeTemplate\\BaseService.txt");
                if (!File.Exists(templatePath))
                {
                    return WebResponseContent.Instance.Error($"未找到模板文件");
                }
                string template = FileHelper.ReadFile(templatePath);
                string classStr = template.Replace("[TableName]", tableName).Replace("[TableShortName]", tableShortName).Replace("[NameSpace]", nameSpaceFullName).Replace("[StartName]", startName).Replace("[Module]", module);
                int rootPathIndex = App.HostEnvironment.ContentRootPath.LastIndexOf("\\");
                string rootPaht = App.HostEnvironment.ContentRootPath.Substring(0, rootPathIndex - 1);
                int rootPathIndex2 = rootPaht.LastIndexOf("\\");
                string projectPath = Path.Combine(rootPaht.Substring(0, rootPathIndex2), nameSpaceFullName);
                string filePath = Path.Combine(projectPath, $"{tableShortName}Service.cs");
                FileHelper.WriteFileAndDelOldFile(filePath, classStr);
                return WebResponseContent.Instance.OK();
            }
            catch (Exception ex)
            {
                return WebResponseContent.Instance.Error(ex.Message);
            }
        }
        public static WebResponseContent CreateController(string tableName, string module)
        {
            try
            {
                string startName = "WIDESEA";
                string thisNameSpace = typeof(CodeGenertors).Namespace ?? "WIDESEA_";
                int nameSpaceIndex = thisNameSpace.IndexOf("_");
                if (nameSpaceIndex > -1)
                {
                    startName = thisNameSpace.Substring(0, nameSpaceIndex);
                }
                List<Assembly> assemblies = App.Assemblies.ToList();
                Assembly? assembly = assemblies.FirstOrDefault(x => (x.GetName()?.Name?.Contains($"{module}Service") ?? false) && (!x.GetName()?.Name?.Contains($"I{module}Service") ?? false));
                if (assembly == null)
                {
                    return WebResponseContent.Instance.Error($"未找到程序集{startName}_{module}Service");
                }
                string? nameSpaceFullName = assembly.GetName()?.Name;
                if (string.IsNullOrEmpty(nameSpaceFullName))
                {
                    return WebResponseContent.Instance.Error($"{nameSpaceFullName} not found.");
                }
                int index = tableName.IndexOf("_");
                string tableShortName = tableName;
                if (index > -1)
                {
                    tableShortName = tableName.Substring(index + 1);
                }
                string rootPath = App.WebHostEnvironment.WebRootPath;
                string templatePath = Path.Combine(rootPath, $"CodeTemplate\\BaseController.txt");
                if (!File.Exists(templatePath))
                {
                    return WebResponseContent.Instance.Error($"未找到模板文件");
                }
                string template = FileHelper.ReadFile(templatePath);
                string classStr = template.Replace("[TableName]", tableName).Replace("[TableShortName]", tableShortName).Replace("[NameSpace]", nameSpaceFullName).Replace("[StartName]", startName).Replace("[Module]", module);
                string projectPath = Path.Combine(App.HostEnvironment.ContentRootPath , $"Controllers\\{module}");
                string filePath = Path.Combine(projectPath, $"{tableShortName}Controller.cs");
                FileHelper.WriteFileAndDelOldFile(filePath, classStr);
                return WebResponseContent.Instance.OK();
            }
            catch (Exception ex)
            {
                return WebResponseContent.Instance.Error(ex.Message);
            }
        }
    }
}
ÏîÄ¿´úÂë/WCS/WCSServer/WIDESEAWCS_DTO/TaskInfo/WMSTaskDTO.cs
@@ -56,7 +56,7 @@
        /// <summary>
        /// è½¦åž‹
        /// </summary>
        public string CarType { get; set; }
        public int CarType { get; set; }
        public string PVI { get; set; }
ÏîÄ¿´úÂë/WCS/WCSServer/WIDESEAWCS_Model/Models/BasicInfo/Dt_StationManager.cs
@@ -33,7 +33,7 @@
        public int stationID { get; set; }
        /// <summary>
        /// ç«™å°ç±»åž‹  1-入库站台 2-出库站台 3-异常排出站台 4-过点站台 5-提升机 6-空框入库 7-空框出库,8-入库线体扫码确认,9-入库站台确认
        /// ç«™å°ç±»åž‹  1-入库站台 2-出库站台 3-RB043精排过点 4-西侧横移机 5-提升机 6-空框入库 7-空框出库,8-RB001白车身接车 ,9-空撬入库判断  10-RB042精排判断
        /// </summary>
        [ImporterHeader(Name = "站台类型")]
        [ExporterHeader(DisplayName = "站台类型")]
ÏîÄ¿´úÂë/WCS/WCSServer/WIDESEAWCS_Model/Models/TaskInfo/Dt_Task.cs
@@ -152,8 +152,8 @@
        /// <summary>
        /// è½¦åž‹
        ///</summary>
        [SugarColumn(ColumnName = "CarType", Length = 40, ColumnDescription = "车型")]
        public string CarType { get; set; }
        [SugarColumn(ColumnName = "CarType", ColumnDescription = "车型")]
        public int CarType { get; set; }
        /// <summary>
        /// å¤‡  æ³¨:PVI码
ÏîÄ¿´úÂë/WCS/WCSServer/WIDESEAWCS_Model/Models/TaskInfo/Dt_Task_Hty.cs
@@ -150,14 +150,13 @@
        public string Remark { get; set; }
        /// <summary>
        /// è½¦åž‹
        /// è½¦ç±»åž‹
        ///</summary>
        [SugarColumn(ColumnName = "CarType", Length = 40, ColumnDescription = "车型")]
        public string CarType { get; set; }
        [SugarColumn(ColumnName = "CarType", ColumnDescription = "车类型")]
        public int CarType { get; set; }
        /// <summary>
        /// å¤‡  æ³¨:PVI码
        /// é»˜è®¤å€¼:
        /// PVI码
        ///</summary>
        [SugarColumn(ColumnName = "PVI", Length = 30, IsNullable = true)]
        public string PVI { get; set; }
ÏîÄ¿´úÂë/WCS/WCSServer/WIDESEAWCS_Server/Controllers/System/Sys_UserController.cs
@@ -4,9 +4,11 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Caching.Memory;
using StackExchange.Profiling;
using System.CodeDom.Compiler;
using WIDESEAWCS_Core;
using WIDESEAWCS_Core.Authorization;
using WIDESEAWCS_Core.BaseController;
using WIDESEAWCS_Core.CodeGenerator;
using WIDESEAWCS_Core.Const;
using WIDESEAWCS_Core.Helper;
using WIDESEAWCS_Core.HttpContextUser;
@@ -90,5 +92,16 @@
            }
        }
        [HttpPost, Route("CreateIRepository"), AllowAnonymous]
        public WebResponseContent CreateIRepository(string tableName, string nameSpace)
        {
            CodeGenertors.CreateIRepository(tableName, nameSpace);
            CodeGenertors.CreateRepository(tableName, nameSpace);
            CodeGenertors.CreateIService(tableName, nameSpace);
            CodeGenertors.CreateService(tableName, nameSpace);
            CodeGenertors.CreateController(tableName, nameSpace);
            return WebResponseContent.Instance.OK();
        }
    }
}
ÏîÄ¿´úÂë/WCS/WCSServer/WIDESEAWCS_TaskInfoService/Partial/TaskService.cs
@@ -225,7 +225,19 @@
        private async Task<WebResponseContent> RequestInRoadWayTask(string palletCode, string PVI, Dt_StationManager stationManager)
        {
            var wmsIpAddrss = GetWmsIpAddress(SysConfigKeyConst.RequestInboundRoadWayNo);
            var wmsIpAddrss = string.Empty;
            if (stationManager.stationType == 5)
            {
                wmsIpAddrss = GetWmsIpAddress(SysConfigKeyConst.RequestInboundRoadWayNo);
            }
            else if (stationManager.stationType == 9)
            {
                wmsIpAddrss = GetWmsIpAddress(SysConfigKeyConst.RequestEmptyInboundRoadWayNo);
            }
            if (string.IsNullOrEmpty(wmsIpAddrss)) throw new Exception("未配置WMS请求地址");
            //var wmsIpAddrss = GetWmsIpAddress(SysConfigKeyConst.RequestInboundRoadWayNo);
            var result = await HttpHelper.PostAsync(wmsIpAddrss, new { palletCode = palletCode, Roadways = stationManager.Roadway, area = stationManager.stationArea, Position = stationManager.stationChildCode, PVI = PVI }.ToJsonString());
            return JsonConvert.DeserializeObject<WebResponseContent>(result);
        }
ÏîÄ¿´úÂë/WCS/WCSServer/WIDESEAWCS_TaskInfoService/TaskService.cs
@@ -105,7 +105,6 @@
                        List<Dt_Router> routers = _routerService.QueryNextRoutes(item.RoadWay, item.TargetAddress);
                        if (routers.Count > 0)
                        {
                            // è®¾ç½®ä»»åŠ¡çŠ¶æ€ä¸ºå‡ºåº“æ–°å»º
                            task.TaskState = (int)TaskOutStatusEnum.OutNew;
                            // è®¾ç½®å½“前地址为源地址
@@ -131,7 +130,6 @@
                    // åˆ¤æ–­ä»»åŠ¡ç±»åž‹æ˜¯å¦ä¸ºå…¥åº“ä»»åŠ¡
                    else if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.InboundGroup)
                    {
                        // æŸ¥è¯¢ä»Žæºåœ°å€åˆ°ç›®æ ‡åœ°å€çš„路由
                        List<Dt_Router> routers = _routerService.QueryNextRoutes(item.SourceAddress, item.TargetAddress);
                        if (routers.Count > 0)
@@ -667,18 +665,33 @@
                if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup && task.TaskState == (int)TaskOutStatusEnum.SC_OutExecuting)
                {
                    var routers = _routerService.QueryNextRoutes(task.NextAddress, task.TargetAddress);
                    if (!routers.Any()) return WebResponseContent.Instance.Error($"未找到设备路由信息");
                    if(task.NextAddress == task.TargetAddress)
                    {
                        int nextStatus = task.TaskState.GetNextNotCompletedStatus<TaskOutStatusEnum>();
                        task.TaskState = nextStatus;
                        task.CurrentAddress = task.NextAddress;
                        task.NextAddress = task.NextAddress;
                        task.ModifyDate = DateTime.Now;
                        task.Modifier = "System";
                    int nextStatus = task.TaskState.GetNextNotCompletedStatus<TaskOutStatusEnum>();
                    task.TaskState = nextStatus;
                    task.CurrentAddress = task.NextAddress;
                    task.NextAddress = routers.FirstOrDefault().ChildPosi;
                    task.ModifyDate = DateTime.Now;
                    task.Modifier = "System";
                    BaseDal.UpdateData(task);
                    }
                    else
                    {
                    _taskExecuteDetailService.AddTaskExecuteDetail(task.TaskId, $"堆垛机出库完成");
                        var routers = _routerService.QueryNextRoutes(task.NextAddress, task.TargetAddress);
                        if (!routers.Any()) return WebResponseContent.Instance.Error($"未找到设备路由信息");
                        int nextStatus = task.TaskState.GetNextNotCompletedStatus<TaskOutStatusEnum>();
                        task.TaskState = nextStatus;
                        task.CurrentAddress = task.NextAddress;
                        task.NextAddress = routers.FirstOrDefault().ChildPosi;
                        task.ModifyDate = DateTime.Now;
                        task.Modifier = "System";
                        BaseDal.UpdateData(task);
                        _taskExecuteDetailService.AddTaskExecuteDetail(task.TaskId, $"堆垛机出库完成");
                    }
                    //暂不考虑多个出库口
                }
ÏîÄ¿´úÂë/WCS/WCSServer/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs
@@ -115,19 +115,28 @@
                                var palletcode = conveyorLine.GetValue<ConveyorLineDBName, Int16>(ConveyorLineDBName.SkidNo, station.stationChildCode);
                                var pvi = conveyorLine.GetValue<ConveyorLineDBName, string>(ConveyorLineDBName.PVI, station.stationChildCode);
                                WebResponseContent response = _taskService.RequestRoadWayTask(palletcode.ToString(), pvi, station).Result;
                                if (response.Status)
                                if (station.stationModel == "1") //直通模式
                                {
                                    var task = _taskService.QueryBarCodeConveyorLineTask(palletcode.ToString(), station.stationChildCode);
                                    if (task != null)
                                    //todo BDC02过点  ç„Šæ¶‚绑定
                                    conveyorLine.SetValue<ConveyorLineDBName, Int16>(ConveyorLineDBName.Spare6, 2, station.stationChildCode);
                                    conveyorLine.SetValue<ConveyorLineDBName, Int16>(ConveyorLineDBName.AllowRelease, 1, station.stationChildCode);
                                }
                                else  //入库模式
                                {
                                    WebResponseContent response = _taskService.RequestRoadWayTask(palletcode.ToString(), pvi, station).Result;
                                    if (response.Status)
                                    {
                                        var stationInfo = _stationManagerRepository.QueryFirst(x => x.stationChildCode == task.NextAddress);
                                        conveyorLine.SetValue<ConveyorLineDBName, Int16>(ConveyorLineDBName.Spare6, 3, station.stationChildCode);
                                        Thread.Sleep(300);
                                        conveyorLine.SetValue<ConveyorLineDBName, Int16>(ConveyorLineDBName.Spare5, Convert.ToInt16(stationInfo.stationTCLocation), station.stationChildCode);
                                        conveyorLine.SetValue<ConveyorLineDBName, Int16>(ConveyorLineDBName.AllowRelease, 1, station.stationChildCode);
                                        var task = _taskService.QueryBarCodeConveyorLineTask(palletcode.ToString(), station.stationChildCode);
                                        if (task != null)
                                        {
                                            var stationInfo = _stationManagerRepository.QueryFirst(x => x.stationChildCode == task.NextAddress);
                                            conveyorLine.SetValue<ConveyorLineDBName, Int16>(ConveyorLineDBName.Spare6, 3, station.stationChildCode);
                                            Thread.Sleep(300);
                                            conveyorLine.SetValue<ConveyorLineDBName, Int16>(ConveyorLineDBName.Spare5, Convert.ToInt16(stationInfo.stationTCLocation), station.stationChildCode);
                                            conveyorLine.SetValue<ConveyorLineDBName, Int16>(ConveyorLineDBName.AllowRelease, 1, station.stationChildCode);
                                        _taskService.UpdateTaskStatusToNext(task);
                                            _taskService.UpdateTaskStatusToNext(task);
                                        }
                                    }
                                }
                            }
ÏîÄ¿´úÂë/WCS/WCSServer/WIDESEAWCS_Tasks/ConveyorLineJobTZ/CommonConveyorLineTZJob.cs
@@ -233,7 +233,7 @@
                            }
                        }
                        if (station.stationType == 6) // ç©ºæ»‘橇入库
                        if (station.stationType == 9) // ç©ºæ»‘橇入库
                        {
                            var requestInbound = conveyorLine.GetValue<ConveyorLineDBName, bool>(ConveyorLineDBName.EntApply, station.stationChildCode);
                            if (requestInbound)
@@ -241,7 +241,7 @@
                                var palletcode = conveyorLine.GetValue<ConveyorLineDBName, Int16>(ConveyorLineDBName.SkidNo, station.stationChildCode);
                                //var pvi = conveyorLine.GetValue<ConveyorLineDBName, string>(ConveyorLineDBName.PVI, station.stationChildCode);
                                WebResponseContent response = _taskService.RequestTask(palletcode.ToString(), palletcode.ToString(), station).Result;
                                WebResponseContent response = _taskService.RequestRoadWayTask(palletcode.ToString(), palletcode.ToString(), station).Result;
                                if (!response.Status)
                                {
ÏîÄ¿´úÂë/WCS/WCSServer/WIDESEAWCS_Tasks/SC/SCJob.cs
@@ -69,9 +69,7 @@
                    List<string> childCodes = commonStackerCrane.DeviceProDTOs.GroupBy(d => d.DeviceChildCode).Select(g => g.Key).ToList();
                    Parallel.For(0, childCodes.Count, (i, state) =>
                    {
                        //ConsoleHelper.WriteColorLine($"【{childCodes[i]}】时间【{DateTime.Now}】】【{Thread.CurrentThread.ManagedThreadId}】", ConsoleColor.Magenta);
                        if (commonStackerCrane.GetValue<StackerCraneDBName, Int16>(StackerCraneDBName.TaskState, childCodes[i]) == 2)
                        {
                            int taskNum = commonStackerCrane.GetValue<StackerCraneDBName, int>(StackerCraneDBName.TaskNum, childCodes[i]);
@@ -144,8 +142,6 @@
                                    //StackerExecutor.SendStackerTask(commonStackerCrane, task, childCodes[i]);
                                    //bool sendFlag = commonStackerCrane.SendCommand(stackerCraneTaskCommand, childCodes[i]);
                                    //commonStackerCrane.LastTaskType = task.TaskType;
                                }
                                //}
                            }
ÏîÄ¿´úÂë/WMS/WMSClient/src/extension/widesea_wms/stock/VV_MesLockInfo.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,60 @@
let extension = {
  components: {
    //查询界面扩展组件
    gridHeader: '',
    gridBody: '',
    gridFooter: '',
    //新建、编辑弹出框扩展组件
    modelHeader: '',
    modelBody: '',
    modelFooter: ''
  },
  tableAction: '', //指定某张表的权限(这里填写表名,默认不用填写)
  buttons: { view: [], box: [], detail: [] }, //扩展的按钮
  methods: {
    //下面这些方法可以保留也可以删除
    onInit() {
      //框架初始化配置前,
      //设置查询界面弹出框的label宽度
    },
    onInited() {
      //框架初始化配置后
      //如果要配置明细表,在此方法操作
      //this.detailOptions.columns.forEach(column=>{ });
    },
    searchBefore(param) {
      //界面查询前,可以给param.wheres添加查询参数
      //返回false,则不会执行查询
      return true;
    },
    searchAfter(result) {
      //查询后,result返回的查询数据,可以在显示到表格前处理表格的值
      return true;
    },
    addBefore(formData) {
      //新建保存前formData为对象,包括明细表,可以给给表单设置值,自己输出看formData的值
      return true;
    },
    updateBefore(formData) {
      //编辑保存前formData为对象,包括明细表、删除行的Id
      return true;
    },
    addrow() {
      return true;
    },
    rowClick({ row, column, event }) {
      //查询界面点击行事件
      //this.$refs.table.$refs.table.toggleRowSelection(row); //单击行时选中当前行;
    },
    modelOpenAfter(row) {
      //点击编辑、新建按钮弹出框后,可以在此处写逻辑,如,从后台获取数据
      //(1)判断是编辑还是新建操作: this.currentAction=='Add';
      //(2)给弹出框设置默认值
      //(3)this.editFormFields.字段='xxx';
      //如果需要给下拉框设置默认值,请遍历this.editFormOptions找到字段配置对应data属性的key值
      //看不懂就把输出看:console.log(this.editFormOptions)
    }
  }
};
export default extension;
ÏîÄ¿´úÂë/WMS/WMSClient/src/router/tables.js
@@ -322,6 +322,13 @@
    // meta: {
    //   keepAlive: true
    // }
  },{
    path: '/VV_MesLockInfo',
    name: 'VV_MesLockInfo',
    component: () => import('@/views/widesea_wms/stock/VV_MesLockInfo.vue'),
    // meta: {
    //   keepAlive: true
    // }
  },
]
export default tables
ÏîÄ¿´úÂë/WMS/WMSClient/src/views/widesea_wms/stock/VV_MesLockInfo.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,95 @@
<!--
*Author:jxx
 *Contact:283591387@qq.com
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/widesea_wms/invoices/Dt_InboundOrder.js此处编写
 -->
<template>
    <view-grid ref="grid" :columns="columns" :detail="detail" :editFormFields="editFormFields"
        :editFormOptions="editFormOptions" :searchFormFields="searchFormFields" :searchFormOptions="searchFormOptions"
        :table="table" :extend="extend">
    </view-grid>
</template>
<script>
import extend from "@/extension/widesea_wms/stock/VV_MesLockInfo.js";
import { ref, defineComponent } from "vue";
export default defineComponent({
    setup() {
        const table = ref({
            key: 'id',
            footer: "Foots",
            cnName: '锁车队列信息',
            name: 'stock/VV_MesLockInfo',
            url: "/VV_MesLockInfo/",
            sortName: "id"
        });
        const editFormFields = ref({
        });
        const editFormOptions = ref([
        ]);
        const searchFormFields = ref({
            locationCode: "",
            palletCode: ""
        });
        const searchFormOptions = ref([
            [
                { "title": "滑橇号", "field": "palletCode", type: "text" },
                { "title": "库位号", "field": "locationCode", type: "text" },
                { "title": "锁定状态", "field": "stockStatus", type: "select", dataKey: "BodyStatus", data: [] },
                { "title": "拉动锁定", "field": "lockOrder", type: "select", dataKey: "LockStatus", data: [] },
            ],
            [
                { "title": "车身ID", "field": "carBodyID", type: "int" },
                { "title": "PVI", "field": "pvi", type: "string" },
                { "title": "巷道号", "field": "roadwayNo", type: "int" },
                { "title": "任务状态", "field": "taskStatus", type: "select", dataKey: "TaskInfoStatus", data: [] },
            ],
            [
                { "title": "车身类型", "field": "carType", type: "select", dataKey: "BodyType", data: [] },
                { "title": "白车身物料号", "field": "biwMaterialCode", type: "int" },
                { "title": "彩车身物料号", "field": "pbMaterial", type: "string" },
            ],
            [
                { "title": "车身颜色", "field": "carBodyCharacteristic", type: "string" },
                { "title": "天窗特征", "field": "skylightCharacteristic", type: "string" },
                { "title": "车型", "field": "vehicleCharacteristic", type: "string" },
            ]
        ]);
        const columns = ref([
            { field: 'id', title: '主键ID', type: 'int', width: 110, readonly: true, hidden: true, require: true, align: 'left' },
            { field: 'lockStatue', title: '拉动状态', type: 'string', width: 60, align: 'left' },
            { field: 'tcLine', title: '横移机产线', type: 'int', width: 100, align: 'left' },
            { field: 'sequenceNo', title: '顺序号', type: 'int', width: 120, align: 'left' },
            { field: 'carBodyID', title: '车身ID', type: 'string', width: 75, align: 'left' },
            { field: 'pvi', title: 'PVI码', type: 'int', width: 80, align: 'left' },
            { field: 'palletCode', title: '滑橇号', type: 'string', width: 100, align: 'left' },
            { field: 'vehicleCharacteristic', title: '车型', type: 'string', width: 75, align: 'left' },
            { field: 'carType', title: '车身类型', type: 'string', width: 75, align: 'left' , bind: { key: "BodyType", data: [] } },
            { field: 'workOrderType', title: '订单状态', type: 'string', width: 110, align: 'left' },
            { field: 'skylightCharacteristic', title: '天窗特征', type: 'string', width: 110, align: 'left' },
            { field: 'carBodyCharacteristic', title: '车身颜色', type: 'datetime', width: 130, align: 'left' },
            { field: 'biwMaterialCode', title: '白车身物料号', type: 'string', width: 80, align: 'left'},
            { field: 'pbMaterial', title: '彩车身物料号', type: 'int', width: 75, align: 'left'},
            { field: 'biwInPassTime', title: '焊装上线时间', type: 'string', width: 80, align: 'left' },
        ]);
        const detail = ref({
            cnName: "#detailCnName",
            table: "#detailTable",
            columns: [],
            sortName: "",
            key: ""
        });
        return {
            table,
            extend,
            editFormFields,
            editFormOptions,
            searchFormFields,
            searchFormOptions,
            columns,
            detail,
        };
    },
});
</script>
ÏîÄ¿´úÂë/WMS/WMSServer/WIDESEA_Core/BaseModels/WebResponseContent.cs
@@ -71,5 +71,14 @@
            Data = data;
            return this;
        }
        public WebResponseContent Error(int code, string message = null)
        {
            Status = false;
            Message = message;
            msg = message;
            Code = code;
            return this;
        }
    }
}
ÏîÄ¿´úÂë/WMS/WMSServer/WIDESEA_Core/Enums/ManageEnum.cs
@@ -147,18 +147,6 @@
        /// </summary>
        [Description("NG入库")]
        InNG = 205,
        /// <summary>
        /// è½¦è½®å…¥åº“
        /// </summary>
        [Description("车轮入库")]
        InWheels = 206,
        /// <summary>
        /// åˆ¶åŠ¨ç›˜å…¥åº“
        /// </summary>
        [Description("制动盘入库")]
        InBrake = 207,
    }
    public enum TaskOutboundTypeEnum
@@ -204,18 +192,6 @@
        /// </summary>
        [Description("直接出库")]
        InToOut = 106,
        /// <summary>
        /// è½¦è½®å‡ºåº“
        /// </summary>
        [Description("车轮入库")]
        OutWheels = 107,
        /// <summary>
        /// åˆ¶åŠ¨ç›˜å‡ºåº“
        /// </summary>
        [Description("制动盘出库")]
        OutBrake = 108,
    }
    public enum TaskRelocationTypeEnum
@@ -429,14 +405,14 @@
        /// <summary>
        /// è®¾å¤‡æµ‹é‡ä¸­
        /// </summary>
        [Description("设备测量中")]
        Lien_Check = 150,
        //[Description("设备测量中")]
        //Lien_Check = 150,
        /// <summary>
        /// è®¾å¤‡æµ‹é‡å®Œæˆ
        /// </summary>
        [Description("设备测量完成")]
        Lien_CheckFinish = 155,
        ///// <summary>
        ///// è®¾å¤‡æµ‹é‡å®Œæˆ
        ///// </summary>
        //[Description("设备测量完成")]
        //Lien_CheckFinish = 155,
        /// <summary>
        /// å‡ºåº“任务完成
ÏîÄ¿´úÂë/WMS/WMSServer/WIDESEA_DTO/WMS/WMSTaskDTO.cs
@@ -55,6 +55,8 @@
        public int Grade { get; set; }
        public string pvi { get; set; }
        public int CarType { get; set; }
        public string NextAddress { get; set; }
    }
}
ÏîÄ¿´úÂë/WMS/WMSServer/WIDESEA_IStorageBasicRepository/Stock/IStockInfoRepository - ¸´ÖÆ.cs
ÎļþÒÑɾ³ý
ÏîÄ¿´úÂë/WMS/WMSServer/WIDESEA_IStorageBasicRepository/Stock/IStockInfoRepository.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEA_Core.BaseRepository;
using WIDESEA_Model.Models;
namespace WIDESEA_IStorageBasicRepository
{
    public interface IStockInfoRepository : IRepository<DtStockInfo>
    {
    }
}
ÏîÄ¿´úÂë/WMS/WMSServer/WIDESEA_IStorageBasicRepository/Stock/IVV_MesLockInfoRepository.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,6 @@
namespace WIDESEA_IStorageBasicRepository
{
    public interface IVV_MesLockInfoRepository : IRepository<VV_MesLockInfo>
    {
    }
}
ÏîÄ¿´úÂë/WMS/WMSServer/WIDESEA_IStorageBasicService/Stock/IVV_MesLockInfoService.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,5 @@
namespace WIDESEA_IStorageBasicService;
public interface IVV_MesLockInfoService : IService<VV_MesLockInfo>
{
}
ÏîÄ¿´úÂë/WMS/WMSServer/WIDESEA_Model/Models/Basic/Dt_Task.cs
@@ -123,7 +123,11 @@
    [SugarColumn(ColumnName = "ErrorMessage", Length = 100, IsNullable = true)]
    public string? ErrorMessage { get; set; }
    /// <summary>
    /// è½¦åž‹
    ///</summary>
    [SugarColumn(ColumnName = "CarType", ColumnDescription = "车型")]
    public int CarType { get; set; }
    /// <summary>
    /// ä»»åŠ¡æ‰§è¡Œæ˜Žç»†
ÏîÄ¿´úÂë/WMS/WMSServer/WIDESEA_Model/Models/BasicModel/Stock/VV_MesLockInfo.cs
@@ -70,21 +70,6 @@
        [SugarColumn(IsNullable = true, ColumnDescription = "顺序号")]
        public int sequenceNo { get; set; }
        /// <summary>
        /// æ‰€å±žå··é“
        /// </summary>
        [ImporterHeader(Name = "所属巷道")]
        [ExporterHeader(DisplayName = "所属巷道")]
        [SugarColumn(IsNullable = true, Length = 20, ColumnDescription = "所属巷道")]
        public string RoadwayNo { get; set; }
        /// <summary>
        /// è´§ä½ç¼–号
        /// </summary>
        [ImporterHeader(Name = "货位编号")]
        [ExporterHeader(DisplayName = "货位编号")]
        [SugarColumn(IsNullable = true, Length = 20, ColumnDescription = "货位编号")]
        public string LocationCode { get; set; }
        /// <summary>
        /// è½¦èº«ID
@@ -118,7 +103,7 @@
        public string vehicleCharacteristic { get; set; }
        /// <summary> 
        /// è½¦èº«ç±»åž‹  1-白 2-彩 3-空滑橇 4-空撬组
        /// è½¦èº«ç±»åž‹  1-白 2-彩 3-空撬组 4-空滑橇
        /// </summary>
        [ImporterHeader(Name = "车身类型")]
        [ExporterHeader(DisplayName = "车身类型")]
@@ -174,43 +159,15 @@
        public DateTime? biwInPassTime { get; set; }
        /// <summary>
        /// é”å®šçŠ¶æ€   0-未锁定 1-锁定
        /// </summary>
        [ImporterHeader(Name = "锁定状态")]
        [ExporterHeader(DisplayName = "锁定状态")]
        [SugarColumn(IsNullable = true, ColumnDescription = "锁定状态")]
        public int StockStatus { get; set; }
        /// <summary>
        /// æ‹‰åŠ¨é”å®š  0-未拉动 1-拉动
        /// </summary>
        [ImporterHeader(Name = "拉动锁定")]
        [ExporterHeader(DisplayName = "拉动锁定")]
        [SugarColumn(IsNullable = true, ColumnDescription = "拉动锁定")]
        public int LockOrder { get; set; }
        /// <summary>
        /// ä»»åŠ¡çŠ¶æ€ 0-无任务 1-任务中
        /// </summary>
        [ImporterHeader(Name = "任务状态")]
        [ExporterHeader(DisplayName = "任务状态")]
        [SugarColumn(IsNullable = true, ColumnDescription = "任务状态")]
        public int TaskStatus { get; set; }
        /// <summary>
        /// ä¿ç•™çŠ¶æ€
        /// </summary>
        [ImporterHeader(Name = "保留状态")]
        [ExporterHeader(DisplayName = "保留状态")]
        [SugarColumn(IsNullable = true, ColumnDescription = "保留状态")]
        public int StayStatus { get; set; }
        /// <summary>
        /// æ‰€å±žå·¥å•(预绑定)
        /// </summary>
        //[ImporterHeader(Name = "所属工单")]
        //[ExporterHeader(DisplayName = "所属工单")]
        //[SugarColumn(IsNullable = true, Length = 20, ColumnDescription = "所属工单")]
        //public string OrderID { get; set; }
    }
}
ÏîÄ¿´úÂë/WMS/WMSServer/WIDESEA_Model/Models/BasicModel/Stock/VV_StockInfo.cs
@@ -68,7 +68,7 @@
        public string vehicleCharacteristic { get; set; }
        /// <summary> 
        /// è½¦èº«ç±»åž‹  1-白 2-彩 3-空滑橇 4-空撬组
        /// è½¦èº«ç±»åž‹  1-白 2-彩 3-空滑橇
        /// </summary>
        [ImporterHeader(Name = "车身类型")]
        [ExporterHeader(DisplayName = "车身类型")]
@@ -162,5 +162,22 @@
        //[ExporterHeader(DisplayName = "所属工单")]
        //[SugarColumn(IsNullable = true, Length = 20, ColumnDescription = "所属工单")]
        //public string OrderID { get; set; }
        /// <summary>
        /// åˆ›å»ºè€…
        /// </summary>
        [ImporterHeader(Name = "创建者")]
        [ExporterHeader(DisplayName = "创建者")]
        [SugarColumn(IsNullable = false, IsOnlyIgnoreUpdate = true, ColumnDescription = "创建者")]
        public string Creater { get; set; } = "Systeam";
        /// <summary>
        /// åˆ›å»ºæ—¶é—´
        /// </summary>
        [ImporterHeader(Name = "创建时间")]
        [ExporterHeader(DisplayName = "创建时间")]
        [SugarColumn(IsNullable = false, IsOnlyIgnoreUpdate = true, ColumnDescription = "创建时间")]
        public DateTime CreateDate { get; set; }   //= DateTime.Now;
    }
}
ÏîÄ¿´úÂë/WMS/WMSServer/WIDESEA_StoragIntegrationServices/MES/Partial/PassPoint.cs
@@ -45,7 +45,7 @@
                PassPointInfo passPoint = new PassPointInfo()
                {
                    union_key = Guid.NewGuid().ToString(),
                    line_code = stationInfo.stationEquipMES,  //todo éœ€æ›¿æ¢æˆç‚¹ä½ä¿¡æ¯æ—¶å¯¹åº”MES点位
                    line_code = stationInfo.stationEquipMES,
                    message_time = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
                    plant_code = "1052",
                    pvi = json.PVI,
ÏîÄ¿´úÂë/WMS/WMSServer/WIDESEA_StoragIntegrationServices/MES/Partial/bindWorkOrder.cs
@@ -91,7 +91,7 @@
                }
                LogFactory.GetLog("BDC请求绑定工单信息").Info(true, $"\r\r--------------------------------------");
                LogFactory.GetLog("BDC请求绑定工单信息").Info(true, $"工位号:{stationNo},RFID:{rfid}");
                LogFactory.GetLog("BDC请求绑定工单信息").Info(true, $"工位号:{stationNo},RFID:{rfid},响应信息:{webResponse.ToJson()}");
                _unitOfWorkManage.CommitTran();
                return content.OK();
ÏîÄ¿´úÂë/WMS/WMSServer/WIDESEA_StoragIntegrationServices/MES/Partial/issuedCharacter.cs
@@ -74,14 +74,14 @@
                _carBodyRepository.AddData(CarBody);
                LogFactory.GetLog("请求焊装特征信息").Info(true, $"\r\r--------------------------------------");
                LogFactory.GetLog("请求焊装特征信息").Info(true, $"工位号:{stationNo},RFID:{rfidPrint}");
                LogFactory.GetLog("请求焊装特征信息").Info(true, $"工位号:{stationNo},RFID:{rfidPrint},响应信息:{webResponse.ToJson()}");
                return content.OK("获取焊装白车身信息成功");
            }
            catch (Exception ex)
            {
                LogFactory.GetLog("请求焊装特征信息").Info(true, $"请求焊装特征信息异常::{ex.Message}");
                LogFactory.GetLog("请求焊装特征信息").Info(true, $"请求焊装特征信息异常RFID:{rfidPrint}异常信息:{ex.Message}");
                return content.Error($"请求焊装特征信息异常::{ex.Message}");
            }
        }
ÏîÄ¿´úÂë/WMS/WMSServer/WIDESEA_StoragIntegrationServices/MES/Partial/removeWorkOrderInfo.cs
@@ -45,7 +45,7 @@
                        var orderinfo = _assemblyOrderInfoRepository.QueryFirst(x => x.workOrderNo == item.workOrderNo && x.orderType == item.orderType);
                        if (orderinfo == null) throw new Exception($"未找到工单号{item.workOrderNo}工单类型为{item.orderType}的总装工单");
                        if (!string.IsNullOrEmpty(orderinfo.pvi)) throw new Exception($"总装工单号{item.workOrderNo}已拉动锁车的车身工单不支持撤排");
                        //if (!string.IsNullOrEmpty(orderinfo.pvi)) throw new Exception($"总装工单号{item.workOrderNo}已拉动锁车的车身工单不支持撤排");
                        _assemblyOrderInfoRepository.DeleteData(orderinfo);
                    }
ÏîÄ¿´úÂë/WMS/WMSServer/WIDESEA_StoragIntegrationServices/WCS/Partial/HZPassTZ.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,42 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.ConstrainedExecution;
using System.Text;
using System.Threading.Tasks;
using WIDESEA_Common.MES;
using WIDESEA_Core;
using WIDESEA_DTO;
namespace WIDESEA_StoragIntegrationServices
{
    public partial class WCSService
    {
        public WebResponseContent HZPassTZ(RequestTaskDto json)
        {
            WebResponseContent content = new WebResponseContent();
            try
            {
                //var carInfo = _carBodyInfoRepository.QueryFirst(x => x.RFID == json.PVI);  ///*x.PalletCode == json.PalletCode ||*/
                //if (carInfo != null) throw new Exception($"涂装直通总装失败:PVI{json.Rfid}已存在。");
                var station = _stationManagerRepository.QueryFirst(x => x.stationChildCode == json.Position);
                if (station == null) throw new Exception("站台未找到");
                WebResponseContent webResponse = _mesService.bindWorkOrder(json.Position, json.PVI);
                if (!webResponse.Status) throw new Exception($"焊涂绑定失败:{webResponse.msg}");
                //过点信息 -BDC02
                //json.Position = "EL01RB";
                WebResponseContent BDC02 = _mesService.PassPoint(json);
                if (!BDC02.Status) throw new Exception($"BDC02过点失败:{BDC02.msg}");
                content.OK();
            }
            catch (Exception ex)
            {
                content.Error(ex.Message);
            }
            return content;
        }
    }
}
ÏîÄ¿´úÂë/WMS/WMSServer/WIDESEA_StoragIntegrationServices/WCS/Partial/RequestEmptyInboundRoadWayNo.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,100 @@
using OfficeOpenXml.FormulaParsing.Excel.Functions.Math;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection.Metadata;
using System.Security.Cryptography;
using System.Text;
using System.Threading.Tasks;
using WIDESEA_Core;
using WIDESEA_Core.Enums;
using WIDESEA_DTO;
using WIDESEA_Model.Models;
using WIDESEA_Repository;
using WIDESEAWCS_BasicInfoRepository;
using WIDESEAWCS_Model.Models;
namespace WIDESEA_StoragIntegrationServices
{
    public partial class WCSService
    {
        /// <summary>
        /// è¯·æ±‚入库巷道号
        /// </summary>
        /// <param name="json"></param>
        /// <returns></returns>
        public WebResponseContent RequestEmptyInboundRoadWayNo(RequestTaskDto json)
        {
            WebResponseContent response = new WebResponseContent();
            try
            {
                var carInfo = _carBodyInfoRepository.QueryFirst(x => x.RFID == json.PVI && x.PalletCode == json.PalletCode);
                if (carInfo == null) throw new Exception("未知空撬信息,无法入库");
                //{
                //    Dt_CarBodyInfo _CarBodyInfo = new Dt_CarBodyInfo  //测试
                //    {
                //        PVI = "J25000660",
                //        RFID = json.PVI,
                //        BodyStatus = 0,
                //        CarType = 1,
                //    };
                //}
                var maxGroup = _locationRepository.QueryData(x => x.LocationType == 3 && x.LocationStatus == (int)LocationEnum.Free && x.EnalbeStatus == (int)EnableEnum.Enable)
                                .GroupBy(x => x.RoadwayNo)
                                .OrderByDescending(g => g.Count()) // æ ¹æ®æ¯ä¸ªç»„的元素数量排序
                                .ToList(); // å–出数量最多的组
                Dictionary<string, int> result = new Dictionary<string, int>();
                foreach (var item in maxGroup)
                {
                    var number = _taskRepository.QueryData(x => x.TargetAddress == item.Key).Count();
                    if (item.Count() - number <= 0)
                    {
                        continue;
                    }
                    result.Add(item.Key, item.Count() - number);
                }
                string maxRoadwayNo = result.OrderByDescending(x => x.Value).FirstOrDefault().Key; // æ•°é‡æœ€å¤šçš„组的Key
                var station = _stationManagerRepository.QueryFirst(x => x.RoadwayNo == maxRoadwayNo && x.stationArea == json.area && x.stationType == 6);
                var newtask = new Dt_Task
                {
                    CurrentAddress = json.Position,
                    Grade = 1,
                    Roadway = station.Roadway,
                    TargetAddress = station.Roadway,
                    //Dispatchertime = DateTime.Now,
                    NextAddress = station.stationChildCode,
                    OrderNo = null,
                    PalletCode = json.PalletCode,
                    SourceAddress = json.Position,
                    TaskState = (int)TaskInStatusEnum.InNew,
                    TaskType = (int)TaskInboundTypeEnum.InTray,
                    TaskNum = _taskRepository.GetTaskNo().Result,
                    Creater = "Systeam",
                    PVI = json.PVI,
                };
                _unitOfWorkManage.BeginTran();
                _taskRepository.AddData(newtask);
                //location.LocationStatus = (int)LocationEnum.InStockDisable;
                //_locationRepository.UpdateData(location);
                _unitOfWorkManage.CommitTran();
                response.OK("空撬申请入库成功", data: newtask);
                //response.OK(data: maxRoadwayNo);
            }
            catch (Exception ex)
            {
                response.Error($"请求巷道号失败:{ex.Message}");
            }
            return response;
        }
    }
}
ÏîÄ¿´úÂë/WMS/WMSServer/WIDESEA_StoragIntegrationServices/WCS/Partial/RequestInboundRoadWayNo.cs
@@ -29,7 +29,16 @@
            try
            {
                //屏蔽MES
                TZPassZZ(json);
                if (json.Position == "EL01RB")
                {
                    //焊装提升机
                    HZPassTZ(json);
                }
                else
                {
                    ///涂装提升机
                    TZPassZZ(json);
                }
                var carInfo = _carBodyInfoRepository.QueryFirst(x => x.RFID == json.PVI && x.PalletCode == json.PalletCode);
@@ -43,7 +52,6 @@
                //        CarType = 1,
                //    };
                //}
                List<Dt_RoadWay> roadWays = new List<Dt_RoadWay>();
                if (carInfo.CarType == 1)
ÏîÄ¿´úÂë/WMS/WMSServer/WIDESEA_StoragIntegrationServices/WCS/Partial/RequstCarBodyInfo.cs
@@ -20,16 +20,16 @@
            WebResponseContent webResponseContent = new WebResponseContent();
            try
            {
                var carInfo = _carBodyInfoRepository.QueryFirst(x => x.PVI == json.PVI);
                var carInfo = _carBodyInfoRepository.QueryFirst(x => x.RFID == json.PVI);
                if (carInfo != null) throw new Exception($"PVI{json.PVI}车身数据已存在");
                ///请求焊装车身特征
                WebResponseContent webResponse = _mesService.issuedCharacter(json.PVI, json.Position, json.PalletCode);
                if (webResponse.Status) throw new Exception($"{webResponse.Message}");
                if (!webResponse.Status) throw new Exception($"{webResponse.Message}");
                ///BDC01  è¿‡ç‚¹
                WebResponseContent content = _mesService.PassPoint(json);
                if (content.Status) throw new Exception($"{content.Message}");
                if (!content.Status) throw new Exception($"{content.Message}");
                return webResponseContent.OK();
ÏîÄ¿´úÂë/WMS/WMSServer/WIDESEA_StoragIntegrationServices/WCS/Partial/TZPassZZ.cs
@@ -33,7 +33,7 @@
                if (!content1.Status) throw new Exception($"BDC02过点失败:{content1.msg}");
                WebResponseContent webResponse = _mesService.bindWorkOrder("EL01RB", json.PVI);
                if (!responseContent.Status) throw new Exception($"焊涂绑定失败:{webResponse.msg}");
                if (!webResponse.Status) throw new Exception($"焊涂绑定失败:{webResponse.msg}");
                //过点信息 -BDC02
                json.Position = "EL01RB";
ÏîÄ¿´úÂë/WMS/WMSServer/WIDESEA_StorageBasicRepository/Stock/VV_MesLockInfoRepository.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,9 @@
namespace WIDESEA_StorageBasicRepository
{
    public class VV_MesLockInfoRepository : RepositoryBase<VV_MesLockInfo>, IVV_MesLockInfoRepository
    {
        public VV_MesLockInfoRepository(IUnitOfWorkManage unitOfWorkManage) : base(unitOfWorkManage)
        {
        }
    }
}
ÏîÄ¿´úÂë/WMS/WMSServer/WIDESEA_StorageBasicServices/Stock/VV_MesLockInfoService.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,18 @@
using AngleSharp.Dom;
using Mapster;
using Masuit.Tools;
using SqlSugar;
using System.Collections.Generic;
using System.Drawing.Printing;
using System.Linq.Expressions;
using WIDESEA_Core;
namespace WIDESEA_StorageBasicService;
public class VV_MesLockInfoService : ServiceBase<VV_MesLockInfo, IVV_MesLockInfoRepository>, IVV_MesLockInfoService
{
    public VV_MesLockInfoService(IVV_MesLockInfoRepository BaseDal) : base(BaseDal)
    {
    }
}
ÏîÄ¿´úÂë/WMS/WMSServer/WIDESEA_StorageTaskServices/AutoTask/BackgroundJob.cs
@@ -47,23 +47,15 @@
        {
            try
            {
                //var area = _areaInfoRepository.QueryFirst(x => x.AreaCode == "GWSC1");
                //总装不生产  åˆ™åœæ­¢æ‹‰åŠ¨å‡ºåº“
                var area = _areaInfoRepository.QueryFirst(x => x.AreaCode == "5");
                if (area.AreaStatus != 1l) { return Task.CompletedTask; }
                //if (area == null) { return; }
                //IDictionary<string, DtStockInfo>? stockInfos = _simpleCacheService.HashGetAll<DtStockInfo>(WIDESEA_Cache.CacheConst.Cache_DtStockInfo);
                //List<DtStockInfo> stockInfoList = stockInfos.Values.ToList();
                //var stockInfo = stockInfoList.Where(x => x.AreaCode == area.AreaCode && x.OutboundTime < DateTime.Now && x.IsFull == true) // è¿‡æ»¤æ¡ä»¶
                //     .Where(x => x.LocationInfo != null && x.LocationInfo.LocationStatus == (int)LocationEnum.InStock && x.LocationInfo.AreaId == area.AreaID) // è¿‡æ»¤æ¡ä»¶
                //     .OrderBy(x => x.OutboundTime) // æŽ’序
                //     .ToList(); // èŽ·å–ç¬¬ä¸€ä¸ªå…ƒç´ 
                var lockInfo = _palletStockInfoRepository.Db.Queryable<Dt_MESLockInfo>()
                    //.Where(x => x.LockStatue == 0)
                    .Includes(x => x.CarBodyInfo)
                    .OrderBy(x => x.sequenceNo) // æŽ’序
                    .ToList(); // èŽ·å–ç¬¬ä¸€ä¸ªå…ƒç´ 
                if (lockInfo.Where(x => x.LockStatue == 1).Count() > 10) return Task.CompletedTask;
                if (lockInfo.Count == 0) return Task.CompletedTask;
@@ -132,6 +124,7 @@
                    Creater = "System",
                    CreateDate = DateTime.Now,
                    TaskId = 0,
                    CarType = stock.CarType,
                };
                // åˆ›å»ºä»»åŠ¡ä¼ è¾“ç”¨çš„DTO对象
@@ -160,6 +153,7 @@
                    _unitOfWorkManage.CommitTran();
                }
                #region é›†åˆ
                //foreach (var item in lockInfo)
                //{
                //    var hasTask = _taskRepository.QueryFirst(x => x.PalletCode == item.CarBodyInfo.PalletCode);
@@ -251,7 +245,8 @@
                //        _palletStockInfoRepository.UpdateData(lockStock);
                //        _unitOfWorkManage.CommitTran();
                //    }
                //}
                //}
                #endregion
            }
            catch (Exception ex)
            {
@@ -261,33 +256,8 @@
            {
                ConsoleHelper.WriteSuccessLine($"拉动锁车:" + DateTime.Now.ToString());
            }
            return Task.CompletedTask;
        }
        /// <summary>
        /// åˆ›å»ºä»»åŠ¡å®žä¾‹
        /// </summary>
        private Dt_Task CreateTask(DtStockInfo stockInfo, string position, int tag)
        {
            return new Dt_Task
            {
                Grade = 1,
                Roadway = stockInfo.LocationInfo.RoadwayNo,
                TargetAddress = position,
                Dispatchertime = DateTime.Now,
                NextAddress = position,
                OrderNo = null,
                PalletCode = stockInfo.PalletCode,
                SourceAddress = stockInfo.LocationCode,
                CurrentAddress = stockInfo.LocationCode,
                TaskState = (int)TaskOutStatusEnum.OutNew,
                TaskType = tag,
                TaskNum = _taskRepository.GetTaskNo().Result,
                Creater = "System", // ä¿®æ­£æ‹¼å†™é”™è¯¯
                CreateDate = DateTime.Now,
                TaskId = 0,
            };
            return Task.CompletedTask;
        }
        /// <summary>
@@ -307,8 +277,8 @@
                Id = 0,
                TaskType = task.TaskType,
                pvi = task.PVI,
                NextAddress = task.NextAddress
                NextAddress = task.NextAddress,
                CarType = task.CarType
            };
        }
ÏîÄ¿´úÂë/WMS/WMSServer/WIDESEA_StorageTaskServices/AutoTask/QuartzJobMildd.cs
@@ -34,6 +34,19 @@
                         JobGroup = "WIDESEA_StorageTaskServices",
                         Name = "BackgroundJob",
                         TriggerType = 0
                    },
                    new TasksQz()
                    {
                         Id = 2,
                         AssemblyName = "WIDESEA_StorageTaskServices",
                         ClassName = "WhiteCarAutoOutJob",
                         CreateTime = DateTime.Now,
                         IntervalSecond = 15,
                         IsDeleted = false,
                         IsStart = false,
                         JobGroup = "AutoTask",
                         Name = "AutoTask",
                         TriggerType = 0
                    }
                };
ÏîÄ¿´úÂë/WMS/WMSServer/WIDESEA_StorageTaskServices/AutoTask/WhiteCarAutoOutJob.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,186 @@
using Masuit.Tools;
using Microsoft.Extensions.Logging;
using Quartz;
using WIDESEA_Core.Const;
using WIDESEA_DTO.WMS;
using WIDESEA_IServices;
using WIDESEAWCS_BasicInfoRepository;
using WIDESEAWCS_Model.Models;
namespace WIDESEA_StorageTaskServices
{
    [DisallowConcurrentExecution]
    public class WhiteCarAutoOutJob : IJob
    {
        private ILogger<WhiteCarAutoOutJob> _logger;
        private IDt_PalletStockInfoRepository _palletStockInfoRepository;
        private IDt_AreaInfoRepository _areaInfoRepository; //区域
        private IDt_TaskRepository _taskRepository;
        private IDt_StationManagerRepository _stationManagerRepository;
        private ISys_ConfigService _configService;
        private ILocationInfoRepository _locationRepository;
        private IVV_StockInfoRepository _VVStockInfoRepository;
        private IUnitOfWorkManage _unitOfWorkManage;
        public WhiteCarAutoOutJob(ILogger<WhiteCarAutoOutJob> logger, IDt_PalletStockInfoRepository palletStockInfoRepository, IDt_AreaInfoRepository areaInfoRepository, IDt_TaskRepository taskRepository, IDt_StationManagerRepository stationManagerRepository, ISys_ConfigService configService, ILocationInfoRepository locationRepository, IVV_StockInfoRepository vVStockInfoRepository, IUnitOfWorkManage unitOfWorkManage)
        {
            _logger = logger;
            _palletStockInfoRepository = palletStockInfoRepository;
            _areaInfoRepository = areaInfoRepository;
            _taskRepository = taskRepository;
            _stationManagerRepository = stationManagerRepository;
            _configService = configService;
            _locationRepository = locationRepository;
            _VVStockInfoRepository = vVStockInfoRepository;
            _unitOfWorkManage = unitOfWorkManage;
        }
        public Task Execute(IJobExecutionContext context)
        {
            try
            {
                //涂装不生产  åˆ™åœæ­¢æ‹‰åŠ¨å‡ºåº“
                var area = _areaInfoRepository.QueryFirst(x => x.AreaCode == "2");
                if (area.AreaStatus != 1l) { return Task.CompletedTask; }
                var stockInfo = _palletStockInfoRepository.Db.Queryable<Dt_PalletStockInfo>()
                    //.Where(x => x.LockStatue == 0)
                    .Includes(x => x.CarBodyInfo)
                    .Where(x => x.CarBodyInfo.CarType == 1 && x.TaskStatus == 0)
                    .OrderBy(x => x.CreateDate) // æŽ’序
                    .ToList(); // èŽ·å–ç¬¬ä¸€ä¸ªå…ƒç´ 
                if (stockInfo.Where(x => x.TaskStatus == 1).Count() > 10) return Task.CompletedTask;
                if (stockInfo.Count == 0) return Task.CompletedTask;
                var OutCar = stockInfo.Where(x => x.TaskStatus == 0).FirstOrDefault();
                if (OutCar == null) return Task.CompletedTask;
                var hasTask = _taskRepository.QueryFirst(x => x.PalletCode == OutCar.CarBodyInfo.PalletCode);
                if (hasTask != null)
                {
                    Console.WriteLine("已存在出库任务");
                    return Task.CompletedTask;
                }
                List<Dt_StationManager> stationLists = null;
                if (OutCar.CarBodyInfo.CarType == 1)
                {
                    stationLists = _stationManagerRepository.QueryData(x => x.RoadwayNo == OutCar.RoadwayNo && x.stationType == 2 && x.stationStatus == "1" && x.stationArea == "3");
                }
                var stock = _VVStockInfoRepository.QueryFirst(x => x.carBodyID == OutCar.carBodyID);
                var lockStock = _palletStockInfoRepository.QueryFirst(x => x.carBodyID == OutCar.carBodyID);
                var location = _locationRepository.QueryFirst(x => x.LocationCode == stock.LocationCode);
                location.LocationStatus = (int)LocationEnum.InStockDisable;
                lockStock.TaskStatus = 1;
                if (stationLists == null || stationLists.Count == 0) throw new Exception("出库站台未配置或未启用");
                Dt_StationManager Outstation = null;
                //if (stationLists.Count > 1)
                //{
                //    var Outtask = BaseDal.QueryData(x => x.Roadway == stationLists.FirstOrDefault().Roadway && x.TaskType == (int)TaskTypeEnum.Outbound).OrderByDescending(x => x.CreateDate).FirstOrDefault();
                //    if (Outtask != null) Outstation = stationLists.Where(x => x.stationChildCode != task.NextAddress && x.stationChildCode != Outtask.CurrentAddress).FirstOrDefault();
                //    else Outstation = stationLists.FirstOrDefault();
                //}
                //else
                //{
                Outstation = stationLists.FirstOrDefault();
                //}
                //var stationInfo = stationInfos.FirstOrDefault();
                // åˆ›å»ºå¹¶æ·»åŠ ä»»åŠ¡åˆ°æ•°æ®åº“
                hasTask = new Dt_Task
                {
                    Grade = 1,
                    Roadway = Outstation.Roadway,
                    TargetAddress = Outstation.stationChildCode,
                    Dispatchertime = DateTime.Now,
                    NextAddress = Outstation.stationChildCode,
                    OrderNo = null,
                    PalletCode = stock.PalletCode,
                    PVI = stock.PVI,
                    SourceAddress = stock.LocationCode,
                    CurrentAddress = stock.LocationCode,
                    TaskState = (int)TaskOutStatusEnum.OutNew,
                    TaskType = (int)TaskOutboundTypeEnum.Outbound,
                    TaskNum = _taskRepository.GetTaskNo().Result,
                    Creater = "System",
                    CreateDate = DateTime.Now,
                    TaskId = 0,
                    CarType = stock.CarType,
                };
                // åˆ›å»ºä»»åŠ¡ä¼ è¾“ç”¨çš„DTO对象
                var taskDTO = CreateTaskDTO(hasTask);
                // èŽ·å–WMS IP地址用于发送任务请求
                var wmsIpAddress = GetWCSIpReceiveTask();
                if (wmsIpAddress == null)
                {
                    throw new InvalidOperationException("WMS IP æœªé…ç½®");
                }
                var tasks = new List<WMSTaskDTO>() { taskDTO };
                // å‘送任务请求到WMS
                var result = HttpHelper.PostAsync(wmsIpAddress, tasks.ToJsonString()).Result;
                WebResponseContent content = JsonConvert.DeserializeObject<WebResponseContent>(result);
                if (content.Status)
                {
                    _unitOfWorkManage.BeginTran();
                    // æ·»åŠ ä»»åŠ¡åˆ°æ•°æ®åº“
                    _taskRepository.AddData(hasTask);
                    // æ›´æ–°åº“位位置状态为不可用
                    _locationRepository.UpdateData(location);
                    _palletStockInfoRepository.UpdateData(lockStock);
                    _unitOfWorkManage.CommitTran();
                }
            }
            catch (Exception ex)
            {
                ConsoleHelper.WriteErrorLine($"白车身自动出车错误信息:" + ex.Message);
            }
            finally
            {
                ConsoleHelper.WriteSuccessLine($"白车身自动出车:" + DateTime.Now.ToString());
            }
            return Task.CompletedTask;
        }
        /// <summary>
        /// åˆ›å»ºä»»åŠ¡DTO
        /// </summary>
        private WMSTaskDTO CreateTaskDTO(Dt_Task task)
        {
            return new WMSTaskDTO
            {
                TaskNum = task.TaskNum.Value,
                Grade = task.Grade.Value,
                PalletCode = task.PalletCode,
                RoadWay = task.Roadway,
                SourceAddress = task.SourceAddress,
                TargetAddress = task.TargetAddress,
                TaskState = task.TaskState.Value,
                Id = 0,
                TaskType = task.TaskType,
                pvi = task.PVI,
                NextAddress = task.NextAddress,
                CarType = task.CarType
            };
        }
        private string GetWCSIpReceiveTask()
        {
            var configs = _configService.GetConfigsByCategory(CateGoryConst.CONFIG_SYS_IPAddress);
            var wmsBase = configs.FirstOrDefault(x => x.ConfigKey == SysConfigConst.WCSIPAddress)?.ConfigValue;
            var ipAddress = configs.FirstOrDefault(x => x.ConfigKey == SysConfigConst.ReceiveTask)?.ConfigValue;
            if (wmsBase == null || ipAddress == null)
            {
                return null;
            }
            return wmsBase + ipAddress;
        }
    }
}
ÏîÄ¿´úÂë/WMS/WMSServer/WIDESEA_StorageTaskServices/Task/Dt_TaskService.cs
@@ -235,6 +235,7 @@
        // æ ¹æ®ä»»åŠ¡ç±»åž‹è°ƒç”¨ç›¸åº”çš„å®Œæˆä»»åŠ¡æ–¹æ³•
        switch (task.TaskType)
        {
            case (int)TaskInboundTypeEnum.InTray:
            case (int)TaskInboundTypeEnum.Inbound:
                LogFactory.GetLog("任务完成").InfoFormat(true, "入库任务", "");
                return await CompleteInboundTaskAsync(task);
@@ -769,8 +770,6 @@
    #endregion
    #region ä»»åŠ¡è¯·æ±‚æ–¹æ³•
    private static readonly SemaphoreSlim _semaphoreUpdate = new SemaphoreSlim(1, 1);
    // æ›´æ–°ä»»åŠ¡è´§ä½
@@ -789,7 +788,7 @@
                // åˆ›å»ºWebResponseContent对象
                var content = new WebResponseContent();
                var carInfo = _carBodyRepository.QueryFirst(x => x.PalletCode == task.PalletCode);
                var carInfo = _carBodyRepository.QueryFirst(x => x.PalletCode == task.PalletCode );
                var stationInfo = _stationManagerRepository.QueryFirst(x => x.stationChildCode == input.Position);
                // èŽ·å–åº“ä½;
                var location = RequestLocation(stationInfo.RoadwayNo, carInfo.CarType);
ÏîÄ¿´úÂë/WMS/WMSServer/WIDESEA_StorageTaskServices/Task/Partial/Dt_TaskService.cs
@@ -44,14 +44,23 @@
            }
            var carBody = _carBodyRepository.QueryFirst(x => x.PalletCode == input.PalletCode);
            if (carBody == null) throw new Exception($"车身{input.PalletCode}信息不存在");
            if (carBody != null) throw new Exception($"空撬{input.PalletCode}信息已存在");
            Dt_CarBodyInfo dt_CarBodyInfo = new Dt_CarBodyInfo
            {
                PalletCode = input.PalletCode,
                CarType = 3,
                PVI = input.PalletCode,
                RFID = input.PalletCode,
                BodyStatus = 0
            };
            //BDCManager bDCManager = new BDCManager(_bdcConfigurationService, _locationRepository, _roadWayInfoRepository);
            //await bDCManager.AddToBDC(carBody);
            // èŽ·å–åº“ä½
            var location = RequestLocation(stationInfo.RoadwayNo, carBody.CarType);
            var location = RequestLocation(stationInfo.RoadwayNo, 3);
            if (location == null)
            {
                return content.Error("无法获取货位信息或库位已满");
@@ -69,16 +78,16 @@
                PalletCode = input.PalletCode,
                SourceAddress = stationInfo.stationLocation,
                TaskState = (int)TaskInStatusEnum.InNew,
                TaskType = (int)TaskInboundTypeEnum.Inbound,
                TaskType = (int)TaskInboundTypeEnum.InTray,
                TaskNum = await BaseDal.GetTaskNo(),
                Creater = "Systeam",
                PVI = input.PVI,
            };
            _unitOfWorkManage.BeginTran();
            BaseDal.AddData(newtask);
            _carBodyRepository.AddData(dt_CarBodyInfo);
            location.LocationStatus = (int)LocationEnum.InStockDisable;
            _locationRepository.UpdateData(location);
            _unitOfWorkManage.CommitTran();
ÏîÄ¿´úÂë/WMS/WMSServer/WIDESEA_WMSServer/Controllers/Stock/VV_MesLockInfoController.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,14 @@
using WIDESEA_IStorageBasicService;
using WIDESEA_StorageBasicService;
namespace WIDESEA_WMSServer.Controllers;
[Route("api/VV_MesLockInfo")]
[ApiController]
public class VV_MesLockInfoController : ApiBaseController<IVV_MesLockInfoService, VV_MesLockInfo>
{
    public VV_MesLockInfoController(IVV_MesLockInfoService service) : base(service)
    {
    }
}
ÏîÄ¿´úÂë/WMS/WMSServer/WIDESEA_WMSServer/Program.cs
@@ -59,6 +59,7 @@
builder.Services.AddSingleton<IJobFactory, JobFactory>();
builder.Services.AddTransient<BackgroundJob>();//Job使用瞬时依赖注入
builder.Services.AddTransient<WhiteCarAutoOutJob>();//Job使用瞬时依赖注入
builder.Services.AddSingleton<ISchedulerCenter, SchedulerCenterServer>();
builder.Services.AddHttpContextSetup();
@@ -116,7 +117,7 @@
});
//全自动出库
builder.Services.AddHostedService<MyBackgroundService>();
//builder.Services.AddHostedService<MyBackgroundService>();
var app = builder.Build();