RoadSectionLevel.java 4.97 KB
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;
	}
}