1
hutongqing
2024-12-23 f723c6e9087a2110a28572543c7cfd9104e2a4ed
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
using Autofac.Core;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEA_DTO.Agv;
using WIDESEAWCS_Common.APIEnum;
using WIDESEAWCS_Core;
using WIDESEAWCS_Core.Helper;
 
namespace WIDESEAWCS_TaskInfoService
{
    public partial class TaskService
    {
        /// <summary>
        /// 发送AGV任务 
        /// </summary>
        /// <param name="taskModel"></param>
        /// <returns></returns>
        public WebResponseContent AgvSendTask(AgvTaskDTO taskModel)
        {
            WebResponseContent content = new WebResponseContent();
            try
            {
                string apiAddress = AppSettings.Get(APIEnum.AgvSendTask.ToString());
                string response = HttpHelper.Post(apiAddress, taskModel.Serialize());
                AgvResponseContent agvContent = response.DeserializeObject<AgvResponseContent>();
                if (agvContent.Code == "200")
                {
                    content.OK(agvContent.Message);
                }
                else
                {
                    content.Error(agvContent.Message);
                }
            }
            catch (Exception ex)
            {
                content.Error(ex.Message);
            }
            return content;
        }
        /// <summary>
        /// 安全信号申请 AGV-WCS
        /// </summary>
        public AgvResponseContent AgvSecureApply(AgvSecureApplyDTO secureApplyModel)
        {
 
            return new AgvResponseContent();
        }
        /// <summary>
        /// 安全信号回复 WCS-AGV
        /// </summary>
        /// <param name="secureModel"></param>
        /// <returns></returns>
        public WebResponseContent AgvSecureReply(AgvSecureReplyDTO secureReplyModel)
        {
            WebResponseContent content = new WebResponseContent();
            try
            {
                string apiAddress = AppSettings.Get(APIEnum.AgvSecureReply.ToString());
                string response = HttpHelper.Post(apiAddress, secureReplyModel.Serialize());
                AgvResponseContent agvContent = response.DeserializeObject<AgvResponseContent>();
                if (agvContent.Code == "200")
                {
                    content.OK(agvContent.Message);
                }
                else
                {
                    content.Error(agvContent.Message);
                }
            }
            catch (Exception ex)
            {
                content.Error(ex.Message);
            }
            return content;
        }
        /// <summary>
        /// AGV任务状态刷新
        /// </summary>
        /// <param name="agvUpdateModel"></param>
        /// <returns></returns>
        public AgvResponseContent AgvUpdateTask(AgvUpdateDTO agvUpdateModel)
        {
 
            return new AgvResponseContent();
        }
    }
}