RoadSectionLevel.java
4.97 KB
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
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
package com.bsth.data.commonData.entity;
import com.bsth.entity.Line;
import com.bsth.entity.LsSectionRoute;
import com.bsth.entity.Section;
import com.bsth.entity.SectionRoute;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class RoadSectionLevel implements Cloneable{
//线路编码
private String line_code;
//路段编码
private String section_code;
//路段路由序号
private String sectionroute_code;
//路段路由方向
private Integer directions;
//线路基础信息编号
private String line_base_id;
//路段信息(id)
private String section;
//描述
private String descriptions;
//版本号
private Integer versions;
//是否撤销 0-否,1-是
private Integer destroy;
//是否有路段限速数据 0-分段;1-未分段
private Integer is_roade_speed;
//线路名称
private String line_name;
//路段名称
private String section_name;
public static SectionRoute convert(RoadSectionLevel rsl){
SectionRoute sectionRoute = new SectionRoute();
sectionRoute.setSectionrouteCode(Integer.parseInt(rsl.getSectionroute_code()));
sectionRoute.setLineCode(rsl.getLine_code());
sectionRoute.setSectionCode(rsl.getSection_code());
sectionRoute.setDirections(rsl.getDirections());
sectionRoute.setVersions(1);
sectionRoute.setDestroy(rsl.getDestroy());
sectionRoute.setIsRoadeSpeed(rsl.getIs_roade_speed());
sectionRoute.setDescriptions(rsl.getDescriptions());
Section section = new Section();
section.setId(Integer.parseInt(rsl.getSection()));
sectionRoute.setSection(section);
Line line = new Line();
line.setId(Integer.parseInt(rsl.getLine_code()));
sectionRoute.setLine(line);
sectionRoute.setCreateDate(new java.sql.Date(new Date().getTime()));
sectionRoute.setUpdateDate(new java.sql.Date(new Date().getTime()));
return sectionRoute;
}
public static List<SectionRoute> convert(List<RoadSectionLevel> roadSectionLevels){
List<SectionRoute> list = new ArrayList<>();
for (RoadSectionLevel roadSectionLevel : roadSectionLevels) {
list.add(convert(roadSectionLevel));
}
return list;
}
public static LsSectionRoute convertLS(RoadSectionLevel rsl){
LsSectionRoute sectionRoute = new LsSectionRoute();
sectionRoute.setSectionrouteCode(Integer.parseInt(rsl.getSectionroute_code()));
sectionRoute.setLineCode(rsl.getLine_code());
sectionRoute.setSectionCode(rsl.getSection_code());
sectionRoute.setDirections(rsl.getDirections());
sectionRoute.setVersions(1);
sectionRoute.setDestroy(rsl.getDestroy());
sectionRoute.setIsRoadeSpeed(rsl.getIs_roade_speed());
sectionRoute.setDescriptions(rsl.getDescriptions());
Section section = new Section();
section.setId(Integer.parseInt(rsl.getSection()));
sectionRoute.setSection(section);
Line line = new Line();
line.setId(Integer.parseInt(rsl.getLine_code()));
sectionRoute.setLine(line);
sectionRoute.setCreateDate(new java.sql.Date(new Date().getTime()));
sectionRoute.setUpdateDate(new java.sql.Date(new Date().getTime()));
return sectionRoute;
}
public static List<LsSectionRoute> convertLS(List<RoadSectionLevel> roadSectionLevels){
List<LsSectionRoute> list = new ArrayList<>();
for (RoadSectionLevel roadSectionLevel : roadSectionLevels) {
list.add(convertLS(roadSectionLevel));
}
return list;
}
public String getLine_code() {
return line_code;
}
public void setLine_code(String line_code) {
this.line_code = line_code;
}
public String getSection_code() {
return section_code;
}
public void setSection_code(String section_code) {
this.section_code = section_code;
}
public String getSectionroute_code() {
return sectionroute_code;
}
public void setSectionroute_code(String sectionroute_code) {
this.sectionroute_code = sectionroute_code;
}
public Integer getDirections() {
return directions;
}
public void setDirections(Integer directions) {
this.directions = directions;
}
public String getLine_base_id() {
return line_base_id;
}
public void setLine_base_id(String line_base_id) {
this.line_base_id = line_base_id;
}
public String getSection() {
return section;
}
public void setSection(String section) {
this.section = section;
}
public String getDescriptions() {
return descriptions;
}
public void setDescriptions(String descriptions) {
this.descriptions = descriptions;
}
public Integer getVersions() {
return versions;
}
public void setVersions(Integer versions) {
this.versions = versions;
}
public Integer getDestroy() {
return destroy;
}
public void setDestroy(Integer destroy) {
this.destroy = destroy;
}
public Integer getIs_roade_speed() {
return is_roade_speed;
}
public void setIs_roade_speed(Integer is_roade_speed) {
this.is_roade_speed = is_roade_speed;
}
public String getLine_name() {
return line_name;
}
public void setLine_name(String line_name) {
this.line_name = line_name;
}
public String getSection_name() {
return section_name;
}
public void setSection_name(String section_name) {
this.section_name = section_name;
}
}