自动化立体仓库 - WMS系统
chen.llin
2 天以前 2307db8fc3abd03227f54e24f73d87fb34908dc2
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
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();
 
    /**
     * 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<>();
    }
 
    /**
     * 获取东侧站点列表(兼容旧代码)
     */
    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";
    }
 
    /**
     * 站点分配策略配置内部类
     */
    @Data
    public static class SiteAllocationStrategy {
        /**
         * 分配策略类型
         * round-robin: 轮询分配(平均分配)
         * least-task: 最少任务优先(默认)
         * random: 随机分配
         */
        private String strategy = "least-task";
 
        /**
         * 是否启用平均分配
         * true: 当多个站点任务数相同时,使用轮询分配
         * false: 总是选择第一个(任务最少的)
         */
        private boolean enableRoundRobin = true;
    }
}