| | |
| | | Dt_trackloginfo trackloginfo = new Dt_trackloginfo() |
| | | { |
| | | tracklog_name = logName, |
| | | tracklog_content = JsonConvert.SerializeObject(entity), |
| | | //tracklog_content = JsonConvert.SerializeObject(entity), |
| | | tracklog_content = entity is string strEntity ? strEntity : JsonConvert.SerializeObject(entity),//妿entityæ¯å符串类åï¼åç´æ¥ä½¿ç¨ï¼å¦ååºåå为JSONå符串 |
| | | tracklog_createtime = DateTime.Now, |
| | | tracklog_type = content.Status ? "æå" : "失败", |
| | | tracklog_code = content.Status ? logCode : ("4" + logCode), |
| | |
| | | { |
| | | _taskService = taskService; |
| | | } |
| | | |
| | | |
| | | public WMSReturn ReturnWMS(WebResponseContent content, int successCode = 0, int failCode = 404) |
| | | { |
| | | return new WMSReturn |
| | | { |
| | | code = content.Status ? successCode : failCode, |
| | | msg = content.Message ?? (content.Status ? "æä½æå" : "æä½å¤±è´¥"), |
| | | data = content.Status ? content.Data : null |
| | | }; |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// WMSä¸åä»»å¡ |
| | | /// </summary> |
| | | /// <param name="taskDTOs"></param> |
| | | /// <returns></returns> |
| | | [HttpPost, Route("ReceiveTask"), AllowAnonymous] |
| | | public object ReceiveWMSTask([FromBody] List<WMSTasksDTO> taskDTOs) |
| | | public WMSReturn ReceiveWMSTask([FromBody] List<WMSTasksDTO> taskDTOs) |
| | | { |
| | | WebResponseContent content = _taskService.ReceiveWMSTask(taskDTOs); |
| | | if (!content.Status) |
| | | { |
| | | return new |
| | | { |
| | | code = "404", |
| | | msg = content.Message |
| | | }; |
| | | } |
| | | else |
| | | { |
| | | return new |
| | | { |
| | | code = "0", |
| | | msg = content.Message, |
| | | data = content.Data |
| | | }; |
| | | } |
| | | return ReturnWMS(content); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | /// <param name="wMSCancelTask"></param> |
| | | /// <returns></returns> |
| | | [HttpPost, Route("CancelWMSTask"), AllowAnonymous] |
| | | public object CancelWMSTask([FromBody] WMSCancelTask wMSCancelTask) |
| | | public WMSReturn CancelWMSTask([FromBody] WMSCancelTask wMSCancelTask) |
| | | { |
| | | WebResponseContent content = _taskService.CancelWMSTask(wMSCancelTask); |
| | | if (!content.Status) |
| | | { |
| | | return new |
| | | { |
| | | code = "404", |
| | | msg = content.Message |
| | | }; |
| | | } |
| | | else |
| | | { |
| | | return new |
| | | { |
| | | code = "0", |
| | | msg = content.Message, |
| | | data = content.Data |
| | | }; |
| | | } |
| | | return ReturnWMS(content); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | /// <param name="updateTaskPriority"></param> |
| | | /// <returns></returns> |
| | | [HttpPost, Route("UpdateWMSTaskPriority"), AllowAnonymous] |
| | | public object UpdateWMSTaskPriority([FromBody] WMSUpdateTaskPriority updateTaskPriority) |
| | | public WMSReturn UpdateWMSTaskPriority([FromBody] WMSUpdateTaskPriority updateTaskPriority) |
| | | { |
| | | WebResponseContent content = _taskService.UpdateWMSTaskPriority(updateTaskPriority); |
| | | if (!content.Status) |
| | | { |
| | | return new |
| | | { |
| | | code = "404", |
| | | msg = content.Message |
| | | }; |
| | | } |
| | | else |
| | | { |
| | | return new |
| | | { |
| | | code = "0", |
| | | msg = content.Message, |
| | | data = content.Data |
| | | }; |
| | | } |
| | | return ReturnWMS(content); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | /// <param name="WMSUpdateLocationArea"></param> |
| | | /// <returns></returns> |
| | | [HttpPost, Route("ModifyWMSLayoutZone"), AllowAnonymous] |
| | | public object ModifyWMSLayoutZone([FromBody] WMSUpdateLocationArea wMSUpdateLocationArea) |
| | | public WMSReturn ModifyWMSLayoutZone([FromBody] WMSUpdateLocationArea wMSUpdateLocationArea) |
| | | { |
| | | WebResponseContent content = _taskService.ModifyWMSLayoutZone(wMSUpdateLocationArea); |
| | | if (!content.Status) |
| | | { |
| | | return new |
| | | { |
| | | code = "404", |
| | | msg = content.Message |
| | | }; |
| | | } |
| | | else |
| | | { |
| | | return new |
| | | { |
| | | code = "0", |
| | | msg = content.Message, |
| | | data = content.Data |
| | | }; |
| | | } |
| | | return ReturnWMS(content); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | /// <param name="AreaCode">åºåå·</param> |
| | | /// <returns></returns> |
| | | [HttpPost, Route("LocationInquiry"), AllowAnonymous] |
| | | public object LocationInquiry(string AreaCode) |
| | | public WMSReturn LocationInquiry(string AreaCode) |
| | | { |
| | | WebResponseContent content = _taskService.LocationInquiry(AreaCode); |
| | | if (!content.Status) |
| | | { |
| | | return new |
| | | { |
| | | code = "404", |
| | | msg = content.Message |
| | | }; |
| | | } |
| | | else |
| | | { |
| | | return new |
| | | { |
| | | code = "0", |
| | | msg = content.Message, |
| | | data = content.Data |
| | | }; |
| | | } |
| | | return ReturnWMS(content); |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | finally |
| | | { |
| | | _trackloginfoService.AddTrackLog(gALAXISTaskInfo.Serialize(), content, "ä¸åå¯ä¹å£«AGVä»»å¡","",""); |
| | | _trackloginfoService.AddTrackLog(gALAXISTaskInfo, content, "ä¸åå¯ä¹å£«AGVä»»å¡","",""); |
| | | //dt_trackloginfoService.Instance.AddTrackLog(outTaskInfo, content, "æ¥æ¶å®èªWMSåºåºä»»å¡ä¸å", "", $"{msg},åæ´ç»æ:{content.Status}"); |
| | | } |
| | | } |