自动化立体仓库 - WMS系统
chen.llin
2 天以前 1815bcadb613f8951c02031176d2b54dcfa5a393
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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
package com.zy.common.properties;
 
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
 
import java.util.ArrayList;
import java.util.List;
 
/**
 * AGV配置属性
 * 
 * @author system
 */
@Data
@Configuration
@ConfigurationProperties(prefix = "agv")
public class AgvProperties {
 
    /**
     * 是否发送任务
     */
    private boolean sendTask = false;
 
    /**
     * 东侧配置
     */
    private RobotGroupConfig east = new RobotGroupConfig();
 
    /**
     * 西侧配置
     */
    private RobotGroupConfig west = new RobotGroupConfig();
 
    /**
     * whs_type映射配置
     * 1: 入库区(东侧),2: 缓存区(西侧)
     */
    private WhsTypeMapping whsTypeMapping = new WhsTypeMapping();
 
    /**
     * 站点分配策略配置
     */
    private SiteAllocationStrategy siteAllocation = new SiteAllocationStrategy();
 
    /**
     * 库位前缀配置
     */
    private LocationPrefix locationPrefix = new LocationPrefix();
 
    /**
     * whs_type映射配置内部类
     */
    @Data
    public static class WhsTypeMapping {
        /**
         * 入库区对应的whs_type值(默认1)
         */
        private Long inboundArea = 1L;
 
        /**
         * 缓存区对应的whs_type值(默认2)
         */
        private Long cacheArea = 2L;
    }
 
    /**
     * 机器人组配置内部类
     */
    @Data
    public static class RobotGroupConfig {
        /**
         * 机器人组编号
         */
        private String robotGroup = "";
 
        /**
         * 站点列表
         */
        private List<String> stations = new ArrayList<>();
 
        /**
         * 侧边显示名称(用于日志和提示信息,如"东侧"、"西侧")
         */
        private String displayName = "";
    }
 
    /**
     * 获取东侧站点列表(兼容旧代码)
     */
    public List<String> getEastStations() {
        return east != null ? east.getStations() : new ArrayList<>();
    }
 
    /**
     * 获取西侧站点列表(兼容旧代码)
     */
    public List<String> getWestStations() {
        return west != null ? west.getStations() : new ArrayList<>();
    }
 
    /**
     * 获取东侧机器人组编号(兼容旧代码)
     */
    public String getRobotGroupEast() {
        return east != null && east.getRobotGroup() != null && !east.getRobotGroup().isEmpty() 
            ? east.getRobotGroup() : "Group-001";
    }
 
    /**
     * 获取西侧机器人组编号(兼容旧代码)
     */
    public String getRobotGroupWest() {
        return west != null && west.getRobotGroup() != null && !west.getRobotGroup().isEmpty() 
            ? west.getRobotGroup() : "Group-002";
    }
 
    /**
     * 获取东侧显示名称
     */
    public String getEastDisplayName() {
        return east != null && east.getDisplayName() != null && !east.getDisplayName().isEmpty()
            ? east.getDisplayName() : "东侧";
    }
 
    /**
     * 获取西侧显示名称
     */
    public String getWestDisplayName() {
        return west != null && west.getDisplayName() != null && !west.getDisplayName().isEmpty()
            ? west.getDisplayName() : "西侧";
    }
 
    /**
     * 站点分配策略配置内部类
     */
    @Data
    public static class SiteAllocationStrategy {
        /**
         * 分配策略类型
         * round-robin: 轮询分配(平均分配)
         * least-task: 最少任务优先(默认)
         * random: 随机分配
         */
        private String strategy = "least-task";
 
        /**
         * 是否启用平均分配
         * true: 当多个站点任务数相同时,使用轮询分配
         * false: 总是选择第一个(任务最少的)
         */
        private boolean enableRoundRobin = true;
    }
 
    /**
     * 库位前缀配置内部类
     */
    @Data
    public static class LocationPrefix {
        /**
         * CA前缀:只做入库的库位前缀(默认"CA")
         */
        private String inboundOnly = "CA";
 
        /**
         * WA前缀:会被出库分配缓存区的库位前缀(默认"WA")
         */
        private String cacheArea = "WA";
    }
}