| | |
| | | using Microsoft.AspNetCore.Authorization; |
| | | using Microsoft.AspNetCore.Http; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using System.Text; |
| | | using WIDESEAWCS_Common.TaskEnum; |
| | | using WIDESEAWCS_Core; |
| | | using WIDESEAWCS_Core.BaseController; |
| | |
| | | { |
| | | return WebResponseContent.Instance.Error($"鏈壘鍒板搴旇澶噞stationManger.StationDeviceCode}"); |
| | | } |
| | | CommonConveyorLine commonConveyorLine = (CommonConveyorLine)device; |
| | | string PickBarCode = commonConveyorLine.GetValue<ConveyorLineDBName, string>(ConveyorLineDBName.R_PickBarCode, stationManger.StationCode).Replace("\0", ""); |
| | | if (containerFlowDTO.ContainerCode!= PickBarCode) throw new Exception($"浼犲叆鏂欑鐮亄containerFlowDTO.ContainerCode}锛岃緭閫佹枡绠辩爜{PickBarCode}鏁版嵁閿欒"); |
| | | commonConveyorLine.SetValue(ConveyorLineDBName.W_PickToHode,(short)containerFlowDTO.Direction.ObjToInt(), stationManger.StationCode); |
| | | if (stationManger.StationDeviceCode== "CL1" || stationManger.StationDeviceCode == "CL2") |
| | | { |
| | | OtherDevice commonConveyorLine = (OtherDevice)device; |
| | | byte[] bytesPick = commonConveyorLine.Communicator.Read("2", 5); |
| | | string PickBarCode = Encoding.UTF8.GetString(bytesPick).Replace("\0", "").Replace("\\0", ""); |
| | | if (containerFlowDTO.ContainerCode != PickBarCode) throw new Exception($"浼犲叆鏂欑鐮亄containerFlowDTO.ContainerCode}锛岃緭閫佹枡绠辩爜{PickBarCode}鏁版嵁閿欒"); |
| | | if (containerFlowDTO.Direction == "100") |
| | | { |
| | | WebResponseContent responseContent = Service.ContainerFlow(containerFlowDTO, stationManger.StationDeviceCode); |
| | | if (!responseContent.Status) throw new Exception(responseContent.Message); |
| | | } |
| | | commonConveyorLine.Communicator.Write("22", (short)(containerFlowDTO.Direction == "100" ? 256 : 512)); |
| | | } |
| | | else |
| | | { |
| | | CommonConveyorLine commonConveyorLine = (CommonConveyorLine)device; |
| | | string PickBarCode = commonConveyorLine.GetValue<ConveyorLineDBName, string>(ConveyorLineDBName.R_PickBarCode, stationManger.StationCode).Trim(); |
| | | if (containerFlowDTO.ContainerCode != PickBarCode) throw new Exception($"浼犲叆鏂欑鐮亄containerFlowDTO.ContainerCode}锛岃緭閫佹枡绠辩爜{PickBarCode}鏁版嵁閿欒"); |
| | | if (containerFlowDTO.Direction == "100") |
| | | { |
| | | WebResponseContent responseContent = Service.ContainerFlow(containerFlowDTO, stationManger.StationDeviceCode); |
| | | if (!responseContent.Status) throw new Exception(responseContent.Message); |
| | | } |
| | | commonConveyorLine.SetValue(ConveyorLineDBName.W_PickToHode, (short)containerFlowDTO.Direction.ObjToInt(), stationManger.StationCode); |
| | | } |
| | | content.OK(); |
| | | } |
| | | catch (Exception ex) |
| | |
| | | } |
| | | return content; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 鐢宠鍏ュ簱 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost, HttpGet, Route("RequestInTask"), AllowAnonymous] |
| | | public WebResponseContent RequestInTask(string stationCode, string barCode) |
| | | { |
| | | return Service.RequestInTask(stationCode, barCode); |
| | | } |
| | | [HttpPost, HttpGet, Route("GetRouteEndPoint"), AllowAnonymous] |
| | | public WebResponseContent GetRouteEndPoint(string startPoint, int routeType) |
| | | { |
| | |
| | | /// </summary> |
| | | /// <param name="taskNum"></param> |
| | | /// <returns></returns> |
| | | [HttpPost, HttpGet, Route("RecWMSTaskCompleted"), AllowAnonymous] |
| | | public WebResponseContent RecWMSTaskCompleted(int taskNum) |
| | | [HttpPost, HttpGet, Route("RecTaskCompleted"), AllowAnonymous] |
| | | public WebResponseContent RecTaskCompleted(int taskNum) |
| | | { |
| | | return Service.RecWMSTaskCompleted(taskNum); |
| | | return Service.TaskCompleted(taskNum); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// WMS浠诲姟鍙栨秷鍚屾 |
| | | /// </summary> |
| | | /// <param name="taskNum"></param> |
| | | /// <returns></returns> |
| | | [HttpPost, HttpGet, Route("CancelTask"), AllowAnonymous] |
| | | public WebResponseContent CancelTask(List<TaskCancel> taskCancels) |
| | | { |
| | | return WebResponseContent.Instance.Error(); |
| | | } |
| | | } |
| | | } |