| | |
| | | /// WMSæ¯å¦ç§»åºå¤æ |
| | | /// </summary> |
| | | [Description("WMSæ¯å¦ç§»åºå¤æ")] |
| | | WMSIsReloaction |
| | | WMSIsReloaction, |
| | | /// <summary> |
| | | /// AGVå¨ä½ç»å®æ¥è¯¢ |
| | | /// </summary> |
| | | [Description("AGVå¨ä½ç»å®æ¥è¯¢")] |
| | | Agv_CSJPodBerthAndMat |
| | | } |
| | | } |
| | |
| | | /// </summary> |
| | | [Description("MESåºåº")] |
| | | MesOutbound = 200, |
| | | |
| | | /// <summary> |
| | | /// MESæå¨åºåº |
| | | /// </summary> |
| | | [Description("MESæå¨åºåº")] |
| | | MesHandOutbound = 210, |
| | | |
| | | /// <summary> |
| | | /// MESæå¨æ£éåºåº |
| | | /// </summary> |
| | | [Description("MESæå¨æ£éåºåº")] |
| | | MesHandPickOutbound = 220, |
| | | |
| | | /// <summary> |
| | | /// éè´å
¥åº |
| | | /// </summary> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace WIDESEAWCS_DTO.Agv |
| | | { |
| | | public class AgvPodBerthAndMatDTO |
| | | { |
| | | /// <summary> |
| | | /// 请æ±ç¼å· |
| | | /// </summary> |
| | | public string ReqCode { get; set; } |
| | | /// <summary> |
| | | /// è¯·æ±æ¶é´æ³ |
| | | /// </summary> |
| | | public string ReqTime { get; set; } |
| | | /// <summary> |
| | | /// 客æ·ç«¯ç¼å· |
| | | /// </summary> |
| | | public string ClientCode { get; set; } |
| | | /// <summary> |
| | | /// 令çå· |
| | | /// </summary> |
| | | public string TokenCode { get; set; } |
| | | /// <summary> |
| | | /// è´§æ¶ç¼å· |
| | | /// </summary> |
| | | public string PodCode { get; set; } |
| | | /// <summary> |
| | | /// ç©ææ¹æ¬¡ |
| | | /// </summary> |
| | | public string MaterialLot { get; set; } |
| | | /// <summary> |
| | | /// ä½ç½®ç¼å· |
| | | /// </summary> |
| | | public string PositionCode { get; set; } |
| | | /// <summary> |
| | | /// åºåç¼å· |
| | | /// </summary> |
| | | public string AreaCode { get; set; } |
| | | /// <summary> |
| | | /// å°å¾ç®ç§° |
| | | /// </summary> |
| | | public string MapShortName { get; set; } |
| | | } |
| | | } |
| | |
| | | using WIDESEAWCS_Core; |
| | | using WIDESEAWCS_Core.BaseServices; |
| | | using WIDESEAWCS_Core.Enums; |
| | | using WIDESEAWCS_DTO.Agv; |
| | | using WIDESEAWCS_DTO.TaskInfo; |
| | | using WIDESEAWCS_Model.Models; |
| | | |
| | |
| | | /// <param name="roadwayNos"></param> |
| | | /// <returns></returns> |
| | | WebResponseContent RequestWMSAssignRoadway(List<string> roadwayNos); |
| | | |
| | | WebResponseContent AgvPodBerthAndMat(AgvPodBerthAndMatDTO agvPodModel, APIEnum PodBerthAndMat = APIEnum.Agv_CSJPodBerthAndMat); |
| | | } |
| | | } |
| | |
| | | { |
| | | private readonly IHttpContextAccessor _httpContextAccessor; |
| | | private readonly IRouterExtension _routerExtension; |
| | | private readonly WebSocketServer _webSocketServer; |
| | | //private readonly WebSocketServer _webSocketServer; |
| | | |
| | | public TaskController(ITaskService service, IHttpContextAccessor httpContextAccessor, IRouterExtension routerExtension, WebSocketServer webSocketServer) : base(service) |
| | | public TaskController(ITaskService service, IHttpContextAccessor httpContextAccessor, IRouterExtension routerExtension/*, WebSocketServer webSocketServer*/) : base(service) |
| | | { |
| | | _httpContextAccessor = httpContextAccessor; |
| | | _routerExtension = routerExtension; |
| | | _webSocketServer = webSocketServer; |
| | | //_webSocketServer = webSocketServer; |
| | | } |
| | | |
| | | [HttpPost, Route("ReceiveTask"), AllowAnonymous] |
| | |
| | | return WebResponseContent.Instance.OK(data: _routerExtension.GetEndPoint(startPoint, routeType)); |
| | | } |
| | | |
| | | [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("WebSocketPushMessage"), AllowAnonymous] |
| | | //public WebResponseContent WebSocketPushMessage(string message) |
| | | //{ |
| | | // try |
| | | // { |
| | | // _webSocketServer.PublishAllClientPayload(message); |
| | | // return WebResponseContent.Instance.OK(); |
| | | // } |
| | | // catch(Exception ex) |
| | | // { |
| | | // return WebResponseContent.Instance.Error(ex.Message); |
| | | // } |
| | | //} |
| | | } |
| | | } |
| | |
| | | { |
| | | private readonly ICacheService _cacheService; |
| | | private readonly DBContext _dbContext; |
| | | private readonly WebSocketServer _webSocketServer; |
| | | //private readonly WebSocketServer _webSocketServer; |
| | | |
| | | public WarehouseHostedService(ICacheService cacheService, DBContext dbContext, WebSocketServer webSocketServer) |
| | | public WarehouseHostedService(ICacheService cacheService, DBContext dbContext/*, WebSocketServer webSocketServer*/) |
| | | { |
| | | _cacheService = cacheService; |
| | | _dbContext = dbContext; |
| | | _webSocketServer = webSocketServer; |
| | | //_webSocketServer = webSocketServer; |
| | | } |
| | | |
| | | public Task StartAsync(CancellationToken cancellationToken) |
| | |
| | | builder.Services.AddHostedService<WarehouseHostedService>(); |
| | | builder.Services.AddHostedService<QuartzJobDataTableHostedService>(); |
| | | |
| | | builder.Services.AddWebSocketSetup(); |
| | | //builder.Services.AddWebSocketSetup(); |
| | | |
| | | builder.Services.AddAutoMapperSetup(); |
| | | |
| | |
| | | using WIDESEAWCS_Common.TaskEnum; |
| | | using WIDESEAWCS_Core; |
| | | using WIDESEAWCS_Core.Helper; |
| | | using WIDESEAWCS_DTO.Agv; |
| | | |
| | | namespace WIDESEAWCS_TaskInfoService |
| | | { |
| | |
| | | { |
| | | return new AgvResponseContent(); |
| | | } |
| | | public WebResponseContent AgvPodBerthAndMat(AgvPodBerthAndMatDTO agvPodModel, APIEnum PodBerthAndMat = APIEnum.Agv_CSJPodBerthAndMat) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | string? apiAddress = apiInfos.FirstOrDefault(x => x.ApiCode == PodBerthAndMat.ToString())?.ApiAddress; |
| | | if (string.IsNullOrEmpty(apiAddress)) |
| | | return WebResponseContent.Instance.Error($"æªæ¾å°åéAGV任塿¥å£,è¯·æ£æ¥æ¥å£é
ç½®"); |
| | | string response = HttpHelper.Post(apiAddress, agvPodModel.Serialize()); |
| | | AgvResponseContent agvContent = response.DeserializeObject<AgvResponseContent>(); |
| | | if (agvContent.Code == "0") |
| | | { |
| | | content.OK(agvContent.Message); |
| | | } |
| | | else |
| | | { |
| | | content.Error(agvContent.Message); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | content.Error(ex.Message); |
| | | } |
| | | return content; |
| | | } |
| | | } |
| | | } |
| | |
| | | task.NextAddress = router.NextPosi; |
| | | task.DeviceCode = router.ChildPosi; |
| | | } |
| | | else if (item.TaskType == TaskTypeEnum.MesOutbound.ObjToInt()) |
| | | else if (item.TaskType == TaskTypeEnum.MesOutbound.ObjToInt() || item.TaskType == TaskTypeEnum.MesHandOutbound.ObjToInt() || item.TaskType == TaskTypeEnum.MesHandPickOutbound.ObjToInt()) |
| | | { |
| | | task.NextAddress = router.NextPosi; |
| | | task.DeviceCode = stationManger.StackerCraneCode; |
| | |
| | | using WIDESEAWCS_Model.Models; |
| | | using static Dm.net.buffer.ByteArrayBuffer; |
| | | using WIDESEAWCS_QuartzJob; |
| | | using WIDESEAWCS_DTO.Agv; |
| | | |
| | | namespace WIDESEAWCS_Tasks |
| | | { |
| | |
| | | } |
| | | } |
| | | _taskService.UpdateData(newTasks); |
| | | //åºåºç»å®æ¥è¯¢ |
| | | Dt_Task outBound = _taskService.Db.Queryable<Dt_Task>().Where(x => x.TaskState == TaskStatusEnum.Exception.ObjToInt() && nameof(AGV_CSJJob).Contains(x.DeviceCode) && x.TaskType==TaskTypeEnum.Outbound.ObjToInt()).ToList().OrderBy(x => x.Grade).ThenBy(x=>x.CreateDate).First(); |
| | | if (outBound != null) |
| | | { |
| | | AgvPodBerthAndMatDTO andMatDTO = new AgvPodBerthAndMatDTO() |
| | | { |
| | | ReqCode = Guid.NewGuid().ToString().Replace("-", ""), |
| | | PositionCode=outBound.TargetAddress |
| | | }; |
| | | WebResponseContent content = _taskService.AgvPodBerthAndMat(andMatDTO); |
| | | if (content.Status) |
| | | { |
| | | outBound.TaskState = TaskStatusEnum.AGV_Execute.ObjToInt(); |
| | | outBound.ExceptionMessage = ""; |
| | | //agvTask.Remark = content.Data.ObjToString(); |
| | | _taskService.UpdateTask(outBound, TaskStatusEnum.AGV_Execute); |
| | | } |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | |
| | | Dt_Router router = _routerRepository.QueryFirst(x => x.InOutType == task.TaskType && x.StartPosi == stationManger.StationCode); |
| | | if (router == null) |
| | | { |
| | | //_taskExecuteDetailService.AddTaskExecuteDetail(taskNum, $"æªæ¾å°è·¯ç±ä¿¡æ¯,{task.NextAddress}"); |
| | | _taskService.UpdateTaskExceptionMessage(taskNum, $"æªæ¾å°è·¯ç±ä¿¡æ¯,{task.NextAddress}"); |
| | | WriteError(deviceCode, $"æªæ¾å°è·¯ç±ä¿¡æ¯,{task.NextAddress}"); |
| | | return WebResponseContent.Instance.Error($"æªæ¾å°è·¯ç±ä¿¡æ¯,{task.NextAddress}"); |
| | | 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}"); |
| | | } |
| | | } |
| | | |
| | | _taskService.UpdateTask(task, TaskStatusEnum.Line_Execute, deviceCode: stationManger.StationDeviceCode, currentAddress: stationManger.StationCode, nextAddress: router.NextPosi, targetAddress: router.NextPosi); |
| | |
| | | this.http |
| | | .post("/api/mesOutboundOrder/AddMesOrder", params, "æ°æ®å¤çä¸...") |
| | | .then((res) => { |
| | | if (!res.status) return this.$message.error(x.message); |
| | | if (!res.status) return this.$message.error(res.message); |
| | | this.$message.success("æä½æå"); |
| | | this.showDetailBox = false; |
| | | this.$emit("parentCall", ($vue) => { |
| | |
| | | task.TaskStatus = TaskStatusEnum.Finish.ObjToInt(); |
| | | _unitOfWorkManage.BeginTran(); |
| | | |
| | | if (task.TaskType == TaskTypeEnum.Outbound.ObjToInt()) |
| | | if (task.TaskType == TaskTypeEnum.Outbound.ObjToInt() || task.TaskType == TaskTypeEnum.MesHandPickOutbound.ObjToInt() || task.TaskType == TaskTypeEnum.MesHandOutbound.ObjToInt()) |
| | | { |
| | | if (outboundOrderDetails.Count > 0) |
| | | { |