dengjunjie
6 天以前 f56f8d4bf3bf088579a169519ef2547d40586f76
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using WIDESEAWCS_Common;
using WIDESEAWCS_Core;
using WIDESEAWCS_DTO;
using WIDESEAWCS_DTO.WMS;
using WIDESEAWCS_ITaskInfoService;
 
namespace WIDESEAWCS_Server.Controllers.AGV
{
    [Route("api/[controller]")]
    [ApiController]
    public class KLSAGVController : ControllerBase
    {
        private readonly ITaskService _taskService;
        public KLSAGVController(ITaskService taskService)
        {
            _taskService = taskService;
        }
 
        /// <summary>
        /// 任务状态更新
        /// </summary>
        /// <param name="taskDTOs"></param>
        /// <returns></returns>
        [HttpPost, Route("UpdateTaskStatus"), AllowAnonymous]
        public ReturnGALAXIS UpdateTaskStatus([FromBody] object TaskDTO)
        {
            ReturnGALAXIS returnGALAXIS = new ReturnGALAXIS();
            var take=  _taskService.UpdateTaskStatus(TaskDTO, DeviceTypeEnum.GALAXIS);
            if (take.Status)
            {
                returnGALAXIS.returnStatus = 0;
                returnGALAXIS.msgTime=DateTime.Now.ToString();
                returnGALAXIS.returnInfo = "";
            }
            else
            {
                returnGALAXIS.returnStatus=take.Code;
                returnGALAXIS.msgTime=DateTime.Now.ToString();
                returnGALAXIS.returnInfo = take.Message;
            }
 
            return returnGALAXIS;
        }
    }
}