| | |
| | | /// </summary> |
| | | [Description("è´¨æ£åºåº")] |
| | | OutQuality = 130, |
| | | |
| | | /// <summary> |
| | | /// 空箱åºåº |
| | | /// </summary> |
| | | [Description("空箱åºåº")] |
| | | OutEmpty = 140, |
| | | |
| | | /// <summary> |
| | | /// è°æ¨åºåº |
| | | /// </summary> |
| | | [Description("è°æ¨åºåº")] |
| | | OutAllocate = 150, |
| | | |
| | | /// <summary> |
| | | /// å çåºåº |
| | | /// èååºåº |
| | | /// </summary> |
| | | [Description("å çåºåº")] |
| | | StackingPlates = 160, |
| | | [Description("èååºåº")] |
| | | OldOutbound = 160, |
| | | |
| | | /// <summary> |
| | | /// MESåºåº |
| | | /// </summary> |
| | |
| | | [Description("æåå¯å®åºåº")] |
| | | OutSendProduct = 240, |
| | | /// <summary> |
| | | /// æåMESåºåº/æåº |
| | | /// æåMESæåº |
| | | /// </summary> |
| | | [Description("æåMESæåº")] |
| | | OutMesRworkProduct = 250, |
| | |
| | | MesMatReturn = 560, |
| | | |
| | | /// <summary> |
| | | /// è°æ¨å
¥åº |
| | | /// </summary> |
| | | [Description("è°æ¨å
¥åº")] |
| | | InAllocate = 570, |
| | | |
| | | /// <summary> |
| | | /// MES大空æéæ |
| | | /// </summary> |
| | | [Description("MES大空æéæ")] |
| | |
| | | MesPalletSmallReturn = 585, |
| | | |
| | | /// <summary> |
| | | /// è°æ¨å
¥åº |
| | | /// æå¨å
¥åº |
| | | /// </summary> |
| | | [Description("è°æ¨å
¥åº")] |
| | | InAllocate = 570, |
| | | |
| | | /// <summary> |
| | | /// 线边ä»å
¥åº |
| | | /// </summary> |
| | | [Description("线边ä»å
¥åº")] |
| | | InboundXB = 580, |
| | | |
| | | /// <summary> |
| | | /// æºå°å
¥åº |
| | | /// </summary> |
| | | [Description("æºå°å
¥åº")] |
| | | InboundJT = 590, |
| | | |
| | | /// <summary> |
| | | /// 空箱å
¥åº |
| | | /// </summary> |
| | | [Description("空箱å
¥åº")] |
| | | [Description("æå¨å
¥åº")] |
| | | InEmpty = 600, |
| | | |
| | | /// <summary> |
| | |
| | | [Description("æå使ååº")] |
| | | InProductBack = 620, |
| | | /// <summary> |
| | | /// æå空æ¡ååº |
| | | /// æå空æååº |
| | | /// </summary> |
| | | [Description("æå空æ¡ååº")] |
| | | [Description("æå空æååº")] |
| | | EmptyProductBack = 630, |
| | | |
| | | /// <summary> |
| | |
| | | /// 1åè´§å®æ<br/> |
| | | /// 2æ¾è´§å®æ<br/> |
| | | /// </summary> |
| | | public int GoodsState { get; set; } |
| | | public string GoodsState { get; set; } |
| | | } |
| | | } |
| | |
| | | //WebResponseContent RequestWMSTask(string palletCode, string sourceAddress, string roadway); |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | /// <param name="sourceAddress"></param> |
| | | /// <param name="palletCode"></param> |
| | | /// <param name="heightType"></param> |
| | | /// <param name="roadways"></param> |
| | | /// <returns></returns> |
| | | WebResponseContent RequestWMSTask(string palletCode, string sourceAddress, int heightType, List<string> roadways); |
| | | |
| | | /// <summary> |
| | | /// åWMSç³è¯·åé
è´§ä½ |
| | | /// </summary> |
| | | /// <param name="taskNum">ä»»å¡å·</param> |
| | |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | WebResponseContent AgvBoxApplyPass(AgvCTUCancelDTO applyPassDTO, APIEnum SecureReply = APIEnum.AGV_CTUCancelTask); |
| | | /// <summary> |
| | | /// çæç©ºæ¡ä»»å¡ |
| | | /// </summary> |
| | | WebResponseContent AgvCarrying(int row, int startColumn, int endColumn, int layer, int targetLayer); |
| | | /// <summary> |
| | | /// é¢è°åº¦æä»¤ |
| | | /// </summary> |
| | |
| | | { |
| | | var task = _taskRepository.QueryFirst(x => secureApplyModel.ReceiveTaskID.ObjToInt() == x.TaskNum); |
| | | if (task == null) throw new Exception("æªæ¾å°ä»»å¡"); |
| | | if (task.TaskType == TaskTypeEnum.Outbound.ObjToInt()) |
| | | if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup) |
| | | { |
| | | var content = TakeRequest(task.CurrentAddress); |
| | | if (!content.Status) |
| | |
| | | if (task == null) throw new Exception($"æªæ¾å°ä»»å¡,ä»»å¡å·ã{agvUpdateModel.ReceiveTaskID}ã"); |
| | | switch (agvUpdateModel.GoodsState) |
| | | { |
| | | //case 1://åºåºæ ¹æ®è¿ä¸ªä¿¡å·å¤æåè´§å®æ |
| | | // if (task.TaskType == TaskTypeEnum.Outbound.ObjToInt()) |
| | | // { |
| | | // var content = TakeFinish(task.CurrentAddress); |
| | | // if (!content.Status) throw new Exception(content.Message); |
| | | // task.TaskState = TaskStatusEnum.AGV_Finish.ObjToInt(); |
| | | // var up = _taskRepository.DeleteAndMoveIntoHty(task, OperateTypeEnum.èªå¨å®æ); |
| | | // _taskService.TaskCompleted(task.TaskNum); |
| | | // } |
| | | // break; |
| | | case 2://å
¥åºæ ¹æ®è¿ä¸ªä¿¡å·å¤ææ¾è´§å®æ |
| | | case "1"://åºåºæ ¹æ®è¿ä¸ªä¿¡å·å¤æåè´§å®æ |
| | | if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup) |
| | | { |
| | | var content = TakeFinish(task.CurrentAddress); |
| | | if (!content.Status) |
| | | { |
| | | throw new Exception(content.Message); |
| | | }; |
| | | return agvResponse.OK("æå", "0"); |
| | | } |
| | | break; |
| | | case "2"://å
¥åºæ ¹æ®è¿ä¸ªä¿¡å·å¤ææ¾è´§å®æ |
| | | if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.InboundGroup) |
| | | { |
| | | Dt_StationManger dt_Station = _stationMangerRepository.QueryFirst(x => x.StationCode == task.NextAddress); |
| | |
| | | task.DeviceCode = dt_Station.StationDeviceCode; |
| | | var up = _taskRepository.UpdateData(task); |
| | | return agvResponse.OK("æå","0"); |
| | | } |
| | | else if(task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup) |
| | | { |
| | | _taskService.TaskCompleted(task.TaskNum); |
| | | return agvResponse.OK("æå", "0"); |
| | | } |
| | | break; |
| | | default: |
| | |
| | | [HttpPost, HttpGet, Route("TakeRequest"), AllowAnonymous] |
| | | public WebResponseContent TakeRequest(string code) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | Dt_StationManger stationManger = _stationMangerRepository.QueryFirst(x => x.AGVStationCode == code); |
| | | Dt_StationManger stationManger = _stationMangerRepository.QueryFirst(x => x.StationCode == code); |
| | | if (stationManger == null) |
| | | { |
| | | return WebResponseContent.Instance.Error($"æªæ¾å°ç«å°é
ç½®"); |
| | | return WebResponseContent.Instance.Error($"æªæ¾å°ç«å°é
ç½®{code}"); |
| | | } |
| | | IDevice? device = Storage.Devices.FirstOrDefault(x => x.DeviceCode == stationManger.StationDeviceCode); |
| | | if (device == null) |
| | | { |
| | | return WebResponseContent.Instance.Error($"æªæ¾å°å¯¹åºè®¾å¤"); |
| | | return WebResponseContent.Instance.Error($"æªæ¾å°å¯¹åºè®¾å¤{stationManger.StationDeviceCode}"); |
| | | } |
| | | |
| | | OtherDevice otherDevice = (OtherDevice)device; |
| | | |
| | | bool canPut = otherDevice.GetValue<GroundStationDBName, bool>(GroundStationDBName.R_IsCanTake, stationManger.StationCode); |
| | | if (canPut) |
| | | short Command = otherDevice.GetValue<R_ConveyorLineCPDB, short>(R_ConveyorLineCPDB.Command, stationManger.StationCode); |
| | | if (Command == 2) |
| | | { |
| | | otherDevice.SetValue(GroundStationDBName.W_TakeRequest, true, stationManger.StationCode); |
| | | return WebResponseContent.Instance.OK(); |
| | | content.OK("å
许åæ"); |
| | | } |
| | | else |
| | | { |
| | | otherDevice.SetValue(GroundStationDBName.W_TakeRequest, true, stationManger.StationCode); |
| | | Thread.Sleep(1000); |
| | | canPut = otherDevice.GetValue<GroundStationDBName, bool>(GroundStationDBName.R_IsCanTake, stationManger.StationCode); |
| | | if (canPut) |
| | | { |
| | | return WebResponseContent.Instance.OK(); |
| | | } |
| | | else |
| | | { |
| | | return WebResponseContent.Instance.Error($"åè´§ç³è¯·ä¸"); |
| | | } |
| | | return content.Error("ç¦æ¢åæ"); |
| | | } |
| | | return content; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return WebResponseContent.Instance.Error(ex.Message); |
| | | return content.Error(ex.Message); |
| | | } |
| | | } |
| | | |
| | |
| | | { |
| | | try |
| | | { |
| | | Dt_StationManger stationManger = _stationMangerRepository.QueryFirst(x => x.AGVStationCode == code); |
| | | Dt_StationManger stationManger = _stationMangerRepository.QueryFirst(x => x.StationCode == code); |
| | | if (stationManger == null) |
| | | { |
| | | return WebResponseContent.Instance.Error($"æªæ¾å°ç«å°é
ç½®"); |
| | |
| | | } |
| | | |
| | | OtherDevice otherDevice = (OtherDevice)device; |
| | | otherDevice.SetValue(GroundStationDBName.W_TakeFinish, true, stationManger.StationCode); |
| | | Thread.Sleep(1000); |
| | | otherDevice.SetValue(GroundStationDBName.W_TakeFinish, false, stationManger.StationCode); |
| | | if (device.DeviceCode.Contains("CP")) |
| | | { |
| | | otherDevice.SetValue(W_ConveyorLineCPDB.W_Command, 2, stationManger.StationCode); |
| | | } |
| | | return WebResponseContent.Instance.OK(); |
| | | } |
| | | catch (Exception ex) |
| | |
| | | { |
| | | return WebResponseContent.Instance.OK(data: _routerExtension.GetEndPoint(startPoint, routeType)); |
| | | } |
| | | [HttpPost, HttpGet, Route("AgvCarrying"), AllowAnonymous] |
| | | public WebResponseContent AgvCarrying(int row, int startColumn, int endColumn, int layer, int targetLayer) |
| | | { |
| | | return Service.AgvCarrying(row, startColumn, endColumn, layer, targetLayer); |
| | | } |
| | | /// <summary> |
| | | /// æµè¯å åæºåºåº |
| | | /// </summary> |
| | |
| | | { |
| | | return Service.RequestWMSTaskSimple(palletCode,sourceAddress, roadWay, taskType); |
| | | } |
| | | //[HttpPost, HttpGet, Route("WebSocketPushMessage"), AllowAnonymous] |
| | | //public WebResponseContent WebSocketPushMessage(string message) |
| | | //{ |
| | | // try |
| | | // { |
| | | // _webSocketServer.PublishAllClientPayload(message); |
| | | // return WebResponseContent.Instance.OK(); |
| | | // } |
| | | // catch(Exception ex) |
| | | // { |
| | | // return WebResponseContent.Instance.Error(ex.Message); |
| | | // } |
| | | //} |
| | | [HttpPost, HttpGet, Route("RecWMSTaskCompleted"), AllowAnonymous] |
| | | public WebResponseContent RecWMSTaskCompleted(int taskNum) |
| | | { |
| | |
| | | "DBType": "SqlServer", |
| | | //è¿æ¥å符串 |
| | | //"ConnectionString": "HTI6FB1H05Krd07mNm9yBCNhofW6edA5zLs9TY~MNthRYW3kn0qKbMIsGp~3yyPDF1YZUCPBQx8U0Jfk4PH~ajNFXVIwlH85M3F~v_qKYQ3CeAz3q1mLVDn8O5uWt1~3Ut2V3KRkEwYHvW2oMDN~QIDXPxDgXN0R2oTIhc9dNu7QNaLEknblqmHhjaNSSpERdDVZIgHnMKejU_SL49tralBkZmDNi0hmkbL~837j1NWe37u9fJKmv91QPb~16JsuI9uu0EvNZ06g6PuZfOSAeFH9GMMIZiketdcJG3tHelo=", |
| | | "ConnectionString": "Data Source=.;Initial Catalog=WIDESEA_WCSLLD;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=TestWCS_TC;User ID=sa;Password=duo123456;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False", |
| | | "ConnectionString": "Data Source=192.168.35.3;Initial Catalog=WIDESEA_WCSLLD;User ID=sa;Password=Sa123456;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False", |
| | | //"ConnectionString": "Data Source=192.168.35.3;Initial Catalog=TestWCS_TC;User ID=sa;Password=Sa123456;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False", |
| | | //"ConnectionString": "Data Source=10.30.4.92;Initial Catalog=TESTWCSCP_WCS;User ID=sa;Password=duo123456;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False", |
| | | "WMSConnectionStrings": "Data Source=.;Initial Catalog=WIDESEA_WMSLLD;User ID=sa;Password=123456;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False", |
| | | "WMSConnectionStrings": "Data Source=192.168.35.3;Initial Catalog=WIDESEA_WMSLLD;User ID=sa;Password=Sa123456;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False", |
| | | //"WMSConnectionStrings": "Data Source=10.30.4.92;Initial Catalog=WIDESEAWMS_HUAIAN;User ID=sa;Password=123456;Integrated Security=False;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False", |
| | | //è·¨å |
| | | "Cors": { |
| | |
| | | return WebResponseContent.Instance.Error(ex.Message); |
| | | } |
| | | } |
| | | public WebResponseContent AgvCarrying(int row,int startColumn, int endColumn, int startlayer,int targetLayer) |
| | | { |
| | | try |
| | | { |
| | | List<Dt_Task> tasks = new List<Dt_Task>(); |
| | | for (int i = startColumn; i <= endColumn; i++) |
| | | { |
| | | string column = i.ToString(); |
| | | if (i<10) |
| | | { |
| | | column = "0" + i.ToString(); |
| | | } |
| | | string layer = targetLayer.ToString(); |
| | | if (targetLayer<10) |
| | | { |
| | | layer = "0"+targetLayer.ToString(); |
| | | } |
| | | Dt_Task task = new Dt_Task() |
| | | { |
| | | WarehouseId = 7, |
| | | TaskNum = DateTime.Now.ToString("yyMMddHHmm").ObjToInt() + i, |
| | | PalletCode= DateTime.Now.ToString("yyMMddHHmm") +i, |
| | | PalletType=0, |
| | | DeviceCode="AGV_CP", |
| | | Roadway= "AGV_CP", |
| | | TaskType =999, |
| | | SourceAddress=string.Format($"AGV_CP-00{row}-0{column}-00{startlayer}-01"), |
| | | CurrentAddress=string.Format($"AGV_CP-00{row}-0{column}-00{startlayer}-01"), |
| | | TargetAddress= string.Format($"AGV_CP-00{row}-0{column}-00{layer}-01"), |
| | | NextAddress= string.Format($"AGV_CP-00{row}-0{column}-00{layer}-01"), |
| | | Grade=0, |
| | | WMSId=0, |
| | | AgvTaskNum = "CP" + DateTime.Now.ToString("yyMMddHHmm").ObjToInt() + i, |
| | | TaskState = TaskStatusEnum.New.ObjToInt(), |
| | | Remark= "æµè¯ç©ºæ¡" |
| | | }; |
| | | tasks.Add(task); |
| | | } |
| | | BaseDal.AddData(tasks); |
| | | return WebResponseContent.Instance.OK(""); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return WebResponseContent.Instance.Error(ex.Message); |
| | | } |
| | | |
| | | } |
| | | /// <summary> |
| | | /// æ¥æ¶WMSä»»å¡ä¿¡æ¯ |
| | | /// </summary> |
| | |
| | | task.CurrentAddress = item.SourceAddress; |
| | | |
| | | Dt_Router? router; |
| | | |
| | | if (task.TaskType==TaskTypeEnum.Relocation.ObjToInt()) |
| | | { |
| | | task.DeviceCode = task.Roadway; |
| | | task.NextAddress = task.TargetAddress; |
| | | task.TaskState = TaskStatusEnum.SC_Execute.ObjToInt(); |
| | | tasks.Add(task); |
| | | break; |
| | | } |
| | | TaskTypeGroup taskTypeGroup = item.TaskType.GetTaskTypeGroup(); |
| | | if (string.IsNullOrEmpty(item.AGVArea)) |
| | | { |
| | | |
| | | Dt_StationManger stationManger; |
| | | //è·åç«å°ä¿¡æ¯ |
| | | if (taskTypeGroup == TaskTypeGroup.InboundGroup) |
| | |
| | | |
| | | if (routers.Count == 1) |
| | | { |
| | | //å
¥åº |
| | | if (taskTypeGroup == TaskTypeGroup.InboundGroup) |
| | | { |
| | | task.CurrentAddress = router.StartPosi; |
| | | task.NextAddress = router.NextPosi; |
| | | task.DeviceCode = router.ChildPosiDeviceCode; |
| | | } |
| | | else |
| | | else //åºåº |
| | | { |
| | | task.DeviceCode = stationManger.StackerCraneCode; |
| | | task.NextAddress = router.NextPosi; |
| | | task.TaskState = (int)TaskStatusEnum.SC_Execute; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | //æåç åä»»å¡çæ |
| | | if (taskTypeGroup == TaskTypeGroup.InboundGroup && !task.Roadway.Contains("YL")) |
| | | { |
| | | task.CurrentAddress = router.StartPosi; |
| | | task.NextAddress = ""; |
| | | task.DeviceCode = router.ChildPosiDeviceCode; |
| | | } |
| | | else |
| | | else if(taskTypeGroup == TaskTypeGroup.InboundGroup && task.Roadway.Contains("YL")) //åæå
¥åº |
| | | { |
| | | router = routers.FirstOrDefault(x=>x.ChildPosiDeviceCode==task.Roadway); |
| | | task.CurrentAddress = router.StartPosi; |
| | |
| | | } |
| | | else |
| | | { |
| | | //æåå
¥åº |
| | | List<Dt_Router> routers = _routerRepository.QueryData(x => x.InOutType == item.TaskType && x.StartPosi=="AGV" && x.ChildPosiDeviceCode==item.RoadWay); |
| | | router = routers.FirstOrDefault(); |
| | | if (routers.Count == 1) |
| | |
| | | // return content; |
| | | //} |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | /// <param name="sourceAddress"></param> |
| | | /// <param name="palletCode"></param> |
| | | /// <param name="heightType"></param> |
| | | /// <param name="roadways"></param> |
| | | /// <returns></returns> |
| | | public WebResponseContent RequestWMSTask(string palletCode, string sourceAddress, int heightType, List<string> roadways) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | string address = AppSettings.Get("WMSApiAddress"); |
| | | if (string.IsNullOrEmpty(address)) |
| | | { |
| | | return WebResponseContent.Instance.Error($"æªæ¾å°WMSApiå°å"); |
| | | } |
| | | string responseStr = HttpHelper.Post($"{address}/api/Task/DeviceRequestInboundTaskByRoadways?stationCode={sourceAddress}&palletCode={palletCode}&heightType={heightType}", roadways.Serialize()); |
| | | WebResponseContent? responseContent = JsonConvert.DeserializeObject<WebResponseContent>(responseStr); |
| | | if (responseContent != null && responseContent.Status && responseContent.Data != null) |
| | | { |
| | | WMSTaskDTO? taskDTO = JsonConvert.DeserializeObject<WMSTaskDTO>(responseContent.Data.ToString()); |
| | | if (taskDTO != null) |
| | | { |
| | | content = ReceiveWMSTask(new List<WMSTaskDTO> { taskDTO }); |
| | | } |
| | | } |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | content = WebResponseContent.Instance.Error(ex.Message); |
| | | } |
| | | return content; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// åé
å··é |
| | |
| | | |
| | | } |
| | | } |
| | | else if (conveyorLineInfoRead != null && item.StationType == StationTypeEnum.StationType_OnlyOutbound.ObjToInt() && conveyorLineInfoRead.WR_ToHode <= 0 && conveyorLineInfoRead.WR_Request == 99 && !string.IsNullOrEmpty(conveyorLineInfoRead.WR_TMID) && conveyorLineInfoRead.WR_Task <= 0) //åºç«å°åé
ç®æ ç¹ |
| | | else if (conveyorLineInfoRead != null && item.StationType == StationTypeEnum.StationType_OnlyOutbound.ObjToInt() && conveyorLineInfoRead.WR_ToHode <= 0 && conveyorLineInfoRead.WR_Request == 99 && conveyorLineInfoRead.WR_Task <= 0) //åºç«å°åé
ç®æ ç¹ |
| | | { |
| | | Dt_Task task = _taskRepository.QueryFirst(x => x.CurrentAddress == item.StationCode && _taskService.TaskOutboundTypes.Contains(x.TaskType) && x.TaskState == TaskStatusEnum.Line_Execute.ObjToInt() && x.DeviceCode == device.DeviceCode); |
| | | if (task != null) |
| | | { |
| | | List<Dt_Router> routers = _routerRepository.QueryData(x => x.InOutType == task.TaskType && task.CurrentAddress == x.StartPosi); |
| | | Dt_Router? router = routers.FirstOrDefault(); |
| | | if (routers == null || routers.Count == 0 || router == null) |
| | | { |
| | | WriteError(item.StationName, $"æªæ¾å°å¯¹åºè·¯ç±ä¿¡æ¯,设å¤ç¼å·:{item.StationCode},ä»»å¡å·:{task.TaskNum}"); |
| | | continue; |
| | | } |
| | | if (routers.Count > 1) |
| | | { |
| | | WriteError(item.StationName, $"è·¯ç±ä¿¡æ¯é
ç½®é误,设å¤ç¼å·:{item.StationCode},ä»»å¡å·:{task.TaskNum}"); |
| | | continue; |
| | | } |
| | | //åéç®æ ç¹ |
| | | device.SetValue(WR_CLineYLDB.WR_Task, task.TaskNum, item.StationCode); |
| | | device.SetValue(WR_CLineYLDB.WR_Width, task.TaskLength, item.StationCode); |
| | | device.SetValue(WR_CLineYLDB.WR_TMID, task.PalletCode, item.StationCode); |
| | | device.SetValue(WR_CLineYLDB.WR_ToHode, router.NextPosi, item.StationCode); |
| | | device.SetValue(WR_CLineYLDB.WR_ToHode, task.NextAddress, item.StationCode); |
| | | device.SetValue(WR_CLineYLDB.WR_Reresult, 86, item.StationCode); |
| | | _taskService.UpdateTask(task,TaskStatusEnum.Line_Executing,nextAddress: router.NextPosi); |
| | | _taskService.UpdateTask(task,TaskStatusEnum.Line_Executing); |
| | | } |
| | | } |
| | | else if (conveyorLineInfoRead != null && item.StationType == StationTypeEnum.StationType_InboundAndOutbound.ObjToInt() && conveyorLineInfoRead.WR_Task > 0 && conveyorLineInfoRead.WR_Request == 98) //䏿¥¼èååºåºå£å®æ |
| | |
| | | return WebResponseContent.Instance.Error($"æªæ¾å°è·¯ç±ä¿¡æ¯,{task.NextAddress}"); |
| | | } |
| | | int oldStatus = task.TaskState; |
| | | task.DeviceCode = stationManger.StationDeviceCode; |
| | | task.TaskState = TaskStatusEnum.Line_Execute.ObjToInt(); |
| | | task.CurrentAddress = stationManger.StationCode; |
| | | task.NextAddress = router.NextPosi; |
| | | task.TargetAddress = router.NextPosi; |
| | | _taskRepository.UpdateData(task); |
| | | //todo å åæºå®æå®æ |
| | | //_taskService.UpdateTask(task, TaskStatusEnum.Line_Execute, deviceCode: stationManger.StationDeviceCode, currentAddress: stationManger.StationCode, nextAddress: router.NextPosi, targetAddress: router.NextPosi); |
| | | _taskService.UpdateTask(task, TaskStatusEnum.Line_Execute, deviceCode: stationManger.StationDeviceCode, currentAddress: stationManger.StationCode, nextAddress: router.NextPosi); |
| | | _taskExecuteDetailService.AddTaskExecuteDetail(taskNum, $"ç³»ç»èªå¨æµç¨,ä»»å¡ç¶æä»ã{oldStatus}ã转å°ã{task.TaskState}ã"); |
| | | WriteInfo(deviceCode, $"å åæºä»»å¡å®æ,ä»»å¡å·:{taskNum}"); |
| | | WriteInfo(deviceCode, $"å åæºåºåºä»»å¡å®æ,ä»»å¡å·:{taskNum}"); |
| | | } |
| | | else if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.InboundGroup || task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.RelocationGroup) |
| | | { |
| | |
| | | } |
| | | } |
| | | |
| | | //if (task != null && task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup) |
| | | //{ |
| | | // if (OutTaskStationIsOccupied(task) == null) |
| | | // { |
| | | // bool flag = false; |
| | | // List<string> otherOutStaionCodes = _routerService.QueryNextRoutes(commonStackerCrane.DeviceCode, task.NextAddress, task.TaskType).Select(x => x.ChildPosi).ToList(); |
| | | // List<Dt_Task> tasks = _taskService.QueryStackerCraneOutTasks(commonStackerCrane.DeviceCode, otherOutStaionCodes); |
| | | // foreach (var item in tasks) |
| | | // { |
| | | // if (OutTaskStationIsOccupied(task) != null) |
| | | // { |
| | | // flag = true; |
| | | // break; |
| | | // } |
| | | // } |
| | | // if (!flag) |
| | | // { |
| | | // task = _taskService.QueryStackerCraneInTask(commonStackerCrane.DeviceCode); |
| | | // } |
| | | // } |
| | | //} |
| | | |
| | | if (task != null && task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup) |
| | | { |
| | | if (OutTaskStationIsOccupied(task) == null) |
| | | { |
| | | bool flag = false; |
| | | List<string> otherOutStaionCodes = _routerService.QueryNextRoutes(commonStackerCrane.DeviceCode, task.NextAddress, task.TaskType).Select(x => x.ChildPosi).ToList(); |
| | | List<Dt_Task> tasks = _taskService.QueryStackerCraneOutTasks(commonStackerCrane.DeviceCode, otherOutStaionCodes); |
| | | foreach (var item in tasks) |
| | | { |
| | | if (OutTaskStationIsOccupied(task) != null) |
| | | { |
| | | flag = true; |
| | | break; |
| | | } |
| | | } |
| | | if (!flag) |
| | | { |
| | | task = _taskService.QueryStackerCraneInTask(commonStackerCrane.DeviceCode); |
| | | } |
| | | } |
| | | } |
| | | task = _taskService.QueryStackerCraneTask(commonStackerCrane.DeviceCode); |
| | | return task; |
| | | } |
| | | |
| | |
| | | if (device != null) |
| | | { |
| | | OtherDevice client = (OtherDevice)device; |
| | | if (client.GetValue<R_ConveyorLineCPDB, short>(R_ConveyorLineCPDB.Command, stationManger.StationCode) == 3)//åºåºç«å°æªè¢«å ç¨ |
| | | if (client.GetValue<WR_CLineYLDB, short>(WR_CLineYLDB.WR_Request, stationManger.StationCode) != 99)//åºåºç«å°æªè¢«å ç¨ |
| | | { |
| | | task.NextAddress = stationManger.StackerCraneStationCode; |
| | | _taskRepository.UpdateData(task); |
| | |
| | | { |
| | | throw new Exception("æªæ¾å°AGVç«ç¹"); |
| | | } |
| | | if (!stationMangerStart.StationCode.Contains("PNT") && stationMangerEnd.StationCode.Contains("PNT")) |
| | | { |
| | | agvTaskSend.TaskCode = "DUIGAO2"; |
| | | } |
| | | //åéAGVä»»å¡ |
| | | WebResponseContent content = _taskService.AgvSendTask(agvTaskSend, APIEnum.AgvSendTask); |
| | | if (!content.Status) |
| | |
| | | //æ´æ°ä»»å¡ä¿¡æ¯ |
| | | task.CurrentAddress = item.StationCode; |
| | | task.NextAddress = router.NextPosi; |
| | | task.PalletType = 1; |
| | | task.PalletCode = conveyorLineInfoRead.PalletCode; |
| | | _taskService.UpdateTask(task, TaskStatusEnum.Line_Executing); |
| | | WriteInfo(item.StationName, $"ä»»å¡å·{conveyorLineInfoRead.TaskNo}ä¸ä¸æ¥"); |
| | | } |
| | | } |
| | | else if (conveyorLineInfoRead != null && conveyorLineInfoRead.Command == 2 && conveyorLineInfoRead.TaskNo > 0) |
| | | { |
| | | Dt_Task task = _taskRepository.QueryFirst(x =>x.TaskNum== conveyorLineInfoRead.TaskNo && x.NextAddress == item.StationCode && _taskService.TaskOutboundTypes.Contains(x.TaskType) && x.TaskState == TaskStatusEnum.Line_Executing.ObjToInt() && x.DeviceCode == device.DeviceCode); |
| | | if (task != null) |
| | | { |
| | | //åé
å··é åå
¥æçæ°æ® |
| | | List<Dt_Router> routers = _routerRepository.QueryData(x => x.InOutType == task.TaskType && task.NextAddress == x.StartPosi); |
| | | Dt_Router router = routers.FirstOrDefault(); |
| | | if (router == null) |
| | | { |
| | | WriteError(item.StationName, $"ä»»å¡å·:{task.TaskNum}æªæ¾å°è·¯ç±é
置信æ¯"); |
| | | return Task.CompletedTask; |
| | | } |
| | | //æ´æ°ä»»å¡ä¿¡æ¯ |
| | | task.CurrentAddress = router.StartPosi; |
| | | task.NextAddress = task.TargetAddress; |
| | | task.DeviceCode = router.NextPosi; |
| | | _taskService.UpdateTask(task, TaskStatusEnum.AGV_Execute); |
| | | WriteInfo(item.StationName, $"ä»»å¡å·{conveyorLineInfoRead.TaskNo}ä¸ä¸æ¥"); |
| | | } |
| | | } |
| | | } |
| | | else if (item.StationType == StationTypeEnum.StationType_OnlyInbound.ObjToInt() && deviceProRead != null) |
| | | { |
| | |
| | | task.TaskState = TaskStatusEnum.Line_Execute.ObjToInt(); |
| | | task.CurrentAddress = stationManger.StationCode; |
| | | task.NextAddress = router.NextPosi; |
| | | task.TargetAddress = router.NextPosi; |
| | | _taskRepository.UpdateData(task); |
| | | _taskService.UpdateTask(task, TaskStatusEnum.Line_Execute); |
| | | //todo å åæºå®æå®æ |
| | | //_taskService.UpdateTask(task, TaskStatusEnum.Line_Execute, deviceCode: stationManger.StationDeviceCode, currentAddress: stationManger.StationCode, nextAddress: router.NextPosi, targetAddress: router.NextPosi); |
| | | _taskExecuteDetailService.AddTaskExecuteDetail(taskNum, $"ç³»ç»èªå¨æµç¨,ä»»å¡ç¶æä»ã{oldStatus}ã转å°ã{task.TaskState}ã"); |
| | |
| | | {field:'agvStationHeight',title:'åæ¾é«åº¦',type:'float',width:110,require:true,align:'left'}, |
| | | {field:'agvFrontCode',title:'AGVåç½®ç¹',type:'string',width:110,require:true,align:'left'}, |
| | | {field:'stationArea',title:'AGVåºå',type:'string',width:110,require:true,align:'left',bind: { key: "agvStationAreaEnum", data: [] }}, |
| | | {field:'isOccupied',title:'æ¯å¦å ç¨',type:'string',width:110,require:true,align:'left',bind: { key: "enable", data: [] }}, |
| | | {field:'creater',title:'å建è
',type:'string',width:110,require:true,align:'left'}, |
| | | {field:'createDate',title:'å建æ¶é´',type:'datetime',width:150,require:true,align:'left'}, |
| | | {field:'modifier',title:'ä¿®æ¹äºº',type:'string',width:100,align:'left'}, |
| | |
| | | }); |
| | | const searchFormOptions = ref([ |
| | | [ |
| | | { title: "æçç¼å·", field: "palletCode" }, |
| | | { title: "è´§ä½ç¼å·", field: "locationCode" }, |
| | | { title: "æçç¼å·", field: "palletCode",type:"like" }, |
| | | { title: "è´§ä½ç¼å·", field: "locationCode",type:"like" }, |
| | | {title: "åºåç»ç»", field:"materielInvOrgId",type:"select",dataKey:"materielInvOrgEnum",data:[]}, |
| | | {title: "ç©æç¼å·", field:"materielCode",type:"like"}, |
| | | ], |
| | | ]); |
| | | const columns = ref([ |
| | |
| | | /// <summary> |
| | | /// æå°åº |
| | | /// </summary> |
| | | [Description("æå°ç 头")] |
| | | AreaA = 0, |
| | | |
| | | /// <summary> |
| | | /// æååº |
| | | /// </summary> |
| | | [Description("æååºå
")] |
| | | AreaB = 1, |
| | | [Description("æå°åº")] |
| | | AreaA = 1, |
| | | |
| | | /// <summary> |
| | | /// å
¥åºåº |
| | | /// </summary> |
| | | [Description("å
¥åºåº")] |
| | | AreaC = 2, |
| | | |
| | | /// <summary> |
| | | /// æ·èåº |
| | | /// </summary> |
| | | [Description("æ·èåº")] |
| | | AreaD = 3, |
| | | AreaB = 2, |
| | | |
| | | /// <summary> |
| | | /// ç»å¸åº |
| | | /// </summary> |
| | | [Description("ç»å¸åº")] |
| | | AreaE = 4, |
| | | AreaC = 3, |
| | | |
| | | /// <summary> |
| | | /// æ·èåº |
| | | /// </summary> |
| | | [Description("æ·èåº")] |
| | | AreaD = 4, |
| | | |
| | | /// <summary> |
| | | /// æååº |
| | | /// </summary> |
| | | [Description("ç»å¸åº")] |
| | | AreaF = 5, |
| | | [Description("æååº")] |
| | | AreaE = 5, |
| | | |
| | | /// <summary> |
| | | /// å°å·åº |
| | | /// </summary> |
| | | [Description("å°å·åº")] |
| | | AreaG = 6, |
| | | AreaF = 6, |
| | | |
| | | /// <summary> |
| | | /// å²ååº |
| | | /// </summary> |
| | | [Description("å²ååº")] |
| | | AreaH = 7 |
| | | AreaG = 7, |
| | | |
| | | /// <summary> |
| | | /// åæåº |
| | | /// </summary> |
| | | [Description("åæåº")] |
| | | AreaH = 8, |
| | | |
| | | /// <summary> |
| | | /// 纸è¢åº |
| | | /// </summary> |
| | | [Description("纸è¢åº")] |
| | | AreaI = 9, |
| | | |
| | | /// <summary> |
| | | /// å¸è¢åº |
| | | /// </summary> |
| | | [Description("å¸è¢åº")] |
| | | AreaJ = 10, |
| | | |
| | | /// <summary> |
| | | /// 纸æ¯åº |
| | | /// </summary> |
| | | [Description("纸æ¯åº")] |
| | | AreaK = 11, |
| | | |
| | | /// <summary> |
| | | /// é¾ååº |
| | | /// </summary> |
| | | [Description("é¾ååº")] |
| | | AreaL = 12 |
| | | } |
| | | } |
| | |
| | | OutAllocate = 150, |
| | | |
| | | /// <summary> |
| | | /// èååºåº |
| | | /// </summary> |
| | | [Description("èååºåº")] |
| | | OldOutbound = 160, |
| | | |
| | | /// <summary> |
| | | /// MESåºåº |
| | | /// </summary> |
| | | [Description("MESåºåº")] |
| | |
| | | /// </summary> |
| | | [Description("æååº")] |
| | | LLDCP, |
| | | /// <summary> |
| | | /// åæåº |
| | | /// </summary> |
| | | [Description("åæåº")] |
| | | LLDYL, |
| | | } |
| | | public enum WarehouseTypEnum |
| | | { |
| | |
| | | WebResponseContent RequestYLWMSTaskSimple(string stationCode, string palletCode); |
| | | |
| | | /// <summary> |
| | | /// åé
å··é |
| | | /// åé
åæå··é |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | string AssignYLRoadwayNo(string palletCode); |
| | |
| | | /// <param name="startPoint"></param> |
| | | /// <returns></returns> |
| | | WebResponseContent EmptyBackTask(string barCode, string startPoint); |
| | | |
| | | /// <summary> |
| | | /// æååºåº |
| | | /// </summary> |
| | | /// <param name="Count"></param> |
| | | /// <returns></returns> |
| | | WebResponseContent RequestCPWMSTaskOut(int Count); |
| | | /// <summary> |
| | | /// åæåºåºä»»å¡ |
| | | /// </summary> |
| | | /// <param name="materielCode">ç©æä»£ç </param> |
| | | /// <param name="materielWide">ç©æå¹
宽</param> |
| | | /// <param name="Count">å·æ°</param> |
| | | /// <returns></returns> |
| | | WebResponseContent RequestYLWMSTaskOut(string materielCode, int materielWide, int Count); |
| | | |
| | | WebResponseContent IsRelocation(string startAddress, string endAddress, string roadWay); |
| | | } |
| | | } |
| | |
| | | [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "åºå")] |
| | | public int StationArea { get; set; } |
| | | /// <summary> |
| | | /// æ¯å¦å ç¨ |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "æ¯å¦å ç¨")] |
| | | public int IsOccupied { get; set; } |
| | | /// <summary> |
| | | /// 夿³¨ |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "夿³¨")] |
| | |
| | | {nameof(Dt_Task.CreateDate),OrderByType.Asc}, |
| | | }; |
| | | |
| | | public List<int> TaskTypes => typeof(TaskTypeEnum).GetEnumIndexList(); |
| | | public List<int> TaskInboundTypes => typeof(TaskTypeEnum).GetEnumIndexList().Where(x => x >= 500 && x < 900).ToList(); |
| | | |
| | | public List<int> TaskOutboundTypes => typeof(TaskTypeEnum).GetEnumIndexList(); |
| | | public List<int> TaskOutboundTypes => typeof(TaskTypeEnum).GetEnumIndexList().Where(x => x >= 100 && x < 500).ToList(); |
| | | |
| | | public TaskService(ITaskRepository BaseDal, IMapper mapper, IUnitOfWorkManage unitOfWorkManage, IStockRepository stockRepository, IBasicService basicService, IRecordService recordService, IStockService stockService, IBasicRepository basicRepository, IApiInfoRepository apiInfoRepository, IInvokeERPService invokeERPService, IPalletTypeInfoRepository palletTypeInfoRepository, IAGVStationInfoRepository agvStationInfoRepository) : base(BaseDal) |
| | | { |
| | |
| | | } |
| | | else if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.OutbondGroup) |
| | | { |
| | | return await Task.FromResult(RelocationTaskCompleted(task)); |
| | | return await Task.FromResult(OutboundTaskCompleted(task)); |
| | | } |
| | | else if (task.TaskType.GetTaskTypeGroup() == TaskTypeGroup.RelocationGroup) |
| | | { |
| | |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Reflection.Metadata; |
| | | using System.Text; |
| | | using System.Text.RegularExpressions; |
| | | using System.Threading.Tasks; |
| | |
| | | } |
| | | |
| | | string roadwayNo = ""; |
| | | if (stockInfo.MaterielWide < 2200 && stockInfo.MaterielThickness > 800) |
| | | if (stockInfo.MaterielThickness > 800) |
| | | { |
| | | List<LocationCount> locationCounts = Db.Queryable<Dt_LocationInfo>().Where(x => x.WarehouseId == warehouse.WarehouseId && x.LocationType == LocationTypeEnum.Undefined.ObjToInt() && x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && (x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt() || x.EnableStatus == EnableStatusEnum.Normal.ObjToInt()) && x.RoadwayNo.Contains("SC01_YL")).GroupBy(x => x.RoadwayNo).Select(x => new LocationCount { RoadwayNo = x.RoadwayNo, Count = SqlFunc.AggregateCount(x) }).ToList(); |
| | | roadwayNo = locationCounts.OrderBy(x => x.Count).FirstOrDefault()?.RoadwayNo ?? ""; |
| | | } |
| | | else if (stockInfo.MaterielWide>2200 && stockInfo.MaterielThickness>800) |
| | | { |
| | | List<LocationCount> locationCounts = Db.Queryable<Dt_LocationInfo>().Where(x => x.WarehouseId == warehouse.WarehouseId && x.LocationType == LocationTypeEnum.Undefined.ObjToInt() && x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && (x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt() || x.EnableStatus == EnableStatusEnum.Normal.ObjToInt()) && !x.RoadwayNo.Contains("SC01_YL")).GroupBy(x => x.RoadwayNo).Select(x => new LocationCount { RoadwayNo = x.RoadwayNo, Count = SqlFunc.AggregateCount(x) }).ToList(); |
| | | roadwayNo = locationCounts.OrderBy(x => x.Count).FirstOrDefault()?.RoadwayNo ?? ""; |
| | | List<LocationCount> locationCounts = Db.Queryable<Dt_LocationInfo>().Where(x => x.WarehouseId == warehouse.WarehouseId && x.LocationType == LocationTypeEnum.Undefined.ObjToInt() && x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && (x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt() || x.EnableStatus == EnableStatusEnum.Normal.ObjToInt()) && x.RoadwayNo.Contains("YL")).GroupBy(x => x.RoadwayNo).Select(x => new LocationCount { RoadwayNo = x.RoadwayNo, Count = SqlFunc.AggregateCount(x) }).ToList(); |
| | | roadwayNo = locationCounts.OrderByDescending(x => x.Count).FirstOrDefault()?.RoadwayNo ?? ""; |
| | | if (stockInfo.MaterielWide > 2200) |
| | | { |
| | | locationCounts = Db.Queryable<Dt_LocationInfo>().Where(x => x.WarehouseId == warehouse.WarehouseId && x.LocationType == LocationTypeEnum.Undefined.ObjToInt() && x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && (x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt() || x.EnableStatus == EnableStatusEnum.Normal.ObjToInt()) && !x.RoadwayNo.Contains("SC01_YL")).GroupBy(x => x.RoadwayNo).Select(x => new LocationCount { RoadwayNo = x.RoadwayNo, Count = SqlFunc.AggregateCount(x) }).ToList(); |
| | | roadwayNo = locationCounts.OrderByDescending(x => x.Count).FirstOrDefault()?.RoadwayNo ?? ""; |
| | | } |
| | | } |
| | | return !string.IsNullOrEmpty(roadwayNo) ? (roadwayNo) : throw new Exception("æªæ¾å°å¯åé
å··é"); |
| | | } |
| | |
| | | throw new Exception(ex.Message); |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// å
¥åºå®æ |
| | | /// </summary> |
| | | public WebResponseContent InboundTaskCompleted(Dt_Task task) |
| | | { |
| | | try |
| | | { |
| | | Dt_Warehouse warehouse = _basicRepository.WarehouseRepository.QueryFirst(x => x.WarehouseId == task.WarehouseId); |
| | | if (warehouse.WarehouseCode == WarehouseEnum.LLDCP.ToString()) //æå宿 |
| | | { |
| | | Dt_LocationInfo locationInfoEnd = _basicService.LocationInfoService.Repository.QueryFirst(x => x.LocationCode == task.TargetAddress); |
| | | if (locationInfoEnd == null) |
| | | { |
| | | return WebResponseContent.Instance.Error($"æªæ¾å°å¯¹åºçç»ç¹è´§ä½ä¿¡æ¯"); |
| | | } |
| | | Dt_AGVStationInfo agvstation = _agvStationInfoRepository.QueryFirst(x => x.AGVStationCode == task.SourceAddress && x.StationArea == AGVStationAreaEnum.AreaA.ObjToInt()); |
| | | if (agvstation != null) |
| | | { |
| | | agvstation.IsOccupied = WhetherEnum.False.ObjToInt(); |
| | | } |
| | | Dt_ProStockInfo proStockInfo = _stockRepository.ProStockInfoRepository.QueryFirst(x => x.PalletCode == task.PalletCode); |
| | | if (proStockInfo != null && proStockInfo.StockStatus == StockStatusEmun.MES空æéåº.ObjToInt()) |
| | | { |
| | | task.TaskStatus = TaskStatusEnum.Finish.ObjToInt(); |
| | | _unitOfWorkManage.BeginTran(); |
| | | if (agvstation != null) |
| | | { |
| | | _agvStationInfoRepository.UpdateData(agvstation); |
| | | } |
| | | proStockInfo.LocationCode = locationInfoEnd.LocationCode; |
| | | proStockInfo.StockStatus = StockStatusEmun.å
¥åºå®æ.ObjToInt(); |
| | | _stockRepository.ProStockInfoRepository.UpdateData(proStockInfo); |
| | | _basicService.LocationInfoService.UpdateLocationStatus(locationInfoEnd, proStockInfo.PalletType, LocationStatusEnum.InStock, proStockInfo.WarehouseId); |
| | | BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId > 0 ? WIDESEA_Core.Enums.OperateTypeEnum.äººå·¥å®æ : WIDESEA_Core.Enums.OperateTypeEnum.èªå¨å®æ); |
| | | _unitOfWorkManage.CommitTran(); |
| | | } |
| | | else |
| | | { |
| | | return WebResponseContent.Instance.Error($"æªæ¾å°å¯¹åºåºåä¿¡æ¯"); |
| | | } |
| | | } |
| | | else//åæåºå®æ |
| | | { |
| | | Dt_StockInfo stockInfo = _stockService.StockInfoService.Repository.QueryFirst(x => x.PalletCode == task.PalletCode); |
| | | if (stockInfo == null) |
| | | { |
| | | return WebResponseContent.Instance.Error($"æªæ¾å°å¯¹åºåºåä¿¡æ¯"); |
| | | } |
| | | Dt_LocationInfo locationInfoEnd = _basicService.LocationInfoService.Repository.QueryFirst(x => x.LocationCode == task.TargetAddress); |
| | | if (locationInfoEnd == null) |
| | | { |
| | | return WebResponseContent.Instance.Error($"æªæ¾å°å¯¹åºçç»ç¹è´§ä½ä¿¡æ¯"); |
| | | } |
| | | task.TaskStatus = TaskStatusEnum.Finish.ObjToInt(); |
| | | _unitOfWorkManage.BeginTran(); |
| | | stockInfo.LocationCode = locationInfoEnd.LocationCode; |
| | | stockInfo.StockStatus = StockStatusEmun.å
¥åºå®æ.ObjToInt(); |
| | | _stockService.StockInfoService.Repository.UpdateData(stockInfo); |
| | | _basicService.LocationInfoService.UpdateLocationStatus(locationInfoEnd, stockInfo.PalletType, LocationStatusEnum.InStock, stockInfo.WarehouseId); |
| | | BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId > 0 ? WIDESEA_Core.Enums.OperateTypeEnum.äººå·¥å®æ : WIDESEA_Core.Enums.OperateTypeEnum.èªå¨å®æ); |
| | | _unitOfWorkManage.CommitTran(); |
| | | } |
| | | return WebResponseContent.Instance.OK(); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | _unitOfWorkManage.RollbackTran(); |
| | | return WebResponseContent.Instance.Error(ex.Message); |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// åé
æåå··é |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public string AssignCPRoadwayNo() |
| | | { |
| | | try |
| | |
| | | |
| | | string roadwayNo = ""; |
| | | List<LocationCount> locationCounts = Db.Queryable<Dt_LocationInfo>().Where(x => x.WarehouseId == warehouse.WarehouseId && x.LocationType == LocationTypeEnum.Undefined.ObjToInt() && x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && (x.EnableStatus == EnableStatusEnum.OnlyIn.ObjToInt() || x.EnableStatus == EnableStatusEnum.Normal.ObjToInt()) && x.RoadwayNo.Contains("CP")).GroupBy(x => x.RoadwayNo).Select(x => new LocationCount { RoadwayNo = x.RoadwayNo, Count = SqlFunc.AggregateCount(x) }).ToList(); |
| | | roadwayNo = locationCounts.OrderBy(x => x.Count).FirstOrDefault()?.RoadwayNo ?? ""; |
| | | |
| | | //è·åå½åå
¥åºä»»å¡ä¸å·²åé
å··é任塿°é |
| | | List<LocationCount> useLocationCounts = Db.Queryable<Dt_Task>().Where(x => x.WarehouseId == warehouse.WarehouseId |
| | | && locationCounts.Select(j=>j.RoadwayNo).Contains(x.Roadway) |
| | | && TaskInboundTypes.Contains(x.TaskType)).GroupBy(x => x.Roadway).Select(x => new LocationCount { RoadwayNo = x.Roadway, Count = SqlFunc.AggregateCount(x) }).ToList(); |
| | | foreach (var item in locationCounts) |
| | | { |
| | | LocationCount? count = useLocationCounts.FirstOrDefault(x => x.RoadwayNo == item.RoadwayNo); |
| | | if (count!=null) |
| | | { |
| | | item.Count -= count.Count; |
| | | } |
| | | } |
| | | roadwayNo = locationCounts.OrderByDescending(x => x.Count).FirstOrDefault()?.RoadwayNo ?? ""; |
| | | return !string.IsNullOrEmpty(roadwayNo) ? (roadwayNo) : throw new Exception("æªæ¾å°å¯åé
å··é"); |
| | | } |
| | | catch (Exception ex) |
| | |
| | | using WIDESEA_Core.CodeConfigEnum; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using WIDESEA_DTO.ERP; |
| | | using WIDESEA_Common.MaterielEnum; |
| | | using WIDESEA_Common.WareHouseEnum; |
| | | |
| | | namespace WIDESEA_TaskInfoService |
| | | { |
| | |
| | | return content; |
| | | } |
| | | /// <summary> |
| | | /// åºåºä»»å¡å®æ |
| | | /// </summary> |
| | | public WebResponseContent OutboundTaskCompleted(Dt_Task task) |
| | | { |
| | | try |
| | | { |
| | | Dt_Warehouse warehouse = _basicRepository.WarehouseRepository.QueryFirst(x => x.WarehouseId == task.WarehouseId); |
| | | if (warehouse.WarehouseCode == WarehouseEnum.LLDCP.ToString()) //æå宿 |
| | | { |
| | | Dt_LocationInfo locationInfoStart = _basicService.LocationInfoService.Repository.QueryFirst(x => x.LocationCode == task.SourceAddress); |
| | | if (locationInfoStart == null) |
| | | { |
| | | return WebResponseContent.Instance.Error($"æªæ¾å°å¯¹åºçèµ·ç¹è´§ä½ä¿¡æ¯"); |
| | | } |
| | | Dt_ProStockInfo proStockInfo = _stockRepository.ProStockInfoRepository.QueryFirst(x => x.PalletCode == task.PalletCode); |
| | | if (proStockInfo != null && proStockInfo.StockStatus==StockStatusEmun.åºåºéå®.ObjToInt()) |
| | | { |
| | | task.TaskStatus = TaskStatusEnum.Finish.ObjToInt(); |
| | | _unitOfWorkManage.BeginTran(); |
| | | proStockInfo.StockStatus = StockStatusEmun.å
¥åºå®æ.ObjToInt(); |
| | | _stockRepository.ProStockInfoRepository.DeleteAndMoveIntoHty(proStockInfo,App.User.UserId > 0 ? WIDESEA_Core.Enums.OperateTypeEnum.äººå·¥å®æ : WIDESEA_Core.Enums.OperateTypeEnum.èªå¨å®æ); |
| | | _basicService.LocationInfoService.UpdateLocationStatus(locationInfoStart, proStockInfo.PalletType, LocationStatusEnum.Free, proStockInfo.WarehouseId); |
| | | BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId > 0 ? WIDESEA_Core.Enums.OperateTypeEnum.äººå·¥å®æ : WIDESEA_Core.Enums.OperateTypeEnum.èªå¨å®æ); |
| | | _unitOfWorkManage.CommitTran(); |
| | | } |
| | | else |
| | | { |
| | | return WebResponseContent.Instance.Error($"æªæ¾å°å¯¹åºåºåä¿¡æ¯"); |
| | | } |
| | | } |
| | | else//åæåºå®æ |
| | | { |
| | | Dt_LocationInfo locationInfoStart = _basicService.LocationInfoService.Repository.QueryFirst(x => x.LocationCode == task.SourceAddress); |
| | | if (locationInfoStart == null) |
| | | { |
| | | return WebResponseContent.Instance.Error($"æªæ¾å°å¯¹åºçèµ·ç¹è´§ä½ä¿¡æ¯"); |
| | | } |
| | | Dt_StockInfo stockInfo = _stockRepository.StockInfoRepository.QueryFirst(x => x.PalletCode == task.PalletCode); |
| | | if (stockInfo != null && stockInfo.StockStatus == StockStatusEmun.åºåºéå®.ObjToInt()) |
| | | { |
| | | task.TaskStatus = TaskStatusEnum.Finish.ObjToInt(); |
| | | _unitOfWorkManage.BeginTran(); |
| | | stockInfo.StockStatus = StockStatusEmun.åºåºå®æ.ObjToInt(); |
| | | _stockRepository.StockInfoRepository.DeleteAndMoveIntoHty(stockInfo, App.User.UserId > 0 ? WIDESEA_Core.Enums.OperateTypeEnum.äººå·¥å®æ : WIDESEA_Core.Enums.OperateTypeEnum.èªå¨å®æ); |
| | | _basicService.LocationInfoService.UpdateLocationStatus(locationInfoStart, stockInfo.PalletType, LocationStatusEnum.Free, stockInfo.WarehouseId); |
| | | BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId > 0 ? WIDESEA_Core.Enums.OperateTypeEnum.äººå·¥å®æ : WIDESEA_Core.Enums.OperateTypeEnum.èªå¨å®æ); |
| | | _unitOfWorkManage.CommitTran(); |
| | | } |
| | | else |
| | | { |
| | | return WebResponseContent.Instance.Error($"æªæ¾å°å¯¹åºåºåä¿¡æ¯"); |
| | | } |
| | | } |
| | | return WebResponseContent.Instance.OK(); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | _unitOfWorkManage.RollbackTran(); |
| | | return WebResponseContent.Instance.Error(ex.Message); |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// åºåæ°æ®è½¬åºåºä»»å¡ |
| | | /// </summary> |
| | | /// <param name="stockInfos"></param> |
| | |
| | | MaterielCode = stockInfo.MaterielCode, |
| | | Quantity = 0, |
| | | }; |
| | | if (stockInfo.StockLength>0) |
| | | if (stockInfo.MaterielWide>0) |
| | | { |
| | | task.TaskLength = stockInfo.StockLength; |
| | | task.TaskLength = (int)stockInfo.MaterielWide; |
| | | } |
| | | tasks.Add(task); |
| | | } |
| | |
| | | } |
| | | return tasks; |
| | | } |
| | | public List<Dt_Task> GetTasks(List<Dt_ProStockInfo> stockInfos, TaskTypeEnum taskType) |
| | | { |
| | | List<Dt_Task> tasks = new List<Dt_Task>(); |
| | | for (int i = 0; i < stockInfos.Count; i++) |
| | | { |
| | | Dt_ProStockInfo stockInfo = stockInfos[i]; |
| | | |
| | | if (stockInfo != null) |
| | | { |
| | | Dt_LocationInfo locationInfo = _basicService.LocationInfoService.Repository.QueryFirst(x => x.LocationCode == stockInfo.LocationCode); |
| | | if (!tasks.Exists(x => x.PalletCode == stockInfo.PalletCode)) |
| | | { |
| | | Dt_Task task = new() |
| | | { |
| | | CurrentAddress = stockInfo.LocationCode, |
| | | Grade = 0, |
| | | PalletCode = stockInfo.PalletCode, |
| | | NextAddress = "", |
| | | Roadway = locationInfo.RoadwayNo, |
| | | SourceAddress = stockInfo.LocationCode, |
| | | TargetAddress = "", |
| | | TaskStatus = TaskStatusEnum.New.ObjToInt(), |
| | | TaskType = taskType.ObjToInt(), |
| | | TaskNum = BaseDal.GetTaskNum(nameof(SequenceEnum.SeqTaskNum)), |
| | | PalletType = stockInfo.PalletType, |
| | | WarehouseId = stockInfo.WarehouseId, |
| | | Quantity = 0, |
| | | }; |
| | | tasks.Add(task); |
| | | } |
| | | } |
| | | } |
| | | return tasks; |
| | | } |
| | | /// <summary> |
| | | /// æååºåº |
| | | /// </summary> |
| | | /// <param name="Count"></param> |
| | | /// <returns></returns> |
| | | public WebResponseContent RequestCPWMSTaskOut(int Count) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | List<Dt_AGVStationInfo> aGVStationInfos = _agvStationInfoRepository.QueryData(x=>x.StationArea==AGVStationAreaEnum.AreaA.ObjToInt() && x.IsOccupied==WhetherEnum.False.ObjToInt()); |
| | | if (aGVStationInfos.Count< Count) |
| | | { |
| | | return content.Error($"å¯ç¨ç¼åæ°ä¸è¶³"); |
| | | } |
| | | List<Dt_ProStockInfo> stockInfos = _stockRepository.ProStockInfoRepository.QueryData(x => x.ProStockAttribute == ProStockAttributeEnum.空æ.ObjToInt() && x.StockStatus == StockStatusEmun.å
¥åºå®æ.ObjToInt()).OrderBy(x=>x.CreateDate).Take(Count).ToList(); |
| | | List<Dt_LocationInfo> locationInfos = _basicRepository.LocationInfoRepository.QueryData(x => stockInfos.Select(x => x.LocationCode).Contains(x.LocationCode)); |
| | | if (stockInfos.Count < Count) |
| | | { |
| | | return content.Error($"åºåæ°éä¸è¶³"); |
| | | } |
| | | foreach (var item in stockInfos) |
| | | { |
| | | Dt_LocationInfo? locationInfo = locationInfos.FirstOrDefault(x => x.LocationCode == item.LocationCode); |
| | | if (locationInfo != null && (locationInfo.EnableStatus == EnableStatusEnum.OnlyOut.ObjToInt() || locationInfo.EnableStatus == EnableStatusEnum.Normal.ObjToInt()) && locationInfo.LocationStatus == LocationStatusEnum.InStock.ObjToInt()) |
| | | { |
| | | item.StockStatus = StockStatusEmun.åºåºéå®.ObjToInt(); |
| | | } |
| | | else |
| | | { |
| | | return content.Error($"è´§ä½ç¶æä¸æ£ç¡®"); |
| | | } |
| | | } |
| | | List<Dt_Task> tasks = GetTasks(stockInfos, TaskTypeEnum.OutProduct); |
| | | if (tasks == null || tasks.Count <= 0) |
| | | { |
| | | return content.Error($"çæä»»å¡å¤±è´¥"); |
| | | } |
| | | for (int i = 0; i < tasks.Count; i++) |
| | | { |
| | | aGVStationInfos[i].IsOccupied = WhetherEnum.True.ObjToInt(); |
| | | tasks[i].TargetAddress = aGVStationInfos[i].AGVStationCode; |
| | | } |
| | | //夿æ¯å¦æåºåºåä¿¡æ¯ |
| | | _unitOfWorkManage.BeginTran(); |
| | | //æ´æ°åºåç¶æ |
| | | _stockRepository.ProStockInfoRepository.UpdateData(stockInfos); |
| | | _agvStationInfoRepository.UpdateData(aGVStationInfos); |
| | | //æ´æ°è´§ä½ç¶æ |
| | | _basicRepository.LocationInfoRepository.UpdateLocationStatus(locationInfos, LocationStatusEnum.Lock); |
| | | //å å
¥è´§ä½åå¨è®°å½ |
| | | _recordService.LocationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(locationInfos, LocationStatusEnum.Lock, LocationChangeType.OutboundAssignLocation, taskNums: tasks.Select(x => x.TaskNum).ToList()); |
| | | //æ°å»ºä»»å¡ |
| | | BaseDal.AddData(tasks); |
| | | _unitOfWorkManage.CommitTran(); |
| | | PushTasksToWCS(tasks); |
| | | content.OK(); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | content.Error(ex.Message); |
| | | } |
| | | return content; |
| | | } |
| | | /// <summary> |
| | | /// åæåºåºä»»å¡ |
| | | /// </summary> |
| | | /// <param name="materielCode">ç©æä»£ç </param> |
| | | /// <param name="materielWide">ç©æå¹
宽</param> |
| | | /// <param name="Count">å·æ°</param> |
| | | /// <returns></returns> |
| | | public WebResponseContent RequestYLWMSTaskOut(string materielCode, int materielWide, int Count) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | //è·å对åºåºå |
| | | List<Dt_StockInfo> stockInfos = _stockRepository.StockInfoRepository.QueryData(x=>x.MaterielCode==materielCode && x.MaterielWide== materielWide && x.StockStatus==StockStatusEmun.å
¥åºå®æ.ObjToInt()).OrderBy(x=>x.CreateDate).Take(Count).ToList(); |
| | | |
| | | if (stockInfos.Count< Count) |
| | | { |
| | | return content.Error($"åºå{materielCode}æ°éä¸è¶³"); |
| | | } |
| | | //è·åè´§ä½ |
| | | List<Dt_LocationInfo> locationInfos = _basicRepository.LocationInfoRepository.QueryData(x => stockInfos.Select(x => x.LocationCode).Contains(x.LocationCode)); |
| | | foreach (var item in stockInfos) |
| | | { |
| | | Dt_LocationInfo? locationInfo = locationInfos.FirstOrDefault(x=>x.LocationCode==item.LocationCode); |
| | | if (locationInfo!=null && (locationInfo.EnableStatus == EnableStatusEnum.OnlyOut.ObjToInt() || locationInfo.EnableStatus == EnableStatusEnum.Normal.ObjToInt()) && locationInfo.LocationStatus == LocationStatusEnum.InStock.ObjToInt()) |
| | | { |
| | | item.StockStatus = StockStatusEmun.åºåºéå®.ObjToInt(); |
| | | } |
| | | else |
| | | { |
| | | return content.Error($"è´§ä½ç¶æä¸æ£ç¡®"); |
| | | } |
| | | } |
| | | TaskTypeEnum taskTypeEnum = new(); |
| | | if (stockInfos.FirstOrDefault()?.MaterielInvOrgId==MaterielInvOrgEnum.èå.ObjToInt()) |
| | | { |
| | | taskTypeEnum = TaskTypeEnum.OldOutbound; |
| | | } |
| | | else |
| | | { |
| | | taskTypeEnum = TaskTypeEnum.Outbound; |
| | | } |
| | | List<Dt_Task> tasks = GetTasks(stockInfos, taskTypeEnum); |
| | | if (tasks == null || tasks.Count <= 0) |
| | | { |
| | | return content.Error($"çæä»»å¡å¤±è´¥"); |
| | | } |
| | | //夿æ¯å¦æåºåºåä¿¡æ¯ |
| | | _unitOfWorkManage.BeginTran(); |
| | | //æ´æ°åºåç¶æ |
| | | _stockRepository.StockInfoRepository.UpdateData(stockInfos); |
| | | //æ´æ°è´§ä½ç¶æ |
| | | _basicRepository.LocationInfoRepository.UpdateLocationStatus(locationInfos, LocationStatusEnum.Lock); |
| | | //å å
¥è´§ä½åå¨è®°å½ |
| | | _recordService.LocationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(locationInfos, LocationStatusEnum.Lock, LocationChangeType.OutboundAssignLocation,taskNums:tasks.Select(x=>x.TaskNum).ToList()); |
| | | |
| | | //æ°å»ºä»»å¡ |
| | | BaseDal.AddData(tasks); |
| | | _unitOfWorkManage.CommitTran(); |
| | | PushTasksToWCS(tasks); |
| | | content.OK(); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | content.Error(ex.Message); |
| | | } |
| | | return content; |
| | | } |
| | | } |
| | | } |
| | |
| | | using WIDESEA_Common.OtherEnum; |
| | | using WIDESEA_Common.StockEnum; |
| | | using WIDESEA_Common.TaskEnum; |
| | | using WIDESEA_Common.WareHouseEnum; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_Core.Helper; |
| | | using WIDESEA_DTO.Basic; |
| | | using WIDESEA_DTO.Task; |
| | | using WIDESEA_Model.Models; |
| | | |
| | |
| | | return WebResponseContent.Instance.Error(ex.Message); |
| | | } |
| | | } |
| | | public WebResponseContent InboundTaskCompleted(Dt_Task task) |
| | | { |
| | | try |
| | | { |
| | | Dt_StockInfo stockInfo = _stockService.StockInfoService.Repository.QueryFirst(x => x.PalletCode == task.PalletCode); |
| | | if (stockInfo == null) |
| | | { |
| | | return WebResponseContent.Instance.Error($"æªæ¾å°å¯¹åºåºåä¿¡æ¯"); |
| | | } |
| | | Dt_LocationInfo locationInfoEnd = _basicService.LocationInfoService.Repository.QueryFirst(x => x.LocationCode == task.TargetAddress); |
| | | if (locationInfoEnd == null) |
| | | { |
| | | return WebResponseContent.Instance.Error($"æªæ¾å°å¯¹åºçç»ç¹è´§ä½ä¿¡æ¯"); |
| | | } |
| | | task.TaskStatus = TaskStatusEnum.Finish.ObjToInt(); |
| | | FeedBackWCSTaskCompleted(task.TaskNum); |
| | | _unitOfWorkManage.BeginTran(); |
| | | stockInfo.LocationCode = locationInfoEnd.LocationCode; |
| | | stockInfo.StockStatus = StockStatusEmun.å
¥åºå®æ.ObjToInt(); |
| | | _stockService.StockInfoService.Repository.UpdateData(stockInfo); |
| | | _basicService.LocationInfoService.UpdateLocationStatus(locationInfoEnd, stockInfo.PalletType, LocationStatusEnum.InStock, stockInfo.WarehouseId); |
| | | BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId > 0 ? WIDESEA_Core.Enums.OperateTypeEnum.äººå·¥å®æ : WIDESEA_Core.Enums.OperateTypeEnum.èªå¨å®æ); |
| | | _unitOfWorkManage.CommitTran(); |
| | | return WebResponseContent.Instance.OK(); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | _unitOfWorkManage.RollbackTran(); |
| | | return WebResponseContent.Instance.Error(ex.Message); |
| | | } |
| | | } |
| | | public WebResponseContent RelocationTaskCompleted(Dt_Task task) |
| | | { |
| | | try |
| | |
| | | return WebResponseContent.Instance.Error(ex.Message); |
| | | } |
| | | } |
| | | public WebResponseContent IsRelocation(string startAddress,string endAddress,string roadWay) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | //è·åè´§ä½ |
| | | Dt_LocationInfo startLocationInfo = _basicRepository.LocationInfoRepository.QueryFirst(x => x.LocationCode == startAddress); |
| | | Dt_StockInfo stockInfo = _stockRepository.StockInfoRepository.QueryFirst(x => x.LocationCode == startAddress); |
| | | Dt_LocationInfo endLocationInfo = _basicRepository.LocationInfoRepository.QueryFirst(x => x.LocationCode == endAddress); |
| | | if (startLocationInfo != null && endLocationInfo != null && stockInfo!=null) |
| | | { |
| | | Dt_Task newTask = new Dt_Task() |
| | | { |
| | | Roadway = roadWay, |
| | | WarehouseId = stockInfo.WarehouseId, |
| | | CurrentAddress = startLocationInfo.LocationCode, |
| | | Grade = 99, |
| | | NextAddress = endLocationInfo.LocationCode, |
| | | OrderNo = "", |
| | | PalletCode = stockInfo.PalletCode, |
| | | PalletType = stockInfo.PalletType, |
| | | SourceAddress = startLocationInfo.LocationCode, |
| | | TargetAddress = endLocationInfo.LocationCode, |
| | | TaskNum = Repository.GetTaskNum(nameof(SequenceEnum.SeqTaskNum)), |
| | | TaskStatus = 0, |
| | | TaskType = TaskTypeEnum.Relocation.ObjToInt() |
| | | }; |
| | | stockInfo.StockStatus = StockStatusEmun.ç§»åºéå®.ObjToInt(); |
| | | _unitOfWorkManage.BeginTran(); |
| | | Repository.AddData(newTask); |
| | | _basicService.LocationInfoService.UpdateLocationStatus(startLocationInfo, stockInfo.PalletType, LocationStatusEnum.Lock, stockInfo.WarehouseId); |
| | | _basicService.LocationInfoService.UpdateLocationStatus(endLocationInfo, stockInfo.PalletType, LocationStatusEnum.Lock, stockInfo.WarehouseId); |
| | | _stockService.StockInfoService.Repository.UpdateData(stockInfo); |
| | | _unitOfWorkManage.CommitTran(); |
| | | PushTasksToWCS(new List<Dt_Task> { newTask }); |
| | | content.OK("æå"); |
| | | } |
| | | else |
| | | { |
| | | content.Error("åºåè´§ä½ä¿¡æ¯ä¸ºç©º"); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | _unitOfWorkManage.RollbackTran(); |
| | | content.Error(ex.Message); |
| | | } |
| | | return content; |
| | | } |
| | | } |
| | | } |
| | |
| | | { |
| | | return Service.RequestYLWMSTaskSimple(stationCode,palletCode); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æååºåºä»»å¡è¯·æ± |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost, HttpGet, Route("RequestCPWMSTaskOut"), AllowAnonymous] |
| | | public WebResponseContent RequestCPWMSTaskOut(int Count) |
| | | { |
| | | return Service.RequestCPWMSTaskOut(Count); |
| | | } |
| | | /// <summary> |
| | | /// åæåºåºä»»å¡ |
| | | /// </summary> |
| | | /// <param name="materielCode">ç©æä»£ç </param> |
| | | /// <param name="materielWide">ç©æå¹
宽</param> |
| | | /// <param name="Count">å·æ°</param> |
| | | /// <returns></returns> |
| | | [HttpPost, HttpGet, Route("RequestYLWMSTaskOut"), AllowAnonymous] |
| | | public WebResponseContent RequestYLWMSTaskOut(string materielCode,int materielWide, int Count) |
| | | { |
| | | return Service.RequestYLWMSTaskOut(materielCode, materielWide, Count); |
| | | } |
| | | /// <summary> |
| | | /// åæç§»åºä»»å¡ |
| | | /// </summary> |
| | | /// <param name="startAddress"></param> |
| | | /// <param name="endAddress"></param> |
| | | /// <param name="roadWay"></param> |
| | | /// <returns></returns> |
| | | [HttpPost, HttpGet, Route("Relocation"), AllowAnonymous] |
| | | public WebResponseContent IsRelocation(string startAddress, string endAddress, string roadWay) |
| | | { |
| | | return Service.IsRelocation(startAddress, endAddress, roadWay); |
| | | } |
| | | } |
| | | } |