Merge branch 'master' of http://115.159.85.185:8098/r/RuiShiGe/LingPaoCheShenKu
已添加12个文件
已删除1个文件
已修改30个文件
| | |
| | | |
| | | public const string RequestWhiteBody = "RequestWhiteBody"; |
| | | |
| | | public const string RequestEmptyInboundRoadWayNo = "RequestEmptyInboundRoadWayNo"; |
| | | |
| | | /// <summary> |
| | | /// 横移æºåæ |
| | | /// </summary> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | 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); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | /// <summary> |
| | | /// 车å |
| | | /// </summary> |
| | | public string CarType { get; set; } |
| | | public int CarType { get; set; } |
| | | |
| | | public string PVI { get; set; } |
| | | |
| | |
| | | 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 = "ç«å°ç±»å")] |
| | |
| | | /// <summary> |
| | | /// 车å |
| | | ///</summary> |
| | | [SugarColumn(ColumnName = "CarType", Length = 40, ColumnDescription = "车å")] |
| | | public string CarType { get; set; } |
| | | [SugarColumn(ColumnName = "CarType", ColumnDescription = "车å")] |
| | | public int CarType { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å¤ æ³¨:PVIç |
| | |
| | | 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; } |
| | |
| | | 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; |
| | |
| | | } |
| | | |
| | | } |
| | | |
| | | [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(); |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | 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); |
| | | } |
| | |
| | | List<Dt_Router> routers = _routerService.QueryNextRoutes(item.RoadWay, item.TargetAddress); |
| | | if (routers.Count > 0) |
| | | { |
| | | |
| | | // 设置任å¡ç¶æä¸ºåºåºæ°å»º |
| | | task.TaskState = (int)TaskOutStatusEnum.OutNew; |
| | | // 设置å½åå°å为æºå°å |
| | |
| | | // 夿任å¡ç±»åæ¯å¦ä¸ºå
¥åºä»»å¡ |
| | | else if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.InboundGroup) |
| | | { |
| | | |
| | | // æ¥è¯¢ä»æºå°åå°ç®æ å°åçè·¯ç± |
| | | List<Dt_Router> routers = _routerService.QueryNextRoutes(item.SourceAddress, item.TargetAddress); |
| | | if (routers.Count > 0) |
| | |
| | | |
| | | 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, $"å åæºåºåºå®æ"); |
| | | } |
| | | |
| | | |
| | | //æä¸èèå¤ä¸ªåºåºå£ |
| | | } |
| | |
| | | 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); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | if (station.stationType == 6) // ç©ºæ»æ©å
¥åº |
| | | if (station.stationType == 9) // ç©ºæ»æ©å
¥åº |
| | | { |
| | | var requestInbound = conveyorLine.GetValue<ConveyorLineDBName, bool>(ConveyorLineDBName.EntApply, station.stationChildCode); |
| | | if (requestInbound) |
| | |
| | | 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) |
| | | { |
| | | |
| | |
| | | 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]); |
| | |
| | | //StackerExecutor.SendStackerTask(commonStackerCrane, task, childCodes[i]); |
| | | //bool sendFlag = commonStackerCrane.SendCommand(stackerCraneTaskCommand, childCodes[i]); |
| | | //commonStackerCrane.LastTaskType = task.TaskType; |
| | | |
| | | |
| | | } |
| | | //} |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | |
| | | 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; |
| | |
| | | // meta: { |
| | | // keepAlive: true |
| | | // } |
| | | },{ |
| | | path: '/VV_MesLockInfo', |
| | | name: 'VV_MesLockInfo', |
| | | component: () => import('@/views/widesea_wms/stock/VV_MesLockInfo.vue'), |
| | | // meta: { |
| | | // keepAlive: true |
| | | // } |
| | | }, |
| | | ] |
| | | export default tables |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <!-- |
| | | *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> |
| | |
| | | Data = data; |
| | | return this; |
| | | } |
| | | |
| | | public WebResponseContent Error(int code, string message = null) |
| | | { |
| | | Status = false; |
| | | Message = message; |
| | | msg = message; |
| | | Code = code; |
| | | return this; |
| | | } |
| | | } |
| | | } |
| | |
| | | /// </summary> |
| | | [Description("NGå
¥åº")] |
| | | InNG = 205, |
| | | |
| | | /// <summary> |
| | | /// 车轮å
¥åº |
| | | /// </summary> |
| | | [Description("车轮å
¥åº")] |
| | | InWheels = 206, |
| | | |
| | | /// <summary> |
| | | /// å¶å¨çå
¥åº |
| | | /// </summary> |
| | | [Description("å¶å¨çå
¥åº")] |
| | | InBrake = 207, |
| | | } |
| | | |
| | | public enum TaskOutboundTypeEnum |
| | |
| | | /// </summary> |
| | | [Description("ç´æ¥åºåº")] |
| | | InToOut = 106, |
| | | |
| | | /// <summary> |
| | | /// 车轮åºåº |
| | | /// </summary> |
| | | [Description("车轮å
¥åº")] |
| | | OutWheels = 107, |
| | | |
| | | /// <summary> |
| | | /// å¶å¨çåºåº |
| | | /// </summary> |
| | | [Description("å¶å¨çåºåº")] |
| | | OutBrake = 108, |
| | | } |
| | | |
| | | public enum TaskRelocationTypeEnum |
| | |
| | | /// <summary> |
| | | /// è®¾å¤æµéä¸ |
| | | /// </summary> |
| | | [Description("è®¾å¤æµéä¸")] |
| | | Lien_Check = 150, |
| | | //[Description("è®¾å¤æµéä¸")] |
| | | //Lien_Check = 150, |
| | | |
| | | /// <summary> |
| | | /// è®¾å¤æµé宿 |
| | | /// </summary> |
| | | [Description("è®¾å¤æµé宿")] |
| | | Lien_CheckFinish = 155, |
| | | ///// <summary> |
| | | ///// è®¾å¤æµé宿 |
| | | ///// </summary> |
| | | //[Description("è®¾å¤æµé宿")] |
| | | //Lien_CheckFinish = 155, |
| | | |
| | | /// <summary> |
| | | /// åºåºä»»å¡å®æ |
| | |
| | | public int Grade { get; set; } |
| | | |
| | | public string pvi { get; set; } |
| | | |
| | | public int CarType { get; set; } |
| | | public string NextAddress { get; set; } |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | 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> |
| | | { |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | namespace WIDESEA_IStorageBasicRepository |
| | | { |
| | | public interface IVV_MesLockInfoRepository : IRepository<VV_MesLockInfo> |
| | | { |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | namespace WIDESEA_IStorageBasicService; |
| | | |
| | | public interface IVV_MesLockInfoService : IService<VV_MesLockInfo> |
| | | { |
| | | } |
| | |
| | | [SugarColumn(ColumnName = "ErrorMessage", Length = 100, IsNullable = true)] |
| | | public string? ErrorMessage { get; set; } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 车å |
| | | ///</summary> |
| | | [SugarColumn(ColumnName = "CarType", ColumnDescription = "车å")] |
| | | public int CarType { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 任塿§è¡æç» |
| | |
| | | [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 |
| | |
| | | public string vehicleCharacteristic { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 车身类å 1-ç½ 2-彩 3-ç©ºæ»æ© 4-空æ¬ç» |
| | | /// 车身类å 1-ç½ 2-彩 3-空æ¬ç» 4-ç©ºæ»æ© |
| | | /// </summary> |
| | | [ImporterHeader(Name = "车身类å")] |
| | | [ExporterHeader(DisplayName = "车身类å")] |
| | |
| | | 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; } |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | } |
| | |
| | | public string vehicleCharacteristic { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 车身类å 1-ç½ 2-彩 3-ç©ºæ»æ© 4-空æ¬ç» |
| | | /// 车身类å 1-ç½ 2-彩 3-ç©ºæ»æ© |
| | | /// </summary> |
| | | [ImporterHeader(Name = "车身类å")] |
| | | [ExporterHeader(DisplayName = "车身类å")] |
| | |
| | | //[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; |
| | | |
| | | } |
| | | } |
| | |
| | | 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, |
| | |
| | | } |
| | | |
| | | 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(); |
| | |
| | | _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}"); |
| | | } |
| | | } |
| | |
| | | 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); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | 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; |
| | | } |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | 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; |
| | | } |
| | | } |
| | | } |
| | |
| | | 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); |
| | | |
| | |
| | | // CarType = 1, |
| | | // }; |
| | | //} |
| | | |
| | | |
| | | List<Dt_RoadWay> roadWays = new List<Dt_RoadWay>(); |
| | | if (carInfo.CarType == 1) |
| | |
| | | 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(); |
| | | |
| | |
| | | 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"; |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | namespace WIDESEA_StorageBasicRepository |
| | | { |
| | | public class VV_MesLockInfoRepository : RepositoryBase<VV_MesLockInfo>, IVV_MesLockInfoRepository |
| | | { |
| | | public VV_MesLockInfoRepository(IUnitOfWorkManage unitOfWorkManage) : base(unitOfWorkManage) |
| | | { |
| | | } |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | 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) |
| | | { |
| | | } |
| | | |
| | | } |
| | |
| | | { |
| | | 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; |
| | |
| | | Creater = "System", |
| | | CreateDate = DateTime.Now, |
| | | TaskId = 0, |
| | | CarType = stock.CarType, |
| | | }; |
| | | |
| | | // å建任å¡ä¼ è¾ç¨çDTO对象 |
| | |
| | | _unitOfWorkManage.CommitTran(); |
| | | } |
| | | |
| | | #region éå |
| | | //foreach (var item in lockInfo) |
| | | //{ |
| | | // var hasTask = _taskRepository.QueryFirst(x => x.PalletCode == item.CarBodyInfo.PalletCode); |
| | |
| | | // _palletStockInfoRepository.UpdateData(lockStock); |
| | | // _unitOfWorkManage.CommitTran(); |
| | | // } |
| | | //} |
| | | //} |
| | | #endregion |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | |
| | | { |
| | | 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> |
| | |
| | | Id = 0, |
| | | TaskType = task.TaskType, |
| | | pvi = task.PVI, |
| | | NextAddress = task.NextAddress |
| | | |
| | | NextAddress = task.NextAddress, |
| | | CarType = task.CarType |
| | | }; |
| | | } |
| | | |
| | |
| | | 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 |
| | | } |
| | | }; |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | 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; |
| | | } |
| | | } |
| | | } |
| | |
| | | // æ ¹æ®ä»»å¡ç±»åè°ç¨ç¸åºç宿任塿¹æ³ |
| | | switch (task.TaskType) |
| | | { |
| | | case (int)TaskInboundTypeEnum.InTray: |
| | | case (int)TaskInboundTypeEnum.Inbound: |
| | | LogFactory.GetLog("ä»»å¡å®æ").InfoFormat(true, "å
¥åºä»»å¡", ""); |
| | | return await CompleteInboundTaskAsync(task); |
| | |
| | | #endregion |
| | | |
| | | #region ä»»å¡è¯·æ±æ¹æ³ |
| | | |
| | | |
| | | private static readonly SemaphoreSlim _semaphoreUpdate = new SemaphoreSlim(1, 1); |
| | | // æ´æ°ä»»å¡è´§ä½ |
| | | |
| | |
| | | // å建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); |
| | |
| | | } |
| | | |
| | | 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("æ æ³è·åè´§ä½ä¿¡æ¯æåºä½å·²æ»¡"); |
| | |
| | | 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(); |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | 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) |
| | | { |
| | | |
| | | } |
| | | } |
| | |
| | | |
| | | builder.Services.AddSingleton<IJobFactory, JobFactory>(); |
| | | builder.Services.AddTransient<BackgroundJob>();//Job使ç¨ç¬æ¶ä¾èµæ³¨å
¥ |
| | | builder.Services.AddTransient<WhiteCarAutoOutJob>();//Job使ç¨ç¬æ¶ä¾èµæ³¨å
¥ |
| | | builder.Services.AddSingleton<ISchedulerCenter, SchedulerCenterServer>(); |
| | | |
| | | builder.Services.AddHttpContextSetup(); |
| | |
| | | }); |
| | | |
| | | //å
¨èªå¨åºåº |
| | | builder.Services.AddHostedService<MyBackgroundService>(); |
| | | //builder.Services.AddHostedService<MyBackgroundService>(); |
| | | |
| | | var app = builder.Build(); |
| | | |