Merge branch 'master' of http://115.159.85.185:8098/r/MeiRuiAn/HuaiAn
| | |
| | | onClick: function () { |
| | | this.export(); |
| | | } |
| | | } |
| | | }, |
| | | { |
| | | name: "é»çAGVåºåºä»»å¡éå", |
| | | icon: '', |
| | | class: '', |
| | | type: 'warning', |
| | | value: 'AgvZHTaskResend', |
| | | onClick: function () { |
| | | } |
| | | }, |
| | | { |
| | | name: "å åæºä»»å¡éå", |
| | | icon: '', |
| | | class: '', |
| | | type: 'warning', |
| | | value: 'StackerCraneTaskResending', |
| | | onClick: function () { |
| | | } |
| | | }, |
| | | { |
| | | name: "å åæºä»»å¡ä¼å
æ§è¡", |
| | | icon: '', |
| | | class: '', |
| | | type: 'warning', |
| | | value: 'StackerCraneTaskPriority', |
| | | onClick: function () { |
| | | } |
| | | }, |
| | | |
| | | ] |
| | | |
| | |
| | | this.$refs.gridBody.open(row); |
| | | } |
| | | },); |
| | | let AgvZHTaskResendBtn = this.buttons.find(x => x.value == 'AgvZHTaskResend'); |
| | | if (AgvZHTaskResendBtn) { |
| | | AgvZHTaskResendBtn.onClick = function () { |
| | | this.$confirm("æ¯å¦ç¡®è®¤éåé»çAGVåºåºä»»å¡","æå¨ä»»å¡éåè¦å",{ |
| | | confirmButtonText: "ç¡®å®", |
| | | cancelButtonText: "åæ¶", |
| | | type: "warning", |
| | | center: true, |
| | | }).then(() => { |
| | | let rows = this.$refs.table.getSelected(); |
| | | if (rows.length == 0) return this.$error("è¯·éæ©æ°æ®!"); |
| | | if (rows.length > 1) return this.$error("è¯·éæ©ä¸æ¡æ°æ®!"); |
| | | var param = rows[0].taskNum; |
| | | this.http |
| | | .post("api/ZH_AGV/AgvZHTaskResend?taskNum="+param, "æ°æ®å¤çä¸...") |
| | | .then((x) => { |
| | | if (x.status) { |
| | | this.$Message.success('æå¨ä»»å¡éåæå'); |
| | | this.refresh(); |
| | | } else { |
| | | return this.$error(x.message); |
| | | } |
| | | }); |
| | | }); |
| | | } |
| | | } |
| | | |
| | | let StackerCraneTaskResendingBtn = this.buttons.find(x => x.value == 'StackerCraneTaskResending'); |
| | | if (StackerCraneTaskResendingBtn) { |
| | | StackerCraneTaskResendingBtn.onClick = function () { |
| | | this.$confirm("æ¯å¦ç¡®è®¤éåå åæºä»»å¡","æå¨ä»»å¡éåè¦å",{ |
| | | confirmButtonText: "ç¡®å®", |
| | | cancelButtonText: "åæ¶", |
| | | type: "warning", |
| | | center: true, |
| | | }).then(() => { |
| | | let rows = this.$refs.table.getSelected(); |
| | | if (rows.length == 0) return this.$error("è¯·éæ©æ°æ®!"); |
| | | if (rows.length > 1) return this.$error("è¯·éæ©ä¸æ¡æ°æ®!"); |
| | | var param = rows[0].taskNum; |
| | | this.http |
| | | .post("api/Task/StackerCraneTaskResending?taskNum="+param, "æ°æ®å¤çä¸...") |
| | | .then((x) => { |
| | | if (x.status) { |
| | | this.$Message.success('æå¨ä»»å¡éåæå'); |
| | | this.refresh(); |
| | | } else { |
| | | return this.$error(x.message); |
| | | } |
| | | }); |
| | | }); |
| | | } |
| | | } |
| | | |
| | | let StackerCraneTaskPriorityBtn = this.buttons.find(x => x.value == 'StackerCraneTaskPriority'); |
| | | if (StackerCraneTaskPriorityBtn) { |
| | | StackerCraneTaskPriorityBtn.onClick = function () { |
| | | this.$confirm("æ¯å¦ä¼å
æ§è¡è¯¥å åæºä»»å¡","æå¨ä¼å
ä»»å¡è¦å",{ |
| | | confirmButtonText: "ç¡®å®", |
| | | cancelButtonText: "åæ¶", |
| | | type: "warning", |
| | | center: true, |
| | | }).then(() => { |
| | | let rows = this.$refs.table.getSelected(); |
| | | if (rows.length == 0) return this.$error("è¯·éæ©æ°æ®!"); |
| | | if (rows.length > 1) return this.$error("è¯·éæ©ä¸æ¡æ°æ®!"); |
| | | var param = rows[0].taskNum; |
| | | this.http |
| | | .post("api/Task/StackerCraneTaskPriority?taskNum="+param, "æ°æ®å¤çä¸...") |
| | | .then((x) => { |
| | | if (x.status) { |
| | | this.$Message.success('æå¨ä¼å
任塿å'); |
| | | this.refresh(); |
| | | } else { |
| | | return this.$error(x.message); |
| | | } |
| | | }); |
| | | }); |
| | | } |
| | | } |
| | | }, |
| | | onInited() { |
| | | //æ¡æ¶åå§åé
ç½®å |
| | |
| | | return WebResponseContent.Instance.Error(ex.Message); |
| | | } |
| | | } |
| | | |
| | | //é»çä»åºåºä»»å¡ç©ºå¨ä½å¼å¸¸æå¨éåAGVä»»å¡ |
| | | [HttpPost, HttpGet,Route("AgvZHTaskResend"),AllowAnonymous] |
| | | public WebResponseContent AgvZHTaskResend(int taskNum) |
| | | { |
| | | try |
| | | { |
| | | Dt_Task task = _taskRepository.QueryFirst(x => x.TaskNum == taskNum); |
| | | if (task == null) |
| | | { |
| | | return WebResponseContent.Instance.Error("æªæ¾å°ç¸å
³ä»»å¡ä¿¡æ¯"); |
| | | } |
| | | if (task.TaskState == TaskStatusEnum.Exception.ObjToInt() && task.DeviceCode == "AGV_ZH") |
| | | { |
| | | _taskService.UpdateTask(task, TaskStatusEnum.AGV_Execute); |
| | | } |
| | | else |
| | | { |
| | | return WebResponseContent.Instance.Error("ä»»å¡è®¾å¤ç¼å·ä¸æ£ç¡®æä»»å¡ç¶æé空å¨ä½å¼å¸¸"); |
| | | } |
| | | return WebResponseContent.Instance.OK(); |
| | | } |
| | | catch(Exception ex) |
| | | { |
| | | return WebResponseContent.Instance.Error(ex.Message); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | using Microsoft.AspNetCore.Authorization; |
| | | using Microsoft.AspNetCore.Http; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using SqlSugar.Extensions; |
| | | using WIDESEAWCS_Common.TaskEnum; |
| | | using WIDESEAWCS_Core; |
| | | using WIDESEAWCS_Core.BaseController; |
| | | using WIDESEAWCS_DTO.TaskInfo; |
| | | using WIDESEAWCS_ITaskInfoRepository; |
| | | using WIDESEAWCS_ITaskInfoService; |
| | | using WIDESEAWCS_Model.Models; |
| | | using WIDESEAWCS_TaskInfoRepository; |
| | | using WIDESEAWCS_TaskInfoService; |
| | | using WIDESEAWCS_Tasks; |
| | | |
| | | namespace WIDESEAWCS_WCSServer.Controllers.Task |
| | |
| | | private readonly IHttpContextAccessor _httpContextAccessor; |
| | | private readonly IRouterExtension _routerExtension; |
| | | //private readonly WebSocketServer _webSocketServer; |
| | | |
| | | public TaskController(ITaskService service, IHttpContextAccessor httpContextAccessor, IRouterExtension routerExtension/*, WebSocketServer webSocketServer*/) : base(service) |
| | | private readonly ITaskService _taskService; |
| | | private readonly ITaskRepository _taskRepository; |
| | | public TaskController(ITaskService service, IHttpContextAccessor httpContextAccessor, IRouterExtension routerExtension ,ITaskService taskService,ITaskRepository taskRepository /*, WebSocketServer webSocketServer*/) : base(service) |
| | | { |
| | | _httpContextAccessor = httpContextAccessor; |
| | | _routerExtension = routerExtension; |
| | | _taskService = taskService; |
| | | _taskRepository = taskRepository; |
| | | //_webSocketServer = webSocketServer; |
| | | } |
| | | |
| | |
| | | { |
| | | return Service.RecWMSTaskCompleted(taskNum); |
| | | } |
| | | |
| | | //å åæºä»»å¡éå |
| | | [HttpPost, HttpGet, Route("StackerCraneTaskResending"), AllowAnonymous] |
| | | public WebResponseContent StackerCraneTaskResending(int taskNum) |
| | | { |
| | | try |
| | | { |
| | | Dt_Task task = _taskRepository.QueryFirst(x => x.TaskNum == taskNum); |
| | | if (task == null) |
| | | { |
| | | return WebResponseContent.Instance.Error("æªæ¾å°è¯¥ä»»å¡ä¿¡æ¯"); |
| | | } |
| | | if(task.TaskState == TaskStatusEnum.SC_Executing.ObjToInt()) |
| | | { |
| | | _taskService.UpdateTask(task, TaskStatusEnum.SC_Execute); |
| | | } |
| | | else |
| | | { |
| | | return WebResponseContent.Instance.Error("éå åæºæ§è¡ä¸ç¶æ"); |
| | | } |
| | | return WebResponseContent.Instance.OK(); |
| | | } |
| | | catch(Exception ex) |
| | | { |
| | | return WebResponseContent.Instance.Error(ex.Message); |
| | | } |
| | | } |
| | | |
| | | //å åæºä»»å¡ä¼å
æ§è¡ |
| | | [HttpPost, HttpGet, Route("StackerCraneTaskPriority"), AllowAnonymous] |
| | | public WebResponseContent StackerCraneTaskPriority(int taskNum) |
| | | { |
| | | try |
| | | { |
| | | Dt_Task task = _taskRepository.QueryFirst(x => x.TaskNum == taskNum); |
| | | if (task == null) |
| | | { |
| | | return WebResponseContent.Instance.Error("æªæ¾å°è¯¥ä»»å¡ä¿¡æ¯"); |
| | | } |
| | | if (task.TaskState == TaskStatusEnum.SC_Execute.ObjToInt()) |
| | | { |
| | | task.Grade = 98; |
| | | } |
| | | else |
| | | { |
| | | return WebResponseContent.Instance.Error("éå åæºå¾
æ§è¡ç¶æ"); |
| | | } |
| | | _taskRepository.UpdateData(task); |
| | | return WebResponseContent.Instance.OK(); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return WebResponseContent.Instance.Error(ex.Message); |
| | | } |
| | | } |
| | | } |
| | | } |