Merge branch 'master' of http://115.159.85.185:8098/r/RuiShiGe/LingPaoCheShenKu
| | |
| | | |
| | | public const string TZPassZZ = "TZPassZZ"; |
| | | |
| | | public const string HZPassTZ = "HZPassTZ"; |
| | | |
| | | public const string Queue = "Queue"; |
| | | |
| | | public const string RequestInboundRoadWayNo = "RequestInboundRoadWayNo"; |
| | |
| | | /// <summary> |
| | | /// 忣å
¥åº |
| | | /// </summary> |
| | | [Description("忣å
¥åº")] |
| | | InPick = 202, |
| | | //[Description("忣å
¥åº")] |
| | | //InPick = 202, |
| | | |
| | | /// <summary> |
| | | /// è´¨æ£å
¥åº |
| | | /// </summary> |
| | | [Description("è´¨æ£å
¥åº")] |
| | | InQuality = 203, |
| | | //[Description("è´¨æ£å
¥åº")] |
| | | //InQuality = 203, |
| | | |
| | | /// <summary> |
| | | /// 空æçå
¥åº |
| | |
| | | /// <summary> |
| | | /// NGå
¥åº |
| | | /// </summary> |
| | | [Description("NGå
¥åº")] |
| | | InNG = 205, |
| | | //[Description("NGå
¥åº")] |
| | | //InNG = 205, |
| | | |
| | | /// <summary> |
| | | /// 车轮å
¥åº |
| | | /// </summary> |
| | | [Description("车轮å
¥åº")] |
| | | InWheels = 206, |
| | | //[Description("车轮å
¥åº")] |
| | | //InWheels = 206, |
| | | |
| | | /// <summary> |
| | | /// å¶å¨çå
¥åº |
| | | /// </summary> |
| | | [Description("å¶å¨çå
¥åº")] |
| | | InBrake = 207, |
| | | //[Description("å¶å¨çå
¥åº")] |
| | | //InBrake = 207, |
| | | } |
| | | |
| | | public enum TaskOutboundTypeEnum |
| | |
| | | /// <summary> |
| | | /// 忣åºåº |
| | | /// </summary> |
| | | [Description("忣åºåº")] |
| | | OutPick = 102, |
| | | //[Description("忣åºåº")] |
| | | //OutPick = 102, |
| | | |
| | | /// <summary> |
| | | /// è´¨æ£åºåº |
| | | /// </summary> |
| | | [Description("è´¨æ£åºåº")] |
| | | OutQuality = 103, |
| | | //[Description("è´¨æ£åºåº")] |
| | | //OutQuality = 103, |
| | | |
| | | /// <summary> |
| | | /// 空æçåºåº |
| | |
| | | /// <summary> |
| | | /// NGåºåº |
| | | /// </summary> |
| | | [Description("NGåºåº")] |
| | | OutNG = 105, |
| | | //[Description("NGåºåº")] |
| | | //OutNG = 105, |
| | | |
| | | /// <summary> |
| | | /// ç´æ¥åºåº |
| | |
| | | /// <summary> |
| | | /// 车轮åºåº |
| | | /// </summary> |
| | | [Description("车轮åºåº")] |
| | | OutWheels = 107, |
| | | //[Description("车轮åºåº")] |
| | | //OutWheels = 107, |
| | | |
| | | /// <summary> |
| | | /// å¶å¨çåºåº |
| | | /// </summary> |
| | | [Description("å¶å¨çåºåº")] |
| | | OutBrake = 108, |
| | | //[Description("å¶å¨çåºåº")] |
| | | //OutBrake = 108, |
| | | } |
| | | |
| | | public enum TaskRelocationTypeEnum |
| | |
| | | public string PalletCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å··éå· |
| | | /// å··é设å¤å· |
| | | /// </summary> |
| | | public string RoadWay { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å··éå· |
| | | /// </summary> |
| | | public string RoadwayNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä»»å¡ç±»å |
| | | /// </summary> |
| | | public int TaskType { get; set; } |
| | |
| | | public int CarType { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å··éå· |
| | | ///</summary> |
| | | [SugarColumn(ColumnName = "RoadwayNo", ColumnDescription = "å··éå·")] |
| | | public string RoadwayNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å¤ æ³¨:PVIç |
| | | /// é»è®¤å¼: |
| | | ///</summary> |
| | |
| | | public string PalletCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å··éæº |
| | | /// </summary> |
| | | [ImporterHeader(Name = "å··éæº")] |
| | | [ExporterHeader(DisplayName = "å··éæº")] |
| | | [SugarColumn(IsNullable = false, Length = 10, ColumnDescription = "å··éæº")] |
| | | public string Roadway { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å··éå· |
| | | /// </summary> |
| | | [ImporterHeader(Name = "å··éå·")] |
| | | [ExporterHeader(DisplayName = "å··éå·")] |
| | | [SugarColumn(IsNullable = false, Length = 10, ColumnDescription = "å··éå·")] |
| | | public string Roadway { get; set; } |
| | | public string RoadwayNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä»»å¡ç±»å |
| | |
| | | "ConnectionStringsEncryption": false, |
| | | "MainDB": "DB_WIDESEA", //å½å项ç®ç主åºï¼æå¯¹åºçè¿æ¥å符串çEnabledå¿
须为true |
| | | //è¿æ¥å符串 |
| | | //"ConnectionString": "HTI6FB1H05Krd07mNm9yBCNhofW6edA5zLs9TY~MNthRYW3kn0qKbMIsGp~3yyPDF1YZUCPBQx8U0Jfk4PH~ajNFXVIwlH85M3F~v_qKYQ3CeAz3q1mLVDn8O5uWt1~3Ut2V3KRkEwYHvW2oMDN~QIDXPxDgXN0R2oTIhc9dNu7QNaLEknblqmHhjaNSSpERdDVZIgHnMKejU_SL49tralBkZmDNi0hmkbL~837j1NWe37u9fJKmv91QPb~16JsuI9uu0EvNZ06g6PuZfOSAeFH9GMMIZiketdcJG3tHelo=", |
| | | //"ConnectionString": "Data Source=127.0.0.1;Initial Catalog=WIDESEA_WCS2F08;User ID=sa;Password=P@ssw0rd;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=True;ApplicationIntent=ReadWrite;MultiSubnetFailover=True", |
| | | //"ConnectionString": "Data Source=192.168.20.251;Initial Catalog=WIDESEA_WCSDB;User ID=sa;Password=123456@gy;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False", |
| | | |
| | | "ConnectionString": "Data Source=.;Initial Catalog=LP_WIDESEAWCS;User ID=sa;Password=123456;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False", |
| | | |
| | | //"ConnectionString": "Data Source=.;Initial Catalog=ZCLDY_WIDESEAWCS;User ID=sa;Password=123456;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False", |
| | | //"ConnectionString": "Data Source=.\\LIULEI;Initial Catalog=MX_LDY_WCS;User ID=sa;Password=123456;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False", |
| | | //"ConnectionString": "Data Source=127.0.0.1;Initial Catalog=WIDESEA_WCS2F08;User ID=sa;Password=P@ssw0rd;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=True;ApplicationIntent=ReadWrite;MultiSubnetFailover=True", |
| | | //"ConnectionString": "Data Source=192.168.20.251;Initial Catalog=WIDESEA_WCSDB;User ID=sa;Password=123456@gy;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False", |
| | | //"ConnectionString": "Data Source=192.168.5.251;Initial Catalog=WIDESEAWCS_TEST;User ID=sa;Password=P@ssw0rd;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False", |
| | | |
| | | "ConnectionString": "Data Source=.\\LIULEI;Initial Catalog=LP_WIDESEAWCS;User ID=sa;Password=123456;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False", |
| | | //"ConnectionString": "Data Source=172.21.1.139;Initial Catalog=WIDESEA_WCSDB;User ID=sa;Password=Admin123;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False", |
| | | //è·¨å |
| | | "Cors": { |
| | |
| | | |
| | | |
| | | // æ£æ¥å½åæçæ¯å¦åå¨ä»»å¡ |
| | | private async Task<bool> HasTask(string PVI) |
| | | private async Task<bool> HasTask(string palletCode) |
| | | { |
| | | var hasTask = await BaseDal.QueryFirstAsync(x => x.PVI == PVI); |
| | | var hasTask = await BaseDal.QueryFirstAsync(x => x.PalletCode == palletCode); |
| | | return hasTask != null; |
| | | } |
| | | |
| | |
| | | StaticVariable.isLineRun = false; |
| | | |
| | | // æ£æ¥å½åæçæ¯å¦åå¨ä»»å¡ |
| | | if (await HasTask(palletCode)) |
| | | { |
| | | return content.Error("å½åæçåå¨ä»»å¡"); |
| | | } |
| | | //if (await HasTask(palletCode)) |
| | | //{ |
| | | // return content.Error("å½åæçåå¨ä»»å¡"); |
| | | //} |
| | | |
| | | //PVI = "J26000456TF12"; // 模æPVI请æ±ä»»å¡ |
| | | |
| | |
| | | using Newtonsoft.Json; |
| | | using SqlSugar; |
| | | using System.Diagnostics.CodeAnalysis; |
| | | using System.Threading.Tasks; |
| | | using WIDESEAWCS_BasicInfoRepository; |
| | | using WIDESEAWCS_BasicInfoService; |
| | | using WIDESEAWCS_Common; |
| | |
| | | using WIDESEAWCS_ITaskInfoRepository; |
| | | using WIDESEAWCS_ITaskInfoService; |
| | | using WIDESEAWCS_Model.Models; |
| | | using WIDESEAWCS_QuartzJob.DeviceBase; |
| | | using WIDESEAWCS_QuartzJob; |
| | | using WIDESEAWCS_QuartzJob.Models; |
| | | using WIDESEAWCS_QuartzJob.Repository; |
| | | using WIDESEAWCS_QuartzJob.Service; |
| | | using WIDESEAWCS_QuartzJob.DTO; |
| | | |
| | | namespace WIDESEAWCS_TaskInfoService |
| | | { |
| | |
| | | task.CarType = item.CarType; |
| | | task.PVI = item.PVI; |
| | | task.NextAddress = item.NextAddress; |
| | | task.RoadwayNo = item.RoadwayNo; |
| | | |
| | | // 夿任å¡ç±»åæ¯å¦ä¸ºåºåºä»»å¡ |
| | | if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup) |
| | |
| | | |
| | | if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup && task.TaskState == (int)TaskOutStatusEnum.SC_OutExecuting) |
| | | { |
| | | if(task.NextAddress == task.TargetAddress) |
| | | if (task.NextAddress == task.TargetAddress) |
| | | { |
| | | task.ModifyDate = DateTime.Now; |
| | | task.Modifier = "System"; |
| | |
| | | task.TaskState = nextStatus; |
| | | Dt_Task_Hty task_Hty = _mapper.Map<Dt_Task_Hty>(task); |
| | | task_Hty.TaskId = 0; |
| | | //task_Hty.CarType = task.CarType; |
| | | task_Hty.CarType = task.CarType; |
| | | task_Hty.PVI = task.PVI; |
| | | task_Hty.RoadwayNo = task.RoadwayNo; |
| | | BaseDal.DeleteData(task); |
| | | _taskHtyRepository.AddData(task_Hty); |
| | | |
| | | } |
| | | else |
| | | { |
| | |
| | | |
| | | _taskExecuteDetailService.AddTaskExecuteDetail(task.TaskId, $"å åæºåºåºå®æ"); |
| | | } |
| | | |
| | | |
| | | //æä¸èèå¤ä¸ªåºåºå£ |
| | | } |
| | | else if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.InboundGroup && task.TaskState == (int)TaskInStatusEnum.SC_InExecuting) |
| | |
| | | |
| | | Dt_Task_Hty task_Hty = _mapper.Map<Dt_Task_Hty>(task); |
| | | task_Hty.TaskId = 0; |
| | | |
| | | BaseDal.DeleteData(task); |
| | | _taskHtyRepository.AddData(task_Hty); |
| | | _taskExecuteDetailService.AddTaskExecuteDetail(task.TaskId, $"å åæºå
¥åºå®æ"); |
| | |
| | | else if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.RelocationGroup) |
| | | { |
| | | task.TaskState = (int)TaskStatusGroup.Completed; |
| | | |
| | | Dt_Task_Hty task_Hty = _mapper.Map<Dt_Task_Hty>(task); |
| | | task_Hty.TaskId = 0; |
| | | |
| | | BaseDal.DeleteData(task); |
| | | _taskHtyRepository.AddData(task_Hty); |
| | | _taskExecuteDetailService.AddTaskExecuteDetail(task.TaskId, $"å åæºç§»åºå®æ"); |
| | |
| | | |
| | | if (station.stationModel == "1") //ç´éæ¨¡å¼ |
| | | { |
| | | //todo BDC02è¿ç¹ çæ¶ç»å® |
| | | var config = _sys_ConfigService.GetConfigsByCategory(CateGoryConst.CONFIG_SYS_IPAddress); |
| | | var wmsBase = config.FirstOrDefault(x => x.ConfigKey == SysConfigKeyConst.WMSIP_BASE)?.ConfigValue; |
| | | var requestTask = config.FirstOrDefault(x => x.ConfigKey == SysConfigKeyConst.HZPassTZ)?.ConfigValue; |
| | | if (wmsBase == null || requestTask == null) |
| | | { |
| | | throw new InvalidOperationException("WMS IP æªé
ç½®"); |
| | | } |
| | | var wmsIpAddrss = wmsBase + requestTask; |
| | | |
| | | var result = await HttpHelper.PostAsync(wmsIpAddrss, new { palletCode = palletcode, Roadways = station.Roadway, area = station.stationArea, Position = station.stationChildCode, PVI = pvi }.ToJsonString()); |
| | | WebResponseContent content = JsonConvert.DeserializeObject<WebResponseContent>(result); |
| | | if (!content.Status) |
| | | { |
| | | throw new Exception(content.Message); |
| | | } |
| | | conveyorLine.SetValue<ConveyorLineDBName, Int16>(ConveyorLineDBName.Spare6, 2, station.stationChildCode); |
| | | conveyorLine.SetValue<ConveyorLineDBName, Int16>(ConveyorLineDBName.AllowRelease, 1, station.stationChildCode); |
| | | } |
| | |
| | | _taskService.UpdateTaskStatusToNext(task); |
| | | } |
| | | } |
| | | //else |
| | | //{ |
| | | // conveyorLine.SetValue<ConveyorLineDBName, Int16>(ConveyorLineDBName.AllowRelease, 12, station.stationChildCode); |
| | | //} |
| | | } |
| | | } |
| | | //var config = _sys_ConfigService.GetConfigsByCategory(CateGoryConst.CONFIG_SYS_IPAddress); |
| | | //var wmsBase = config.FirstOrDefault(x => x.ConfigKey == SysConfigKeyConst.WMSIP_BASE)?.ConfigValue; |
| | | //var requestTask = config.FirstOrDefault(x => x.ConfigKey == SysConfigKeyConst.RequestInboundRoadWayNo)?.ConfigValue; |
| | | //if (wmsBase == null || requestTask == null) |
| | | //{ |
| | | // throw new InvalidOperationException("WMS IP æªé
ç½®"); |
| | | //} |
| | | //var wmsIpAddrss = wmsBase + requestTask; |
| | | |
| | | //var result = await HttpHelper.PostAsync(wmsIpAddrss, new { palletCode = palletcode, Roadways = station.Roadway, area = station.stationArea, Position = station.stationChildCode, PVI = pvi }.ToJsonString()); |
| | | //WebResponseContent content = JsonConvert.DeserializeObject<WebResponseContent>(result); |
| | | //if (!content.Status) |
| | | //{ |
| | | // return; |
| | | //} |
| | | |
| | | ////çæ¶æåæº ç´é人æ¶è£
-2 å
¥åº-3 |
| | | //conveyorLine.SetValue<ConveyorLineDBName, Int16>(ConveyorLineDBName.Spare6, 3, station.stationChildCode); |
| | | //conveyorLine.SetValue<ConveyorLineDBName, Int16>(ConveyorLineDBName.Spare5, 5, station.stationChildCode); |
| | | //conveyorLine.SetValue<ConveyorLineDBName, Int16>(ConveyorLineDBName.AllowRelease, 1, station.stationChildCode); |
| | | } |
| | | |
| | | //DeviceProtocolDetailDTO? deviceProtocolDetails = conveyorLine.DeviceProtocolDetailDTOs.FirstOrDefault(x => x.DeviceProParamName == station.stationChildCode && x.ProtocalDetailValue == request.ToString()); |
| | | |
| | | //if (deviceProtocolDetails != null) |
| | | //{ |
| | | // MethodInfo? method = GetType().GetMethod(deviceProtocolDetails.ProtocolDetailType); |
| | | // if (method != null) |
| | | // { |
| | | // method.Invoke(this, new object[] { conveyorLine, conveyorLine, station }); |
| | | // } |
| | | //} |
| | | |
| | | //ConveyorLineTaskCommand command = conveyorLine.ReadCustomer<ConveyorLineTaskCommand>(station.stationChildCode); |
| | | //command.PVI.Replace("/0", "").Replace("\"\\u0010\\u000f", ""); |
| | | //command.CarColor.Replace("/0", ""); |
| | | //command.CarType.Replace("/0", ""); |
| | | //command.CarCate.Replace("/0", ""); |
| | | //command.CatSkyWindow.Replace("/0", ""); |
| | | |
| | | //DeviceProtocolDetailDTO? deviceProtocolDetails = conveyorLine.DeviceProtocolDetailDTOs.FirstOrDefault(x => x.DeviceProParamName == station.stationChildCode && x.ProtocalDetailValue == command.Request.ToString()); |
| | | |
| | | ////x.DeviceProParamName == nameof(ConveyorLineTaskCommand.ConveyorLineSingal) |
| | | //if (deviceProtocolDetails != null) |
| | | //{ |
| | | // MethodInfo? method = GetType().GetMethod(deviceProtocolDetails.ProtocolDetailType); |
| | | // if (method != null) |
| | | // { |
| | | // method.Invoke(this, new object[] { conveyorLine, command, station }); |
| | | // } |
| | | //} |
| | | #region è°ç¨äºä»¶æ»çº¿éç¥å端 |
| | | |
| | | //var tokenInfos = _cacheService.Get<List<UserInfo>>("Cache_UserToken"); |
| | |
| | | } |
| | | } |
| | | |
| | | if (station.stationType == 1) //å
¥åºå£ |
| | | if (station.stationType == 1 ) //å
¥åºå£ |
| | | { |
| | | var requestInbound = conveyorLine.GetValue<ConveyorLineDBName, bool>(ConveyorLineDBName.EntApply, station.stationChildCode); |
| | | if (requestInbound) |
| | |
| | | } |
| | | } |
| | | |
| | | if (station.stationType == 3) |
| | | if (station.stationType == 3) //RB043ç²¾æç¹ |
| | | { |
| | | var requestFolw = conveyorLine.GetValue<ConveyorLineDBName, bool>(ConveyorLineDBName.EntApply, station.stationChildCode); |
| | | if (requestFolw) |
| | |
| | | //var pvi = conveyorLine.GetValue<ConveyorLineDBName, string>(ConveyorLineDBName.PVI, station.stationChildCode); |
| | | |
| | | WebResponseContent response = _taskService.RequestRoadWayTask(palletcode.ToString(), palletcode.ToString(), station).Result; |
| | | if (!response.Status) |
| | | if (response.Status) |
| | | { |
| | | 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, Convert.ToInt16(stationInfo.stationTCLocation), station.stationChildCode); |
| | | Thread.Sleep(200); |
| | | //conveyorLine.SetValue<ConveyorLineDBName, Int16>(ConveyorLineDBName.Spare5, 3, station.stationChildCode); |
| | | conveyorLine.SetValue<ConveyorLineDBName, Int16>(ConveyorLineDBName.AllowRelease, 1, station.stationChildCode); |
| | | |
| | | _taskService.UpdateTaskStatusToNext(task); |
| | | } |
| | | } |
| | | conveyorLine.SetValue<ConveyorLineDBName, Int16>(ConveyorLineDBName.AllowRelease, 1, station.stationChildCode); |
| | | //else |
| | | //{ |
| | | // conveyorLine.SetValue<ConveyorLineDBName, Int16>(ConveyorLineDBName.AllowRelease, 1, station.stationChildCode); |
| | | //} |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | if (station.stationType == 6) //ç©ºæ»æ©å
¥åºå£ |
| | | { |
| | | 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); |
| | | |
| | | //_taskService.QueryBarCodeConveyorLineTask(); |
| | | var task = _taskService.QueryExecutingTaskByBarcode(palletcode.ToString(), station.stationChildCode); |
| | | if (task != null) |
| | | { |
| | | _taskService.UpdateTaskStatusToNext(task); |
| | | conveyorLine.SetValue<ConveyorLineDBName, Int16>(ConveyorLineDBName.AllowRelease, 1, station.stationChildCode); |
| | | } |
| | | else |
| | | { |
| | | continue; |
| | | //妿¾ä¸å°å¯¹åºå
¥åºä»»å¡ï¼åæ ¹æ®æç PVIç³è¯·å
¥åº |
| | | //WebResponseContent response = _taskService.RequestTask(palletcode.ToString(), pvi, station).Result; |
| | | //if (!response.Status) |
| | | //{ |
| | | // continue; |
| | | //} |
| | | } |
| | | } |
| | | } |
| | | |
| | | #region æ ¹æ®åè®®è¯»åæ¹æ¡ |
| | | //DeviceProtocolDetailDTO? deviceProtocolDetails = conveyorLine.DeviceProtocolDetailDTOs.FirstOrDefault(x => x.DeviceProParamName == station.stationChildCode && x.ProtocalDetailValue == request.ToString()); |
| | | |
| | |
| | | if (flag && value != null && value is STK commonStackerCrane) |
| | | { |
| | | List<string> childCodes = commonStackerCrane.DeviceProDTOs.GroupBy(d => d.DeviceChildCode).Select(g => g.Key).ToList(); |
| | | childCodes = new List<string> { "SC01", "SC03", "SC05", "SC07" }; //æµè¯ä½¿ç¨ |
| | | Parallel.For(0, childCodes.Count, (i, state) => |
| | | { |
| | | //ConsoleHelper.WriteColorLine($"ã{childCodes[i]}ãæ¶é´ã{DateTime.Now}ããã{Thread.CurrentThread.ManagedThreadId}ã", ConsoleColor.Magenta); |
| | |
| | | |
| | | Thread.Sleep(500); |
| | | WebResponseContent responseContent = SendStackerTask(commonStackerCrane, task, childCodes[i]); |
| | | if(responseContent.Status) |
| | | if (responseContent.Status) |
| | | { |
| | | _taskService.UpdateTaskStatusToNext(task.TaskNum); |
| | | } |
| | |
| | | { |
| | | //return task; |
| | | |
| | | var stationList = _stationManagerRepository.QueryData(x => x.stationType == 2 && x.Roadway == task.Roadway); |
| | | //var stationList = _stationManagerRepository.QueryData(x => x.stationType == 2 && x.Roadway == task.Roadway); |
| | | |
| | | //foreach (var item in stationList) |
| | | //{ |
| | |
| | | { |
| | | return responseContent.Error(ex.Message); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | } |
| | |
| | | Dt_Task task = null; |
| | | if (station.stationChildCode == "TC05") |
| | | { |
| | | //var executeTaks = _taskRepository.QueryData(x => (x.Roadway == "SC02" || x.Roadway == "SC04") && x.TaskState <= (int)TaskOutStatusEnum.SC_OutFinish).OrderBy(x => x.CreateDate).FirstOrDefault(); |
| | | //var executeTaks = _taskRepository.QueryData(x => (x.Roadway == "SC02" || x.Roadway == "SC04") && x.TaskState == (int)TaskOutStatusEnum.Line_OutExecuting).OrderBy(x => x.CreateDate).FirstOrDefault(); |
| | | |
| | | var leftTask = _taskRepository.QueryData(x => (x.Roadway == "SC02" || x.Roadway == "SC04") && x.TaskState <= (int)TaskOutStatusEnum.SC_OutFinish).OrderBy(x => x.CreateDate).FirstOrDefault(); |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | let confirmTask=this.buttons.find(x=>x.value=='confirmTask'); |
| | | if(confirmTask){ |
| | | confirmTask.onClick=function(){ |
| | | let row = this.$refs.table.getSelected() //è·åéä¸çè¡ |
| | | if (row <= 0) { |
| | | //å¦ææ²¡æéä¸è¡ |
| | | this.$Message.error('è¯·éæ©ä¸è¡æ°æ®') |
| | | return |
| | | } |
| | | let taskNum = row[0].taskNum |
| | | this.http.get(`/api/Task/confirmTask?taskNum=${taskNum}`, {}, "æ£å¨ç¡®è®¤å®æä»»å¡").then((res) => { |
| | | //示ä¾ï¼è°ç¨åå°æ¥å£ |
| | | if (res.status) { |
| | | this.$Message.success('确认任å¡å®æ'); |
| | | this.refresh(); |
| | | } else { |
| | | this.$Message.error(res.message) //é误æç¤º |
| | | this.refresh(); |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | // let confirmTask=this.buttons.find(x=>x.value=='confirmTask'); |
| | | // if(confirmTask){ |
| | | // confirmTask.onClick=function(){ |
| | | // let row = this.$refs.table.getSelected() //è·åéä¸çè¡ |
| | | // if (row <= 0) { |
| | | // //å¦ææ²¡æéä¸è¡ |
| | | // this.$Message.error('è¯·éæ©ä¸è¡æ°æ®') |
| | | // return |
| | | // } |
| | | // let taskNum = row[0].taskNum |
| | | // this.http.get(`/api/Task/confirmTask?taskNum=${taskNum}`, {}, "æ£å¨ç¡®è®¤å®æä»»å¡").then((res) => { |
| | | // //示ä¾ï¼è°ç¨åå°æ¥å£ |
| | | // if (res.status) { |
| | | // this.$Message.success('确认任å¡å®æ'); |
| | | // this.refresh(); |
| | | // } else { |
| | | // this.$Message.error(res.message) //é误æç¤º |
| | | // this.refresh(); |
| | | // } |
| | | // }) |
| | | // } |
| | | // } |
| | | //示ä¾ï¼å¨æé®çæå颿·»å ä¸ä¸ªæé® |
| | | // this.buttons.unshift({ |
| | | // //ä¹å¯ä»¥ç¨pushæè
spliceæ¹æ³æ¥ä¿®æ¹buttonsæ°ç» |
| | |
| | | { field: 'roadway', title: 'å··é', type: 'string', width: 110, align: 'left' }, |
| | | { field: 'taskType', title: 'ä»»å¡ç±»å', type: 'int', width: 110, align: 'left', bind: { key: "TaskType", data: [] } }, |
| | | { field: 'taskState', title: 'ä»»å¡ç¶æ', type: 'int', width: 150, align: 'left', bind: { key: "TaskStatus", data: [] } }, |
| | | { field: 'carType', title: '车å', type: 'int', width: 150, align: 'left'}, |
| | | { field: 'carType', title: '车身类å', type: 'int', width: 150, align: 'left'}, |
| | | { field: 'sourceAddress', title: 'èµ·å§ä½ç½®', type: 'string', width: 110, align: 'left' }, |
| | | { field: 'targetAddress', title: 'ç®æ ä½ç½®', type: 'string', width: 110, align: 'left' }, |
| | | { field: 'grade', title: 'ä¼å
级', type: 'int', width: 60, align: 'left' }, |
| | |
| | | public string PalletCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å··éå· |
| | | /// å··éæº |
| | | /// </summary> |
| | | public string RoadWay { get; set; } |
| | | |
| | |
| | | /// </summary> |
| | | public int Grade { get; set; } |
| | | |
| | | /// <summary> |
| | | /// PVIç |
| | | /// </summary> |
| | | public string pvi { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 车身类å |
| | | /// </summary> |
| | | public int CarType { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å··éå· |
| | | /// </summary> |
| | | public string RoadwayNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// (ä¸ä¸ä½ç½®)å
¥åºå£ |
| | | /// </summary> |
| | | public string NextAddress { get; set; } |
| | | } |
| | | } |
| | |
| | | WebResponseContent RequstCarBodyInfo(RequestTaskDto json); |
| | | |
| | | /// <summary> |
| | | /// æ¶æ»æåæºå
¥åºè¯·æ± |
| | | /// çæ¶/æ¶æ»æåæºå
¥åºè¯·æ± |
| | | /// </summary> |
| | | /// <param name="json"></param> |
| | | /// <returns></returns> |
| | | WebResponseContent RequestInboundRoadWayNo(RequestTaskDto json); |
| | | |
| | | /// <summary> |
| | | /// ç©ºæ»æ©å
¥åº |
| | | /// </summary> |
| | | /// <param name="json"></param> |
| | | /// <returns></returns> |
| | | WebResponseContent RequestEmptyInboundRoadWayNo(RequestTaskDto json); |
| | | |
| | | /// <summary> |
| | | /// æ¶è£
ç´éæ»è£
|
| | |
| | | WebResponseContent TZPassZZ(RequestTaskDto json); |
| | | |
| | | /// <summary> |
| | | /// çè£
è£
ç´éæ¶è£
|
| | | /// </summary> |
| | | /// <param name="json"></param> |
| | | /// <returns></returns> |
| | | WebResponseContent HZPassTZ(RequestTaskDto json); |
| | | |
| | | /// <summary> |
| | | /// æ¶æ»ç²¾æç¹ |
| | | /// </summary> |
| | | /// <param name="json"></param> |
| | |
| | | public string? Roadway { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å¤ æ³¨:å··éå· |
| | | /// é»è®¤å¼: |
| | | ///</summary> |
| | | [SugarColumn(ColumnName = "RoadwayNo", ColumnDescription = "å··éå·")] |
| | | public string RoadwayNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å¤ æ³¨:ä»»å¡ç±»åï¼100 åºåº;çç¹åºåº 101; 102 忣åºåº;103 è´¨æ£åºåº;200 å
¥åº;çç¹å
¥åº 201;忣å
¥åº 202;è´¨æ£å
¥åº 203;ç§»åº 300;åºå
ç§»åº 301;åºå¤ç§»åº 302 ï¼ |
| | | /// é»è®¤å¼: |
| | | ///</summary> |
| | |
| | | public string? ErrorMessage { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 车å |
| | | /// 车身类å 1-ç½ 2-彩 3-空æ¬ç» |
| | | ///</summary> |
| | | [SugarColumn(ColumnName = "CarType", ColumnDescription = "车å")] |
| | | public int CarType { get; set; } |
| | |
| | | [ExporterHeader(DisplayName = "夿³¨")] |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "夿³¨")] |
| | | public string Remark { get; set; } |
| | | |
| | | } |
| | | } |
| | |
| | | [ExporterHeader(DisplayName = "车身ID")] |
| | | [SugarColumn(IsNullable = true, Length = 20, ColumnDescription = "车身ID")] |
| | | public int carBodyID { get; set; } |
| | | |
| | | /// <summary> |
| | | /// PVIç |
| | | /// </summary> |
| | |
| | | public string PVI { get; set; } |
| | | |
| | | /// <summary> |
| | | /// RFID |
| | | /// </summary> |
| | | [ImporterHeader(Name = "RFID")] |
| | | [ExporterHeader(DisplayName = "RFID")] |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "RFID")] |
| | | public string RFID { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ»æ©å· |
| | | /// </summary> |
| | | [ImporterHeader(Name = "æ»æ©å·")] |
| | |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "宿æ¹å¼")] |
| | | public int FinishType { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æºID |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "宿æ¹å¼")] |
| | | public int sourceID { get; set; } |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | LogFactory.GetLog("车身è¿ç¹").Info(true, $"\r\r--------------------------------------"); |
| | | LogFactory.GetLog("车身è¿ç¹").Info(true, $"å·¥ä½å·:{json.Position},RFID:{json.PVI},ååºä¿¡æ¯:{responseContent.ToJson}"); |
| | | LogFactory.GetLog("车身è¿ç¹").Info(true, $"å·¥ä½å·:{json.Position},RFID:{json.PVI},ååºä¿¡æ¯:{MESrespon}"); |
| | | |
| | | return content.OK(); |
| | | } |
| | |
| | | |
| | | var carBodyInfo = _carBodyRepository.QueryFirst(x => x.RFID == rfid); |
| | | |
| | | //if (carBodyInfo == null) throw new Exception($"æªæ¾å°PVI{rfid}çè½¦èº«æ°æ®"); |
| | | if (carBodyInfo == null) throw new Exception($"æªæ¾å°PVI{rfid}çè½¦èº«æ°æ®"); |
| | | |
| | | BindWorkOrder bindOrder = new BindWorkOrder() |
| | | { |
| | |
| | | BindWorkOrderRespon characterRespon = JsonConvert.DeserializeObject<BindWorkOrderRespon>(webResponse.Data.ToJson()); |
| | | |
| | | _unitOfWorkManage.BeginTran(); |
| | | if (stationInfo.stationChildCode == "EL01RB") //æ¶è£
ç²¾æç¹ |
| | | if (stationInfo.stationChildCode == "EL01RB") //çè£
-æ¶è£
æåæº |
| | | { |
| | | var paintingOrderInfo = _paintingOrderInfoRepository.QueryFirst(x => x.workOrderNo == characterRespon.workOrderNo); |
| | | |
| | |
| | | carBodyInfo.carBodyCharacteristic = paintingOrderInfo.carBodyCharacteristic; |
| | | _carBodyRepository.UpdateData(carBodyInfo); |
| | | } |
| | | else if (stationInfo.stationChildCode == "EL01RB01") //æ»è£
ç²¾æç¹ |
| | | else if (stationInfo.stationChildCode == "EL01RB01") //æ¶è£
ç²¾æç¹ |
| | | { |
| | | var assemblyOrderInfo = _assemblyOrderInfoRepository.QueryFirst(x => x.workOrderNo == characterRespon.workOrderNo); |
| | | |
| | |
| | | |
| | | IssuedCharacterRespon characterRespon = JsonConvert.DeserializeObject<IssuedCharacterRespon>(webResponse.Data.ToJson()); |
| | | |
| | | //_carBodyRepository.QueryFirst(x => x.PalletCode == palletCode); |
| | | |
| | | Dt_CarBodyInfo CarBody = new Dt_CarBodyInfo() |
| | | { |
| | | biwInPassTime = Convert.ToDateTime(characterRespon.biwInPassTime), |
| | |
| | | |
| | | LogFactory.GetLog("请æ±çè£
ç¹å¾ä¿¡æ¯").Info(true, $"\r\r--------------------------------------"); |
| | | LogFactory.GetLog("请æ±çè£
ç¹å¾ä¿¡æ¯").Info(true, $"å·¥ä½å·:{stationNo},RFID:{rfidPrint},ååºä¿¡æ¯:{webResponse.ToJson()}"); |
| | | |
| | | |
| | | return content.OK("è·åçè£
ç½è½¦èº«ä¿¡æ¯æå"); |
| | | } |
| | |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | |
| | | |
| | | |
| | | LogFactory.GetLog("éè½¦ä¸æ¥").Info(true, $"\r\r--------------------------------------"); |
| | | LogFactory.GetLog("éè½¦ä¸æ¥").Info(true, jsondata.ToJsonString()); |
| | |
| | | { |
| | | // carinfo = _palletStockInfoRepository.QueryFirst(x => x.PVI == item.pvi && x.pbMaterial == item.pbMaterial); |
| | | //carbodyinfo = _carBodyRepository.QueryFirst(x => x.pbMaterial == item.pbMaterial && x.PVI == item.pvi); |
| | | OutStock = _VVStockInfoRepository.QueryFirst(x => x.PVI == item.pvi && x.pbMaterial == item.pbMaterial && x.StockStatus == 0 && x.LockOrder == 0 && x.StayStatus == 0); |
| | | OutStock = _VVStockInfoRepository.QueryFirst(x => x.PVI == item.pvi /*&& x.pbMaterial == item.pbMaterial*/ && x.StockStatus == 0 && x.LockOrder == 0 && x.StayStatus == 0); |
| | | if (OutStock == null) |
| | | { |
| | | throw new Exception($"æªæ¾å°æå®PVI车身信æ¯{item.pvi}"); |
| | |
| | | //{ |
| | | stockInfo.StockStatus = 0; |
| | | stockInfo.LockOrder = 1; |
| | | carBody.BodyStatus = 1; |
| | | //carBody.BodyStatus = 1; |
| | | assemblyOrderInfo.pvi = carBody.PVI; |
| | | carBody.assemblyWorrkNo = item.workOrderNo; |
| | | |
| | | _MESLockInfoRepository.AddData(mESLockInfo); |
| | | _assemblyOrderInfoRepository.UpdateData(assemblyOrderInfo); |
| | | //_taskRepository.AddData(task); |
| | | _palletStockInfoRepository.UpdateData(stockInfo); |
| | | //_carBodyRepository.UpdateData(carbodyinfo); |
| | | _carBodyRepository.UpdateData(carBody); |
| | | _unitOfWorkManage.CommitTran(); |
| | | //} |
| | | |
| | |
| | | //if (carInfo != null) throw new Exception($"æ¶è£
ç´éæ»è£
失败:PVI{json.Rfid}å·²åå¨ã"); |
| | | |
| | | var station = _stationManagerRepository.QueryFirst(x => x.stationChildCode == json.Position); |
| | | if (station == null) throw new Exception("ç«å°æªæ¾å°"); |
| | | if (station == null) throw new Exception($"{json.Position}å·¥ä½ç«å°æªæ¾å°"); |
| | | |
| | | WebResponseContent webResponse = _mesService.bindWorkOrder(json.Position, json.PVI); |
| | | if (!webResponse.Status) throw new Exception($"çæ¶ç»å®å¤±è´¥ï¼{webResponse.msg}"); |
| | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | content.Error(ex.Message); |
| | | throw new Exception($"çè£
æåæºå¼å¸¸:{ex.Message}"); |
| | | //content.Error(ex.Message); |
| | | } |
| | | return content; |
| | | } |
| | |
| | | using WIDESEA_DTO; |
| | | using WIDESEA_Model.Models; |
| | | using WIDESEA_Repository; |
| | | using WIDESEA_StorageBasicRepository; |
| | | using WIDESEAWCS_BasicInfoRepository; |
| | | using WIDESEAWCS_Model.Models; |
| | | |
| | |
| | | WebResponseContent response = new WebResponseContent(); |
| | | try |
| | | { |
| | | |
| | | //å¦ä»»å¡å·²åå¨å è¿åæ¤ä»»å¡ |
| | | var checkTask = _taskRepository.QueryFirst(x => x.PalletCode == json.PalletCode && x.PVI == json.PVI); |
| | | if (checkTask != null) |
| | | { |
| | | return response.OK("ç³è¯·å
¥åºæå", data: checkTask); |
| | | } |
| | | |
| | | 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, |
| | | // }; |
| | | //} |
| | | if (carInfo == null) |
| | | { |
| | | Dt_CarBodyInfo dt_CarBodyInfo = new Dt_CarBodyInfo |
| | | { |
| | | PalletCode = json.PalletCode, |
| | | CarType = 3, |
| | | PVI = json.PalletCode, |
| | | RFID = json.PalletCode, |
| | | BodyStatus = 0 |
| | | }; |
| | | _carBodyInfoRepository.AddData(dt_CarBodyInfo); |
| | | |
| | | carInfo = _carBodyInfoRepository.QueryFirst(x => x.RFID == json.PVI && x.PalletCode == json.PalletCode); |
| | | } |
| | | |
| | | var maxGroup = _locationRepository.QueryData(x => x.LocationType == 3 && x.LocationStatus == (int)LocationEnum.Free && x.EnalbeStatus == (int)EnableEnum.Enable) |
| | | .GroupBy(x => x.RoadwayNo) |
| | |
| | | TaskNum = _taskRepository.GetTaskNo().Result, |
| | | Creater = "Systeam", |
| | | PVI = json.PVI, |
| | | |
| | | CarType = carInfo.CarType |
| | | }; |
| | | _unitOfWorkManage.BeginTran(); |
| | | |
| | | _taskRepository.AddData(newtask); |
| | | //location.LocationStatus = (int)LocationEnum.InStockDisable; |
| | | //_locationRepository.UpdateData(location); |
| | | _unitOfWorkManage.CommitTran(); |
| | | |
| | | response.OK("空æ¬ç³è¯·å
¥åºæå", data: newtask); |
| | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | response.Error($"请æ±å··éå·å¤±è´¥:{ex.Message}"); |
| | | response.Error($"空æ¬è¯·æ±å··éå·å¤±è´¥:{ex.Message}"); |
| | | } |
| | | return response; |
| | | } |
| | |
| | | WebResponseContent response = new WebResponseContent(); |
| | | try |
| | | { |
| | | //å¦ä»»å¡å·²åå¨å è¿åæ¤ä»»å¡ |
| | | var checkTask = _taskRepository.QueryFirst(x => x.PalletCode == json.PalletCode && x.PVI == json.PVI); |
| | | if (checkTask != null) |
| | | { |
| | | return response.OK("ç³è¯·å
¥åºæå", data: checkTask); |
| | | } |
| | | |
| | | //å±è½MES |
| | | if (json.Position == "EL01RB") |
| | | { |
| | |
| | | roadWays = _roadWayRepository.QueryData(x => x.WirteCar == 2); |
| | | } |
| | | |
| | | //var locations = _locationRepository.QueryData(x => (x.LocationType == carInfo.CarType || x.LocationType == 3) && x.LocationStatus == (int)LocationEnum.Free && x.EnalbeStatus == (int)EnableEnum.Enable); |
| | | |
| | | var maxGroup = _locationRepository.QueryData(x => (x.LocationType == carInfo.CarType || x.LocationType == 3) && x.LocationStatus == (int)LocationEnum.Free && x.EnalbeStatus == (int)EnableEnum.Enable) |
| | | .GroupBy(x => x.RoadwayNo) |
| | | .OrderByDescending(g => g.Count()) // æ ¹æ®æ¯ä¸ªç»çå
ç´ æ°éæåº |
| | | .ToList(); // ååºæ°éæå¤çç» |
| | | |
| | | if (maxGroup.Count == 0) return response.Error(12, "æ å¯ç¨åºä½"); |
| | | |
| | | Dictionary<string, int> result = new Dictionary<string, int>(); |
| | | foreach (var item in maxGroup) |
| | | { |
| | | var number = _taskRepository.QueryData(x => x.TargetAddress == item.Key).Count(); |
| | | var number = _taskRepository.QueryData(x => x.RoadwayNo == item.Key && x.CarType == carInfo.CarType && (x.TaskType == (int)TaskInboundTypeEnum.Inbound || x.TaskType == (int)TaskInboundTypeEnum.InTray)).Count(); |
| | | if (item.Count() - number <= 0) |
| | | { |
| | | continue; |
| | |
| | | |
| | | if (stationList.Count > 1) |
| | | { |
| | | var task = _taskRepository.QueryData(x => x.Roadway == stationList.FirstOrDefault().Roadway).OrderByDescending(x => x.CreateDate).FirstOrDefault(); |
| | | var task = _taskRepository.QueryData(x => x.Roadway == stationList.FirstOrDefault().Roadway && x.TaskType == (int)TaskInboundTypeEnum.Inbound).OrderByDescending(x => x.CreateDate).FirstOrDefault(); |
| | | if (task != null) station = stationList.Where(x => x.stationChildCode != task.NextAddress && x.stationChildCode != task.CurrentAddress).FirstOrDefault(); |
| | | else station = stationList.FirstOrDefault(); |
| | | } |
| | |
| | | TaskNum = _taskRepository.GetTaskNo().Result, |
| | | Creater = "Systeam", |
| | | PVI = json.PVI, |
| | | CarType = carInfo.CarType |
| | | CarType = carInfo.CarType, |
| | | RoadwayNo = station.RoadwayNo |
| | | }; |
| | | _unitOfWorkManage.BeginTran(); |
| | | |
| | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | content.Error(ex.Message); |
| | | throw new Exception($"æ¶è£
æåæºå¼å¸¸:{ex.Message}"); |
| | | //content.Error(ex.Message); |
| | | } |
| | | return content; |
| | | } |
| | |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core.Const; |
| | | using WIDESEA_DTO; |
| | | using WIDESEA_DTO.WMS; |
| | | using WIDESEA_IServices; |
| | | using WIDESEAWCS_BasicInfoRepository; |
| | |
| | | CreateDate = DateTime.Now, |
| | | TaskId = 0, |
| | | CarType = stock.CarType, |
| | | RoadwayNo = stock.RoadwayNo, |
| | | }; |
| | | |
| | | // å建任å¡ä¼ è¾ç¨çDTO对象 |
| | |
| | | AssemblyName = "WIDESEA_StorageTaskServices", |
| | | ClassName = "WhiteCarAutoOutJob", |
| | | CreateTime = DateTime.Now, |
| | | IntervalSecond = 15, |
| | | IntervalSecond = 60, |
| | | IsDeleted = false, |
| | | IsStart = false, |
| | | JobGroup = "AutoTask", |
| | |
| | | CreateDate = DateTime.Now, |
| | | TaskId = 0, |
| | | CarType = stock.CarType, |
| | | RoadwayNo = stock.RoadwayNo |
| | | }; |
| | | |
| | | // å建任å¡ä¼ è¾ç¨çDTO对象 |
| | |
| | | private readonly IDt_BDCConfigurationService _bdcConfigurationService; |
| | | private readonly IDt_RoadWayRepository _roadWayRepository; |
| | | private readonly IDt_RoadWayInfoRepository _roadWayInfoRepository; |
| | | private readonly IDt_CarBodyInfo_htyRepository _carBodyInfo_HtyRepository; |
| | | |
| | | public Dt_TaskService(IDt_TaskRepository BaseDal, |
| | | IUnitOfWorkManage unitOfWorkManage, |
| | |
| | | ITaskExecuteDetailRepository taskExecuteDetailRepository, |
| | | ILocationStatusChangeRecordRepository locationStatusChangeRecordRepository, |
| | | IDt_StationManagerRepository stationManagerRepository, |
| | | ISys_ConfigService configService, IDt_PalletStockInfoRepository palletStockInfoRepository, IDt_PalletStockInfo_htyRepository palletStockInfo_HtyRepository, IDt_CarBodyInfoRepository carBodyRepository, IDt_BDCConfigurationRepository bdcConfigurationRepository, IDt_BDCConfigurationService bDCConfigurationService, IDt_RoadWayRepository roadWayRepository, IDt_RoadWayInfoRepository roadWayInfoRepository) : base(BaseDal) |
| | | ISys_ConfigService configService, IDt_PalletStockInfoRepository palletStockInfoRepository, IDt_PalletStockInfo_htyRepository palletStockInfo_HtyRepository, IDt_CarBodyInfoRepository carBodyRepository, IDt_BDCConfigurationRepository bdcConfigurationRepository, IDt_BDCConfigurationService bDCConfigurationService, IDt_RoadWayRepository roadWayRepository, IDt_RoadWayInfoRepository roadWayInfoRepository, IDt_CarBodyInfo_htyRepository carBodyInfo_HtyRepository) : base(BaseDal) |
| | | |
| | | { |
| | | _unitOfWorkManage = unitOfWorkManage; |
| | |
| | | _bdcConfigurationService = bDCConfigurationService; |
| | | _roadWayRepository = roadWayRepository; |
| | | _roadWayInfoRepository = roadWayInfoRepository; |
| | | _carBodyInfo_HtyRepository = carBodyInfo_HtyRepository; |
| | | } |
| | | |
| | | #region å¤é¨æ¥å£æ¹æ³ |
| | |
| | | stockInfo_Hty.FinishTime = DateTime.Now; |
| | | stockInfo_Hty.OperateType = (int)OperateTypeEnum.èªå¨å®æ; |
| | | |
| | | var boxinfo = _carBodyRepository.QueryFirst(x => x.PalletCode == task.PalletCode); |
| | | |
| | | var carInfo = _carBodyRepository.QueryFirst(x => x.PalletCode == task.PalletCode); |
| | | carInfo.BodyStatus = 2; |
| | | // äºå¡å¤ç |
| | | await _unitOfWorkManage.UseTranAsync(async () => |
| | | { |
| | | var isLocationUpdate = await _locationRepository.UpdateDataAsync(loc); //æ´æ°åºä½ |
| | | var isPalletHty = await _palletStockInfo_HtyRepository.AddDataAsync(stockInfo_Hty); //æ·»å åå²åºåè®°å½ |
| | | var isTaskUpdated = await BaseDal.DeleteDataByIdAsync(task.TaskId); //å é¤ä»»å¡ |
| | | //await BaseDal.UpdateDataAsync(task); //åæ¶å é¤ä»»å¡ï¼æ¹ä¸ºå®æç¶æï¼å¹¶WMSçé¢ç±äººå·¥ç¡®è®¤å®æ |
| | | var isTaskAdd = await _task_HtyRepository.AddDataAsync(taskHty) > 0; //å å
¥åå²ä»»å¡ |
| | | var isDelete = await _palletStockInfoRepository.DeleteDataAsync(stock); //å é¤åºå |
| | | //await DeleteStockInfoDetailsAsync(stock.StockInfoDetails); //å é¤åºåæç» |
| | | //if (boxinfo != null) |
| | | //{ |
| | | // var isDeleteBoxing = await _boxingInfoRepository.Db.DeleteNav<DtBoxingInfo>(x => x.Id == boxinfo.Id) |
| | | // .Include(x => x.BoxingInfoDetails) |
| | | // .ExecuteCommandAsync(); //å é¤ç»ç |
| | | //} |
| | | |
| | | if (task.CarType != 2)//é彩车身åºåºå æ¸
é¤ç»çæ°æ® |
| | | { |
| | | //å é¤ç»ç |
| | | Dt_CarBodyInfo_hty carInfo_Hty = carInfo.Adapt<Dt_CarBodyInfo_hty>(); |
| | | carInfo_Hty.FinishTime = DateTime.Now; |
| | | carInfo_Hty.FinishType = (int)OperateTypeEnum.èªå¨å®æ; |
| | | carInfo_Hty.sourceID = carInfo.Id; |
| | | await _carBodyInfo_HtyRepository.AddDataAsync(carInfo_Hty); |
| | | await _carBodyRepository.DeleteDataAsync(carInfo); |
| | | } |
| | | }); |
| | | |
| | | return content.OK("ä»»å¡å®ææå", task.Remark); |
| | |
| | | return await CompleteInboundTaskAsync(task); |
| | | |
| | | case (int)TaskOutboundTypeEnum.Outbound: |
| | | case (int)TaskOutboundTypeEnum.OutTray: |
| | | LogFactory.GetLog("ä»»å¡å®æ").InfoFormat(true, "åºåºä»»å¡", ""); |
| | | return await CompleteStackTaskAsync(task); |
| | | default: |
| | |
| | | try |
| | | { |
| | | string palletCode = saveModel.MainData["palletCode"].ToString(); |
| | | string station = saveModel.MainData["station"].ToString(); |
| | | //string station = saveModel.MainData["station"].ToString(); |
| | | |
| | | var barcode = JsonConvert.DeserializeObject<List<string>>(saveModel.MainData["palletCode"].ToString()); |
| | | |
| | |
| | | return content.Error("æªæ¥è¯¢å°å¯¹åºçåºåä¿¡æ¯"); |
| | | } |
| | | |
| | | if (stockInfo.StockStatus != 0) return content.Error($"æå®å¤±è´¥ï¼æç{item}å½åç¶æä¸å
许æå®åºåº"); |
| | | if (stockInfo.StockStatus != 0) return content.Error($"æå®å¤±è´¥ï¼åºåæ»æ©{item}å·²éå®ä¸å
许æå®åºåº"); |
| | | |
| | | stockInfo.StockStatus = 1; |
| | | |
| | |
| | | //} |
| | | //var stationInfo = stationInfos.FirstOrDefault(); |
| | | |
| | | |
| | | |
| | | // å建并添å ä»»å¡å°æ°æ®åº |
| | | task = new Dt_Task |
| | | { |
| | | Grade = 1, |
| | | Roadway = Outstation.Roadway, |
| | | TargetAddress = "RB043", |
| | | TargetAddress = carBody.CarType == 2 ? "RB043" : Outstation.stationChildCode, |
| | | Dispatchertime = DateTime.Now, |
| | | NextAddress = Outstation.stationChildCode, |
| | | OrderNo = null, |
| | | PalletCode = carBody.PalletCode, |
| | | PVI = carBody.PVI, |
| | | PVI = carBody.RFID, |
| | | SourceAddress = stockInfo.LocationCode, |
| | | CurrentAddress = stockInfo.LocationCode, |
| | | TaskState = (int)TaskOutStatusEnum.OutNew, |
| | |
| | | Creater = "System", |
| | | CreateDate = DateTime.Now, |
| | | TaskId = 0, |
| | | CarType = carBody.CarType, |
| | | RoadwayNo = stockInfo.RoadwayNo |
| | | }; |
| | | |
| | | // å建任å¡ä¼ è¾ç¨çDTO对象 |
| | |
| | | { |
| | | throw new InvalidOperationException("WMS IP æªé
ç½®"); |
| | | } |
| | | |
| | | |
| | | var tasks = new List<WMSTaskDTO>() { taskDTO }; |
| | | // åéä»»å¡è¯·æ±å°WMS |
| | |
| | | } |
| | | #endregion æå®ä»»å¡åºåº |
| | | |
| | | |
| | | /// <summary> |
| | | /// å建任å¡DTO |
| | | /// </summary> |
| | |
| | | Id = 0, |
| | | TaskType = task.TaskType, |
| | | pvi = task.PVI, |
| | | NextAddress = task.NextAddress |
| | | NextAddress = task.NextAddress, |
| | | CarType = task.CarType |
| | | |
| | | }; |
| | | } |
| | |
| | | { |
| | | // å建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); |
| | |
| | | DtLocationInfo locationinfo = new DtLocationInfo(); |
| | | if (carType == 1 || carType == 3) |
| | | { |
| | | locationinfo = dtLocationInfos.Where(x => x.LocationStatus == (int)LocationEnum.Free && x.EnalbeStatus == 1).OrderBy(x => x.Layer).ThenBy(x => x.Column).ThenBy(x => x.Row).FirstOrDefault(); |
| | | locationinfo = dtLocationInfos.Where(x => x.LocationStatus == (int)LocationEnum.Free && x.EnalbeStatus == 1).OrderBy(x => x.Column).ThenBy(x => x.Layer).ThenBy(x => x.Row).FirstOrDefault(); |
| | | } |
| | | else if (carType == 2) |
| | | { |
| | | locationinfo = dtLocationInfos.Where(x => x.LocationStatus == (int)LocationEnum.Free && x.EnalbeStatus == 1).OrderBy(x => x.Layer).ThenByDescending(x => x.Column).ThenBy(x => x.Row).FirstOrDefault(); |
| | | locationinfo = dtLocationInfos.Where(x => x.LocationStatus == (int)LocationEnum.Free && x.EnalbeStatus == 1).OrderByDescending(x => x.Column).ThenBy(x => x.Layer).ThenBy(x => x.Row).FirstOrDefault(); |
| | | } |
| | | //else if (carType == 3) |
| | | //{ |
| | | // locationinfo = dtLocationInfos.Where(x => x.LocationStatus == (int)LocationEnum.Free && x.EnalbeStatus == 1).OrderBy(x => x.Column).ThenBy(x => x.Row).ThenBy(x => x.Layer).FirstOrDefault(); |
| | | //} |
| | | |
| | | return locationinfo; |
| | | } |
| | | |
| | |
| | | .editorconfig = .editorconfig |
| | | EndProjectSection |
| | | EndProject |
| | | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WIDESEA_StoragIntegrationServices", "WIDESEA_StoragIntegrationServices\WIDESEA_StoragIntegrationServices.csproj", "{55326F38-372A-4606-B7FB-8C01BBAEC4FC}" |
| | | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WIDESEA_StoragIntegrationServices", "WIDESEA_StoragIntegrationServices\WIDESEA_StoragIntegrationServices.csproj", "{55326F38-372A-4606-B7FB-8C01BBAEC4FC}" |
| | | EndProject |
| | | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WIDESEA_IStoragIntegrationServices", "WIDESEA_IStoragIntegrationServices\WIDESEA_IStoragIntegrationServices.csproj", "{94D572FA-810E-4897-B673-AF988FD4019E}" |
| | | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WIDESEA_IStoragIntegrationServices", "WIDESEA_IStoragIntegrationServices\WIDESEA_IStoragIntegrationServices.csproj", "{94D572FA-810E-4897-B673-AF988FD4019E}" |
| | | EndProject |
| | | Global |
| | | GlobalSection(SolutionConfigurationPlatforms) = preSolution |
| | |
| | | {986CA639-B3B4-4D4F-B12B-3D8FBA48B2B1} = {A73C1AFF-FF92-4825-B607-2E908077EBA4} |
| | | {4BDE58B2-5B2E-480B-932F-D63C2A7D557C} = {8498AA9D-CDC4-4FD2-81AE-DE6AD78F75ED} |
| | | {9912BD12-4CF7-4A91-8203-47C9C125004C} = {8498AA9D-CDC4-4FD2-81AE-DE6AD78F75ED} |
| | | {9BA96018-EF8A-4D84-8E72-DA697FA5EAF8} = {8498AA9D-CDC4-4FD2-81AE-DE6AD78F75ED} |
| | | {55326F38-372A-4606-B7FB-8C01BBAEC4FC} = {8498AA9D-CDC4-4FD2-81AE-DE6AD78F75ED} |
| | | {94D572FA-810E-4897-B673-AF988FD4019E} = {A73C1AFF-FF92-4825-B607-2E908077EBA4} |
| | | EndGlobalSection |
| | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 请æ±å
¥åºå··é |
| | | /// </summary> |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | [HttpPost, Route("RequestEmptyInboundRoadWayNo"), AllowAnonymous] |
| | | public WebResponseContent RequestEmptyInboundRoadWayNo([FromBody] RequestTaskDto input) |
| | | { |
| | | return _WCSService.RequestEmptyInboundRoadWayNo(input); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ¶è£
ç´éæ»è£
(ä¸´æ¶æ¹æ¡) |
| | | /// </summary> |
| | | /// <param name="input"></param> |
| | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// çè£
ç´éæ¶è£
(ä¸´æ¶æ¹æ¡) |
| | | /// </summary> |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | [HttpPost, Route("HZPassTZ"), AllowAnonymous] |
| | | public WebResponseContent HZPassTZ([FromBody] RequestTaskDto input) |
| | | { |
| | | return _WCSService.HZPassTZ(input); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ»è£
ç²¾æç¹ |
| | | /// </summary> |
| | | /// <param name="input"></param> |