服务端的TigerApi 框架,基于.NET6 2024 版本
Ben Lin
2024-08-14 19d3c73d49220beb854efacc42c76405701c9919
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
using System;
using System.Collections.Generic;
using System.Net;
using System.Text;
using SqlSugar;
using Tiger.Model.SeaStone.Shelf;
 
namespace Tiger.Model.Sharetronic.Shelf
{
    /// <summary>
    /// 货架 api 返回结果
    /// </summary>
    public class ShelfApiResult
    {
        /// <summary>
        /// 指令是否发送成功(bool 类型)
        /// </summary>
        public bool IsSuccess { get; set; } = false;
        /// <summary>
        /// 可返回货架类型
        /// </summary>
        public string Type { get; set; }
 
        /// <summary>
        /// 可返回颜色编号:"1":"红色","2":"绿色","3":"蓝色","4":"黄色","5":"紫色","6":"靛蓝","7":"白色"
        /// </summary>
        public string ItemCode { get; set; }
 
        /// <summary>
        /// 成功或异常可能返回的信息
        /// </summary>
        public string ResultValue { get; set; }
        /// <summary>
        /// 成功或异常可能返回的信息对应的对象
        /// </summary>
        //public T GetData<T>() => new SerializeService().DeserializeObject<T>(string.IsNullOrEmpty(ResultValue) ? "" : ResultValue);
        public T GetData<T>() => typeof(T).Equals(typeof(string)) ? (T)Convert.ChangeType(ResultValue, typeof(T)) : new SerializeService().DeserializeObject<T>(string.IsNullOrEmpty(ResultValue) ? "" : ResultValue);
    }
 
    /// <summary>
    /// 料槽状态变化信息主动上报(操作货架过程中)
    /// </summary>
    public class ShelfChangeModel
    {
        /// <summary>
        /// 货架编号,Y1 是货架,F 是货架前侧,R 是后侧
        /// </summary>
        public string shelfNo { get; set; }
        /// <summary>
        /// 槽位地址
        /// </summary>
        public int ledAddr { get; set; }
        /// <summary>
        /// 是否存在料盘,false 料盘不在 true 料盘在
        /// </summary>
        public bool inOrOut { get; set; }
        /// <summary>
        /// 订单编号
        /// </summary>
        public string orderCode { get; set; }
        /// <summary>
        /// 订单 ID
        /// </summary>
        public int orderID { get; set; }
        /// <summary>
        /// 指令类型
        /// </summary>
        public int operateType { get; set; }
        /// <summary>
        /// 操作货架PDA的id
        /// </summary>
        public string pdaid { get; set; }
        /// <summary>
        /// 物料唯一码
        /// </summary>
        public string uniqueNumber { get; set; }
        /// <summary>
        /// 颜色,0, "灭灯",1:"红色",2:"绿色",3:" 蓝色",4:"黄色",5:"紫色",6:"靛蓝",7:"白色"
        /// </summary>
        public int color { get; set; }
    }
 
    /// <summary>
    /// 调用GetChuteInfo接口对应对应参数对象
    /// </summary>
    public class PostChuteConfigModel
    {
        /// <summary>
        /// 货架编号,Y1 是货架,F 是货架前侧,R 是后侧
        /// </summary>
        public string shelfNo { get; set; }
        /// <summary>
        /// 板子起始位置
        /// </summary>
        public int ledStartIndex { get; set; }
        /// <summary>
        /// 板子起始位置
        /// </summary>
        public int ledNum { get; set; }
        /// <summary>
        /// 槽位地址集合
        /// </summary>
        public List<int> ledAddrs { get; set; }
        /// <summary>
        /// 槽位地址状态集合
        /// </summary>
        public List<LedAddressInfo> ledAddressList { get; set; } = new List<LedAddressInfo>();
    }
 
    /// <summary>
    /// 故障点位信息传输(超 30 秒故障信息)
    /// </summary>
    public class ShelfErrorInfo
    {
        /// <summary>
        /// 货架编号,Y1 是货架,F 是货架前侧,R 是后侧
        /// </summary>
        public string shelfNo { get; set; }
        /// <summary>
        /// 槽位地址
        /// </summary>
        public int ledAddr { get; set; }
        /// <summary>
        /// 是否存在料盘,false 料盘不在 true 料盘在
        /// </summary>
        public int inOrOut { get; set; }
    }
}