服务端的TigerApi 框架,基于.NET6 2024 版本
Rodney Chen
2024-03-23 5ec2816b25ccc33855c48da7f7f9305e21e6dc38
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
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Rhea.Common;
using System;
using System.Collections.Generic;
using System.ComponentModel.Design;
using System.Linq;
using System.Security.Policy;
using System.Text;
using System.Threading.Tasks;
using Tiger.IBusiness;
using Tiger.Model;
 
namespace Tiger.Business
{
    public partial class Biz
    {
        public partial class AGV : IAGV
        {
            /// <summary>
            /// AGV接口URL
            /// </summary>
            public static string agvurl { get; set; } = @$"{Biz.SysParamOld["agvUrl", "AgvApiAddress"].PARAM_VALUE}"; //@"http://10.12.16.249:10007/rcs/order/";
 
            /// <summary>
            /// 备料完成通知
            /// </summary>
            /// <param name="input"></param>
            /// <returns></returns>
            public AgvActionResult materialPreparation(AgvMPInput input)
            {
                AgvActionResult result = new AgvActionResult();
                Work.DoAsync
                (() =>
                {
                    var requestJson = JsonConvert.SerializeObject(input);
                    var response = HttpHelper.PostAsync(agvurl + "materialPreparation", requestJson).Result;
                    var result1 = JsonConvert.DeserializeObject<AgvActionResult>(response.Message);
                    Logger.Interface.Info("AGV返回:"+response.Message);
                });
 
                return result;
            }
 
            public AgvActionResult materialPreparation(AgvMPInput input,string agvApi)
            {
                AgvActionResult result = new AgvActionResult();
                Work.DoAsync
                (() =>
                {
                    var requestJson = JsonConvert.SerializeObject(input);
                    var response = HttpHelper.PostAsync(agvApi + "materialPreparation", requestJson).Result;
                    var result1 = JsonConvert.DeserializeObject<AgvActionResult>(response.Message);
                    Logger.Interface.Info("AGV返回:" + response.Message);
                });
 
                return result;
            }
 
            /// <summary>
            /// 放行
            /// </summary>
            /// <param name="input"></param>
            /// <returns></returns>
            public AgvActionResultBase carPass(AgvMPInput input)
            {
                var requestJson = JsonConvert.SerializeObject(input);
                var response = HttpHelper.PostAsync(agvurl + "carPass", requestJson).Result;
                var result = JsonConvert.DeserializeObject<AgvActionResultBase>(response.Message);
 
                return result;
            }
        }
    }
}