已添加11个文件
已删除1个文件
已修改30个文件
| ¶Ô±ÈÐÂÎļþ |
| | |
| | |  |
| | | using Newtonsoft.Json; |
| | | using System.Net; |
| | | using System.Text; |
| | | using WIDESEA_Common.Log; |
| | | |
| | | namespace WIDESEA_Comm.Http |
| | | { |
| | | public class HttpHelperh |
| | | { |
| | | private const int Timeout = 60 * 1000; |
| | | |
| | | /// <summary> |
| | | /// postè¯·æ± |
| | | /// </summary> |
| | | /// <param name="url"></param> |
| | | /// <param name="parm">åæ°</param> |
| | | /// <param name="rquestName">æ¥å£åç§°,ç¨äºæ¥å¿åç±»</param> |
| | | /// <returns></returns> |
| | | public static string Post(string url, object parm, string rquestName = "") |
| | | { |
| | | HttpWebResponse response = null; |
| | | StreamReader resultReader = null; |
| | | string responseContent = string.Empty; |
| | | try |
| | | { |
| | | HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url); |
| | | request.Timeout = Timeout; |
| | | request.Method = "POST"; |
| | | request.ContentType = "application/json; charset=UTF-8"; |
| | | parm = parm ?? ""; |
| | | byte[] data = Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(parm)); |
| | | request.ContentLength = data.Length; |
| | | using (Stream newStream = request.GetRequestStream()) |
| | | { |
| | | newStream.Write(data, 0, data.Length); |
| | | }; |
| | | |
| | | response = (HttpWebResponse)request.GetResponse(); |
| | | Stream webStream = response.GetResponseStream(); |
| | | if (webStream == null) |
| | | { |
| | | throw new Exception("Network error"); |
| | | } |
| | | |
| | | int statsCode = (int)response.StatusCode; |
| | | resultReader = new StreamReader(webStream, Encoding.UTF8); |
| | | responseContent = resultReader.ReadToEnd(); |
| | | |
| | | if (response != null) |
| | | response.Close(); |
| | | if (resultReader != null) |
| | | resultReader.Close(); |
| | | |
| | | if (statsCode != 200) |
| | | { |
| | | throw new Exception("å¼å¸¸ï¼ååºç ï¼" + statsCode.ToString()); |
| | | } |
| | | |
| | | //WriteLog.Write_Log("System/API请æ±", rquestName, "è¯·æ±æå", new { è¯·æ±æ¥æ = parm, æ¥æ¶æ¥æ = responseContent }); |
| | | return responseContent; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | WriteLog.Write_Log("System/API请æ±", rquestName, "请æ±å¼å¸¸", new { è¯·æ±æ¥æ = parm, æ¥æ¶æ¥æ = responseContent, é误 = ex.Message }); |
| | | throw ex; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// postè¯·æ± |
| | | /// </summary> |
| | | /// <param name="url"></param> |
| | | /// <param name="parm">åæ°</param> |
| | | /// <param name="rquestName">æ¥å£åç§°,ç¨äºæ¥å¿åç±»</param> |
| | | /// <returns></returns> |
| | | public static T Post<T>(string url, object parm, string rquestName = "") where T : class |
| | | { |
| | | HttpWebResponse response = null; |
| | | StreamReader resultReader = null; |
| | | string responseContent = string.Empty; |
| | | try |
| | | { |
| | | HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url); |
| | | request.Timeout = Timeout; |
| | | request.Method = "POST"; |
| | | request.ContentType = "application/json; charset=UTF-8"; |
| | | parm = parm ?? ""; |
| | | byte[] data = Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(parm)); |
| | | request.ContentLength = data.Length; |
| | | using (Stream newStream = request.GetRequestStream()) |
| | | { |
| | | newStream.Write(data, 0, data.Length); |
| | | }; |
| | | |
| | | response = (HttpWebResponse)request.GetResponse(); |
| | | Stream webStream = response.GetResponseStream(); |
| | | if (webStream == null) |
| | | { |
| | | throw new Exception("Network error"); |
| | | } |
| | | |
| | | int statsCode = (int)response.StatusCode; |
| | | resultReader = new StreamReader(webStream, Encoding.UTF8); |
| | | responseContent = resultReader.ReadToEnd(); |
| | | |
| | | if (response != null) |
| | | response.Close(); |
| | | if (resultReader != null) |
| | | resultReader.Close(); |
| | | |
| | | if (statsCode != 200) |
| | | { |
| | | throw new Exception("å¼å¸¸ï¼ååºç ï¼" + statsCode.ToString()); |
| | | } |
| | | |
| | | //WriteLog.Write_Log("System/API请æ±", rquestName, "è¯·æ±æå", new { è¯·æ±æ¥æ = parm, æ¥æ¶æ¥æ = responseContent }); |
| | | return JsonConvert.DeserializeObject<T>(responseContent); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | WriteLog.Write_Log("System/API请æ±", rquestName, "请æ±å¼å¸¸", new { è¯·æ±æ¥æ = parm, æ¥æ¶æ¥æ = responseContent, é误 = ex.Message }); |
| | | throw ex; |
| | | } |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// getè¯·æ± |
| | | /// </summary> |
| | | /// <typeparam name="T"></typeparam> |
| | | /// <param name="url"></param> |
| | | /// <param name="parm">请æ±åæ°ï¼æ·»å å¨url</param> |
| | | /// <param name="rquestName"></param> |
| | | /// <returns></returns> |
| | | public static T Get<T>(string url, object parm = null, string rquestName = "") where T : class |
| | | { |
| | | HttpWebResponse response = null; |
| | | StreamReader resultReader = null; |
| | | string responseContent = string.Empty; |
| | | try |
| | | { |
| | | if (parm != null) |
| | | { |
| | | var datas = JsonConvert.DeserializeObject<Dictionary<string, string>>(JsonConvert.SerializeObject(parm)); |
| | | var keyList = datas.Keys; |
| | | int index = 0; |
| | | foreach (var key in datas.Keys) |
| | | { |
| | | if (index == 0) |
| | | { |
| | | url += $"?{key}={datas[key]}"; |
| | | } |
| | | else |
| | | { |
| | | url += $"&{key}={datas[key]}"; |
| | | } |
| | | index++; |
| | | } |
| | | } |
| | | HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url); |
| | | request.Timeout = Timeout; |
| | | request.Method = "GET"; |
| | | request.ContentType = "application/json; charset=UTF-8"; |
| | | |
| | | response = (HttpWebResponse)request.GetResponse(); |
| | | Stream webStream = response.GetResponseStream(); |
| | | if (webStream == null) |
| | | { |
| | | throw new Exception("Network error"); |
| | | } |
| | | |
| | | int statsCode = (int)response.StatusCode; |
| | | resultReader = new StreamReader(webStream, Encoding.UTF8); |
| | | responseContent = resultReader.ReadToEnd(); |
| | | |
| | | if (response != null) |
| | | response.Close(); |
| | | if (resultReader != null) |
| | | resultReader.Close(); |
| | | |
| | | if (statsCode != 200) |
| | | { |
| | | throw new Exception("å¼å¸¸ï¼ååºç ï¼" + statsCode.ToString()); |
| | | } |
| | | |
| | | WriteLog.Write_Log("System/API请æ±", rquestName, "è¯·æ±æå", new { è¯·æ±æ¥æ = parm, æ¥æ¶æ¥æ = responseContent }); |
| | | return JsonConvert.DeserializeObject<T>(responseContent); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | WriteLog.Write_Log("System/API请æ±", rquestName, "请æ±å¼å¸¸", new { è¯·æ±æ¥æ = parm, æ¥æ¶æ¥æ = responseContent, é误 = ex.Message }); |
| | | throw ex; |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | |
| | | public enum TaskInStatusEnum |
| | | { |
| | | /// <summary> |
| | | /// æ°å»ºå
¥åºä»»å¡ |
| | | /// </summary> |
| | | [Description("æ°å»ºå
¥åºä»»å¡")] |
| | | InNew = 200, |
| | | |
| | | /// <summary> |
| | | /// è¾é线å
¥åºæ§è¡ä¸ |
| | | /// </summary> |
| | | [Description("è¾é线å
¥åºæ§è¡ä¸")] |
| | |
| | | /// </summary> |
| | | [Description("è¾é线è¾é宿")] |
| | | Line_InFinish = 220, |
| | | |
| | | /// <summary> |
| | | /// å åæºå¾
æ§è¡ |
| | | /// </summary> |
| | | [Description("å åæºå¾
æ§è¡")] |
| | | SC_Execute = 225, |
| | | |
| | | /// <summary> |
| | | /// å åæºå
¥åºæ§è¡ä¸ |
| | |
| | | [Description("è¾é线è¾é宿")] |
| | | Line_OutFinish = 125, |
| | | |
| | | ///// <summary> |
| | | ///// AGVåºåºæ§è¡ä¸ |
| | | ///// </summary> |
| | | //[Description("AGVåºåºæ§è¡ä¸")] |
| | | //AGV_OutExecuting = 130, |
| | | |
| | | ///// <summary> |
| | | ///// AGVåºåºå®æ |
| | | ///// </summary> |
| | | //[Description("AGVæ¬è¿å®æ")] |
| | | //AGV_OutFinish = 135, |
| | | |
| | | |
| | | /// <summary> |
| | | /// åºåºä»»å¡å®æ |
| | | /// </summary> |
| | |
| | | { |
| | | public class WMSTaskDTO |
| | | { |
| | | public int Id { get; set; } |
| | | /// <summary> |
| | | /// WMSä»»å¡ä¸»é® |
| | | /// </summary> |
| | | public int Id { get; set; } |
| | | public int TaskId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä»»å¡å· |
| | |
| | | public int TaskType { get; set; } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public string CurrentAddress { get; set; } |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public string NextAddress { get; set; } |
| | | /// <summary> |
| | | /// ä»»å¡ç¶æ |
| | | /// </summary> |
| | | public int TaskStatus { get; set; } |
| | |
| | | /// </summary> |
| | | public int Grade { get; set; } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public int WarehouseId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä»»å¡ç» |
| | | /// |
| | | /// </summary> |
| | | public string GroupId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä»»å¡ç©æé¿åº¦ |
| | | /// </summary> |
| | | public int TaskLength { get; set; } |
| | | |
| | | public string AGVArea { get; set; } |
| | | |
| | | public int PalletType { get; set; } |
| | | /// <summary> |
| | | /// AGVä»»å¡å· |
| | | /// |
| | | /// </summary> |
| | | public string AGVTaskNum { get; set; } |
| | | public int PalletType { get; set; } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public string CurrentAddress { get; set; } |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public string NextAddress { get; set; } |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public int Depth { get; set; } |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public string OrderNo { get; set; } |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public int SourceKey { get; set; } |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public DateTime Dispatchertime { get; set; } |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public int MaterialType { get; set; } |
| | | |
| | | public string MEStaskId { get; set; } |
| | | public string MESbusinessId { get; set; } |
| | | public string MESsubPalletCode { get; set; } |
| | | |
| | | } |
| | | } |
| | |
| | | /// <param name="deviceNo">设å¤ç¼å·</param> |
| | | /// <param name="outStationCodes">å½åå°å</param> |
| | | /// <returns>è¿åä»»å¡å®ä½å¯¹è±¡éåï¼å¯è½ä¸ºnull</returns> |
| | | List<Dt_Task> QueryStackerCraneOutTasks(string deviceNo, List<string> outStationCodes); |
| | | List<Dt_Task> QueryStackerCraneOutTasks(string deviceNo); |
| | | |
| | | |
| | | /// <summary> |
| | |
| | | /// <param name="taskNum">ä»»å¡å·</param> |
| | | /// <returns>è¿åå¤çç»æ</returns> |
| | | WebResponseContent RollbackTaskStatusToLast(int taskNum); |
| | | |
| | | //æ¥æ¾2楼å
¥åºä»»å¡ |
| | | Dt_Task GetTaskIninfo(string Pallat); |
| | | |
| | | WebResponseContent UpdateTaskIninfo(string Pallat,int TaskNo); |
| | | |
| | | /// <summary> |
| | | /// 夿æµ
è´§ä½æ¯å¦æä»»å¡ |
| | | /// </summary> |
| | | /// <param name="deviceNo"></param> |
| | | /// <param name="SourceAddress"></param> |
| | | /// <returns></returns> |
| | | Dt_Task QueryStationIsOccupiedOutTasks(string deviceNo, string LocaAddress); |
| | | |
| | | /// <summary> |
| | | /// æ ¹æ®æ·±åºä½åwmsç³è¯·å¤ææµ
åºä½æ¯å¦æè´§ï¼æ¯å¦éè¦è¿è¡ç§»åºæä½ |
| | | /// </summary> |
| | | /// <param name="palletCode">æçå·</param> |
| | | /// <param name="sourceAddress">èµ·å§å°å</param> |
| | | /// <returns></returns> |
| | | Dt_Task RequestWMSTaskMovelibrary(Dt_Task _Task); |
| | | } |
| | | } |
| | |
| | | [ExporterHeader(DisplayName = "夿³¨")] |
| | | [SugarColumn(IsNullable = true, Length = 255, ColumnDescription = "夿³¨")] |
| | | public string Remark { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 深度 |
| | | /// </summary> |
| | | [ImporterHeader(Name = "深度")] |
| | | [ExporterHeader(DisplayName = "深度")] |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "深度")] |
| | | public int Depth { get; set; } |
| | | |
| | | /// <summary> |
| | | /// MESä»»å¡id |
| | | /// </summary> |
| | | [ImporterHeader(Name = "MESä»»å¡id")] |
| | | [ExporterHeader(DisplayName = "MESä»»å¡id")] |
| | | [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "MESä»»å¡id")] |
| | | public string MEStaskId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// MESä¸å¡æµid |
| | | /// </summary> |
| | | [ImporterHeader(Name = "MESä¸å¡æµid")] |
| | | [ExporterHeader(DisplayName = "MESä¸å¡æµid")] |
| | | [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "MESä¸å¡æµid")] |
| | | public string MESbusinessId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æçç¼å·åæ |
| | | /// </summary> |
| | | [ImporterHeader(Name = "æçç¼å·åæ")] |
| | | [ExporterHeader(DisplayName = "æçç¼å·åæ")] |
| | | [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "æçç¼å·åæ")] |
| | | public string MESsubPalletCode { get; set; } |
| | | } |
| | | } |
| | |
| | | builder.Services.AddAllOptionRegister();//读åé
ç½®æä»¶ |
| | | builder.Services.AddMemoryCacheSetup();//ç¼å |
| | | builder.Services.AddSqlsugarSetup();//SqlSugar å¯å¨æå¡ |
| | | builder.Services.AddHostedService<SeedDataHostedService>();//åå§åæ°æ®åº |
| | | //builder.Services.AddHostedService<SeedDataHostedService>();//åå§åæ°æ®åº |
| | | |
| | | builder.Services.AddDbSetup();//Db å¯å¨æå¡ |
| | | |
| | |
| | | { |
| | | "urls": "http://*:9291", //webæå¡ç«¯å£ï¼å¦æç¨IISé¨ç½²ï¼æè¿ä¸ªå»æ |
| | | "Logging": { |
| | | "LogLevel": { |
| | | "Default": "Information", |
| | | "Microsoft.AspNetCore": "Warning" |
| | | } |
| | | }, |
| | | "dics": "deviceType,devicePlcType,jobAssembly,jobClassName,deviceStatus,taskType,taskState,inOutType", |
| | | "AllowedHosts": "*", |
| | | "ConnectionStringsEncryption": false, |
| | | "MainDB": "DB_WIDESEA", //å½å项ç®ç主åºï¼æå¯¹åºçè¿æ¥å符串çEnabledå¿
须为true |
| | | //1.MySql |
| | | //2.SqlServer |
| | | //3.Sqlite |
| | | //4.Oracle |
| | | //5.PostgreSQL |
| | | "DBType": "SqlServer", |
| | | //è¿æ¥å符串 |
| | | "ConnectionString": "Data Source=.;Initial Catalog=WIDESEAWCS_SYLK;User ID=sa;Password=sa123456;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False", |
| | | //è·¨å |
| | | "Cors": { |
| | | "PolicyName": "CorsIpAccess", //çç¥åç§° |
| | | "EnableAllIPs": true, //å½ä¸ºtrueæ¶ï¼å¼æ¾ææIPåå¯è®¿é®ã |
| | | // æ¯æå¤ä¸ªåå端å£ï¼æ³¨æç«¯å£å·åä¸è¦å¸¦/ææï¼æ¯å¦localhost:8000/ï¼æ¯éç |
| | | // 注æï¼http://127.0.0.1:1818 å http://localhost:1818 æ¯ä¸ä¸æ ·ç |
| | | "IPs": "http://127.0.0.1:8080,http://localhost:8080" |
| | | }, |
| | | "ApiLogIgnore": "", //è®°å½æ¥å¿æ¶ï¼å¿½ç¥çAPIåç§°ï¼å¤ä¸ªç¨éå·åéï¼é
ç½®çä¸è®°å½å°æ°æ®åºä¸ |
| | | "ApiName": "WIDESEAWCS", |
| | | "ExpMinutes": 120, |
| | | "QuartzJobAutoStart": false, |
| | | "DBSeedEnable": false, |
| | | "QuartzDBSeedEnable": false, |
| | | "LogDeubgEnable": false, //æ¯å¦è®°å½è°è¯æ¥å¿ |
| | | "PrintSql": false, //æå°SQLè¯å¥ |
| | | "LogAOPEnable": false, //æ¯å¦è®°å½AOPæ¥å¿ |
| | | "WebSocketEnable": true, //æ¯å¦å¼å¯WebSocketæå¡ |
| | | "WebSocketPort": 9296, //WebSocketæå¡ç«¯å£ |
| | | "WMSApiAddress": "http://127.0.0.1:9290", //"http://127.0.0.1:9283",æ£å¼ç¯å¢å°å |
| | | "FeedBackWMSTaskCompleted": "http://127.0.0.1:9290/api/Task/InboundTaskCompleted" |
| | | "urls": "http://*:9291", //webæå¡ç«¯å£ï¼å¦æç¨IISé¨ç½²ï¼æè¿ä¸ªå»æ |
| | | "Logging": { |
| | | "LogLevel": { |
| | | "Default": "Information", |
| | | "Microsoft.AspNetCore": "Warning" |
| | | } |
| | | }, |
| | | "dics": "deviceType,devicePlcType,jobAssembly,jobClassName,deviceStatus,taskType,taskState,inOutType", |
| | | |
| | | "urlWMSMovelibraryTask": "http://10.50.11.65:8098/api/Task/IsRelocations", //请æ±ç§»åºæ¥å£ |
| | | "urlTaskCompleted": "http://10.50.11.65:8098/api/Task/TaskCompleted", //ä»»å¡åé¦ |
| | | |
| | | "AllowedHosts": "*", |
| | | "ConnectionStringsEncryption": false, |
| | | "MainDB": "DB_WIDESEA", //å½å项ç®ç主åºï¼æå¯¹åºçè¿æ¥å符串çEnabledå¿
须为true |
| | | //1.MySql |
| | | //2.SqlServer |
| | | //3.Sqlite |
| | | //4.Oracle |
| | | //5.PostgreSQL |
| | | "DBType": "SqlServer", |
| | | //è¿æ¥å符串 |
| | | "ConnectionString": "Data Source=.;Initial Catalog=SY_WIDESEAWCS_SYLK;User ID=sa;Password=123456;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False", |
| | | //è·¨å |
| | | "Cors": { |
| | | "PolicyName": "CorsIpAccess", //çç¥åç§° |
| | | "EnableAllIPs": true, //å½ä¸ºtrueæ¶ï¼å¼æ¾ææIPåå¯è®¿é®ã |
| | | // æ¯æå¤ä¸ªåå端å£ï¼æ³¨æç«¯å£å·åä¸è¦å¸¦/ææï¼æ¯å¦localhost:8000/ï¼æ¯éç |
| | | // 注æï¼http://127.0.0.1:1818 å http://localhost:1818 æ¯ä¸ä¸æ ·ç |
| | | "IPs": "http://127.0.0.1:8080,http://localhost:8080" |
| | | }, |
| | | "ApiLogIgnore": "", //è®°å½æ¥å¿æ¶ï¼å¿½ç¥çAPIåç§°ï¼å¤ä¸ªç¨éå·åéï¼é
ç½®çä¸è®°å½å°æ°æ®åºä¸ |
| | | "ApiName": "WIDESEAWCS", |
| | | "ExpMinutes": 120, |
| | | "QuartzJobAutoStart": false, |
| | | "DBSeedEnable": false, |
| | | "QuartzDBSeedEnable": false, |
| | | "LogDeubgEnable": false, //æ¯å¦è®°å½è°è¯æ¥å¿ |
| | | "PrintSql": false, //æå°SQLè¯å¥ |
| | | "LogAOPEnable": false, //æ¯å¦è®°å½AOPæ¥å¿ |
| | | "WebSocketEnable": true, //æ¯å¦å¼å¯WebSocketæå¡ |
| | | "WebSocketPort": 9296, //WebSocketæå¡ç«¯å£ |
| | | "WMSApiAddress": "http://127.0.0.1:9290", //"http://127.0.0.1:9283",æ£å¼ç¯å¢å°å |
| | | "FeedBackWMSTaskCompleted": "http://127.0.0.1:9290/api/Task/InboundTaskCompleted" |
| | | } |
| | |
| | | using OfficeOpenXml.FormulaParsing.Excel.Functions.RefAndLookup; |
| | | using SqlSugar; |
| | | using System.Diagnostics.CodeAnalysis; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Comm.Http; |
| | | using WIDESEAWCS_Common.TaskEnum; |
| | | using WIDESEAWCS_Core; |
| | | using WIDESEAWCS_Core.BaseRepository; |
| | |
| | | private readonly IRepository<Dt_Router> _routerRepository; |
| | | private readonly IRepository<Dt_StationManger> _stationMangerRepository; |
| | | private readonly IMapper _mapper; |
| | | |
| | | |
| | | private Dictionary<string, OrderByType> _taskOrderBy = new() |
| | | { |
| | |
| | | public List<int> TaskInboundTypes => typeof(TaskInboundTypeEnum).GetEnumIndexList(); |
| | | |
| | | public List<int> TaskOutboundTypes => typeof(TaskOutboundTypeEnum).GetEnumIndexList(); |
| | | |
| | | public string urlWMSMovelibraryTask = WIDESEAWCS_Core.Helper.AppSettings.Configuration["urlWMSMovelibraryTask"]; |
| | | public string urlTaskCompleted = WIDESEAWCS_Core.Helper.AppSettings.Configuration["urlTaskCompleted"]; |
| | | |
| | | /// <summary> |
| | | /// ä»å¨å±(æ°æ®åºè®¿é®) |
| | |
| | | continue; |
| | | } |
| | | Dt_Task task = _mapper.Map<Dt_Task>(item); |
| | | task.TaskState = item.TaskStatus; |
| | | |
| | | |
| | | Dt_Router? router; |
| | | |
| | | TaskTypeGroup taskTypeGroup = item.TaskType.GetTaskTypeGroup(); |
| | | Dt_StationManger? stationManger; |
| | | if (taskTypeGroup == TaskTypeGroup.InboundGroup) |
| | | { |
| | | task.Creater = "WMS"; |
| | | task.TaskState = (int)TaskStatusEnum.New.ObjToInt(); |
| | | stationManger = stationMangers.FirstOrDefault(x => x.StationCode == item.CurrentAddress || x.StationDeviceCode == item.SourceAddress); |
| | | task.DeviceCode = stationManger.StationDeviceCode; |
| | | } |
| | | else |
| | | { |
| | | stationManger = stationMangers.FirstOrDefault(x => x.StationCode == item.NextAddress || x.StationDeviceCode == item.NextAddress); |
| | | task.DeviceCode = stationManger.StationDeviceCode; |
| | | List<Dt_Router> routers = routersAll.Where(x => x.InOutType == RouterInOutType.Out && (item.NextAddress == x.StartPosi || item.RoadWay == x.StartPosi /*|| item.RoadWay == x.ChildPosiDeviceCode || item.RoadWay == x.ChildPosi*/)).ToList(); |
| | | router = routers.FirstOrDefault(); |
| | | if (router == null) |
| | | { |
| | | return WebResponseContent.Instance.Error($"æªæ¾å°è·¯ç±é
置信æ¯"); |
| | | } |
| | | //task.NextAddress = stationManger.StackerCraneStationCode; |
| | | task.TargetAddress = router.NextPosi; |
| | | //åºåº |
| | | } |
| | | tasks.Add(task); |
| | | } |
| | | BaseDal.AddData(tasks); |
| | |
| | | /// <returns></returns> |
| | | public Dt_Task QueryConveyorLineTask(string deviceNo, string currentAddress) |
| | | { |
| | | return BaseDal.QueryFirst(x => (TaskInboundTypes.Contains(x.TaskType) && x.TaskState == (int)TaskInStatusEnum.InNew || TaskOutboundTypes.Contains(x.TaskType) && x.TaskState == (int)TaskOutStatusEnum.SC_OutFinish) && x.CurrentAddress == currentAddress, TaskOrderBy); |
| | | return BaseDal.QueryFirst(x => (TaskInboundTypes.Contains(x.TaskType) && TaskOutboundTypes.Contains(x.TaskType) && x.TaskState == (int)TaskOutStatusEnum.SC_OutFinish) && x.CurrentAddress == currentAddress, TaskOrderBy); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | /// <returns></returns> |
| | | public Dt_Task? QuertStackerCraneTask(string deviceNo, TaskTypeGroup? taskTypeGroup = null) |
| | | { |
| | | if (taskTypeGroup == null) |
| | | return BaseDal.QueryFirst(x => x.DeviceCode == deviceNo && x.TaskState == (int)TaskInStatusEnum.InNew, TaskOrderBy); |
| | | if (taskTypeGroup.Value == TaskTypeGroup.InboundGroup) |
| | | return BaseDal.QueryFirst(x => x.DeviceCode == deviceNo && TaskInboundTypes.Contains(x.TaskType) && x.TaskState == (int)TaskInStatusEnum.SC_Execute, TaskOrderBy); |
| | | return BaseDal.QueryFirst(x => x.DeviceCode == deviceNo && TaskInboundTypes.Contains(x.TaskType), TaskOrderBy); |
| | | if (taskTypeGroup.Value == TaskTypeGroup.OutbondGroup) |
| | | return BaseDal.QueryFirst(x => x.DeviceCode == deviceNo && TaskOutboundTypes.Contains(x.TaskType) && x.TaskState == (int)TaskInStatusEnum.SC_Execute, TaskOrderBy); |
| | | return BaseDal.QueryFirst(x => x.DeviceCode == deviceNo && TaskOutboundTypes.Contains(x.TaskType) , TaskOrderBy); |
| | | return null; |
| | | } |
| | | /// <summary> |
| | |
| | | /// <returns>è¿åä»»å¡å®ä½å¯¹è±¡ï¼å¯è½ä¸ºnull</returns> |
| | | public Dt_Task QueryStackerCraneInTask(string deviceNo, string currentAddress = "") |
| | | { |
| | | if (string.IsNullOrEmpty(currentAddress)) |
| | | return BaseDal.QueryFirst(x => x.DeviceCode == deviceNo && x.TaskState == (int)TaskStatusEnum.SC_Execute, TaskOrderBy); |
| | | else |
| | | return BaseDal.QueryFirst(x => x.DeviceCode == deviceNo && TaskInboundTypes.Contains(x.TaskType) && x.TaskState == (int)TaskStatusEnum.SC_Execute && x.CurrentAddress == currentAddress, TaskOrderBy); |
| | | return BaseDal.QueryFirst(x => x.Roadway == deviceNo && x.TaskType== (int)TaskInboundTypeEnum.Inbound && x.TaskState == (int)TaskInStatusEnum.Line_InFinish, TaskOrderBy); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | /// <returns>è¿åä»»å¡å®ä½å¯¹è±¡ï¼å¯è½ä¸ºnull</returns> |
| | | public Dt_Task QueryStackerCraneOutTask(string deviceNo, string currentAddress = "") |
| | | { |
| | | if (string.IsNullOrEmpty(currentAddress)) |
| | | return BaseDal.QueryFirst(x => x.Roadway == deviceNo && TaskOutboundTypes.Contains(x.TaskType) && x.TaskState == (int)TaskOutStatusEnum.OutNew, TaskOrderBy); |
| | | else |
| | | return BaseDal.QueryFirst(x => x.Roadway == deviceNo && TaskOutboundTypes.Contains(x.TaskType) && x.TaskState == (int)TaskOutStatusEnum.OutNew && x.CurrentAddress == currentAddress, TaskOrderBy); |
| | | return BaseDal.QueryFirst(x => x.Roadway == deviceNo && x.TaskType==(int)TaskOutboundTypeEnum.Outbound && x.TaskState == (int)TaskOutStatusEnum.OutNew, TaskOrderBy); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | /// <param name="deviceNo">设å¤ç¼å·</param> |
| | | /// <param name="currentAddress">å½åå°å</param> |
| | | /// <returns>è¿åä»»å¡å®ä½å¯¹è±¡éåï¼å¯è½ä¸ºnull</returns> |
| | | public List<Dt_Task> QueryStackerCraneOutTasks(string deviceNo, List<string> outStationCodes) |
| | | public List<Dt_Task> QueryStackerCraneOutTasks(string deviceNo) |
| | | { |
| | | return BaseDal.QueryData(x => x.Roadway == deviceNo && TaskOutboundTypes.Contains(x.TaskType) && x.TaskState == (int)TaskOutStatusEnum.OutNew && outStationCodes.Contains(x.CurrentAddress), TaskOrderBy); |
| | | return BaseDal.QueryData(x => x.Roadway == deviceNo && x.TaskType == (int)TaskOutboundTypeEnum.Outbound && x.TaskState == (int)TaskOutStatusEnum.OutNew, TaskOrderBy); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | Dt_Task task = BaseDal.QueryFirst(x => x.TaskNum == taskNum); |
| | | if (task == null) return WebResponseContent.Instance.Error($"æªæ¾å°è¯¥ä»»å¡ä¿¡æ¯,ä»»å¡å·:ã{taskNum}ã"); |
| | | |
| | | if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup && task.TaskState == (int)TaskOutStatusEnum.SC_OutExecuting) |
| | | if (task.TaskType == (int)TaskOutboundTypeEnum.Outbound && task.TaskState == (int)TaskOutStatusEnum.SC_OutExecuting) |
| | | { |
| | | List<Dt_Router> 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"; |
| | | /*List<Dt_Router> routers = _routerService.QueryNextRoutes(task.NextAddress, task.TargetAddress); |
| | | if (!routers.Any()) return WebResponseContent.Instance.Error($"æªæ¾å°è®¾å¤è·¯ç±ä¿¡æ¯");*/ |
| | | task.TaskState = (int)TaskOutStatusEnum.OutFinish; |
| | | BaseDal.UpdateData(task); |
| | | |
| | | _taskExecuteDetailService.AddTaskExecuteDetail(task.TaskId, $"å åæºåºåºå®æ"); |
| | | |
| | | content = HttpHelperh.Get<WebResponseContent>($"{urlTaskCompleted}?TaskNum={task.TaskNum}&HowWorks=2"); |
| | | |
| | | task.ModifyDate = DateTime.Now; |
| | | BaseDal.DeleteData(task); |
| | | // _task_HtyService.AddTaskHty(task); éè¦æ·»å ç§»å
¥åå² |
| | | _taskExecuteDetailService.AddTaskExecuteDetail(task.TaskId, $"åºåºå®æ"); |
| | | //todo 忥å°WMS |
| | | WMSTaskDTO WMStask = _mapper.Map<WMSTaskDTO>(task); |
| | | HttpHelper.PostAsync(WMSInterfaceAddress.UpdateTaskStatus, WMStask.ToJson(), headers: new Dictionary<string, string>()); |
| | | |
| | | //æä¸èèå¤ä¸ªåºåºå£ |
| | | } |
| | | else if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.InboundGroup && task.TaskState == (int)TaskInStatusEnum.SC_InExecuting) |
| | | else if (task.TaskType == (int)TaskInboundTypeEnum.Inbound && task.TaskState == (int)TaskInStatusEnum.SC_InExecuting) |
| | | { |
| | | //todo |
| | | int nextStatus = task.TaskState.GetNextNotCompletedStatus<TaskInStatusEnum>(); |
| | | task.TaskState = nextStatus; |
| | | task.TaskState = (int)TaskInStatusEnum.InFinish; |
| | | BaseDal.UpdateData(task); |
| | | |
| | | content = HttpHelperh.Get<WebResponseContent>($"{urlTaskCompleted}?TaskNum={task.TaskNum}&HowWorks=2"); |
| | | |
| | | task.ModifyDate = DateTime.Now; |
| | | task.Modifier = "System"; |
| | | BaseDal.UpdateData(task); |
| | | _taskExecuteDetailService.AddTaskExecuteDetail(task.TaskId, $"å åæºå
¥åºå®æ"); |
| | | BaseDal.DeleteData(task); |
| | | // _task_HtyService.AddTaskHty(task); éè¦æ·»å ç§»å
¥åå² |
| | | _taskExecuteDetailService.AddTaskExecuteDetail(task.TaskId, $"å
¥åºå®æ"); |
| | | |
| | | WMSTaskDTO WMStask = _mapper.Map<WMSTaskDTO>(task); |
| | | |
| | | HttpHelper.PostAsync(WMSInterfaceAddress.UpdateTaskStatus, WMStask.ToJson(), headers: new Dictionary<string, string>()); |
| | | } |
| | | else if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.RelocationGroup && task.TaskState == (int)TaskRelocationStatusEnum.SC_RelocationFinish) |
| | | else if (task.TaskType == (int)TaskRelocationTypeEnum.Relocation) |
| | | { |
| | | int nextStatus = task.TaskState.GetNextNotCompletedStatus<TaskRelocationStatusEnum>(); |
| | | task.CurrentAddress = task.NextAddress; |
| | | task.NextAddress = string.Empty; |
| | | task.TaskState = nextStatus; |
| | | task.ModifyDate = DateTime.Now; |
| | | task.Modifier = "System"; |
| | | task.TaskState = (int)TaskRelocationStatusEnum.SC_RelocationFinish; |
| | | BaseDal.UpdateData(task); |
| | | _taskExecuteDetailService.AddTaskExecuteDetail(task.TaskId, $"å åæºç§»åºå®æ"); |
| | | WMSTaskDTO WMStask = _mapper.Map<WMSTaskDTO>(task); |
| | | //todo è°ç¨WMSç§»åºå®æ |
| | | HttpHelper.PostAsync(WMSInterfaceAddress.UpdateTaskStatus, WMStask.ToJson(), headers: new Dictionary<string, string>()); |
| | | |
| | | content = HttpHelperh.Get<WebResponseContent>($"{urlTaskCompleted}?TaskNum={task.TaskNum}&HowWorks=2"); |
| | | |
| | | |
| | | task.ModifyDate = DateTime.Now; |
| | | BaseDal.DeleteData(task); |
| | | // _task_HtyService.AddTaskHty(task); éè¦æ·»å ç§»å
¥åå² |
| | | _taskExecuteDetailService.AddTaskExecuteDetail(task.TaskId, $"ç§»åºå®æ"); |
| | | } |
| | | else if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OtherGroup) |
| | | { |
| | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | content = WebResponseContent.Instance.Error($"ä»»å¡å®æå¼å¸¸,ä»»å¡å·:ã{taskNum}ã"); |
| | | content = WebResponseContent.Instance.Error($"ä»»å¡å®æå¼å¸¸,ä»»å¡å·:ã{taskNum}ãï¼åå ï¼{ex.Message}"); |
| | | } |
| | | return content; |
| | | } |
| | |
| | | if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup) |
| | | { |
| | | task.TaskState = (int)TaskOutStatusEnum.OutNew; |
| | | } |
| | | else if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.InboundGroup) |
| | | { |
| | | task.TaskState = (int)TaskInStatusEnum.InNew; |
| | | } |
| | | //todo |
| | | } |
| | |
| | | } |
| | | return content; |
| | | } |
| | | |
| | | public Dt_Task GetTaskIninfo(string Pallat) |
| | | { |
| | | return BaseDal.QueryFirst(x => x.PalletCode == Pallat); |
| | | } |
| | | |
| | | public WebResponseContent UpdateTaskIninfo(string Pallat, int TaskNo) |
| | | { |
| | | try |
| | | { |
| | | Dt_Task task = BaseDal.QueryFirst(x => x.TaskNum == TaskNo && x.PalletCode == Pallat); |
| | | if (task != null) |
| | | { |
| | | task.TaskState = (int)TaskInStatusEnum.Line_InFinish; |
| | | BaseDal.UpdateData(task); |
| | | return WebResponseContent.Instance.OK(); |
| | | } |
| | | |
| | | return WebResponseContent.Instance.Error(); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return WebResponseContent.Instance.Error(); |
| | | throw; |
| | | } |
| | | } |
| | | |
| | | |
| | | public Dt_Task QueryStationIsOccupiedOutTasks(string deviceNo, string LocaAddress) |
| | | { |
| | | return BaseDal.QueryFirst(x => x.Roadway == deviceNo && (x.SourceAddress == LocaAddress || x.TargetAddress == LocaAddress), TaskOrderBy); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ ¹æ®æ·±åºä½åwmsç³è¯·å¤ææµ
åºä½æ¯å¦æè´§ï¼æ¯å¦éè¦è¿è¡ç§»åºæä½ |
| | | /// </summary> |
| | | /// <param name="palletCode">æçå·</param> |
| | | /// <param name="sourceAddress">èµ·å§å°å</param> |
| | | /// <returns></returns> |
| | | public Dt_Task RequestWMSTaskMovelibrary(Dt_Task _Task) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | |
| | | content = HttpHelperh.Get<WebResponseContent>($"{urlWMSMovelibraryTask}?TaskNum={_Task.TaskNum}"); |
| | | Dt_Task task = new Dt_Task(); |
| | | if (content.Status) |
| | | { |
| | | if (content.Data != null) |
| | | { |
| | | task = JsonConvert.DeserializeObject<Dt_Task>(content.Data.ToString()); |
| | | if (task.TaskNum != _Task.TaskNum) |
| | | { |
| | | task.Grade = 3; |
| | | BaseDal.AddData(task); |
| | | return task; |
| | | } |
| | | else |
| | | { |
| | | return _Task; |
| | | } |
| | | } |
| | | } |
| | | return null; |
| | | |
| | | } |
| | | } |
| | | } |
| | |
| | | using Microsoft.AspNetCore.Routing; |
| | | using Quartz; |
| | | using SqlSugar; |
| | | using System.Threading.Tasks; |
| | | using WIDESEAWCS_Common; |
| | | using WIDESEAWCS_Common.Helper; |
| | | using WIDESEAWCS_Common.TaskEnum; |
| | |
| | | private readonly IRouterService _routerService; |
| | | private readonly IRepository<Dt_Task> _taskRepository; |
| | | private readonly IRepository<Dt_StationManger> _stationMangerRepository; |
| | | |
| | | |
| | | public CommonConveyorLineJob(ICacheService cacheService, ITaskService taskService, ITaskExecuteDetailService taskExecuteDetailService, IRepository<Dt_StationManger> stationMangerRepository, IRepository<Dt_Task> taskRepository, IRouterRepository routerRepository, IRouterService routerService) |
| | | { |
| | |
| | | } |
| | | } |
| | | //åºå
¥åºç«å° |
| | | if (item.StationType == StationTypeEnum.StationType_InboundAndOutbound.ObjToInt()) |
| | | else if (item.StationType == StationTypeEnum.StationType_InboundAndOutbound.ObjToInt()) |
| | | { |
| | | //å
¥åºçæå åæºå
¥åºä»»å¡ |
| | | if (conveyorLineSignalRead.STB && conveyorLineStatus.Online && conveyorLineStatus.Goods && !conveyorLineStatus.Alarm && !ACK) |
| | | { |
| | | if (conveyorLineInfoRead.TaskNo == 0 && !string.IsNullOrEmpty(conveyorLineInfoRead.Barcode))//éè´å
¥åº |
| | | if (conveyorLineInfoRead.TaskNo != 0 && !string.IsNullOrEmpty(conveyorLineInfoRead.Barcode))//éè´å
¥åº |
| | | { |
| | | WebResponseContent content = _taskService.RequestWMSTaskSimple(conveyorLineInfoRead.Barcode, item.StationCode); |
| | | if (content.Status) |
| | | WebResponseContent contentweb = _taskService.UpdateTaskIninfo(conveyorLineInfoRead.Barcode, conveyorLineInfoRead.TaskNo); |
| | | if (contentweb.Status) |
| | | { |
| | | Dt_Task task = _taskRepository.QueryFirst(x => x.PalletCode == conveyorLineInfoRead.Barcode && x.CurrentAddress == item.StationCode && x.DeviceCode == device.DeviceCode && x.TaskState == (int)TaskStatusEnum.New.ObjToInt()); |
| | | if (task != null) |
| | | { |
| | | _taskService.UpdateTask(task, TaskStatusEnum.SC_Execute, deviceCode: item.StackerCraneCode, sourceAddress: item.StackerCraneStationCode); |
| | | device.SetValue(W_ConveyorLineDB.ACK, true, item.StationCode); |
| | | device.SetValue(W_ConveyorLineDB.TaskNo, 1111, item.StationCode); |
| | | //_taskService.UpdateTask(task, TaskStatusEnum.RGV_NEW); |
| | | } |
| | | |
| | | device.SetValue(W_ConveyorLineDB.ACK, true, item.StationCode); |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | } |
| | | //å
¥åºç«å° |
| | | if (item.StationType == StationTypeEnum.StationType_OnlyInbound.ObjToInt()) |
| | | else if (item.StationType == StationTypeEnum.StationType_OnlyInbound.ObjToInt()) |
| | | { |
| | | if (conveyorLineSignalRead.STB && conveyorLineStatus.Online && conveyorLineStatus.Goods && !conveyorLineStatus.Alarm && !ACK) |
| | | { |
| | | if (conveyorLineInfoRead.TaskNo == 0 && !string.IsNullOrEmpty(conveyorLineInfoRead.Barcode))//éè´å
¥åº |
| | | { |
| | | device.SetValue(W_ConveyorLineDB.ACK, true, item.StationCode); |
| | | device.SetValue(W_ConveyorLineDB.EndPos, 2020, item.StationCode); |
| | | device.SetValue(W_ConveyorLineDB.TaskNo, 1111, item.StationCode); |
| | | Dt_Task dt_Ta = _taskService.GetTaskIninfo(conveyorLineInfoRead.Barcode); |
| | | if(dt_Ta != null) |
| | | { |
| | | device.SetValue(W_ConveyorLineDB.ACK, true, item.StationCode); |
| | | device.SetValue(W_ConveyorLineDB.EndPos, dt_Ta.SourceAddress, item.StationCode); |
| | | device.SetValue(W_ConveyorLineDB.TaskNo, dt_Ta.TaskNum, item.StationCode); |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | } |
| | | |
| | | |
| | | catch (Exception) |
| | | catch (Exception ex) |
| | | { |
| | | } |
| | | |
| | |
| | | { |
| | | var TaskNum = speStackerCrane.GetValue<StackerCraneDBName, Int32>(StackerCraneDBName.CurrentTaskNum); |
| | | WriteInfo("å åæºä»»å¡å®æ", $"ä»»å¡å·:{TaskNum}"); |
| | | StackerCraneTaskCompleted(e.TaskNum, speStackerCrane.DeviceCode); |
| | | _taskService.StackCraneTaskCompleted(e.TaskNum); |
| | | WriteInfo("å åæºä»»å¡å®æåé¦ä»»å¡å·", $"ä»»å¡ä¿¡æ¯,ä»»å¡å·:{e.TaskNum}"); |
| | | speStackerCrane.SetValue(StackerCraneDBName.WorkType, 5); |
| | | } |
| | | } |
| | | } |
| | | public WebResponseContent StackerCraneTaskCompleted(int taskNum, string deviceCode) |
| | | { |
| | | try |
| | | { |
| | | Dt_Task task = _taskRepository.QueryFirst(x => x.TaskNum == taskNum); |
| | | if (task != null) |
| | | { |
| | | if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup) |
| | | { |
| | | Dt_StationManger stationManger = _stationMangerRepository.QueryFirst(x => x.StackerCraneStationCode == task.NextAddress && x.StackerCraneCode == deviceCode); |
| | | if (stationManger == null) |
| | | { |
| | | //_taskExecuteDetailService.AddTaskExecuteDetail(taskNum, $"è¾é线åºåºç«ç¹æªé
ç½®,{task.NextAddress}"); |
| | | _taskService.UpdateTaskExceptionMessage(taskNum, $"è¾é线åºåºç«ç¹æªé
ç½®,{task.NextAddress}"); |
| | | WriteError(deviceCode, $"è¾é线åºåºç«ç¹æªé
ç½®,{task.NextAddress}"); |
| | | return WebResponseContent.Instance.Error($"è¾é线åºåºç«ç¹æªé
ç½®,{task.NextAddress}"); |
| | | } |
| | | Dt_Router router = _routerRepository.QueryFirst(x => x.InOutType == task.TaskType && x.StartPosi == stationManger.StationCode); |
| | | if (router == null) |
| | | { |
| | | router = _routerRepository.QueryFirst(x => x.ChildPosi == deviceCode && x.ChildPosiDeviceCode == stationManger.StationDeviceCode && x.NextPosi == stationManger.StationCode && x.InOutType == task.TaskType && x.IsEnd); |
| | | if (router != null && router.IsEnd) |
| | | { |
| | | _taskService.TaskCompleted(taskNum); |
| | | } |
| | | else |
| | | { |
| | | _taskService.UpdateTaskExceptionMessage(taskNum, $"æªæ¾å°è·¯ç±ä¿¡æ¯,{task.NextAddress}"); |
| | | WriteError(deviceCode, $"æªæ¾å°è·¯ç±ä¿¡æ¯,{task.NextAddress}"); |
| | | return WebResponseContent.Instance.Error($"æªæ¾å°è·¯ç±ä¿¡æ¯,{task.NextAddress}"); |
| | | } |
| | | } |
| | | if (task.TargetAddress.Contains("1030") || task.TargetAddress.Contains("1026")) //èªå¨ä¸çº¿ |
| | | { |
| | | _taskService.UpdateTask(task, TaskStatusEnum.Line_Execute, deviceCode: stationManger.StationDeviceCode, currentAddress: router.NextPosi); |
| | | } |
| | | |
| | | } |
| | | else if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.InboundGroup || task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.RelocationGroup) |
| | | { |
| | | _taskService.TaskCompleted(taskNum); |
| | | } |
| | | else |
| | | { |
| | | WriteError(deviceCode, $"æªæ¾å°è¯¥ä»»å¡ç±»ååè°WMSä»»å¡å®ææ¥å£,{task.TaskType}"); |
| | | _taskService.UpdateTaskExceptionMessage(taskNum, $"æªæ¾å°è¯¥ä»»å¡ç±»ååè°WMSä»»å¡å®ææ¥å£,{task.TaskType}"); |
| | | } |
| | | |
| | | } |
| | | else |
| | | { |
| | | WriteError(deviceCode, $"æªæ¾å°ä»»å¡ä¿¡æ¯,ä»»å¡å·:{taskNum}"); |
| | | return WebResponseContent.Instance.Error($"æªæ¾å°ä»»å¡ä¿¡æ¯,ä»»å¡å·:{taskNum}"); |
| | | } |
| | | |
| | | return WebResponseContent.Instance.OK(); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | WriteError(deviceCode, $"ä»»å¡å®æé误", ex); |
| | | return WebResponseContent.Instance.Error(ex.Message); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// è·åä»»å¡ |
| | | /// </summary> |
| | |
| | | { |
| | | Dt_Task? task; |
| | | |
| | | //å åæºæ§è¡ä¸ |
| | | if (_taskRepository.QueryFirst(x => x.DeviceCode == commonStackerCrane.DeviceCode && x.TaskState == TaskStatusEnum.SC_Executing.ObjToInt()) != null) |
| | | { |
| | | return null; |
| | | } |
| | | if (commonStackerCrane.LastTaskType.GetValueOrDefault().GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup) |
| | | |
| | | task = _taskService.QueryStackerCraneInTask(commonStackerCrane.DeviceCode); //è·åå
¥åºä»»å¡ |
| | | if(task != null) |
| | | { |
| | | task = _taskService.QueryStackerCraneInTask(commonStackerCrane.DeviceCode); |
| | | if (task == null) |
| | | { |
| | | task = _taskService.QueryStackerCraneOutTask(commonStackerCrane.DeviceCode); |
| | | } |
| | | return task; //妿æä»»å¡åç´æ¥ä¸åç»å åæº |
| | | } |
| | | else |
| | | { |
| | | task = _taskService.QueryStackerCraneOutTask(commonStackerCrane.DeviceCode); |
| | | if (task == null) |
| | | //è¿è¡è·åå åæºåºåºä»»å¡ |
| | | List<Dt_Task> tasks = _taskService.QueryStackerCraneOutTasks(commonStackerCrane.DeviceCode); |
| | | foreach (var item in tasks) |
| | | { |
| | | task = _taskService.QueryStackerCraneInTask(commonStackerCrane.DeviceCode); |
| | | } |
| | | } |
| | | |
| | | |
| | | if (task != null && task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup) |
| | | { |
| | | if (OutTaskStationIsOccupied(task) != null || true) |
| | | { |
| | | return task; |
| | | } |
| | | else |
| | | { |
| | | List<string> otherOutStaionCodes = _routerService.QueryNextRoutes(commonStackerCrane.DeviceCode, task.NextAddress).Select(x => x.ChildPosi).ToList(); |
| | | List<Dt_Task> tasks = _taskService.QueryStackerCraneOutTasks(commonStackerCrane.DeviceCode, otherOutStaionCodes); |
| | | foreach (var item in tasks) |
| | | if (OutTaskStationIsOccupied(item) != null) |
| | | { |
| | | if (OutTaskStationIsOccupied(task) != null) |
| | | if(item.Roadway== "SC01") |
| | | { |
| | | return task; |
| | | if (item.Depth == 1) return item; |
| | | //è°åWMSæ¥å£è¿è¡å¤ææ¯å¦éè¦è¿è¡ç§»åº |
| | | Dt_Task dt_Task= OutTaskMovelibrary(item); |
| | | if (dt_Task != null) return dt_Task; |
| | | |
| | | } |
| | | else |
| | | { |
| | | return item; |
| | | } |
| | | } |
| | | task = _taskService.QueryStackerCraneInTask(commonStackerCrane.DeviceCode); |
| | | } |
| | | } |
| | | |
| | | return task; |
| | | } |
| | | |
| | | private Dt_Task? OutTaskMovelibrary([NotNull] Dt_Task task) |
| | | { |
| | | string[] targetCodes = task.SourceAddress.Split("-"); |
| | | if (targetCodes[1] == "001") |
| | | { |
| | | targetCodes[1] = "002"; |
| | | |
| | | } |
| | | else if (targetCodes[1] == "004") |
| | | { |
| | | targetCodes[1] = "003"; |
| | | } |
| | | targetCodes[4] = "01"; |
| | | string SourceAddress = string.Join("-", targetCodes); //ç»è£
æµ
åºä½å°å |
| | | Dt_Task? tasks = _taskService.QueryStationIsOccupiedOutTasks(task.Roadway, SourceAddress); //æ¾æµ
åºä½æ¯å¦æä»»å¡ |
| | | if (tasks != null) return tasks; |
| | | //åwmsç³è¯·å¤ææµ
åºä½æ¯å¦æè´§ï¼æ¯å¦éè¦è¿è¡ç§»åº |
| | | Dt_Task? taskst = _taskService.RequestWMSTaskMovelibrary(task); |
| | | if (taskst != null) return taskst; |
| | | return null; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | | /// åºåºä»»å¡å¤æåºåºç«å°æ¯å¦è¢«å ç¨ |
| | | /// </summary> |
| | |
| | | stackerCraneTaskCommand.TaskNum = task.TaskNum; |
| | | stackerCraneTaskCommand.WorkType = 1; |
| | | stackerCraneTaskCommand.TrayType = 1; |
| | | if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.InboundGroup)//夿æ¯å¦æ¯å
¥åºä»»å¡ |
| | | if (task.TaskType==(int)TaskInboundTypeEnum.Inbound)//夿æ¯å¦æ¯å
¥åºä»»å¡ |
| | | { |
| | | |
| | | string[] startCodes = task.SourceAddress.Split("-"); |
| | | Dt_StationManger dt_StationManger=_stationMangerRepository.QueryFirst(x=>x.StationCode==task.SourceAddress); |
| | | |
| | | |
| | | string[] startCodes = dt_StationManger.StackerCraneStationCode.Split("-"); |
| | | if (startCodes.Length == 3) |
| | | { |
| | | stackerCraneTaskCommand.StartRow = Convert.ToInt16(startCodes[0]); |
| | |
| | | } |
| | | |
| | | } |
| | | else if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup) |
| | | else if (task.TaskType == (int)TaskOutboundTypeEnum.Outbound) |
| | | { |
| | | Dt_StationManger dt_StationManger = _stationMangerRepository.QueryFirst(x => x.StationCode == task.TargetAddress); |
| | | |
| | | string[] targetCodes = task.TargetAddress.Split("-"); |
| | | string[] targetCodes = dt_StationManger.StackerCraneStationCode.Split("-"); |
| | | |
| | | stackerCraneTaskCommand.EndRow = Convert.ToInt16(targetCodes[0]); |
| | | stackerCraneTaskCommand.EndColumn = Convert.ToInt16(targetCodes[1]); |
| | | stackerCraneTaskCommand.EndLayer = Convert.ToInt16(targetCodes[2]); |
| | | |
| | | string[] sourceCodes = task.SourceAddress.Split("-"); |
| | | if (sourceCodes.Length == 3) |
| | | if (sourceCodes.Length == 5) |
| | | { |
| | | stackerCraneTaskCommand.StartRow = Convert.ToInt16(sourceCodes[0]); |
| | | stackerCraneTaskCommand.StartColumn = Convert.ToInt16(sourceCodes[1]); |
| | | stackerCraneTaskCommand.StartLayer = Convert.ToInt16(sourceCodes[2]); |
| | | stackerCraneTaskCommand.StartRow = Convert.ToInt16(sourceCodes[1]); |
| | | stackerCraneTaskCommand.StartColumn = Convert.ToInt16(sourceCodes[2]); |
| | | stackerCraneTaskCommand.StartLayer = Convert.ToInt16(sourceCodes[3]); |
| | | } |
| | | else |
| | | { |
| | |
| | | } |
| | | |
| | | } |
| | | else if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.RelocationGroup) |
| | | else if (task.TaskType == (int)TaskRelocationTypeEnum.Relocation) //å¤æç§»åºä»»å¡ |
| | | { |
| | | string[] targetCodes = task.NextAddress.Split("-"); |
| | | if (targetCodes.Length == 3) |
| | | if (targetCodes.Length == 5) |
| | | { |
| | | stackerCraneTaskCommand.EndRow = Convert.ToInt16(targetCodes[0]); |
| | | stackerCraneTaskCommand.EndColumn = Convert.ToInt16(targetCodes[1]); |
| | | stackerCraneTaskCommand.EndLayer = Convert.ToInt16(targetCodes[2]); |
| | | stackerCraneTaskCommand.EndRow = Convert.ToInt16(targetCodes[1]); |
| | | stackerCraneTaskCommand.EndColumn = Convert.ToInt16(targetCodes[2]); |
| | | stackerCraneTaskCommand.EndLayer = Convert.ToInt16(targetCodes[3]); |
| | | } |
| | | else |
| | | { |
| | |
| | | return null; |
| | | } |
| | | string[] sourceCodes = task.CurrentAddress.Split("-"); |
| | | if (sourceCodes.Length == 3) |
| | | if (sourceCodes.Length == 5) |
| | | { |
| | | stackerCraneTaskCommand.StartRow = Convert.ToInt16(sourceCodes[0]); |
| | | stackerCraneTaskCommand.StartColumn = Convert.ToInt16(sourceCodes[1]); |
| | | stackerCraneTaskCommand.StartLayer = Convert.ToInt16(sourceCodes[2]); |
| | | stackerCraneTaskCommand.StartRow = Convert.ToInt16(sourceCodes[1]); |
| | | stackerCraneTaskCommand.StartColumn = Convert.ToInt16(sourceCodes[2]); |
| | | stackerCraneTaskCommand.StartLayer = Convert.ToInt16(sourceCodes[3]); |
| | | } |
| | | else |
| | | { |
| | |
| | | } |
| | | }, |
| | | { |
| | | name: "æ å(空æ) åº åº", |
| | | name: "æ å¨ åº åº", |
| | | icon: 'el-icon-plus', |
| | | value: 'HandOutbound', |
| | | type: 'warning', |
| | | onClick: function () { |
| | | |
| | | } |
| | | }, |
| | | { |
| | | name: "å æ æ åº åº", |
| | | icon: 'el-icon-plus', |
| | | value: 'HandOutboundycl', |
| | | type: 'success', |
| | | onClick: function () { |
| | | |
| | | } |
| | | }, |
| | | { |
| | | name: "ç©æç¶ææ´æ¹", |
| | | icon: 'el-icon-plus', |
| | | value: 'Materialstaticupdate', |
| | | type: 'success', |
| | | onClick: function () { |
| | | |
| | | } |
| | | },{ |
| | | name: "ç产æ¶é´æ´æ¹", |
| | | icon: 'el-icon-plus', |
| | | value: 'HanGeneratetime', |
| | | type: 'success', |
| | | onClick: function () { |
| | | |
| | | } |
| | | }, |
| | | { |
| | | name: "人 å·¥ æ å¨ åº åº", |
| | | icon: 'el-icon-plus', |
| | | value: 'HandOutboundt', |
| | | type: 'danger', |
| | | onClick: function () { |
| | | |
| | | } |
| | |
| | | |
| | | //æ¤jsæä»¶æ¯ç¨æ¥èªå®ä¹æ©å±ä¸å¡ä»£ç ï¼å¯ä»¥æ©å±ä¸äºèªå®ä¹é¡µé¢æè
éæ°é
ç½®çæç代ç |
| | | import gridBody from "./extend/HandOutbound.vue" |
| | | import modelBody from "./extend/HandMaterials.vue" |
| | | import griForter from "./extend/HandGenerateti.vue" |
| | | let extension = { |
| | | components: { |
| | | //æ¥è¯¢ç颿©å±ç»ä»¶ |
| | | gridHeader: modelBody, |
| | | gridHeader: '', |
| | | gridBody: gridBody, |
| | | gridFooter: griForter, |
| | | gridFooter: '', |
| | | //æ°å»ºãç¼è¾å¼¹åºæ¡æ©å±ç»ä»¶ |
| | | modelHeader: '', |
| | | modelBody: '', |
| | |
| | | if (rows.length == 0) { |
| | | return this.$error("è¯·éæ©æ°æ®!"); |
| | | } else { |
| | | var ids = rows.map(x => { |
| | | return x.palletCode |
| | | }) |
| | | var param = { |
| | | DelKeys: ids, //taskNo |
| | | Extra: true |
| | | } |
| | | this.http |
| | | .post("api/Task/ManualOutbound", param, "æ°æ®å¤çä¸...") |
| | | .then((x) => { |
| | | if (x.status) { |
| | | this.$Message.success('æå.'); |
| | | this.refresh(); |
| | | } else { |
| | | return this.$error(x.message); |
| | | var data = rows.map(x => { |
| | | return { |
| | | palletCode: x.palletCode, |
| | | otherField: x.otherField // æ¿æ¢ä¸ºæ¨éè¦çå¦ä¸ä¸ªå段 |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | } |
| | | |
| | | var btnHandOutboundycl = this.buttons.find(x => x.value == "HandOutboundycl"); |
| | | if (btnHandOutboundycl != null) { |
| | | btnHandOutboundycl.onClick = () => { |
| | | let rows = this.$refs.table.getSelected(); |
| | | if (rows.length == 0) { |
| | | return this.$error("è¯·éæ©æ°æ®!"); |
| | | } else { |
| | | var ids = rows.map(x => { |
| | | return x.palletCode |
| | | }) |
| | | this.$refs.gridBody.open(ids); |
| | | this.$refs.gridBody.open(data); |
| | | this.refresh(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | var btnMaterialstaticupdate = this.buttons.find(x => x.value == "Materialstaticupdate"); |
| | | if (btnMaterialstaticupdate != null) { |
| | | btnMaterialstaticupdate.onClick = () => { |
| | | let rows = this.$refs.table.getSelected(); |
| | | if (rows.length == 0) { |
| | | return this.$error("è¯·éæ©æ°æ®!"); |
| | | } else { |
| | | var ids = rows.map(x => { |
| | | return x.id |
| | | }) |
| | | this.$refs.gridHeader.open(ids); |
| | | this.refresh(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | var btnHanGeneratetime = this.buttons.find(x => x.value == "HanGeneratetime"); |
| | | if (btnHanGeneratetime != null) { |
| | | btnHanGeneratetime.onClick = () => { |
| | | let rows = this.$refs.table.getSelected(); |
| | | if (rows.length == 0) { |
| | | return this.$error("è¯·éæ©æ°æ®!"); |
| | | } else { |
| | | var ids = rows.map(x => { |
| | | return x.id |
| | | }) |
| | | this.$refs.gridFooter.open(ids); |
| | | this.refresh(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | var btnHandOutbound2 = this.buttons.find(x => x.value == "HandOutboundt"); |
| | | if (btnHandOutbound2 != null) { |
| | | btnHandOutbound2.onClick = () => { |
| | | let rows = this.$refs.table.getSelected(); |
| | | if (rows.length == 0) { |
| | | return this.$error("è¯·éæ©æ°æ®!"); |
| | | } else { |
| | | var ids = rows.map(x => { |
| | | return x.palletCode |
| | | }) |
| | | var param = { |
| | | DelKeys: ids, //taskNo |
| | | Extra: true |
| | | } |
| | | this.http |
| | | .post("api/Task/ManualOutboundDeleteinventory", param, "æ°æ®å¤çä¸...") |
| | | .then((x) => { |
| | | if (x.status) { |
| | | this.$Message.success('æå.'); |
| | | this.refresh(); |
| | | } else { |
| | | return this.$error(x.message); |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | this.columns.forEach(x => { |
| | | if (x.field == "wlstatus") { |
| | | //æ ¹æ®ä¸åçå¼ï¼å®ä¹ä¸åçæ ·å¼(å¦ï¼æåé¢è²) |
| | | x.render = (h, { row, column, index }) => { |
| | | if(row.wlstatus=='1'){ |
| | | return ( |
| | | <span style="display:block;background-color:#67c23a;width:65px;text-align:center;color:white;border:1px solid #67c23a;border-radius:5px;"> |
| | | åæ ¼ |
| | | </span> |
| | | ); |
| | | }else if(row.wlstatus=='0'){ |
| | | return ( |
| | | <tr style="display:block;background-color:#f4b400;width:65px;text-align:center;color:white;border:1px solid #f4b400;border-radius:5px;"> |
| | | å¾
æ£ |
| | | </tr> |
| | | ); |
| | | }else if(row.wlstatus=='2'){ |
| | | return ( |
| | | <tr style="display:block;background-color:#f56c6c;width:65px;text-align:center;color:white;border:1px solid #f56c6c;border-radius:5px;"> |
| | | ä¸åæ ¼ |
| | | </tr> |
| | | ); |
| | | }else if(row.wlstatus=='3'){ |
| | | return ( |
| | | <tr style="display:block;background-color:#909399;width:65px;text-align:center;color:white;border:1px solid #909399;border-radius:5px;"> |
| | | 空æ |
| | | </tr> |
| | | ); |
| | | }else if(row.wlstatus=='4'){ |
| | | return ( |
| | | <tr style="display:block;background-color:#f87eb9;width:65px;text-align:center;color:white;border:1px solid #f87eb9;border-radius:5px;"> |
| | | éè´§ |
| | | </tr> |
| | | ); |
| | | }else if(row.wlstatus=='5'){ |
| | | return ( |
| | | <tr style="display:block;background-color:#409eff;width:65px;text-align:center;color:white;border:1px solid #409eff;border-radius:5px;"> |
| | | è¿å·¥ |
| | | </tr> |
| | | ); |
| | | }else if(row.wlstatus=='6'){ |
| | | return ( |
| | | <tr style="display:block;background-color:#9b59b6;width:65px;text-align:center;color:white;border:1px solid #9b59b6;border-radius:5px;"> |
| | | ç¹é |
| | | </tr> |
| | | ); |
| | | }else{ |
| | | return ( |
| | | <span style="display:block;background-color:#909399;width:55px;text-align:center;color:white;border:1px solid #e9e9eb;border-radius:5px;"> |
| | | æªç¥ |
| | | </span> |
| | | ); |
| | | } |
| | | } |
| | | } |
| | | }); |
| | | }, |
| | | onInited() { |
| | | //æ¡æ¶åå§åé
ç½®å |
| | |
| | | const searchFormOptions = ref([ |
| | | [ |
| | | { title: "è´§ä½ç¼å·", field: "locationCode" ,type: "like",}, |
| | | { title: "å··éç¼å·", field: "roadwayNo" }, |
| | | { title: "å··éç¼å·", field: "roadwayNo" ,type: "like",}, |
| | | { title: "è´§ä½ç±»å", field: "locationType",type: "select",dataKey: "locationTypeEnum",data: []}, |
| | | { title: "ç¦ç¨ç¶æ", field: "enableStatus" ,type: "select",dataKey: "enableStatusEnum",data: []}, |
| | | ], |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Reflection.Emit; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_Core.BaseRepository; |
| | | using WIDESEA_Core.BaseServices; |
| | | using WIDESEA_IBasicService; |
| | | using WIDESEA_Model.Models; |
| | | |
| | | namespace WIDESEA_BasicService |
| | | { |
| | | public partial class Dt_ApiInfoService : ServiceBase<Dt_ApiInfo, IRepository<Dt_ApiInfo>>, IDt_ApiInfoService |
| | | { |
| | | |
| | | public Dt_ApiInfoService(IRepository<Dt_ApiInfo> BaseDal) : base(BaseDal) |
| | | { |
| | | } |
| | | |
| | | public IRepository<Dt_ApiInfo> Repository => BaseDal; |
| | | |
| | | |
| | | public Dt_ApiInfo GetConfigsByAPIInfo(string ApiCode, string ApiInterfaceAddress) |
| | | { |
| | | return BaseDal.QueryFirst(x => x.ApiCode == ApiCode && x.ApiInterfaceAddress== ApiInterfaceAddress); |
| | | } |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core.BaseRepository; |
| | | using WIDESEA_Core.BaseServices; |
| | | using WIDESEA_IBasicService; |
| | | using WIDESEA_Model.Models; |
| | | |
| | | namespace WIDESEAWCS_BasicInfoService |
| | | { |
| | | public class StationMangerService : ServiceBase<Dt_StationManger, IRepository<Dt_StationManger>>, IStationMangerService |
| | | { |
| | | public StationMangerService(IRepository<Dt_StationManger> BaseDal) : base(BaseDal) |
| | | { |
| | | } |
| | | |
| | | public Dt_StationManger QueryPlatform(string StationCode) |
| | | { |
| | | return BaseDal.QueryFirst(x=>x.StationCode == StationCode); |
| | | } |
| | | } |
| | | } |
| | |
| | | [Description("å
¥åºå®æ")] |
| | | å
¥åºå®æ = 6, |
| | | |
| | | [Description("å·²å
¥åº")] |
| | | å·²å
¥åº = 6, |
| | | |
| | | [Description("åºåºéå®")] |
| | | åºåºéå® = 7, |
| | | |
| | |
| | | namespace WIDESEA_Common.TaskEnum |
| | | { |
| | | /// <summary> |
| | | /// ä»»å¡ç¶æ |
| | | /// åºåºä»»å¡ç¶æ |
| | | /// </summary> |
| | | public enum TaskStatusEnum |
| | | public enum TaskOutStatusEnum |
| | | { |
| | | /// <summary> |
| | | /// æ°å»ºä»»å¡ |
| | | /// æ°å»ºåºåºä»»å¡ |
| | | /// </summary> |
| | | [Description("æ°å»º")] |
| | | New = 100, |
| | | [Description("æ°å»ºåºåºä»»å¡")] |
| | | OutNew = 100, |
| | | |
| | | /// <summary> |
| | | /// å åæºå¾
æ§è¡ |
| | | /// å åæºåºåºæ§è¡ä¸ |
| | | /// </summary> |
| | | [Description("å åæºå¾
æ§è¡")] |
| | | SC_Execute = 200, |
| | | [Description("å åæºåºåºæ§è¡ä¸")] |
| | | SC_OutExecuting = 110, |
| | | |
| | | /// <summary> |
| | | /// å åæºæ§è¡ä¸ |
| | | /// å åæºåºåºå®æ |
| | | /// </summary> |
| | | [Description("å åæºæ§è¡ä¸")] |
| | | SC_Executing = 210, |
| | | [Description("å åæºåºåºå®æ")] |
| | | SC_OutFinish = 115, |
| | | |
| | | /// <summary> |
| | | /// å åæºå®æ |
| | | /// è¾é线åºåºæ§è¡ä¸ |
| | | /// </summary> |
| | | [Description("å åæºå®æ")] |
| | | SC_Finish = 220, |
| | | [Description("è¾é线åºåºæ§è¡ä¸")] |
| | | Line_OutExecuting = 120, |
| | | |
| | | /// <summary> |
| | | /// è¾é线å¾
æ§è¡ |
| | | /// è¾é线åºåºå®æ |
| | | /// </summary> |
| | | [Description("è¾é线å¾
æ§è¡")] |
| | | Line_Execute = 400, |
| | | [Description("è¾é线è¾é宿")] |
| | | Line_OutFinish = 125, |
| | | |
| | | |
| | | /// <summary> |
| | | /// è¾é线æ§è¡ä¸ |
| | | /// åºåºä»»å¡å®æ |
| | | /// </summary> |
| | | [Description("è¾é线æ§è¡ä¸")] |
| | | Line_Executing = 410, |
| | | [Description("åºåºä»»å¡å®æ")] |
| | | OutFinish = 190, |
| | | |
| | | /// <summary> |
| | | /// è¾éçº¿å®æ |
| | | /// åºåºä»»å¡æèµ· |
| | | /// </summary> |
| | | [Description("è¾éçº¿å®æ")] |
| | | Line_Finish = 420, |
| | | [Description("åºåºä»»å¡æèµ·")] |
| | | OutPending = 197, |
| | | |
| | | /// <summary> |
| | | /// AGVå¾
æ§è¡ |
| | | /// åºåºä»»å¡åæ¶ |
| | | /// </summary> |
| | | [Description("AGVå¾
æ§è¡")] |
| | | AGV_Execute = 300, |
| | | [Description("åºåºä»»å¡åæ¶")] |
| | | OutCancel = 198, |
| | | |
| | | /// <summary> |
| | | /// AGVæ§è¡ä¸ |
| | | /// åºåºä»»å¡å¼å¸¸ |
| | | /// </summary> |
| | | [Description("AGVæ§è¡ä¸")] |
| | | AGV_Executing = 310, |
| | | [Description("åºåºä»»å¡å¼å¸¸")] |
| | | OutException = 199, |
| | | } |
| | | |
| | | public enum TaskInStatusEnum |
| | | { |
| | | /// <summary> |
| | | /// è¾é线å
¥åºæ§è¡ä¸ |
| | | /// </summary> |
| | | [Description("è¾é线å
¥åºæ§è¡ä¸")] |
| | | Line_InExecuting = 215, |
| | | |
| | | /// <summary> |
| | | /// AGVå¾
ç»§ç»æ§è¡ |
| | | /// è¾é线å
¥åºå®æ |
| | | /// </summary> |
| | | [Description("AGVå¾
ç»§ç»æ§è¡")] |
| | | AGV_WaitToExecute = 320, |
| | | /// <summary> |
| | | /// AGVæ¾è´§ä¸ |
| | | /// </summary> |
| | | [Description("AGVæ¾è´§ä¸")] |
| | | AGV_Puting = 325, |
| | | [Description("è¾é线è¾é宿")] |
| | | Line_InFinish = 220, |
| | | |
| | | /// <summary> |
| | | /// AGV宿 |
| | | /// å åæºå
¥åºæ§è¡ä¸ |
| | | /// </summary> |
| | | [Description("AGV宿")] |
| | | AGV_Finish = 330, |
| | | [Description("å åæºå
¥åºæ§è¡ä¸")] |
| | | SC_InExecuting = 230, |
| | | |
| | | /// <summary> |
| | | /// ä»»å¡å®æ |
| | | /// å åæºå
¥åºå®æ |
| | | /// </summary> |
| | | [Description("ä»»å¡å®æ")] |
| | | Finish = 900, |
| | | [Description("å åæºå
¥åºå®æ")] |
| | | SC_InFinish = 235, |
| | | |
| | | /// <summary> |
| | | /// ä»»å¡æèµ· |
| | | /// å
¥åºä»»å¡å®æ |
| | | /// </summary> |
| | | [Description("ä»»å¡æèµ·")] |
| | | Pending = 970, |
| | | [Description("å
¥åºä»»å¡å®æ")] |
| | | InFinish = 290, |
| | | |
| | | /// <summary> |
| | | /// ä»»å¡åæ¶ |
| | | /// å
¥åºä»»å¡æèµ· |
| | | /// </summary> |
| | | [Description("ä»»å¡åæ¶")] |
| | | Cancel = 980, |
| | | [Description("å
¥åºä»»å¡æèµ·")] |
| | | InPending = 297, |
| | | |
| | | /// <summary> |
| | | /// ä»»å¡å¼å¸¸ |
| | | /// å
¥åºä»»å¡åæ¶ |
| | | /// </summary> |
| | | [Description("ä»»å¡å¼å¸¸")] |
| | | Exception = 990, |
| | | [Description("å
¥åºä»»å¡åæ¶")] |
| | | InCancel = 298, |
| | | |
| | | /// <summary> |
| | | /// æåæºæ§è¡ä¸ |
| | | /// å
¥åºä»»å¡å¼å¸¸ |
| | | /// </summary> |
| | | [Description("æåæºæ§è¡ä¸")] |
| | | HT_Executing = 110, |
| | | [Description("å
¥åºä»»å¡å¼å¸¸")] |
| | | InException = 299, |
| | | } |
| | | |
| | | public enum TaskRelocationStatusEnum |
| | | { |
| | | /// <summary> |
| | | /// æ°å»ºç§»åºä»»å¡ |
| | | /// </summary> |
| | | [Description("æ°å»ºç§»åºä»»å¡")] |
| | | RelocationNew = 400, |
| | | |
| | | /// <summary> |
| | | /// å åæºç§»åºæ§è¡ä¸ |
| | | /// </summary> |
| | | [Description("å åæºç§»åºæ§è¡ä¸")] |
| | | SC_RelocationExecuting = 410, |
| | | |
| | | /// <summary> |
| | | /// å åæºç§»åºå®æ |
| | | /// </summary> |
| | | [Description("å åæºç§»åºå®æ")] |
| | | SC_RelocationFinish = 420, |
| | | |
| | | /// <summary> |
| | | /// ç§»åºå®æ |
| | | /// </summary> |
| | | [Description("ç§»åºå®æ")] |
| | | RelocationFinish = 430, |
| | | } |
| | | } |
| | |
| | | |
| | | namespace WIDESEA_Common.TaskEnum |
| | | { |
| | | public enum TaskTypeEnum |
| | | { |
| | | /// <summary> |
| | | /// 颿åºåº |
| | | /// </summary> |
| | | [Description("颿åºåº")] |
| | | Outbound = 100, |
| | | /// <summary> |
| | | /// çç¹åºåº |
| | | /// </summary> |
| | | [Description("çç¹åºåº")] |
| | | OutInventory = 110, |
| | | /// <summary> |
| | | /// 忣åºåº |
| | | /// </summary> |
| | | [Description("忣åºåº")] |
| | | OutPick = 120, |
| | | /// <summary> |
| | | /// è´¨æ£åºåº |
| | | /// </summary> |
| | | [Description("è´¨æ£åºåº")] |
| | | OutQuality = 130, |
| | | |
| | | /// <summary> |
| | | /// 空箱åºåº |
| | | /// </summary> |
| | | [Description("空箱åºåº")] |
| | | OutEmpty = 140, |
| | | |
| | | /// <summary> |
| | | /// MESåºåº |
| | | /// </summary> |
| | | [Description("MESåºåº")] |
| | | MesOutbound = 200, |
| | | |
| | | /// <summary> |
| | | /// MESæå¨åºåº |
| | | /// </summary> |
| | | [Description("MESæå¨åºåº")] |
| | | MesHandOutbound = 210, |
| | | |
| | | /// <summary> |
| | | /// MESæå¨æ£éåºåº |
| | | /// </summary> |
| | | [Description("MESæå¨æ£éåºåº")] |
| | | MesHandPickOutbound = 220, |
| | | |
| | | /// <summary> |
| | | /// éè´å
¥åº |
| | | /// </summary> |
| | | [Description("éè´å
¥åº")] |
| | | Inbound = 510, |
| | | /// <summary> |
| | | /// çç¹å
¥åº |
| | | /// </summary> |
| | | [Description("çç¹å
¥åº")] |
| | | InInventory = 520, |
| | | /// <summary> |
| | | /// 忣å
¥åº |
| | | /// </summary> |
| | | [Description("忣å
¥åº")] |
| | | InPick = 530, |
| | | /// <summary> |
| | | /// è´¨æ£å
¥åº |
| | | /// </summary> |
| | | [Description("è´¨æ£å
¥åº")] |
| | | InQuality = 540, |
| | | |
| | | /// <summary> |
| | | /// çäº§éæ |
| | | /// </summary> |
| | | [Description("ç产éæ")] |
| | | ProductionReturn = 550, |
| | | |
| | | /// <summary> |
| | | /// MESéæ |
| | | /// </summary> |
| | | [Description("MESéæ")] |
| | | MesMatReturn = 560, |
| | | |
| | | /// <summary> |
| | | /// 空箱å
¥åº |
| | | /// </summary> |
| | | [Description("空箱å
¥åº")] |
| | | InEmpty = 600, |
| | | |
| | | /// <summary> |
| | | /// å··éå
ç§»åº |
| | | /// </summary> |
| | | [Description("å··éå
ç§»åº")] |
| | | Relocation = 900 |
| | | |
| | | } |
| | | |
| | | public enum TaskTypeGroup |
| | | { |
| | | /// <summary> |
| | |
| | | /// </summary> |
| | | OtherGroup |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | public enum TaskInboundTypeEnum |
| | | { |
| | | /// <summary> |
| | | /// å
¥åº |
| | | /// </summary> |
| | | [Description("å
¥åº")] |
| | | Inbound = 200, |
| | | /// <summary> |
| | | /// çç¹å
¥åº |
| | | /// </summary> |
| | | [Description("çç¹å
¥åº")] |
| | | InInventory = 201, |
| | | /// <summary> |
| | | /// 忣å
¥åº |
| | | /// </summary> |
| | | [Description("忣å
¥åº")] |
| | | InPick = 202, |
| | | /// <summary> |
| | | /// è´¨æ£å
¥åº |
| | | /// </summary> |
| | | [Description("è´¨æ£å
¥åº")] |
| | | InQuality = 203 |
| | | } |
| | | |
| | | public enum TaskOutboundTypeEnum |
| | | { |
| | | /// <summary> |
| | | /// åºåº |
| | | /// </summary> |
| | | [Description("åºåº")] |
| | | Outbound = 100, |
| | | /// <summary> |
| | | /// çç¹åºåº |
| | | /// </summary> |
| | | [Description("çç¹åºåº")] |
| | | OutInventory = 101, |
| | | /// <summary> |
| | | /// 忣åºåº |
| | | /// </summary> |
| | | [Description("忣åºåº")] |
| | | OutPick = 102, |
| | | /// <summary> |
| | | /// è´¨æ£åºåº |
| | | /// </summary> |
| | | [Description("è´¨æ£åºåº")] |
| | | OutQuality = 103, |
| | | } |
| | | |
| | | public enum TaskRelocationTypeEnum |
| | | { |
| | | /// <summary> |
| | | /// åºå
ç§»åº |
| | | /// </summary> |
| | | [Description("åºå
ç§»åº")] |
| | | Relocation = 300, |
| | | } |
| | | |
| | | } |
| | |
| | | public class CateGoryConst |
| | | { |
| | | /// <summary> |
| | | /// é®ç®±åºç¡ |
| | | /// IPæ¥å£å°å |
| | | /// </summary> |
| | | public const string CONFIG_SYS_BaseExmail = "Sys_BaseExmail"; |
| | | public const string CONFIG_WCS_IPAddress = "WCS_IPAddress"; |
| | | |
| | | /// <summary> |
| | | /// é®ç®±é
ç½® |
| | | /// </summary> |
| | | public const string CONFIG_SYS_RegExmail = "Sys_RegExmail"; |
| | | public const string CONFIG_MES_IPAddress = "MES_IPAddress"; |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | public class SysConfigConst |
| | | { |
| | | /// <summary> |
| | | /// é®ç®±SMTPå°å |
| | | /// ä¸åWCSä»»å¡ |
| | | /// </summary> |
| | | public const string SMTP_Server = "smtpServer"; |
| | | public const string WCSReceiveTask = "ReceiveTask"; |
| | | |
| | | /// <summary> |
| | | /// é®ç®±SMTPç«¯å£ |
| | | /// ç§»åºä»»å¡å®æ |
| | | /// </summary> |
| | | public const string SMTP_Port = "smtpPort"; |
| | | public const string MESTransferCompletionFeedback = "MESTransferCompletionFeedback"; |
| | | public const string MESTaskFeedback = "MESTaskFeedback"; |
| | | |
| | | /// <summary> |
| | | /// é®ç®±SMTPè´¦å· |
| | | /// </summary> |
| | | public const string SMTP_User = "smtpUser"; |
| | | |
| | | /// <summary> |
| | | /// é®ç®±SMTPå¯ç |
| | | /// </summary> |
| | | public const string SMTP_Pass = "smtpPass"; |
| | | |
| | | /// <summary> |
| | | /// é®ç®±æ é¢ |
| | | /// </summary> |
| | | public const string SMTP_Title = "smtpTitle"; |
| | | |
| | | /// <summary> |
| | | /// é®ç®±å
容æ é¢ |
| | | /// </summary> |
| | | public const string SMTP_ContentTitle = "smtpContentTitle"; |
| | | /// <summary> |
| | | /// é®ç®±å
容æ é¢ |
| | | /// </summary> |
| | | public const string SMTP_RegUser = "smtpRegUser"; |
| | | } |
| | | } |
| | |
| | | /// </summary> |
| | | public int MaterialType { get; set; } |
| | | |
| | | public string MEStaskId { get; set; } |
| | | public string MESbusinessId { get; set; } |
| | | public string MESsubPalletCode { get; set; } |
| | | |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace WIDESEA_DTO.ToMes |
| | | { |
| | | /// <summary> |
| | | /// ç§»åºç±»ä¸ä¼ MESéç¥ |
| | | /// </summary> |
| | | public class TransferRequest |
| | | { |
| | | /// <summary> |
| | | /// ä¸å¡ID |
| | | /// </summary> |
| | | public string businessId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä»»å¡ID |
| | | /// </summary> |
| | | public string TaskId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åè´§ä½ |
| | | /// </summary> |
| | | public string SourceLocationCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç®æ è´§ä½ç¼ç |
| | | /// </summary> |
| | | public string LocationCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æçç¼ç |
| | | /// </summary> |
| | | public string PalletCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç¶æ: FINISH-已宿, TRANSFER-è½¬ç§»ä¸ |
| | | /// </summary> |
| | | public string Status { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å¼å¸¸ç¶æ: NORMAL-æ£å¸¸ï¼ERROR-å¼å¸¸ |
| | | /// </summary> |
| | | public string ErrorStatus { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å¼å¸¸ä¿¡æ¯ |
| | | /// </summary> |
| | | public string ErrorInfo { get; set; } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ¥æ¶åé¦åæ°éç¥ |
| | | /// </summary> |
| | | /// <typeparam name="T"></typeparam> |
| | | public class ApiResponse<T> |
| | | { |
| | | /// <summary> |
| | | /// ç¶æç : 1-æå, å
¶ä»-失败 |
| | | /// </summary> |
| | | public int Code { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¶æ¯ |
| | | /// </summary> |
| | | public string Message { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ°æ® |
| | | /// </summary> |
| | | public T Data { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¯å¦æå |
| | | /// </summary> |
| | | public bool Success { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æåååº |
| | | /// </summary> |
| | | public static ApiResponse<T> SuccessResponse(string message = "æä½æåï¼", T data = default) |
| | | { |
| | | return new ApiResponse<T> |
| | | { |
| | | Code = 1, |
| | | Message = message, |
| | | Data = data, |
| | | Success = true |
| | | }; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 失败ååº |
| | | /// </summary> |
| | | public static ApiResponse<T> ErrorResponse(string message = "æä½å¤±è´¥ï¼", int code = 0) |
| | | { |
| | | return new ApiResponse<T> |
| | | { |
| | | Code = code, |
| | | Message = message, |
| | | Data = default, |
| | | Success = false |
| | | }; |
| | | } |
| | | } |
| | | |
| | | |
| | | public class TaskNotification |
| | | { |
| | | /// <summary> |
| | | /// ä»»å¡ID |
| | | /// </summary> |
| | | public string TaskId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä¸å¡ID |
| | | /// </summary> |
| | | public string BusinessId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æçç¼ç |
| | | /// </summary> |
| | | public string PalletCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åæçç¼ç |
| | | /// </summary> |
| | | public string SubPalletCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// è´§ä½ç¼ç |
| | | /// </summary> |
| | | public string LocationCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å¼å¸¸ç¶æï¼NORMAL-æ£å¸¸ï¼ERROR-å¼å¸¸ |
| | | /// </summary> |
| | | public string ErrorStatus { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å¼å¸¸ä¿¡æ¯ |
| | | /// </summary> |
| | | public string ErrorInfo { get; set; } |
| | | } |
| | | |
| | | |
| | | public class InOutboundTaskReceived |
| | | { |
| | | /// <summary> |
| | | /// è¯·æ±æ¶é´ |
| | | /// </summary> |
| | | public string ReqTime { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä»»å¡ID |
| | | /// </summary> |
| | | public string TaskId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä¸å¡ID |
| | | /// </summary> |
| | | public string BusinessId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// èç¹ç¼ç |
| | | /// </summary> |
| | | public string NodeCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æçç¼ç å表 |
| | | /// </summary> |
| | | public List<string> PalletCodeList { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æçä¿¡æ¯å表 |
| | | /// </summary> |
| | | public List<PalletInfo> palletInfoList { get; set; } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æçä¿¡æ¯ |
| | | /// </summary> |
| | | public class PalletInfo |
| | | { |
| | | /// <summary> |
| | | /// è´§ä½ç¼ç |
| | | /// </summary> |
| | | public string locationCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æçç¼ç |
| | | /// </summary> |
| | | public string palletCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åæçç¼ç |
| | | /// </summary> |
| | | public string subPalletCode { get; set; } |
| | | } |
| | | |
| | | public class LocationInfoDto |
| | | { |
| | | /// <summary> |
| | | /// åºåç¼ç |
| | | /// </summary> |
| | | public string areaCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// è´§ä½ç¼ç |
| | | /// </summary> |
| | | public string locationCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// è´§ä½åç§° |
| | | /// </summary> |
| | | public string locationName { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å··éç¼å· |
| | | /// </summary> |
| | | public string roadwayNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// è¡ |
| | | /// </summary> |
| | | public int row { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å |
| | | /// </summary> |
| | | public int column { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å± |
| | | /// </summary> |
| | | public int layer { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 深度 |
| | | /// </summary> |
| | | public double depth { get; set; } |
| | | |
| | | /// <summary> |
| | | /// è´§ä½ç±»å |
| | | /// </summary> |
| | | public int locationType { get; set; } |
| | | |
| | | /// <summary> |
| | | /// è´§ä½ç¶æ |
| | | /// </summary> |
| | | public int locationStatus { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å¯ç¨ç¶æ |
| | | /// </summary> |
| | | public bool enableStatus { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 夿³¨ |
| | | /// </summary> |
| | | public string remark { get; set; } |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_Core.BaseRepository; |
| | | using WIDESEA_Core.BaseServices; |
| | | using WIDESEA_DTO.Basic; |
| | | using WIDESEA_Model.Models; |
| | | |
| | | namespace WIDESEA_IBasicService |
| | | { |
| | | public interface IDt_ApiInfoService : IService<Dt_ApiInfo> |
| | | { |
| | | /// <summary> |
| | | /// æ ¹æ®ç±»å«,apié®è·åå°å¯¹åºçæ¥å£æ°æ® |
| | | /// </summary> |
| | | /// <param name="category">ç±»å«</param> |
| | | /// <returns></returns> |
| | | Dt_ApiInfo GetConfigsByAPIInfo(string ApiCode, string ApiInterfaceAddress); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core.BaseServices; |
| | | using WIDESEA_Model.Models; |
| | | |
| | | namespace WIDESEA_IBasicService |
| | | { |
| | | public interface IStationMangerService : IService<Dt_StationManger> |
| | | { |
| | | Dt_StationManger QueryPlatform(string StationCode); |
| | | } |
| | | } |
| | |
| | | public interface ILocationStatusChangeRecordService : IService<Dt_LocationStatusChangeRecord> |
| | | { |
| | | IRepository<Dt_LocationStatusChangeRecord> Repository { get; } |
| | | |
| | | void AddLocationStatusChangeRecord(Dt_LocationInfo locationInfo, int lastStatus, int changeType, string orderNo, int? taskNum); |
| | | } |
| | | } |
| | |
| | | { |
| | | public interface ISys_LogService : IService<Sys_Log> |
| | | { |
| | | |
| | | } |
| | | } |
| | |
| | | using WIDESEA_DTO; |
| | | using WIDESEA_DTO.Stock; |
| | | using WIDESEA_DTO.Task; |
| | | using WIDESEA_DTO.ToMes; |
| | | using WIDESEA_Model.Models; |
| | | |
| | | namespace WIDESEA_ITaskInfoService |
| | | { |
| | | public interface ITaskService : IService<Dt_Task> |
| | | { |
| | | int GetTaskNum(string sequenceName); |
| | | |
| | | IRepository<Dt_Task> Repository { get; } |
| | | |
| | | WebResponseContent DeviceRequestInboundTaskSimple(string stationCode, string palletCode); |
| | | |
| | | WebResponseContent InboundTaskCompleted(int taskNum); |
| | | /// <summary> |
| | | /// åºåº |
| | | /// </summary> |
| | | /// <param name="outbound"></param> |
| | | /// <returns></returns> |
| | | ApiResponse<object> sendExTask(InOutboundTaskReceived outbound); |
| | | |
| | | /// <summary> |
| | | /// å
¥åº |
| | | /// </summary> |
| | | /// <param name="outbound"></param> |
| | | /// <returns></returns> |
| | | ApiResponse<object> sendEnTask(InOutboundTaskReceived outbound); |
| | | |
| | | |
| | | /// <summary> |
| | | /// ä»»å¡å®ææ¥å£ |
| | | /// </summary> |
| | | /// <param name="taskNum"></param> |
| | | /// <returns></returns> |
| | | WebResponseContent TaskCompleted(int taskNum); |
| | | |
| | | /// <summary> |
| | | /// ç§»åºç³è¯·å¤ææ¥å£ |
| | | /// </summary> |
| | | /// <param name="TaskNum"></param> |
| | | /// <returns></returns> |
| | | WebResponseContent IsRelocations(int TaskNum); |
| | | |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | | /// åå»ºè´§ä½ |
| | | /// </summary> |
| | | /// <param name="locationInfo"></param> |
| | | /// <returns></returns> |
| | | ApiResponse<object> createLocation(List<LocationInfoDto> locationInfo); |
| | | /// <summary> |
| | | /// å é¤è´§ä½ |
| | | /// </summary> |
| | | ApiResponse<object> deleteLocation(List<string> locationCode); |
| | | /// <summary> |
| | | /// ä¿®æ¹è´§ä½ |
| | | /// </summary> |
| | | /// <param name="locationInfo"></param> |
| | | /// <returns></returns> |
| | | ApiResponse<object> updateLocation(LocationInfoDto locationInfo); |
| | | } |
| | | } |
| | |
| | | [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "主é®")] |
| | | public int Id { get; set; } |
| | | /// <summary> |
| | | /// æ¥å£ç¼å· |
| | | /// æ¥å£ç±»å |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "æ¥å£ç¼å·")] |
| | | public string ApiCode { get; set; } |
| | |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "æ¥å£åç§°")] |
| | | public string ApiName { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¥å£é® |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "æ¥å£é®")] |
| | | public string ApiInterfaceAddress { get; set; } |
| | | /// <summary> |
| | | /// æ¥å£å°å |
| | | /// </summary> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | using SqlSugar; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core.DB.Models; |
| | | |
| | | namespace WIDESEA_Model.Models |
| | | { |
| | | [SugarTable(nameof(Dt_StationManger), "ç«å°è¡¨")] |
| | | public class Dt_StationManger : BaseEntity |
| | | { |
| | | /// <summary> |
| | | /// ä¸»é® |
| | | /// </summary> |
| | | [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "主é®")] |
| | | public int Id { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç«å°ç¼å· |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "ç«å°ç¼å·")] |
| | | public string StationCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç«å°åç§° |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "ç«å°åç§°")] |
| | | public string StationName { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç«å°ç±»å <br/> |
| | | /// 1ï¼åªå
¥ <br/> |
| | | /// 2ï¼åªåº <br/> |
| | | /// 3ï¼å¯å
¥å¯åº |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "ç«å°ç±»å")] |
| | | public int StationType { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 对åºå åæºæ-å-å± |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "对åºå åæºæ-å-å±")] |
| | | public string StackerCraneStationCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç«å°è®¾å¤ç¼å· |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "ç«å°è®¾å¤ç¼å·")] |
| | | public string StationDeviceCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å åæºç¼å· |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "å åæºç¼å·")] |
| | | public string StackerCraneCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// AGVç«å°ç¼å· |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "AGVç«å°ç¼å·")] |
| | | public string? AGVStationCode { get; set; } |
| | | /// <summary> |
| | | /// ç«å°æ¯å¦å¯ç¨ <br/> |
| | | /// 0ï¼å¯ç¨ <br/> |
| | | /// 1ï¼å ç¨ <br/> |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "ç«å°æ¯å¦å¯ç¨")] |
| | | public int IsOccupied { get; set; } |
| | | /// <summary> |
| | | /// 夿³¨ |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "夿³¨")] |
| | | public string Remark { get; set; } |
| | | } |
| | | } |
| | |
| | | using SqlSugar; |
| | | using Magicodes.ExporterAndImporter.Core; |
| | | using SqlSugar; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using System.Xml.Linq; |
| | | using WIDESEA_Core.DB.Models; |
| | | |
| | | namespace WIDESEA_Model.Models |
| | |
| | | public string Remark { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æçç¼å·åæ |
| | | /// </summary> |
| | | [ImporterHeader(Name = "æçç¼å·åæ")] |
| | | [ExporterHeader(DisplayName = "æçç¼å·åæ")] |
| | | [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "æçç¼å·åæ")] |
| | | public string MESsubPalletCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åºåæç» |
| | | /// </summary> |
| | | [Navigate(NavigateType.OneToMany, nameof(Dt_StockInfoDetail.StockId), nameof(Id))] |
| | |
| | | [ExporterHeader(DisplayName = "夿³¨")] |
| | | [SugarColumn(IsNullable = true, Length = 255, ColumnDescription = "夿³¨")] |
| | | public string Remark { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 深度 |
| | | /// </summary> |
| | | [ImporterHeader(Name = "深度")] |
| | | [ExporterHeader(DisplayName = "深度")] |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "深度")] |
| | | public int Depth { get; set; } |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | | /// MESä»»å¡id |
| | | /// </summary> |
| | | [ImporterHeader(Name = "MESä»»å¡id")] |
| | | [ExporterHeader(DisplayName = "MESä»»å¡id")] |
| | | [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "MESä»»å¡id")] |
| | | public string MEStaskId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// MESä¸å¡æµid |
| | | /// </summary> |
| | | [ImporterHeader(Name = "MESä¸å¡æµid")] |
| | | [ExporterHeader(DisplayName = "MESä¸å¡æµid")] |
| | | [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "MESä¸å¡æµid")] |
| | | public string MESbusinessId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æçç¼å·åæ |
| | | /// </summary> |
| | | [ImporterHeader(Name = "æçç¼å·åæ")] |
| | | [ExporterHeader(DisplayName = "æçç¼å·åæ")] |
| | | [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "æçç¼å·åæ")] |
| | | public string MESsubPalletCode { get; set; } |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | public IRepository<Dt_LocationStatusChangeRecord> Repository => BaseDal; |
| | | |
| | | public void AddLocationStatusChangeRecord(Dt_LocationInfo locationInfo, int lastStatus, int changeType, string? orderNo, int? taskNum) |
| | | { |
| | | Dt_LocationStatusChangeRecord locationStatusChangeRecord = new Dt_LocationStatusChangeRecord() |
| | | { |
| | | AfterStatus = locationInfo.LocationStatus, |
| | | BeforeStatus = lastStatus, |
| | | ChangeType = changeType, |
| | | LocationCode = locationInfo.LocationCode, |
| | | LocationId = locationInfo.Id, |
| | | TaskNum = taskNum, |
| | | Creater = "WMS", |
| | | OrderNo = orderNo ?? "" |
| | | }; |
| | | |
| | | BaseDal.AddData(locationStatusChangeRecord); |
| | | } |
| | | } |
| | | } |
| | |
| | | using WIDESEA_Common.TaskEnum; |
| | | using WIDESEA_Common.StockEnum; |
| | | using WIDESEA_Common.LocationEnum; |
| | | using WIDESEA_Common.CommonEnum; |
| | | using WIDESEA_DTO.ToMes; |
| | | using System.Diagnostics; |
| | | using WIDESEA_Common.OtherEnum; |
| | | using WIDESEA_Core.Const; |
| | | |
| | | namespace WIDESEA_TaskInfoService |
| | | { |
| | |
| | | PushTasksToWCS(new List<Dt_Task> { task }); |
| | | return WebResponseContent.Instance.OK($"该æçå·²çæä»»å¡", _mapper.Map<WMSTaskDTO>(task)); |
| | | } |
| | | if (Repository.QueryFirst(x => x.SourceAddress == stationCode && x.TaskStatus == TaskStatusEnum.New.ObjToInt()) != null) |
| | | /* if (Repository.QueryFirst(x => x.SourceAddress == stationCode && x.TaskStatus == OutTaskStatusEnum.New.ObjToInt()) != null) |
| | | { |
| | | return WebResponseContent.Instance.Error($"该ç«ç¹å·²ææªæ§è¡çä»»å¡"); |
| | | } |
| | | }*/ |
| | | |
| | | |
| | | //Dt_StockInfo stockInfo = _stockRepository.Db.Queryable<Dt_StockInfo>().Where(x => x.PalletCode == palletCode).Includes(x => x.Details).First(); |
| | | |
| | | //if (stockInfo == null) |
| | |
| | | Dt_Warehouse warehouse = _warehouseRepository.QueryFirst(x => x.WarehouseCode == roadwayInfo.RoadwayNo); |
| | | if (warehouse == null) |
| | | { |
| | | return WebResponseContent.Instance.Error("æªæ¾å°æ¹ä»åº"); |
| | | return WebResponseContent.Instance.Error("æªæ¾å°è¯¥ä»åº"); |
| | | } |
| | | Dt_LocationInfo? locationInfo = _basicService.LocationInfoService.AssignLocation(roadwayInfo.RoadwayNo, warehouse.WarehouseId, "");// |
| | | if (locationInfo == null) |
| | |
| | | Roadway = "1", |
| | | SourceAddress = "", |
| | | TargetAddress = locationInfo.LocationCode, |
| | | TaskType = TaskTypeEnum.Inbound.ObjToInt(), |
| | | TaskStatus = TaskStatusEnum.New.ObjToInt(), |
| | | TaskType = TaskInboundTypeEnum.Inbound.ObjToInt(), |
| | | TaskStatus = TaskInStatusEnum.Line_InExecuting.ObjToInt(), |
| | | WarehouseId = warehouse.WarehouseId, |
| | | //PalletType = GetPalletType(warehouse, palletCode),//GetPalletType(warehouse, palletCode) |
| | | Creater = "WCS", |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// å建å
¥åºä»»å¡ |
| | | /// </summary> |
| | | /// <param name="inboundTask"></param> |
| | | /// <returns></returns> |
| | | /// <exception cref="NotImplementedException"></exception> |
| | | public ApiResponse<object> sendEnTask(InOutboundTaskReceived inboundTask) |
| | | { |
| | | WebResponseContent webResponseContent = new WebResponseContent(); |
| | | |
| | | try |
| | | { |
| | | List<Dt_Task> AddtaskList = new List<Dt_Task>(); |
| | | List<Dt_LocationInfo> Adddt_Locations = new List<Dt_LocationInfo>(); |
| | | List<Dt_StockInfo> Adddtstockt = new List<Dt_StockInfo>(); |
| | | |
| | | if (inboundTask.palletInfoList.Count > 0) |
| | | { |
| | | List<Dt_Task> taskData = BaseDal.QueryData(); |
| | | |
| | | Dt_StationManger dt_Station = _stationMangerService.QueryPlatform(inboundTask.NodeCode); |
| | | if (dt_Station == null) return MESresponse($"æªæ¾å°ç«å°ä¿¡æ¯,ç«å°ç¼å·ï¼{inboundTask.NodeCode}", false); |
| | | |
| | | foreach (PalletInfo palletInfo in inboundTask.palletInfoList) |
| | | { |
| | | Dt_LocationInfo location = null; |
| | | if (palletInfo.locationCode == null || palletInfo.locationCode == "") |
| | | { |
| | | Dt_Warehouse warehouse = _warehouseRepository.QueryFirst(x => x.WarehouseCode == dt_Station.StackerCraneCode); |
| | | |
| | | location = _basicService.LocationInfoService.AssignLocation(dt_Station.StackerCraneCode, warehouse.WarehouseId, "");//è·åå°æ°åºä½ |
| | | } |
| | | else |
| | | { |
| | | location = _locationInfoRepository.QueryFirst(x => x.LocationCode == palletInfo.locationCode); |
| | | } |
| | | if (location == null) return MESresponse($"æªæ¾å°è´§ä½ä¿¡æ¯,æ¡ç ï¼{palletInfo.palletCode}", false); |
| | | if (location.LocationStatus != (int)LocationStatusEnum.Free) return MESresponse($"æçæ¡ç ï¼{palletInfo.palletCode}ï¼æ¥æ¾å°çè´§ä½ï¼{location.LocationCode},ä¸ä¸ºç©ºè´§ä½ï¼", false); |
| | | |
| | | |
| | | //å建ç»çä¿¡æ¯ |
| | | var dt_Stock = new Dt_StockInfo |
| | | { |
| | | PalletCode = palletInfo.palletCode, |
| | | PalletType = 1, |
| | | LocationCode = location.LocationCode, |
| | | StockStatus = (int)StockStatusEmun.ç»çæå, |
| | | Creater = "WMS", |
| | | CreateDate = DateTime.Now, |
| | | MESsubPalletCode = palletInfo.palletCode, |
| | | }; |
| | | location.LocationStatus = (int)LocationStatusEnum.InStockLock; |
| | | |
| | | //çæç§»å¨ä»»å¡ |
| | | Dt_Task dt_Task = new() |
| | | { |
| | | PalletCode = palletInfo.palletCode, |
| | | TaskNum = GetTaskNum(nameof(SequenceEnum.SeqTaskNum)), |
| | | Roadway = location.RoadwayNo, |
| | | TaskType = TaskInboundTypeEnum.Inbound.ObjToInt(), |
| | | TaskStatus = TaskInStatusEnum.Line_InExecuting.ObjToInt(), |
| | | SourceAddress = dt_Station.StationCode, |
| | | TargetAddress = location.LocationCode, |
| | | CurrentAddress = dt_Station.StationCode, |
| | | NextAddress = location.LocationCode, |
| | | Grade = 1, |
| | | Creater = "MES", |
| | | Depth = location.Depth, |
| | | CreateDate = DateTime.Now, |
| | | MEStaskId = inboundTask.TaskId, |
| | | MESbusinessId = inboundTask.BusinessId, |
| | | MESsubPalletCode = palletInfo.subPalletCode |
| | | }; |
| | | Adddtstockt.Add(dt_Stock); |
| | | Adddt_Locations.Add(location); |
| | | AddtaskList.Add(dt_Task); |
| | | } |
| | | if (Adddtstockt.Count > 0 && Adddt_Locations.Count > 0 && AddtaskList.Count > 0) |
| | | { |
| | | _unitOfWorkManage.BeginTran(); |
| | | |
| | | |
| | | _stockRepository.AddData(Adddtstockt); |
| | | _locationInfoRepository.UpdateData(Adddt_Locations); |
| | | BaseDal.AddData(AddtaskList); |
| | | |
| | | var respon = PushTasksToWCS(AddtaskList, ""); |
| | | if (respon.Status) |
| | | { |
| | | _unitOfWorkManage.CommitTran(); //æäº¤äºå¡ |
| | | return MESresponse("", true); |
| | | } |
| | | else |
| | | { |
| | | _unitOfWorkManage.RollbackTran(); //åæ»äºå¡ |
| | | return MESresponse($"ä¸ååºåºå¤±è´¥ï¼åå ï¼{respon.Message}ï¼", false); |
| | | } |
| | | |
| | | } |
| | | else |
| | | { |
| | | return MESresponse("ä»»å¡çæå¤±è´¥ï¼", false); |
| | | } |
| | | |
| | | } |
| | | else |
| | | { |
| | | return MESresponse("æ¥æ¶å°MESæçç¼ç åè¡¨æ æ°æ®ï¼", false); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | _unitOfWorkManage.RollbackTran(); //åæ»äºå¡ |
| | | return MESresponse($"ä¸ååºåºå¤±è´¥ï¼åå ï¼{ex.Message}ï¼", false); |
| | | throw; |
| | | } |
| | | } |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Reflection; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core.Enums; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_Model.Models; |
| | | using WIDESEA_Core.Helper; |
| | | using Microsoft.Extensions.Logging; |
| | | using MailKit.Search; |
| | | using System.Reflection.Metadata; |
| | | using static WIDESEA_ITaskInfoService.ITaskService; |
| | | using WIDESEA_Common; |
| | | using WIDESEA_Core.LogHelper; |
| | | using WIDESEA_DTO.Task; |
| | | using WIDESEA_Common.TaskEnum; |
| | | using WIDESEA_Common.StockEnum; |
| | | using WIDESEA_Common.LocationEnum; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using Newtonsoft.Json; |
| | | using WIDESEA_Common.OtherEnum; |
| | | using WIDESEA_Core.Const; |
| | | using WIDESEA_DTO.ToMes; |
| | | using System.DirectoryServices.Protocols; |
| | | using System.Net; |
| | | |
| | | namespace WIDESEA_TaskInfoService |
| | | { |
| | | public partial class TaskService |
| | | { |
| | | |
| | | /// <summary> |
| | | /// ä¸ååºåºæ¥å£ |
| | | /// </summary> |
| | | /// <param name="outbound"></param> |
| | | /// <returns></returns> |
| | | public ApiResponse<object> sendExTask(InOutboundTaskReceived outbound) |
| | | { |
| | | |
| | | List<Dt_StockInfo> Adddtstockt = new List<Dt_StockInfo>(); |
| | | List<Dt_LocationInfo> Addlocations = new List<Dt_LocationInfo>(); |
| | | List<Dt_Task> Addtaskdt = new List<Dt_Task>(); |
| | | |
| | | if ( outbound != null ) |
| | | { |
| | | if (outbound.PalletCodeList.Count > 0) |
| | | { |
| | | List<Dt_StockInfo> StockData = _stockRepository.QueryData(); |
| | | List<Dt_LocationInfo> LocationData=_locationInfoRepository.QueryData(x=>x.LocationStatus== (int)LocationStatusEnum.InStock); |
| | | List<Dt_Task> taskData = BaseDal.QueryData(); |
| | | |
| | | foreach (string Pallet in outbound.PalletCodeList) |
| | | { |
| | | //æ¥æ¾åºåä¿¡æ¯ |
| | | Dt_StockInfo dt_StockInfo = StockData.Find(x => x.PalletCode == Pallet); |
| | | if(dt_StockInfo==null) return MESresponse($"æ¥æ¶å°çæçæ¡ç ï¼{Pallet},æªå¨ç³»ç»ä¸æ¾å°åºåä¿¡æ¯ï¼", false); |
| | | //æ¥æ¾åºä½ä¿¡æ¯ |
| | | Dt_LocationInfo locationInfo = LocationData.Find(x => x.LocationCode == dt_StockInfo.LocationCode); |
| | | if (locationInfo == null) return MESresponse($"æ¥æ¶å°çæçæ¡ç ï¼{Pallet},æªå¨ç³»ç»ä¸æ¾å°åºä½ä¿¡æ¯ï¼", false); |
| | | |
| | | //夿å½åè´§ä½æ¯å¦æä»»å¡ |
| | | Dt_Task _Task = taskData.Find(x => x.SourceAddress == locationInfo.LocationCode || x.TargetAddress == locationInfo.LocationCode); |
| | | if (_Task != null) return MESresponse($"æ¥æ¶å°çæçæ¡ç ï¼{Pallet},å½åæç对åºçåºä½ä¿¡æ¯å·²æä»»å¡ï¼ä¸å¯åºåºï¼", false); |
| | | |
| | | dt_StockInfo.StockStatus = (int)StockStatusEmun.åºåºéå®; |
| | | locationInfo.LocationStatus = (int)LocationStatusEnum.InStockLock; |
| | | |
| | | //çæç§»å¨ä»»å¡ |
| | | Dt_Task dt_Task = new() |
| | | { |
| | | PalletCode = dt_StockInfo.PalletCode, |
| | | TaskNum = GetTaskNum(nameof(SequenceEnum.SeqTaskNum)), |
| | | Roadway = locationInfo.RoadwayNo, |
| | | TaskType = TaskOutboundTypeEnum.Outbound.ObjToInt(), |
| | | TaskStatus = TaskOutStatusEnum.OutNew.ObjToInt(), |
| | | SourceAddress = locationInfo.LocationCode, |
| | | TargetAddress = outbound.NodeCode, |
| | | CurrentAddress = locationInfo.LocationCode, |
| | | NextAddress = outbound.NodeCode, |
| | | Grade = 1, |
| | | Creater = "MES", |
| | | Depth = locationInfo.Depth, |
| | | CreateDate = DateTime.Now, |
| | | MEStaskId= outbound.TaskId, |
| | | MESbusinessId= outbound.BusinessId, |
| | | MESsubPalletCode= dt_StockInfo.MESsubPalletCode |
| | | }; |
| | | Adddtstockt.Add(dt_StockInfo); |
| | | Addlocations.Add(locationInfo); |
| | | Addtaskdt.Add(dt_Task); |
| | | } |
| | | if (Adddtstockt.Count > 0 && Addlocations.Count > 0 && Addtaskdt.Count > 0) |
| | | { |
| | | _unitOfWorkManage.BeginTran(); |
| | | |
| | | |
| | | _stockRepository.AddData(Adddtstockt); |
| | | _locationInfoRepository.AddData(Addlocations); |
| | | BaseDal.AddData(Addtaskdt); |
| | | |
| | | var respon = PushTasksToWCS(Addtaskdt,""); |
| | | if (respon.Status) |
| | | { |
| | | _unitOfWorkManage.CommitTran(); //æäº¤äºå¡ |
| | | return MESresponse("", true); |
| | | } |
| | | else |
| | | { |
| | | _unitOfWorkManage.RollbackTran(); //åæ»äºå¡ |
| | | return MESresponse($"ä¸ååºåºå¤±è´¥ï¼åå ï¼{respon.Message}ï¼", false); |
| | | } |
| | | |
| | | } |
| | | else |
| | | { |
| | | return MESresponse("ä»»å¡çæå¤±è´¥ï¼", false); |
| | | } |
| | | |
| | | } |
| | | else |
| | | { |
| | | return MESresponse("æ¥æ¶å°MESæçç¼ç åè¡¨æ æ°æ®ï¼", false); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | return MESresponse("æ¥æ¶å°MESä¸åçä»»å¡ä¸ºç©ºï¼", false); |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
| | |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using Newtonsoft.Json; |
| | | using SqlSugar; |
| | | using System.DirectoryServices.Protocols; |
| | | using System.Net; |
| | | using System.Reflection.Emit; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Common.LocationEnum; |
| | | using WIDESEA_Common.OtherEnum; |
| | | using WIDESEA_Common.StockEnum; |
| | | using WIDESEA_Common.TaskEnum; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_Core.BaseRepository; |
| | | using WIDESEA_Core.BaseServices; |
| | | using WIDESEA_Core.Const; |
| | | using WIDESEA_Core.Enums; |
| | | using WIDESEA_Core.Helper; |
| | | using WIDESEA_DTO.Task; |
| | | using WIDESEA_DTO.ToMes; |
| | | using WIDESEA_IBasicService; |
| | | using WIDESEA_IInboundService; |
| | | using WIDESEA_IOutboundService; |
| | |
| | | private readonly IRepository<Dt_LocationInfo> _locationInfoRepository; |
| | | private readonly IRepository<Dt_RoadwayInfo> _roadwayInforepository; |
| | | private readonly IBasicService _basicService; |
| | | private readonly IDt_ApiInfoService _dt_ApiInfoService; |
| | | private readonly ILocationStatusChangeRecordService _locationStatusChangeRecordService; |
| | | private readonly IStationMangerService _stationMangerService; |
| | | |
| | | public IRepository<Dt_Task> Repository => BaseDal; |
| | | |
| | |
| | | {nameof(Dt_Task.CreateDate),OrderByType.Asc}, |
| | | }; |
| | | |
| | | public List<int> TaskTypes => typeof(TaskTypeEnum).GetEnumIndexList(); |
| | | |
| | | public List<int> TaskOutboundTypes => typeof(TaskTypeEnum).GetEnumIndexList(); |
| | | |
| | | public TaskService(IRepository<Dt_Task> BaseDal, IMapper mapper, IUnitOfWorkManage unitOfWorkManage, IRepository<Dt_StockInfo> stockRepository, IBasicService basicService, IRepository<Dt_Warehouse> warehouseRepository, IRepository<Dt_LocationInfo> locationInfoRepository, IRepository<Dt_RoadwayInfo> roadwayInforepository) : base(BaseDal) |
| | | public TaskService(IRepository<Dt_Task> BaseDal, IMapper mapper, IUnitOfWorkManage unitOfWorkManage, IRepository<Dt_StockInfo> stockRepository, IBasicService basicService, IRepository<Dt_Warehouse> warehouseRepository, IRepository<Dt_LocationInfo> locationInfoRepository, IRepository<Dt_RoadwayInfo> roadwayInforepository, IDt_ApiInfoService dt_ApiInfoService, ILocationStatusChangeRecordService locationStatusChangeRecordService, IStationMangerService stationMangerService) : base(BaseDal) |
| | | { |
| | | _mapper = mapper; |
| | | _unitOfWorkManage = unitOfWorkManage; |
| | |
| | | _warehouseRepository = warehouseRepository; |
| | | _locationInfoRepository = locationInfoRepository; |
| | | _roadwayInforepository = roadwayInforepository; |
| | | _dt_ApiInfoService = dt_ApiInfoService; |
| | | _locationStatusChangeRecordService = locationStatusChangeRecordService; |
| | | _stationMangerService=stationMangerService; |
| | | } |
| | | public int GetTaskNum(string sequenceName) |
| | | { |
| | | return Db.Ado.GetScalar($"SELECT NEXT VALUE FOR {sequenceName}").ObjToInt(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// ä»»å¡ä¿¡æ¯æ¨éè³WCS |
| | | /// </summary> |
| | |
| | | { |
| | | x.AGVArea = agvDescription; |
| | | }); |
| | | string url = AppSettings.Get("WCSApiAddress"); |
| | | if (string.IsNullOrEmpty(url)) |
| | | { |
| | | return WebResponseContent.Instance.Error($"æªæ¾å°WCSApiå°å,è¯·æ£æ¥é
ç½®æä»¶"); |
| | | } |
| | | string response = HttpHelper.Post($"{url}/api/Task/ReceiveTask", taskDTOs.Serialize()); |
| | | |
| | | return JsonConvert.DeserializeObject<WebResponseContent>(response) ?? WebResponseContent.Instance.Error("è¿åé误"); |
| | | var ConfigsAPIInfo = _dt_ApiInfoService.GetConfigsByAPIInfo(CateGoryConst.CONFIG_WCS_IPAddress, SysConfigConst.WCSReceiveTask); //è·åå°wcså
¨é¨ç±»åçæ¥å£ |
| | | string WCSReceiveTaskAPI = ConfigsAPIInfo.ApiAddress + ConfigsAPIInfo.ApiName; |
| | | |
| | | var respon = HttpHelper.Post(WCSReceiveTaskAPI, JsonConvert.SerializeObject(taskDTOs)); |
| | | if (respon != null) |
| | | { |
| | | WebResponseContent respone = JsonConvert.DeserializeObject<WebResponseContent>(respon.ToString()); |
| | | if (respone.Status) |
| | | { |
| | | return WebResponseContent.Instance.OK(); |
| | | } |
| | | else |
| | | { |
| | | return WebResponseContent.Instance.Error($"ä¸ååºåºå¤±è´¥ï¼åå ï¼{respone.Message}ï¼"); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | return WebResponseContent.Instance.Error("ä»»å¡ä¸å失败ï¼"); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return WebResponseContent.Instance.Error(ex.Message); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | | /// 夿巷éå
ç§»åº |
| | | /// </summary> |
| | | /// <param name="TaskNum"></param> |
| | | /// <param name="SourceAddress"></param> |
| | | /// <returns></returns> |
| | | public WebResponseContent IsRelocations(int TaskNum) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | List<Dt_LocationInfo> loca = new List<Dt_LocationInfo>(); |
| | | |
| | | Dt_Task task = BaseDal.QueryFirst(x => x.TaskNum == TaskNum); |
| | | if (task == null) return content.Error($"æªæ¾å°è¯¥ä»»å¡ä¿¡æ¯ï¼ä»»å¡å·ï¼{TaskNum}"); |
| | | string Locatask = task.SourceAddress; |
| | | |
| | | //è·åå°æ·±åºä½ç¼å· |
| | | Dt_LocationInfo DeepLocation = _basicService.LocationInfoService.Repository.QueryFirst(x => x.LocationCode == Locatask); |
| | | if(DeepLocation == null) return content.Error($"æªæ¾å°è¯¥è´§ä½ä¿¡æ¯,è´§ä½ç¼å·:{Locatask}"); |
| | | |
| | | //è¿è¡è·åæµ
åºä½ç¼å· |
| | | int locrow = DeepLocation.Row == 1 ? 2 : 3; |
| | | Dt_LocationInfo ShallowLocation = _basicService.LocationInfoService.Repository.QueryFirst(x =>x.Row== locrow && x.Layer== DeepLocation.Layer && x.Column== DeepLocation.Column && x.RoadwayNo== DeepLocation.RoadwayNo); |
| | | if (ShallowLocation == null) return content.Error($"æªæ¾å°è´§ä½ç¼å·:{Locatask}çæµ
è´§ä½"); |
| | | |
| | | if (ShallowLocation.LocationStatus == (int)LocationStatusEnum.Free) |
| | | { |
| | | return content.OK(data: task); //ç´æ¥è¿åå½åæ¥è¯¢çä»»å¡ |
| | | } |
| | | |
| | | |
| | | //妿æè´§ï¼åçæç§»åºä»»å¡ |
| | | if (ShallowLocation.LocationStatus == (int)LocationStatusEnum.InStock) |
| | | { |
| | | Dt_StockInfo dt_Stock = _stockRepository.QueryFirst(x => x.LocationCode == ShallowLocation.LocationCode); |
| | | if (dt_Stock == null) return content.Error($"è´§ä½ç¼å·:{Locatask}çæµ
è´§ä½åºåå¼å¸¸ï¼è¯·æ£æ¥ï¼ï¼ï¼"); |
| | | |
| | | Dt_Task _Task = BaseDal.QueryFirst(x => x.SourceAddress == ShallowLocation.LocationCode || x.TargetAddress == ShallowLocation.LocationCode); |
| | | if (_Task != null) return content.Error($"è´§ä½ç¼å·:{Locatask}çæµ
è´§ä½åºå·²æä»»å¡ï¼ä¸å¯è¿è¡ç§»åº"); |
| | | |
| | | //è¿è¡è·åæ°çåºä½ |
| | | Dt_LocationInfo? Nextlocation = _basicService.LocationInfoService.AssignLocation(DeepLocation.RoadwayNo, 0, "");//è·åå°æ°åºä½ |
| | | if (Nextlocation == null) |
| | | { |
| | | return content.Error($"è´§ä½åé
失败,æªæ¾å°å¯åé
è´§ä½"); |
| | | } |
| | | ShallowLocation.LocationStatus = (int)LocationStatusEnum.Lock; |
| | | Nextlocation.LocationStatus = (int)LocationStatusEnum.Lock; |
| | | loca.Add(ShallowLocation); |
| | | loca.Add(Nextlocation); |
| | | |
| | | _unitOfWorkManage.BeginTran(); |
| | | //çæç§»å¨ä»»å¡ |
| | | Dt_Task dt_Task = new() |
| | | { |
| | | PalletCode = dt_Stock.PalletCode, |
| | | TaskNum = GetTaskNum(nameof(SequenceEnum.SeqTaskNum)), |
| | | Roadway = Nextlocation.RoadwayNo, |
| | | TaskType = TaskRelocationTypeEnum.Relocation.ObjToInt(), |
| | | TaskStatus = TaskRelocationStatusEnum.RelocationNew.ObjToInt(), |
| | | SourceAddress = ShallowLocation.LocationCode, |
| | | TargetAddress = Nextlocation.LocationCode, |
| | | CurrentAddress = ShallowLocation.LocationCode, |
| | | NextAddress = Nextlocation.LocationCode, |
| | | Grade = 1, |
| | | Creater = "WMS", |
| | | Depth = ShallowLocation.Depth, |
| | | CreateDate = DateTime.Now, |
| | | }; |
| | | |
| | | _locationInfoRepository.AddData(loca); |
| | | BaseDal.AddData(dt_Task); //æ°å¢ä»»å¡ |
| | | _unitOfWorkManage.CommitTran(); |
| | | |
| | | return content.OK(data: dt_Task); |
| | | } |
| | | else |
| | | { |
| | | return content.Error($"è´§ä½ç¼å·:{Locatask}çæµ
è´§ä½ç¶æå¼å¸¸ï¼æµ
è´§ä½ç¼å·ï¼{ShallowLocation.LocationCode}"); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | _unitOfWorkManage.RollbackTran(); |
| | | throw; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// ä»»å¡å®æ |
| | | /// </summary> |
| | | /// <param name="taskNum">ä»»å¡ç¼å·</param> |
| | | /// <param name="HowWorks">模å¼ï¼1ï¼èªå¨ï¼2ï¼æå¨ï¼</param> |
| | | /// <returns></returns> |
| | | public WebResponseContent TaskCompleted(int taskNum) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | |
| | | Dt_Task task = BaseDal.QueryFirst(x => x.TaskNum == taskNum); |
| | | if (task == null) return WebResponseContent.Instance.Error("æªæ¾å°ä»»å¡ä¿¡æ¯"); |
| | | switch (task.TaskType) |
| | | { |
| | | case (int)TaskRelocationTypeEnum.Relocation: |
| | | return RelocationInTaskCompleted(task); |
| | | case (int)TaskInboundTypeEnum.Inbound: |
| | | return InboundTaskCompleted(task); |
| | | case (int)TaskOutboundTypeEnum.Outbound: |
| | | return OutboundTaskCompleted(task); |
| | | default: return content.Error($"ä»»å¡ç±»åé误ï¼ä»»å¡å·ï¼{task.TaskNum}"); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// ç§»åºå®ææ¹æ³ |
| | | /// </summary> |
| | | /// <param name="task"></param> |
| | | /// <returns></returns> |
| | | public WebResponseContent RelocationInTaskCompleted(Dt_Task task) |
| | | { |
| | | WebResponseContent webResponse = new WebResponseContent(); |
| | | try |
| | | { |
| | | Dt_StockInfo stockInfo = _stockRepository.QueryFirst(x => x.PalletCode == task.PalletCode); |
| | | Dt_LocationInfo locationpoint = _basicService.LocationInfoService.Repository.QueryFirst(x => x.LocationCode == task.SourceAddress); |
| | | Dt_LocationInfo locationEnd = _basicService.LocationInfoService.Repository.QueryFirst(x => x.LocationCode == task.TargetAddress); |
| | | List<Dt_LocationInfo> loca = new List<Dt_LocationInfo>(); |
| | | stockInfo.LocationCode = locationEnd.LocationCode; |
| | | stockInfo.StockStatus = StockStatusEmun.å·²å
¥åº.ObjToInt(); |
| | | locationpoint.LocationStatus = LocationStatusEnum.Free.ObjToInt(); |
| | | locationEnd.LocationStatus = LocationStatusEnum.InStock.ObjToInt(); |
| | | loca.Add(locationpoint); |
| | | loca.Add(locationEnd); |
| | | |
| | | _unitOfWorkManage.BeginTran(); |
| | | _stockRepository.UpdateData(stockInfo); |
| | | _basicService.LocationInfoService.Repository.UpdateData(loca); |
| | | BaseDal.DeleteData(task); |
| | | BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId == 0 ? OperateTypeEnum.èªå¨å®æ : OperateTypeEnum.äººå·¥å®æ); |
| | | |
| | | WebResponseContent content=MES_TransferCompletionFeedback(task); |
| | | if (!content.Status) |
| | | { |
| | | _unitOfWorkManage.RollbackTran(); |
| | | return content; |
| | | } |
| | | |
| | | _unitOfWorkManage.CommitTran(); |
| | | return webResponse.OK(); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | _unitOfWorkManage.RollbackTran(); |
| | | return webResponse.Error($"ç§»åºä»»å¡å®æå¤±è´¥ï¼ä»»å¡idï¼{task.TaskNum}"); |
| | | throw; |
| | | } |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å
¥åºä»»å¡å®æ |
| | | /// </summary> |
| | | /// <param name="tasknum"></param> |
| | | /// <returns></returns> |
| | | public WebResponseContent InboundTaskCompleted(int taskNum) |
| | | public WebResponseContent InboundTaskCompleted(Dt_Task task) |
| | | { |
| | | try |
| | | { |
| | | Dt_Task task = BaseDal.QueryFirst(x => x.TaskNum == taskNum); |
| | | if (task == null) |
| | | { |
| | | return WebResponseContent.Instance.Error($"æªæ¾å°è¯¥ä»»å¡ä¿¡æ¯"); |
| | | } |
| | | Dt_Warehouse warehouse = _warehouseRepository.QueryFirst(x => x.WarehouseId == task.WarehouseId); |
| | | Dt_StockInfo stockInfo = _stockRepository.Db.Queryable<Dt_StockInfo>().Where(x => x.PalletCode == task.PalletCode && x.WarehouseId == task.WarehouseId).First(); |
| | | if (stockInfo == null) |
| | |
| | | } |
| | | dt_LocationInfo.LocationStatus = LocationStatusEnum.InStock.ObjToInt(); |
| | | stockInfo.StockStatus = StockStatusEmun.å
¥åºå®æ.ObjToInt(); |
| | | |
| | | _unitOfWorkManage.BeginTran(); |
| | | //ä¿®æ¹è´§ä½ç¶æä¸ºæè´§ |
| | | _locationInfoRepository.UpdateData(dt_LocationInfo); |
| | |
| | | _stockRepository.UpdateData(stockInfo); |
| | | //å é¤ä»»å¡æ·»å åå² |
| | | BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId > 0 ? OperateTypeEnum.äººå·¥å®æ : OperateTypeEnum.èªå¨å®æ); |
| | | |
| | | WebResponseContent content = TaskCompletionFeedback(task); |
| | | if (!content.Status) |
| | | { |
| | | _unitOfWorkManage.RollbackTran(); |
| | | return content; |
| | | } |
| | | |
| | | _unitOfWorkManage.CommitTran(); |
| | | } |
| | | catch (Exception) |
| | |
| | | } |
| | | return WebResponseContent.Instance.OK(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// åºåºä»»å¡å®æ |
| | | /// </summary> |
| | | /// <param name="task"></param> |
| | | /// <returns></returns> |
| | | public WebResponseContent OutboundTaskCompleted(Dt_Task task) |
| | | { |
| | | WebResponseContent webResponse = new WebResponseContent(); |
| | | try |
| | | { |
| | | Dt_StockInfo stockInfo = _stockRepository.QueryFirst(x => x.PalletCode == task.PalletCode); |
| | | if (stockInfo == null) return webResponse.Error($"ä»»å¡ç¼å·ï¼{task.TaskNum},æªæ¾å°æçï¼{stockInfo.PalletCode}çåºåä¿¡æ¯"); |
| | | Dt_LocationInfo locationInfo = _locationInfoRepository.QueryFirst(x => x.LocationCode == task.SourceAddress); |
| | | if (locationInfo == null) return webResponse.Error($"ä»»å¡ç¼å·ï¼{task.TaskNum},æªæ¾å°æçï¼{stockInfo.PalletCode}çè´§ä½ä¿¡æ¯"); |
| | | |
| | | |
| | | stockInfo.StockStatus = StockStatusEmun.åºåºå®æ.ObjToInt(); |
| | | |
| | | int beforeStatus = locationInfo.LocationStatus; |
| | | locationInfo.LocationStatus = LocationStatusEnum.Free.ObjToInt(); |
| | | task.TaskStatus = TaskOutStatusEnum.OutFinish.ObjToInt(); |
| | | |
| | | _unitOfWorkManage.BeginTran(); |
| | | _stockRepository.DeleteData(stockInfo); |
| | | _locationInfoRepository.UpdateData(locationInfo); //ä¿®æ¹æç©ºè´§ä½ |
| | | BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId == 0 ? OperateTypeEnum.èªå¨å®æ : OperateTypeEnum.äººå·¥å®æ); |
| | | _locationStatusChangeRecordService.AddLocationStatusChangeRecord(locationInfo, beforeStatus, StockStatusEmun.åºåºå®æ.ObjToInt(), stockInfo.Details.FirstOrDefault()?.OrderNo ?? "", task.TaskNum); |
| | | WebResponseContent content = TaskCompletionFeedback(task); |
| | | if (!content.Status) |
| | | { |
| | | _unitOfWorkManage.RollbackTran(); |
| | | return content; |
| | | } |
| | | |
| | | _unitOfWorkManage.CommitTran(); |
| | | return webResponse.OK(); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | _unitOfWorkManage.RollbackTran(); |
| | | return webResponse.Error($"ç§»åºä»»å¡å®æå¤±è´¥ï¼ä»»å¡idï¼{task.TaskNum},é误åå ï¼{ex.Message}"); |
| | | throw; |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | //==============================================ç§»åºå®æå馿¥å£==================================================== |
| | | /// <summary> |
| | | /// ä¸ä¼ ç§»åºä»»å¡å®æç»MES |
| | | /// </summary> |
| | | /// <param name="dt_Task"></param> |
| | | /// <returns></returns> |
| | | public WebResponseContent MES_TransferCompletionFeedback(Dt_Task dt_Task) |
| | | { |
| | | WebResponseContent webResponse = new WebResponseContent(); |
| | | |
| | | try |
| | | { |
| | | TransferRequest transferRequest = new TransferRequest() |
| | | { |
| | | //ä¸å¡idï¼ä»»å¡idåç»è¿è¡æ´æ¹ |
| | | businessId = "1", |
| | | TaskId = "1", |
| | | SourceLocationCode = dt_Task.SourceAddress, |
| | | LocationCode = dt_Task.TargetAddress, |
| | | PalletCode = dt_Task.PalletCode, |
| | | Status = "FINISH", |
| | | ErrorStatus = "NORMAL", |
| | | ErrorInfo = "", |
| | | }; |
| | | |
| | | //è·åæ¥å£è¿è¡è°å |
| | | var ConfigsAPIInfo = _dt_ApiInfoService.GetConfigsByAPIInfo(CateGoryConst.CONFIG_MES_IPAddress, SysConfigConst.MESTransferCompletionFeedback); //è·åå°wcså
¨é¨ç±»åçæ¥å£ |
| | | string WCSReceiveTaskAPI = ConfigsAPIInfo.ApiAddress + ConfigsAPIInfo.ApiName; |
| | | if (WCSReceiveTaskAPI == null) |
| | | { |
| | | return webResponse.Error($"åºåºå¤±è´¥ï¼æªé
ç½®MESç§»åºå®æå馿¥å£"); |
| | | } |
| | | var respon = HttpHelper.Post(WCSReceiveTaskAPI, JsonConvert.SerializeObject(transferRequest)); |
| | | if (respon != null) |
| | | { |
| | | var response = JsonConvert.DeserializeObject<ApiResponse<object>>(respon); |
| | | if (response.Success) |
| | | { |
| | | return webResponse.OK(); |
| | | } |
| | | else |
| | | { |
| | | return webResponse.Error($"è°åæ¥å£å¤±è´¥ï¼åé¦åæ°åå ï¼{response.Message}"); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | return webResponse.Error($"è°åæ¥å£å¤±è´¥ï¼åé¦åæ°ä¸ºç©º"); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return webResponse.Error($"ç§»åºä»»å¡ä¸ä¼ 失败ï¼åå ï¼{ex.Message}"); |
| | | throw; |
| | | } |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// ä¸ä¼ åºå
¥åºä»»å¡å®æç»MES |
| | | /// </summary> |
| | | /// <param name="dt_Task"></param> |
| | | /// <returns></returns> |
| | | public WebResponseContent TaskCompletionFeedback(Dt_Task dt_Task) |
| | | { |
| | | WebResponseContent webResponse = new WebResponseContent(); |
| | | |
| | | try |
| | | { |
| | | TaskNotification transferRequest = new TaskNotification() |
| | | { |
| | | //ä¸å¡idï¼ä»»å¡idåç»è¿è¡æ´æ¹ |
| | | TaskId = "1", //ä»»å¡id |
| | | BusinessId = "1", //ä¸å¡id |
| | | PalletCode = dt_Task.PalletCode, |
| | | SubPalletCode = "",//åæçç¼ç |
| | | LocationCode = dt_Task.SourceAddress, |
| | | ErrorStatus = "NORMAL", |
| | | ErrorInfo = "", |
| | | }; |
| | | |
| | | //è·åæ¥å£è¿è¡è°å |
| | | var ConfigsAPIInfo = _dt_ApiInfoService.GetConfigsByAPIInfo(CateGoryConst.CONFIG_MES_IPAddress, SysConfigConst.MESTaskFeedback); //è·åå°wcså
¨é¨ç±»åçæ¥å£ |
| | | string WCSReceiveTaskAPI = ConfigsAPIInfo.ApiAddress + ConfigsAPIInfo.ApiName; |
| | | if (WCSReceiveTaskAPI == null) |
| | | { |
| | | return webResponse.Error($"ä»»å¡åé¦MESå¤±è´¥ï¼æªé
ç½®MESä»»å¡å®æå馿¥å£"); |
| | | } |
| | | var respon = HttpHelper.Post(WCSReceiveTaskAPI, JsonConvert.SerializeObject(transferRequest)); |
| | | if (respon != null) |
| | | { |
| | | var response = JsonConvert.DeserializeObject<ApiResponse<object>>(respon); |
| | | if (response.Success) |
| | | { |
| | | return webResponse.OK(); |
| | | } |
| | | else |
| | | { |
| | | return webResponse.Error($"è°åæ¥å£å¤±è´¥ï¼åé¦åæ°åå ï¼{response.Message}"); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | return webResponse.Error($"è°åæ¥å£å¤±è´¥ï¼åé¦åæ°ä¸ºç©º"); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return webResponse.Error($"ä»»å¡ä»»å¡ä¸ä¼ 失败ï¼åå ï¼{ex.Message}"); |
| | | throw; |
| | | } |
| | | } |
| | | |
| | | public ApiResponse<object> MESresponse(string Message, bool Success) |
| | | { |
| | | ApiResponse<object> apiResponse = new ApiResponse<object>(); |
| | | apiResponse.Message = Message; |
| | | apiResponse.Success = Success; |
| | | apiResponse.Code = 1; |
| | | return apiResponse; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | | /// åå»ºè´§ä½ |
| | | /// </summary> |
| | | /// <param name="locationInfo"></param> |
| | | /// <returns></returns> |
| | | /// <exception cref="NotImplementedException"></exception> |
| | | public ApiResponse<object> createLocation(List<LocationInfoDto> locationInfo) |
| | | { |
| | | List<Dt_LocationInfo> dt_LocationInfoList = new List<Dt_LocationInfo>(); |
| | | foreach (var item in locationInfo) |
| | | { |
| | | Dt_LocationInfo dt_LocationInfo = new Dt_LocationInfo() |
| | | { |
| | | LocationCode = item.locationCode, |
| | | LocationName = item.locationName, |
| | | RoadwayNo = item.roadwayNo, |
| | | Row = item.row, |
| | | Column = item.column, |
| | | Layer = item.layer, |
| | | Depth = (int)item.depth, |
| | | LocationType = item.locationType, |
| | | LocationStatus = item.locationStatus, |
| | | EnableStatus = item.enableStatus == true ? 1 : 0, |
| | | Remark = item.remark, |
| | | CreateDate = DateTime.Now, |
| | | Creater = App.User.UserName, |
| | | }; |
| | | dt_LocationInfoList.Add(dt_LocationInfo); |
| | | } |
| | | int res = _locationInfoRepository.AddData(dt_LocationInfoList); |
| | | if (res <= 0) |
| | | { |
| | | return MESresponse($"å建货ä½å¤±è´¥",false); |
| | | } |
| | | return MESresponse($"", true); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// ä¿®æ¹è´§ä½ |
| | | /// </summary> |
| | | /// <param name="locationInfo"></param> |
| | | /// <returns></returns> |
| | | /// <exception cref="NotImplementedException"></exception> |
| | | public ApiResponse<object> updateLocation(LocationInfoDto locationInfo) |
| | | { |
| | | Dt_LocationInfo dt_LocationInfo = new Dt_LocationInfo() |
| | | { |
| | | LocationCode = locationInfo.locationCode, |
| | | LocationName = locationInfo.locationName, |
| | | RoadwayNo = locationInfo.roadwayNo, |
| | | Row = locationInfo.row, |
| | | Column = locationInfo.column, |
| | | Layer = locationInfo.layer, |
| | | Depth = (int)locationInfo.depth, |
| | | LocationType = locationInfo.locationType, |
| | | LocationStatus = locationInfo.locationStatus, |
| | | EnableStatus = locationInfo.enableStatus == true ? 1 : 0, |
| | | Remark = locationInfo.remark, |
| | | CreateDate = DateTime.Now, |
| | | }; |
| | | bool res = _locationInfoRepository.Db.Updateable(dt_LocationInfo) |
| | | .Where(x => x.LocationCode == dt_LocationInfo.LocationCode) |
| | | .ExecuteCommand() > 0; |
| | | if (!res) |
| | | { |
| | | return MESresponse($"ä¿®æ¹è´§ä½å¤±è´¥",false); |
| | | } |
| | | return MESresponse($"", true); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å é¤è´§ä½ |
| | | /// </summary> |
| | | /// <param name="locationCode"></param> |
| | | /// <returns></returns> |
| | | /// <exception cref="NotImplementedException"></exception> |
| | | public ApiResponse<object> deleteLocation(List<string> locationCode) |
| | | { |
| | | WebResponseContent webResponseContent = new WebResponseContent(); |
| | | int res = _locationInfoRepository.Db.Deleteable<Dt_LocationInfo>().Where(x => locationCode.Contains(x.LocationCode)).ExecuteCommand(); |
| | | if (res <= 0) |
| | | { |
| | | return MESresponse($"å é¤è´§ä½å¤±è´¥",false); |
| | | } |
| | | return MESresponse($"", true); |
| | | } |
| | | } |
| | | } |
| | |
| | | using WIDESEA_Core.BaseController; |
| | | using WIDESEA_DTO.Stock; |
| | | using WIDESEA_DTO.Task; |
| | | using WIDESEA_DTO.ToMes; |
| | | using WIDESEA_ITaskInfoService; |
| | | using WIDESEA_Model.Models; |
| | | |
| | |
| | | public TaskController(ITaskService service) : base(service) |
| | | { |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// ä»»å¡å®ææ¥å£ |
| | | /// </summary> |
| | | /// <param name="taskNum"></param> |
| | | /// <returns></returns> |
| | | [HttpGet, Route("TaskCompleted"), AllowAnonymous] |
| | | public WebResponseContent TaskCompleted(int taskNum) |
| | | { |
| | | return Service.TaskCompleted(taskNum); |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// ç§»åºç³è¯·å¤ææ¥å£ |
| | | /// </summary> |
| | | /// <param name="taskNum"></param> |
| | | /// <returns></returns> |
| | | [HttpGet, Route("IsRelocations"), AllowAnonymous] |
| | | public WebResponseContent IsRelocations(int taskNum) |
| | | { |
| | | return Service.IsRelocations(taskNum); |
| | | } |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | | /// WCSç³è¯·å
¥åºä»»å¡(ä¸åé
è´§ä½) |
| | | /// </summary> |
| | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å
¥åºä»»å¡å®æ |
| | | /// MESä¸ååºåºä»»å¡ |
| | | /// </summary> |
| | | /// <param name="taskNum"></param> |
| | | /// <returns></returns> |
| | | [HttpPost, HttpGet, Route("InboundTaskCompleted"), AllowAnonymous] |
| | | public WebResponseContent InboundTaskCompleted(int taskNum) |
| | | [HttpPost, HttpGet, Route("sendExTask"), AllowAnonymous] |
| | | public ApiResponse<object> sendExTask([FromBody] InOutboundTaskReceived outbound) |
| | | { |
| | | return Service.InboundTaskCompleted(taskNum); |
| | | return Service.sendExTask(outbound); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// MESä¸åå
¥åºä»»å¡ |
| | | /// </summary> |
| | | /// <param name="taskNum"></param> |
| | | /// <returns></returns> |
| | | [HttpPost, HttpGet, Route("sendEnTask"), AllowAnonymous] |
| | | public ApiResponse<object> sendEnTask([FromBody] InOutboundTaskReceived outbound) |
| | | { |
| | | return Service.sendEnTask(outbound); |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// æ°å»ºè´§ä½ |
| | | /// </summary> |
| | | [HttpPost, HttpGet, Route("createLocation"), AllowAnonymous] |
| | | public ApiResponse<object> createLocation([FromBody] List<LocationInfoDto> locationInfo) |
| | | { |
| | | return Service.createLocation(locationInfo); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// ä¿®æ¹è´§ä½ |
| | | /// </summary> |
| | | [HttpPost, HttpGet, Route("updateLocation"), AllowAnonymous] |
| | | public ApiResponse<object> updateLocation([FromBody] LocationInfoDto locationInfo) |
| | | { |
| | | return Service.updateLocation(locationInfo); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å é¤è´§ä½ |
| | | /// </summary> |
| | | [HttpPost, HttpGet, Route("deleteLocation"), AllowAnonymous] |
| | | public ApiResponse<object> deleteLocation([FromBody] List<string> locationCode) |
| | | { |
| | | return Service.deleteLocation(locationCode); |
| | | } |
| | | } |
| | | } |
| | |
| | | builder.Services.AddWebSocketSetup(); |
| | | builder.Services.AddSqlsugarSetup();//SqlSugar å¯å¨æå¡ |
| | | builder.Services.AddDbSetup();//Db å¯å¨æå¡ |
| | | builder.Services.AddInitializationHostServiceSetup();//åºç¨åå§åæå¡æ³¨å
¥ |
| | | //builder.Services.AddInitializationHostServiceSetup();//åºç¨åå§åæå¡æ³¨å
¥ |
| | | //builder.Services.AddHostedService<PermissionDataHostService>();//æ°æ®æé |
| | | builder.Services.AddAutoMapperSetup(); |
| | | |
| | |
| | | "MainDB": "DB_WIDESEA", //å½å项ç®ç主åºï¼æå¯¹åºçè¿æ¥å符串çEnabledå¿
须为true |
| | | //è¿æ¥å符串 |
| | | //"ConnectionString": "HTI6FB1H05Krd07mNm9yBCNhofW6edA5zLs9TY~MNthRYW3kn0qKbMIsGp~3yyPDF1YZUCPBQx8U0Jfk4PH~ajNFXVIwlH85M3F~v_qKYQ3CeAz3q1mLVDn8O5uWt1~3Ut2V3KRkEwYHvW2oMDN~QIDXPxDgXN0R2oTIhc9dNu7QNaLEknblqmHhjaNSSpERdDVZIgHnMKejU_SL49tralBkZmDNi0hmkbL~837j1NWe37u9fJKmv91QPb~16JsuI9uu0EvNZ06g6PuZfOSAeFH9GMMIZiketdcJG3tHelo=", |
| | | "ConnectionString": "Data Source=.;Initial Catalog=WIDESEAWMS_SYLK;User ID=sa;Password=sa123456;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False", |
| | | "ConnectionString": "Data Source=.;Initial Catalog=SY_WIDESEAWMS_SYLK;User ID=sa;Password=123456;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False", |
| | | //"ConnectionString": "Data Source=10.30.4.92;Initial Catalog=WMS_TC;User ID=sa;Password=duo123456;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False", |
| | | //æ§WMSæ°æ®åºè¿æ¥ |
| | | //"TeConnectionString": "Data Source=10.30.4.92;Initial Catalog=TeChuang;User ID=sa;Password=duo123456;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False", |