Commit d525d33cb7fbe3af44e9a0351f31e083c267df17

Authored by 徐烜
1 parent 7faaa175

嘉定公交调度系统计划调度功能优化3

1、完成前置时刻表信息验证
2、时刻表测试框架建立,完成前置时刻表信息验证测试用例
Showing 53 changed files with 8862 additions and 2 deletions
@@ -34,7 +34,7 @@ @@ -34,7 +34,7 @@
34 <groupId>org.springframework.boot</groupId> 34 <groupId>org.springframework.boot</groupId>
35 <artifactId>spring-boot-starter-security</artifactId> 35 <artifactId>spring-boot-starter-security</artifactId>
36 </dependency> 36 </dependency>
37 - <!-- <dependency> <groupId>org.springframework.security</groupId> <artifactId>spring-security-config</artifactId> 37 + <!-- <dependency> <groupId>org.springframework.security</groupId> <artifactId>spring-security-config</artifactId>
38 </dependency> --> 38 </dependency> -->
39 <dependency> 39 <dependency>
40 <groupId>org.springframework.boot</groupId> 40 <groupId>org.springframework.boot</groupId>
@@ -302,7 +302,15 @@ @@ -302,7 +302,15 @@
302 <artifactId>plan_module-common</artifactId> 302 <artifactId>plan_module-common</artifactId>
303 <version>1.0-SNAPSHOT</version> 303 <version>1.0-SNAPSHOT</version>
304 </dependency> 304 </dependency>
305 - </dependencies> 305 +
  306 + <!-- lombok依赖 -->
  307 + <dependency>
  308 + <groupId>org.projectlombok</groupId>
  309 + <artifactId>lombok</artifactId>
  310 + <version>1.16.22</version>
  311 + </dependency>
  312 +
  313 + </dependencies>
306 314
307 <dependencyManagement> 315 <dependencyManagement>
308 <dependencies> 316 <dependencies>
src/main/java/com/bsth/service/schedule/plan/PlanConfig.java 0 → 100644
  1 +package com.bsth.service.schedule.plan;
  2 +
  3 +import org.kie.api.KieBase;
  4 +import org.kie.api.KieBaseConfiguration;
  5 +import org.kie.api.KieServices;
  6 +import org.kie.api.builder.*;
  7 +import org.kie.api.builder.model.KieBaseModel;
  8 +import org.kie.api.builder.model.KieModuleModel;
  9 +import org.kie.api.builder.model.KieSessionModel;
  10 +import org.kie.api.conf.EqualityBehaviorOption;
  11 +import org.kie.api.conf.EventProcessingOption;
  12 +import org.kie.api.runtime.KieContainer;
  13 +import org.kie.api.runtime.conf.ClockTypeOption;
  14 +import org.kie.internal.io.ResourceFactory;
  15 +import org.slf4j.Logger;
  16 +import org.slf4j.LoggerFactory;
  17 +import org.springframework.beans.factory.annotation.Autowired;
  18 +import org.springframework.boot.context.properties.EnableConfigurationProperties;
  19 +import org.springframework.context.annotation.Bean;
  20 +import org.springframework.context.annotation.Configuration;
  21 +
  22 +/**
  23 + * 计划配置类。
  24 + */
  25 +@Configuration
  26 +@EnableConfigurationProperties(PlanConfigProperties.class)
  27 +public class PlanConfig {
  28 + /** 日志记录器 */
  29 + private static final Logger LOGGER = LoggerFactory.getLogger(PlanConfig.class);
  30 +
  31 + /** 计划配置文件 */
  32 + @Autowired
  33 + private PlanConfigProperties planConfigProperties;
  34 +
  35 + /**
  36 + * 验证时刻表kieBase。
  37 + * @return
  38 + */
  39 + @Bean(name = "kBaseValidateTimetable")
  40 + public KieBase kBaseValidateTimetable() {
  41 + KieBase kieBase = this.generateKieBase(
  42 + "kBaseValidateTimetable",
  43 + new String[] {this.planConfigProperties.getValidateTimetable()}
  44 + );
  45 + LOGGER.info("初始化 KieBase[{}]成功", "前置验证相关时刻表信息");
  46 + return kieBase;
  47 + }
  48 +
  49 + /**
  50 + * 生成KieBase。
  51 + * @param kBaseName kBase名字
  52 + * @param drlClasspaths 规则类路径
  53 + */
  54 + private KieBase generateKieBase(String kBaseName, String[] drlClasspaths) {
  55 + // Drools 6开始引入kie统一接口(jboss的jbpm工作流也使用kie接口了),整个定义方式和5差别很大
  56 + // 这里使用全api方式配置知识库对象,不使用xml的方式,提供最大的灵活性
  57 +
  58 + // 1、创建kieservices
  59 + KieServices kieServices = KieServices.Factory.get();
  60 +
  61 + // 2、创建KieModuleModel,默认是由kmodule.xml的方式创建,这里使用api方式闯将
  62 + KieModuleModel kieModuleModel = kieServices.newKieModuleModel();
  63 + // 2.1、创建KieBaseModel,类似kmodule.xml中的kbase标签
  64 + KieBaseModel kieBaseModel1 = kieModuleModel.newKieBaseModel(kBaseName)
  65 + .setDefault(true)
  66 + .setEqualsBehavior(EqualityBehaviorOption.EQUALITY)
  67 + .setEventProcessingMode(EventProcessingOption.STREAM);
  68 + // 2.2、创建与kbase关联的KieSessionModel,类似kmodule.xml中的kbase内的ksession标签
  69 + kieBaseModel1.newKieSessionModel("KSession1")
  70 + .setDefault(true)
  71 + .setType(KieSessionModel.KieSessionType.STATEFUL)
  72 + .setClockType(ClockTypeOption.get("realtime"));
  73 +
  74 + // 3、创建KieFileSystem,将模型xml,drl等写入,TODO:以后考虑从数据库中获取
  75 + KieFileSystem kfs = kieServices.newKieFileSystem();
  76 + // 3.1、写入KieBaseModel(内部包含了KieSessionModel的内容了,注意之前的KieSessionModel的创建方式)
  77 + kfs.writeKModuleXML(kieModuleModel.toXML());
  78 + // 3.2、写入drl
  79 + // 这里使用文件的形式写入,TODO:以后考虑从数据库中读drl写入
  80 + // 注意kfs写的时候如果指定path,强制为src/main/resources/加上文件名,还有就是文件名不要重复否则会覆盖的
  81 +// kfs.write(ResourceFactory.newFileResource(new File(rules_root_path + kbase_validate_timetable_drl)));
  82 + for (String drlClasspath : drlClasspaths) {
  83 + kfs.write(ResourceFactory.newClassPathResource(drlClasspath));
  84 + }
  85 +
  86 + // 4、创建KieBuilder,使用KieFileSystem构建
  87 + KieBuilder kieBuilder = kieServices.newKieBuilder(kfs).buildAll();
  88 + Results results = kieBuilder.getResults();
  89 + if (results.hasMessages(Message.Level.ERROR))
  90 + throw new IllegalStateException("构建drools6错误:" + results.getMessages());
  91 +
  92 + // 5、获取KieContainer
  93 + // TODO:ReleaseId用处很大,以后再议
  94 + ReleaseId releaseId = kieServices.getRepository().getDefaultReleaseId();
  95 + KieContainer kieContainer = kieServices.newKieContainer(releaseId);
  96 +
  97 + // 6、创建kbase
  98 + KieBaseConfiguration kieBaseConfiguration = kieServices.newKieBaseConfiguration();
  99 + KieBase kieBase = kieContainer.newKieBase(kBaseName, kieBaseConfiguration);
  100 +
  101 + return kieBase;
  102 + }
  103 +}
src/main/java/com/bsth/service/schedule/plan/PlanConfigProperties.java 0 → 100644
  1 +package com.bsth.service.schedule.plan;
  2 +
  3 +import org.springframework.boot.context.properties.ConfigurationProperties;
  4 +
  5 +import javax.validation.constraints.NotNull;
  6 +
  7 +/**
  8 + * 排班计划相关配置文件。
  9 + */
  10 +@ConfigurationProperties(
  11 + locations = "classpath:drools/config.properties",
  12 + ignoreInvalidFields = true,
  13 + prefix = "drools.KBase"
  14 +)
  15 +public class PlanConfigProperties {
  16 +
  17 + /** 排班前置验证规则(时刻表)*/
  18 + @NotNull
  19 + private String validateTimetable;
  20 +
  21 + public String getValidateTimetable() {
  22 + return validateTimetable;
  23 + }
  24 +
  25 + public void setValidateTimetable(String validateTimetable) {
  26 + this.validateTimetable = validateTimetable;
  27 + }
  28 +}
src/main/java/com/bsth/service/schedule/plan/process/_1_validate/_1_timetable/PlanProcessValidateTimetableService.java 0 → 100644
  1 +package com.bsth.service.schedule.plan.process._1_validate._1_timetable;
  2 +
  3 +import com.bsth.service.schedule.plan.process._1_validate._1_timetable.drools.KBaseValidateTimeTable_Result;
  4 +
  5 +import java.util.Date;
  6 +
  7 +/**
  8 + * 验证时刻表服务。
  9 + */
  10 +public interface PlanProcessValidateTimetableService {
  11 + /**
  12 + * 验证关联的时刻表信息。
  13 + * @param xlid 线路Id
  14 + * @param from 排班计划开始时间
  15 + * @param to 排班计划结束时间
  16 + * @return 验证输出
  17 + */
  18 + KBaseValidateTimeTable_Result validateTTInfovalidateTTInfo(Integer xlid, Date from, Date to);
  19 +}
src/main/java/com/bsth/service/schedule/plan/process/_1_validate/_1_timetable/PlanProcessValidateTimetableServiceDroolsImpl.java 0 → 100644
  1 +package com.bsth.service.schedule.plan.process._1_validate._1_timetable;
  2 +
  3 +import com.bsth.service.schedule.plan.process._1_validate._1_timetable.drools.*;
  4 +import org.joda.time.DateTime;
  5 +import org.kie.api.KieBase;
  6 +import org.kie.api.runtime.KieSession;
  7 +import org.slf4j.Logger;
  8 +import org.slf4j.LoggerFactory;
  9 +import org.springframework.jdbc.core.JdbcTemplate;
  10 +import org.springframework.jdbc.core.RowMapper;
  11 +import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;
  12 +
  13 +import java.sql.ResultSet;
  14 +import java.sql.SQLException;
  15 +import java.util.*;
  16 +
  17 +/**
  18 + * 验证时刻表服务drools实现。
  19 + */
  20 +public class PlanProcessValidateTimetableServiceDroolsImpl implements PlanProcessValidateTimetableService {
  21 + /** 日志记录器 */
  22 + private static final Logger LOGGER = LoggerFactory.getLogger(PlanProcessValidateTimetableServiceDroolsImpl.class);
  23 +
  24 + /** 验证时刻表drools kbase */
  25 + private KieBase validateTimetableKBase;
  26 +
  27 + /** 使用的jdbc服务 */
  28 + private JdbcTemplate jdbcTemplate;
  29 +
  30 + /** 线路查询SQL */
  31 + private static final String LINE_QUERY_SQL =
  32 + "select id, name from bsth_c_line line where line.id = ? and destroy = 0";
  33 + /** 时刻表查询SQL */
  34 + private static final String TTINFO_QUERY_SQL =
  35 + "select id, name, rule_days, special_days, line_version " +
  36 + "from bsth_c_s_ttinfo ttinfo " +
  37 + "where ttinfo.is_cancel = 0 and ttinfo.is_enable_dis_template = 1 and ttinfo.xl = ?";
  38 + /** 时刻表明细查询SQL(使用 NamedParameterJdbcTemplate) */
  39 + private static final String TTINFO_DETAIL_QUERY_SQL =
  40 + "select id, qdz_code, qdz_name, zdz_code, zdz_name, ttinfo, line_version, bc_type, bcsj " +
  41 + "from bsth_c_s_ttinfo_detail td " +
  42 + "where td.ttinfo in (:ttInfoIds)";
  43 +
  44 + @Override
  45 + public KBaseValidateTimeTable_Result validateTTInfovalidateTTInfo(final Integer xlid, Date from, Date to) {
  46 + LOGGER.info("KieBase[{}],线路id={},开始日期={},结束日期={} 开始验证",
  47 + "前置验证相关时刻表信息", xlid, from, to);
  48 +
  49 + // 构造drools session->载入数据->启动规则->计算->销毁session
  50 + // 创建session,内部配置的是stateful
  51 + KieSession session = validateTimetableKBase.newKieSession();
  52 + // 设置gloable对象,在drl中通过别名使用
  53 + session.setGlobal("LOGGER", LOGGER);
  54 +
  55 + KBaseValidateTimeTable_Result rs = new KBaseValidateTimeTable_Result(); // 输出gloable对象
  56 + session.setGlobal("rs", rs);
  57 +
  58 + // 载入数据,参数数据,线路数据,时刻表数据,时刻表明细数据
  59 + KBaseValidateTimeTable_Fact_CalcuParam calcuParam = new KBaseValidateTimeTable_Fact_CalcuParam(
  60 + new DateTime(from), new DateTime(to), xlid);
  61 + session.insert(calcuParam);
  62 +
  63 + // 载入线路dto
  64 + List<KBaseValidateTimeTable_Fact_Line> fact_lines = jdbcTemplate.query(
  65 + LINE_QUERY_SQL,
  66 + new Object[] {xlid},
  67 + new RowMapper<KBaseValidateTimeTable_Fact_Line>() {
  68 + @Override
  69 + public KBaseValidateTimeTable_Fact_Line mapRow(ResultSet rs, int rowNum) throws SQLException {
  70 + return KBaseValidateTimeTable_Fact_Line.builder()
  71 + .id(rs.getInt("id"))
  72 + .name(rs.getString("name"))
  73 + .build();
  74 + }
  75 + });
  76 + if (fact_lines.size() > 0) {
  77 + session.insert(fact_lines.get(0));
  78 + }
  79 +
  80 + // 载入时刻表dto
  81 + List<KBaseValidateTimeTable_Fact_TTInfo> fact_ttInfos = jdbcTemplate.query(
  82 + TTINFO_QUERY_SQL,
  83 + new Object[] {xlid},
  84 + new RowMapper<KBaseValidateTimeTable_Fact_TTInfo>() {
  85 + @Override
  86 + public KBaseValidateTimeTable_Fact_TTInfo mapRow(ResultSet rs, int rowNum) throws SQLException {
  87 + return KBaseValidateTimeTable_Fact_TTInfo.getBuilder()
  88 + .setId(rs.getLong("id"))
  89 + .setName(rs.getString("name"))
  90 + .setRule_days(rs.getString("rule_days"))
  91 + .setWeekdayList(rs.getString("rule_days"))
  92 + .setSpecial_days(rs.getString("special_days"))
  93 + .setSpecialDayList(rs.getString("special_days"))
  94 + .setLineVersion(rs.getInt("line_version"))
  95 + .setXl(KBaseValidateTimeTable_Fact_Line.builder().id(xlid).build())
  96 + .build();
  97 + }
  98 + });
  99 + for (KBaseValidateTimeTable_Fact_TTInfo fact_ttInfo : fact_ttInfos) {
  100 + session.insert(fact_ttInfo);
  101 + }
  102 +
  103 + // 载入时刻表明细dto
  104 + Map<String, Object> param = new HashMap<>();
  105 + List<Long> ttInfoIds = new ArrayList<>();
  106 + param.put("ttInfoIds", ttInfoIds);
  107 + for (KBaseValidateTimeTable_Fact_TTInfo fact_ttInfo : fact_ttInfos) {
  108 + ttInfoIds.add(fact_ttInfo.getId());
  109 + }
  110 + if (ttInfoIds.size() > 0) {
  111 + NamedParameterJdbcTemplate namedParameterJdbcTemplate = new NamedParameterJdbcTemplate(jdbcTemplate);
  112 + List<KBaseValidateTimeTable_Fact_TTInfoDetail> fact_ttInfoDetails = namedParameterJdbcTemplate.query(
  113 + TTINFO_DETAIL_QUERY_SQL,
  114 + param,
  115 + new RowMapper<KBaseValidateTimeTable_Fact_TTInfoDetail>() {
  116 + @Override
  117 + public KBaseValidateTimeTable_Fact_TTInfoDetail mapRow(ResultSet rs, int rowNum) throws SQLException {
  118 + return KBaseValidateTimeTable_Fact_TTInfoDetail.builder()
  119 + .id(rs.getLong("id"))
  120 + .qdzCode(rs.getString("qdz_code"))
  121 + .qdzName(rs.getString("qdz_name"))
  122 + .zdzCode(rs.getString("zdz_code"))
  123 + .zdzName(rs.getString("zdz_name"))
  124 + .ttinfo(KBaseValidateTimeTable_Fact_TTInfo.getBuilder().setId(rs.getLong("ttinfo")).build())
  125 + .lineVersion(rs.getInt("line_version"))
  126 + .bcType(rs.getString("bc_type"))
  127 + .bcsj(rs.getInt("bcsj"))
  128 + .build();
  129 + }
  130 + });
  131 + for (KBaseValidateTimeTable_Fact_TTInfoDetail fact_ttInfoDetail : fact_ttInfoDetails) {
  132 + session.insert(fact_ttInfoDetail);
  133 + }
  134 + }
  135 +
  136 + // 执行rule
  137 + session.fireAllRules();
  138 +
  139 + // 执行完毕销毁,有日志的也要关闭
  140 + session.dispose();
  141 +
  142 + LOGGER.info("KieBase[{}],线路id={},开始日期={},结束日期={} 完成验证",
  143 + "前置验证相关时刻表信息", xlid, from, to);
  144 +
  145 + return rs;
  146 + }
  147 +
  148 + private PlanProcessValidateTimetableServiceDroolsImpl() {}
  149 + private PlanProcessValidateTimetableServiceDroolsImpl(Builder builder) {
  150 + this.validateTimetableKBase = builder.validateTimetableKBase;
  151 + this.jdbcTemplate = builder.jdbcTemplate;
  152 +
  153 + }
  154 +
  155 + public static Builder getBuilder() {
  156 + return new Builder();
  157 + }
  158 +
  159 + public static class Builder {
  160 + /** 验证时刻表drools kbase */
  161 + private KieBase validateTimetableKBase;
  162 +
  163 + /** 使用的jdbc服务 */
  164 + private JdbcTemplate jdbcTemplate;
  165 +
  166 + public Builder setValidateTimetableKBase(KieBase validateTimetableKBase) {
  167 + this.validateTimetableKBase = validateTimetableKBase;
  168 + return this;
  169 + }
  170 +
  171 + public Builder setJdbcTemplate(JdbcTemplate jdbcTemplate) {
  172 + this.jdbcTemplate = jdbcTemplate;
  173 + return this;
  174 + }
  175 +
  176 + public PlanProcessValidateTimetableServiceDroolsImpl build() {
  177 + return new PlanProcessValidateTimetableServiceDroolsImpl(this);
  178 + }
  179 + }
  180 +}
src/main/java/com/bsth/service/schedule/plan/process/_1_validate/_1_timetable/drools/KBaseValidateTimeTable_Fact_CalcuParam.java 0 → 100644
  1 +package com.bsth.service.schedule.plan.process._1_validate._1_timetable.drools;
  2 +
  3 +import lombok.AllArgsConstructor;
  4 +import lombok.Builder;
  5 +import lombok.Data;
  6 +import org.joda.time.DateTime;
  7 +
  8 +/**
  9 + * drools规则验证时刻表使用的参数fact对象。
  10 + */
  11 +@Data
  12 +@Builder
  13 +@AllArgsConstructor
  14 +public class KBaseValidateTimeTable_Fact_CalcuParam {
  15 + /** 开始计算时间 */
  16 + private DateTime fromDate;
  17 + /** 结束计算时间 */
  18 + private DateTime toDate;
  19 + /** 线路id */
  20 + private Integer xlId;
  21 +
  22 +}
src/main/java/com/bsth/service/schedule/plan/process/_1_validate/_1_timetable/drools/KBaseValidateTimeTable_Fact_Line.java 0 → 100644
  1 +package com.bsth.service.schedule.plan.process._1_validate._1_timetable.drools;
  2 +
  3 +import lombok.AllArgsConstructor;
  4 +import lombok.Builder;
  5 +import lombok.Data;
  6 +
  7 +/**
  8 + * drools规则验证时刻表使用的线路fact对象。
  9 + */
  10 +@Data
  11 +@Builder
  12 +@AllArgsConstructor
  13 +public class KBaseValidateTimeTable_Fact_Line {
  14 + /** 主键id */
  15 + private Integer id;
  16 + /** 线路名称 */
  17 + private String name;
  18 +}
src/main/java/com/bsth/service/schedule/plan/process/_1_validate/_1_timetable/drools/KBaseValidateTimeTable_Fact_TTInfo.java 0 → 100644
  1 +package com.bsth.service.schedule.plan.process._1_validate._1_timetable.drools;
  2 +
  3 +import org.apache.commons.lang3.StringUtils;
  4 +import org.apache.commons.lang3.time.DateFormatUtils;
  5 +import org.joda.time.DateTime;
  6 +
  7 +import java.text.ParseException;
  8 +import java.util.ArrayList;
  9 +import java.util.List;
  10 +
  11 +/**
  12 + * drools规则验证时刻表使用的时刻表fact对象。
  13 + */
  14 +public class KBaseValidateTimeTable_Fact_TTInfo {
  15 + /** 主键Id */
  16 + private Long id;
  17 +
  18 + /** 线路关联 */
  19 + private KBaseValidateTimeTable_Fact_Line xl;
  20 +
  21 + /** 时刻表名称 */
  22 + private String name;
  23 +
  24 + // TODO:原系统里的分别在,圈后圈进场,意思不知道,再议
  25 +
  26 + /** 常规有效日(1-7表示星期一到星期日,多个用逗号隔开) */
  27 + private String rule_days;
  28 + /** 特殊有效日期(格式:2001-01-01,多个用逗号隔开) */
  29 + private String special_days;
  30 +
  31 + /** 常规有效日(参照rule_days,1=true表示启用,0=false表示未启用,一个星期7天,保存7个元素) */
  32 + private List<Boolean> weekdayList = new ArrayList<>();
  33 + /** 特殊有效日期(参照special_days,1个日期保存1个元素) */
  34 + private List<DateTime> specialDayList = new ArrayList<>();
  35 +
  36 + /** 线路版本(bsth_c_line_versions表对应字段) */
  37 + private int lineVersion;
  38 +
  39 + public Long getId() {
  40 + return id;
  41 + }
  42 +
  43 + public void setId(Long id) {
  44 + this.id = id;
  45 + }
  46 +
  47 + public KBaseValidateTimeTable_Fact_Line getXl() {
  48 + return xl;
  49 + }
  50 +
  51 + public void setXl(KBaseValidateTimeTable_Fact_Line xl) {
  52 + this.xl = xl;
  53 + }
  54 +
  55 + public String getName() {
  56 + return name;
  57 + }
  58 +
  59 + public void setName(String name) {
  60 + this.name = name;
  61 + }
  62 +
  63 + public String getRule_days() {
  64 + return rule_days;
  65 + }
  66 +
  67 + public void setRule_days(String rule_days) {
  68 + this.rule_days = rule_days;
  69 + }
  70 +
  71 + public String getSpecial_days() {
  72 + return special_days;
  73 + }
  74 +
  75 + public void setSpecial_days(String special_days) {
  76 + this.special_days = special_days;
  77 + }
  78 +
  79 + public List<Boolean> getWeekdayList() {
  80 + return weekdayList;
  81 + }
  82 +
  83 + public void setWeekdayList(List<Boolean> weekdayList) {
  84 + this.weekdayList = weekdayList;
  85 + }
  86 +
  87 + public List<DateTime> getSpecialDayList() {
  88 + return specialDayList;
  89 + }
  90 +
  91 + public void setSpecialDayList(List<DateTime> specialDayList) {
  92 + this.specialDayList = specialDayList;
  93 + }
  94 +
  95 + public int getLineVersion() {
  96 + return lineVersion;
  97 + }
  98 +
  99 + public void setLineVersion(int lineVersion) {
  100 + this.lineVersion = lineVersion;
  101 + }
  102 +
  103 + public KBaseValidateTimeTable_Fact_TTInfo(Builder builder) {
  104 + this.id = builder.id;
  105 +
  106 + this.xl = builder.xl;
  107 +
  108 + this.name = builder.name;
  109 +
  110 + this.rule_days = builder.rule_days;
  111 + this.special_days = builder.special_days;
  112 + this.weekdayList = builder.weekdayList;
  113 + this.specialDayList = builder.specialDayList;
  114 +
  115 + this.lineVersion = builder.lineVersion;
  116 +
  117 + }
  118 +
  119 + //------------------- builder模式 -----------------//
  120 + public static Builder getBuilder() {
  121 + return new Builder();
  122 + }
  123 + public static class Builder {
  124 + /** 主键Id */
  125 + private Long id;
  126 +
  127 + /** 线路关联 */
  128 + private KBaseValidateTimeTable_Fact_Line xl;
  129 +
  130 + /** 时刻表名称 */
  131 + private String name;
  132 +
  133 + // TODO:原系统里的分别在,圈后圈进场,意思不知道,再议
  134 +
  135 + /** 常规有效日(1-7表示星期一到星期日,多个用逗号隔开) */
  136 + private String rule_days;
  137 + /** 特殊有效日期(格式:2001-01-01,多个用逗号隔开) */
  138 + private String special_days;
  139 +
  140 + /** 常规有效日(参照rule_days,1=true表示启用,0=false表示未启用,一个星期7天,保存7个元素) */
  141 + private List<Boolean> weekdayList = new ArrayList<>();
  142 + /** 特殊有效日期(参照special_days,1个日期保存1个元素) */
  143 + private List<DateTime> specialDayList = new ArrayList<>();
  144 +
  145 + /** 线路版本(bsth_c_line_versions表对应字段) */
  146 + private int lineVersion;
  147 +
  148 + public Builder() {
  149 + // 初始化 weekdayList,7个元素为FALSE
  150 + for (int i = 0; i < 7; i++) {
  151 + this.weekdayList.add(Boolean.FALSE);
  152 + }
  153 + }
  154 +
  155 + public Builder setId(Long id) {
  156 + this.id = id;
  157 + return this;
  158 + }
  159 +
  160 + public Builder setXl(KBaseValidateTimeTable_Fact_Line xl) {
  161 + this.xl = xl;
  162 + return this;
  163 + }
  164 +
  165 + public Builder setName(String name) {
  166 + this.name = name;
  167 + return this;
  168 + }
  169 +
  170 + public Builder setRule_days(String rule_days) {
  171 + this.rule_days = rule_days;
  172 + return this;
  173 + }
  174 +
  175 + public Builder setSpecial_days(String special_days) {
  176 + this.special_days = special_days;
  177 + return this;
  178 + }
  179 +
  180 + public Builder setWeekdayList(String rule_days) {
  181 + // 初始化weekday,全false
  182 + this.weekdayList = new ArrayList<>(7);
  183 + for (int i = 0; i < 7; i++) {
  184 + this.weekdayList.add(Boolean.FALSE);
  185 + }
  186 + // 1表示工作,其他表示不工作
  187 + if (StringUtils.isNotEmpty(rule_days)) {
  188 + String[] days = rule_days.split(",");
  189 + for (int i = 0; i < 7 && i < days.length; i++) {
  190 + if ("1".equals(days[i])) {
  191 + this.weekdayList.set(i, Boolean.TRUE);
  192 + } else {
  193 + this.weekdayList.set(i, Boolean.FALSE);
  194 + }
  195 + }
  196 + }
  197 + return this;
  198 + }
  199 +
  200 + public Builder setSpecialDayList(String special_days) {
  201 + this.specialDayList = new ArrayList<>();
  202 + if (StringUtils.isNotEmpty(special_days)) {
  203 + String[] days = special_days.split(",");
  204 + for (String day : days) {
  205 + try {
  206 + this.specialDayList.add(new DateTime(DateFormatUtils.ISO_DATE_FORMAT.parse(day)));
  207 + } catch (ParseException exp) {
  208 + throw new RuntimeException(exp);
  209 + }
  210 + }
  211 + }
  212 + return this;
  213 + }
  214 +
  215 + public Builder setLineVersion(int lineVersion) {
  216 + this.lineVersion = lineVersion;
  217 + return this;
  218 + }
  219 +
  220 + public KBaseValidateTimeTable_Fact_TTInfo build() {
  221 + return new KBaseValidateTimeTable_Fact_TTInfo(this);
  222 + }
  223 + }
  224 +
  225 +}
src/main/java/com/bsth/service/schedule/plan/process/_1_validate/_1_timetable/drools/KBaseValidateTimeTable_Fact_TTInfoDetail.java 0 → 100644
  1 +package com.bsth.service.schedule.plan.process._1_validate._1_timetable.drools;
  2 +
  3 +import lombok.AllArgsConstructor;
  4 +import lombok.Builder;
  5 +import lombok.Data;
  6 +
  7 +/**
  8 + * drools规则验证时刻表使用的时刻表明细fact对象。
  9 + */
  10 +@Data
  11 +@Builder
  12 +@AllArgsConstructor
  13 +public class KBaseValidateTimeTable_Fact_TTInfoDetail {
  14 + /** 主健Id */
  15 + private Long id;
  16 + /** 时刻表主对象关联 */
  17 + private KBaseValidateTimeTable_Fact_TTInfo ttinfo;
  18 +
  19 + // 站点包括普通站点和停车场(站点编码不同,使用站点编码区分)
  20 + // 以后不需要再区分是站点还是停车场了
  21 + /** 起站点代码(bsth_c_station,bsth_c_car_park 里的编码) */
  22 + private String qdzCode;
  23 + /** 起站点名字(bsth_c_stationroute,bsth_c_car_park里的名字) */
  24 + private String qdzName;
  25 + /** 终点站代码(bsth_c_station,bsth_c_car_park 里的编码) */
  26 + private String zdzCode;
  27 + /** 终点站名字(bsth_c_stationroute,bsth_c_car_park里的名字) */
  28 + private String zdzName;
  29 +
  30 + /** 线路版本(bsth_c_line_versions表对应字段) */
  31 + private int lineVersion;
  32 +
  33 + /** 班次类型 字典type=ScheduleType */
  34 + private String bcType;
  35 +
  36 + /** 班次历时 */
  37 + private Integer bcsj;
  38 +
  39 +}
src/main/java/com/bsth/service/schedule/plan/process/_1_validate/_1_timetable/drools/KBaseValidateTimeTable_Function_AccumulateConflict.java 0 → 100644
  1 +package com.bsth.service.schedule.plan.process._1_validate._1_timetable.drools;
  2 +
  3 +import com.bsth.service.schedule.plan.process._1_validate._1_timetable.drools.KBaseValidateTimeTable_Result.StatInfo;
  4 +import org.apache.commons.lang3.StringUtils;
  5 +import org.kie.api.runtime.rule.AccumulateFunction;
  6 +import org.springframework.util.CollectionUtils;
  7 +
  8 +import java.io.*;
  9 +import java.util.ArrayList;
  10 +import java.util.HashMap;
  11 +import java.util.List;
  12 +import java.util.Map;
  13 +
  14 +/**
  15 + * 聚合时刻表冲突函数(去除重复的时刻表,优先提取冲突的时刻表)。
  16 + */
  17 +public class KBaseValidateTimeTable_Function_AccumulateConflict implements AccumulateFunction {
  18 + @Override
  19 + public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
  20 + }
  21 + @Override
  22 + public void writeExternal(ObjectOutput out) throws IOException {
  23 + }
  24 +
  25 + protected static class AccumulateConflictData implements Serializable {
  26 + /** 聚合后的时刻表统计信息(key为时刻表Id) */
  27 + private Map<Long, StatInfo> statInfoGroupMap;
  28 + /** 聚合后的冲突描述信息(key为时刻表Id) */
  29 + private Map<Long, List<String>> conflictDescGroupMap;
  30 +
  31 + public AccumulateConflictData() {
  32 + statInfoGroupMap = new HashMap<>();
  33 + conflictDescGroupMap = new HashMap<>();
  34 + }
  35 +
  36 + public void remove(Long ttInfoId) {
  37 + statInfoGroupMap.remove(ttInfoId);
  38 + conflictDescGroupMap.remove(ttInfoId);
  39 + }
  40 +
  41 + public List<StatInfo> result() {
  42 + // 输出时,需要讲聚合后的冲突信息合并到时刻表统计信息中
  43 + List<StatInfo> rs = new ArrayList<>();
  44 + for (Long ttInfoId : statInfoGroupMap.keySet()) {
  45 + StatInfo statInfo = statInfoGroupMap.get(ttInfoId);
  46 + List<String> conflictDescList = conflictDescGroupMap.get(ttInfoId);
  47 + if (!CollectionUtils.isEmpty(conflictDescGroupMap)) {
  48 + // 使用逗号分隔
  49 + String conflictDesc = StringUtils.join(conflictDescList, ",");
  50 + statInfo.setConflictDesc(conflictDesc);
  51 + }
  52 + rs.add(statInfo);
  53 + }
  54 + return rs;
  55 + }
  56 + public void add(StatInfo statInfo) {
  57 + /**
  58 + * 聚合时刻表统计信息,
  59 + * 1、第一次直接添加时刻表统计信息
  60 + * 2、如果下一个时刻表统计信息中有冲突标识,则覆盖添加
  61 + */
  62 + Long ttInfoId = statInfo.getTtid();
  63 + boolean conflict = statInfo.getConflict();
  64 + if (statInfoGroupMap.get(ttInfoId) == null) {
  65 + statInfoGroupMap.put(ttInfoId, statInfo);
  66 + } else {
  67 + if (conflict) {
  68 + statInfoGroupMap.put(ttInfoId, statInfo);
  69 + }
  70 + }
  71 + /**
  72 + * 聚合时刻表冲突信息。
  73 + */
  74 + if (conflict) {
  75 + if (conflictDescGroupMap.get(ttInfoId) == null) {
  76 + conflictDescGroupMap.put(ttInfoId, new ArrayList<String>());
  77 + }
  78 + conflictDescGroupMap.get(ttInfoId).add(statInfo.getConflictDesc());
  79 + }
  80 +
  81 + }
  82 + }
  83 +
  84 + @Override
  85 + public Serializable createContext() {
  86 + return new AccumulateConflictData();
  87 + }
  88 +
  89 + @Override
  90 + public void init(Serializable context) throws Exception {
  91 + }
  92 +
  93 + @Override
  94 + public void accumulate(Serializable context, Object value) {
  95 + AccumulateConflictData accumulateConflictData = (AccumulateConflictData) context;
  96 + StatInfo statInfo = (StatInfo) value;
  97 + accumulateConflictData.add(statInfo);
  98 + }
  99 +
  100 + @Override
  101 + public void reverse(Serializable context, Object value) throws Exception {
  102 + AccumulateConflictData accumulateConflictData = (AccumulateConflictData) context;
  103 + StatInfo statInfo = (StatInfo) value;
  104 + accumulateConflictData.remove(statInfo.getTtid());
  105 + }
  106 +
  107 + @Override
  108 + public boolean supportsReverse() {
  109 + return true;
  110 + }
  111 +
  112 + @Override
  113 + public Class<?> getResultType() {
  114 + return List.class;
  115 + }
  116 +
  117 + @Override
  118 + public Object getResult(Serializable context) throws Exception {
  119 + AccumulateConflictData accumulateConflictData = (AccumulateConflictData) context;
  120 + return accumulateConflictData.result();
  121 + }
  122 +}
src/main/java/com/bsth/service/schedule/plan/process/_1_validate/_1_timetable/drools/KBaseValidateTimeTable_Function_ErrorBcCount.java 0 → 100644
  1 +package com.bsth.service.schedule.plan.process._1_validate._1_timetable.drools;
  2 +
  3 +import org.apache.commons.lang3.StringUtils;
  4 +import org.kie.api.runtime.rule.AccumulateFunction;
  5 +
  6 +import java.io.*;
  7 +
  8 +/**
  9 + * drools规则验证时刻表用的函数(计算错误班次数量)
  10 + */
  11 +public class KBaseValidateTimeTable_Function_ErrorBcCount implements AccumulateFunction {
  12 + @Override
  13 + public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
  14 + }
  15 +
  16 + @Override
  17 + public void writeExternal(ObjectOutput out) throws IOException {
  18 + }
  19 +
  20 + protected static class ErrorCountData implements Externalizable {
  21 + public long errorcount = 0;
  22 + public KBaseValidateTimeTable_Fact_TTInfoDetail ttInfoDetail;
  23 +
  24 + public ErrorCountData() {
  25 + }
  26 +
  27 + @Override
  28 + public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
  29 + errorcount = in.readLong();
  30 + ttInfoDetail = (KBaseValidateTimeTable_Fact_TTInfoDetail) in.readObject();
  31 + }
  32 +
  33 + @Override
  34 + public void writeExternal(ObjectOutput out) throws IOException {
  35 + out.writeLong(errorcount);
  36 + out.writeObject(ttInfoDetail);
  37 + }
  38 + }
  39 +
  40 + @Override
  41 + public Serializable createContext() {
  42 + return new ErrorCountData();
  43 + }
  44 +
  45 + @Override
  46 + public void init(Serializable context) throws Exception {
  47 + ErrorCountData errorCountData = (ErrorCountData) context;
  48 + errorCountData.errorcount = 0;
  49 + }
  50 +
  51 + @Override
  52 + public void accumulate(Serializable context, Object value) {
  53 + ErrorCountData errorCountData = (ErrorCountData) context;
  54 + KBaseValidateTimeTable_Fact_TTInfoDetail ttInfoDetail = (KBaseValidateTimeTable_Fact_TTInfoDetail) value;
  55 +
  56 + if (ttInfoDetail.getTtinfo() == null) {
  57 + errorCountData.errorcount ++;
  58 + return;
  59 + }
  60 +
  61 + // 判定条件(数据库中的对应字段没有非空约束),与界面saTimeTable.js的validInfo方法对应
  62 + // 1、起点站编码,名字为空
  63 + // 2、终点站编码,名字为空
  64 + // 3、班次时间
  65 + // TODO:其他再议
  66 + if (StringUtils.isEmpty(ttInfoDetail.getQdzCode()) ||
  67 + StringUtils.isEmpty(ttInfoDetail.getQdzName()) ||
  68 + StringUtils.isEmpty(ttInfoDetail.getZdzCode()) ||
  69 + StringUtils.isEmpty(ttInfoDetail.getZdzName()) ||
  70 + (ttInfoDetail.getBcsj() == null) ) {
  71 +
  72 + errorCountData.errorcount ++;
  73 + }
  74 + }
  75 +
  76 + @Override
  77 + public void reverse(Serializable context, Object value) throws Exception {
  78 + ErrorCountData errorCountData = (ErrorCountData) context;
  79 + KBaseValidateTimeTable_Fact_TTInfoDetail ttInfoDetail = (KBaseValidateTimeTable_Fact_TTInfoDetail) value;
  80 +
  81 + if (ttInfoDetail.getTtinfo() == null) {
  82 + errorCountData.errorcount --;
  83 + return;
  84 + }
  85 +
  86 + if (StringUtils.isEmpty(ttInfoDetail.getQdzCode()) ||
  87 + StringUtils.isEmpty(ttInfoDetail.getQdzName()) ||
  88 + StringUtils.isEmpty(ttInfoDetail.getZdzCode()) ||
  89 + StringUtils.isEmpty(ttInfoDetail.getZdzName()) ) {
  90 +
  91 + errorCountData.errorcount --;
  92 + }
  93 +
  94 + }
  95 +
  96 + @Override
  97 + public Object getResult(Serializable context) throws Exception {
  98 + ErrorCountData errorCountData = (ErrorCountData) context;
  99 + return errorCountData.errorcount;
  100 + }
  101 +
  102 + @Override
  103 + public boolean supportsReverse() {
  104 + return true;
  105 + }
  106 +
  107 + @Override
  108 + public Class<?> getResultType() {
  109 + return Number.class;
  110 + }
  111 +}
src/main/java/com/bsth/service/schedule/plan/process/_1_validate/_1_timetable/drools/KBaseValidateTimeTable_Result.java 0 → 100644
  1 +package com.bsth.service.schedule.plan.process._1_validate._1_timetable.drools;
  2 +
  3 +import java.util.ArrayList;
  4 +import java.util.List;
  5 +
  6 +/**
  7 + * drools规则验证时刻表输出结果。
  8 + */
  9 +public class KBaseValidateTimeTable_Result {
  10 + private List<StatInfo> infos = new ArrayList<>();
  11 +
  12 + public List<StatInfo> getInfos() {
  13 + return infos;
  14 + }
  15 +
  16 + public void setInfos(List<StatInfo> infos) {
  17 + this.infos = infos;
  18 + }
  19 +
  20 + public static class StatInfo {
  21 + /** 时刻表id */
  22 + private Long ttid;
  23 + /** 时刻表名字 */
  24 + private String ttname;
  25 + /** 线路版本 */
  26 + private Integer lineVersion;
  27 +
  28 + /** 所有班次数 */
  29 + private Long allbc;
  30 + /** 进场班次数 */
  31 + private Long inbc;
  32 + /** 出场班次数 */
  33 + private Long outbc;
  34 + /** 营运班次数 */
  35 + private Long yybc;
  36 +
  37 + /** 错误班次数 */
  38 + private Long errorbc;
  39 +
  40 + /** 是否冲突(同一天多张时刻表) */
  41 + private Boolean conflict;
  42 + /** 冲突描述(在drools规则中写入) */
  43 + private String conflictDesc;
  44 + /** 是否进行了冲突聚合计算(针对drools规则的聚合函数) */
  45 + private Boolean conflictAccumulate;
  46 +
  47 + public Long getTtid() {
  48 + return ttid;
  49 + }
  50 +
  51 + public void setTtid(Long ttid) {
  52 + this.ttid = ttid;
  53 + }
  54 +
  55 + public String getTtname() {
  56 + return ttname;
  57 + }
  58 +
  59 + public void setTtname(String ttname) {
  60 + this.ttname = ttname;
  61 + }
  62 +
  63 + public Long getAllbc() {
  64 + return allbc;
  65 + }
  66 +
  67 + public void setAllbc(Long allbc) {
  68 + this.allbc = allbc;
  69 + }
  70 +
  71 + public Long getInbc() {
  72 + return inbc;
  73 + }
  74 +
  75 + public void setInbc(Long inbc) {
  76 + this.inbc = inbc;
  77 + }
  78 +
  79 + public Long getOutbc() {
  80 + return outbc;
  81 + }
  82 +
  83 + public void setOutbc(Long outbc) {
  84 + this.outbc = outbc;
  85 + }
  86 +
  87 + public Long getYybc() {
  88 + return yybc;
  89 + }
  90 +
  91 + public void setYybc(Long yybc) {
  92 + this.yybc = yybc;
  93 + }
  94 +
  95 + public Long getErrorbc() {
  96 + return errorbc;
  97 + }
  98 +
  99 + public void setErrorbc(Long errorbc) {
  100 + this.errorbc = errorbc;
  101 + }
  102 +
  103 + public Integer getLineVersion() {
  104 + return lineVersion;
  105 + }
  106 +
  107 + public void setLineVersion(Integer lineVersion) {
  108 + this.lineVersion = lineVersion;
  109 + }
  110 +
  111 + public Boolean getConflict() {
  112 + return conflict;
  113 + }
  114 +
  115 + public void setConflict(Boolean conflict) {
  116 + this.conflict = conflict;
  117 + }
  118 +
  119 + public String getConflictDesc() {
  120 + return conflictDesc;
  121 + }
  122 +
  123 + public void setConflictDesc(String conflictDesc) {
  124 + this.conflictDesc = conflictDesc;
  125 + }
  126 +
  127 + public Boolean getConflictAccumulate() {
  128 + return conflictAccumulate;
  129 + }
  130 +
  131 + public void setConflictAccumulate(Boolean conflictAccumulate) {
  132 + this.conflictAccumulate = conflictAccumulate;
  133 + }
  134 + }
  135 +}
src/main/resources/drools/KBase/validate/timetable/KBase_validate_timetable.drl 0 → 100644
  1 +package com.bsth.service.schedule.plan.process._1_validate._1_timetable.drools;
  2 +
  3 +import org.joda.time.*;
  4 +import org.joda.time.format.DateTimeFormat;
  5 +import java.util.*;
  6 +import org.apache.commons.lang3.StringUtils;
  7 +
  8 +import com.bsth.service.schedule.plan.process._1_validate._1_timetable.drools.KBaseValidateTimeTable_Fact_CalcuParam;
  9 +import com.bsth.service.schedule.plan.process._1_validate._1_timetable.drools.KBaseValidateTimeTable_Result;
  10 +import com.bsth.service.schedule.plan.process._1_validate._1_timetable.drools.KBaseValidateTimeTable_Result.StatInfo;
  11 +
  12 +import com.bsth.service.schedule.plan.process._1_validate._1_timetable.drools.KBaseValidateTimeTable_Fact_Line;
  13 +import com.bsth.service.schedule.plan.process._1_validate._1_timetable.drools.KBaseValidateTimeTable_Fact_TTInfo;
  14 +import com.bsth.service.schedule.plan.process._1_validate._1_timetable.drools.KBaseValidateTimeTable_Fact_TTInfoDetail;
  15 +
  16 +import org.slf4j.Logger;
  17 +
  18 +// 全局日志类(使用PlanPreValidateServiceImpl里定义的LOGGER)
  19 +global Logger LOGGER;
  20 +
  21 +// 输出
  22 +global KBaseValidateTimeTable_Result rs;
  23 +
  24 +/*
  25 + 规则说明:
  26 + 1、找出指定线路,指定时间范围的时刻表
  27 + 2、统计这些时刻表班次数据的情况
  28 + 3、统计时会计算同一天多张时刻表的情况
  29 +*/
  30 +
  31 +//-------------- 第一阶段、计算规则迭代数据(天数) ------------//
  32 +declare Calcu_iter_days_result
  33 + xlId: Integer // 线路Id
  34 + xlName: String // 线路名字
  35 +
  36 + // 迭代数据
  37 + calcu_day: Integer // 准备计算第几天
  38 + calcu_weekday: Integer // 准备计算星期几(1到7)
  39 + calcu_date: DateTime // 准备计算的具体日期
  40 +
  41 + // 范围数据
  42 + calcu_days: Integer // 总共需要计算的天数
  43 + calcu_start_date: DateTime // 开始计算日期
  44 + calcu_end_date: DateTime // 结束计算日期
  45 +
  46 + // 时刻表映射数据
  47 + ttinfomap: Map // 指定时间段内,用的时刻表id映射 Map<Long, Long>
  48 +end
  49 +
  50 +rule "calcu_iter_days"
  51 + salience 1900
  52 + when
  53 + KBaseValidateTimeTable_Fact_CalcuParam(
  54 + $xlId: xlId,
  55 + $fromDate: fromDate,
  56 + $toDate: toDate,
  57 + $fromDate.isBefore($toDate) || $fromDate.isEqual($toDate)
  58 + )
  59 + $line: KBaseValidateTimeTable_Fact_Line(id == $xlId)
  60 + then
  61 + // 构造Calcu_iter_days_result对象,进行下一步计算
  62 + Calcu_iter_days_result cidr = new Calcu_iter_days_result();
  63 + Period p = new Period($fromDate, $toDate, PeriodType.days());
  64 +
  65 + cidr.setXlId($xlId);
  66 + cidr.setXlName($line.getName());
  67 +
  68 + cidr.setCalcu_day(new Integer(1));
  69 + cidr.setCalcu_weekday(Integer.valueOf($fromDate.getDayOfWeek()));
  70 + cidr.setCalcu_date($fromDate);
  71 +
  72 + cidr.setCalcu_days(Integer.valueOf(p.getDays() + 1));
  73 + cidr.setCalcu_start_date($fromDate);
  74 + cidr.setCalcu_end_date($toDate);
  75 +
  76 + cidr.setTtinfomap(new HashMap());
  77 +
  78 + LOGGER.info(
  79 + "线路={}-id={},开始时间={},结束时间={},总共计算的天数={},将从开始时间迭代",
  80 + cidr.getXlName(),
  81 + cidr.getXlId(),
  82 + cidr.getCalcu_start_date(),
  83 + cidr.getCalcu_end_date(),
  84 + cidr.getCalcu_days()
  85 + );
  86 +
  87 + insert(cidr);
  88 +end
  89 +
  90 +//-------------- 第二阶段、时刻表的日期匹配 ------------//
  91 +declare TTInfoList_wrap // 时刻表封装对象
  92 + calcu_date: DateTime // 具体的日期
  93 + ttInfoNormalList: List // 时刻表列表-平日匹配 List<KBaseValidateTimeTable_Fact_TTInfo>
  94 + ttInfoSpecialList: List // 时刻表类标-特殊日期匹配 List<KBaseValidateTimeTable_Fact_TTInfo>
  95 +end
  96 +
  97 +rule "Calcu_iter_days_special_day" // 日期匹配
  98 + salience 800
  99 + when
  100 + $cid : Calcu_iter_days_result(
  101 + $calcu_date: calcu_date,
  102 + $calcu_weekday: calcu_weekday,
  103 + $calcu_day: calcu_day,
  104 + calcu_day <= calcu_days
  105 + )
  106 + $ttInfoSpecialList : ArrayList() from collect (
  107 + KBaseValidateTimeTable_Fact_TTInfo(
  108 + specialDayList contains $calcu_date
  109 + )
  110 + )
  111 + $ttInfoNormalList : ArrayList() from collect (
  112 + KBaseValidateTimeTable_Fact_TTInfo(
  113 + specialDayList not contains $calcu_date,
  114 + weekdayList[$calcu_weekday - 1] == Boolean.TRUE
  115 + )
  116 + )
  117 + then
  118 + LOGGER.debug("日期={}, 一般日期匹配时刻表数量={}, 特殊日期时刻表匹配数量={}",
  119 + $calcu_date, $ttInfoNormalList.size(), $ttInfoSpecialList.size());
  120 +
  121 + // 插入时刻表封装对象
  122 + TTInfoList_wrap fact = new TTInfoList_wrap();
  123 + fact.setCalcu_date(new DateTime($calcu_date));
  124 + // 注意:如果要赋值List,必须重新建ArrayList,直接用drools的变量有问题
  125 + List ttInfoNormalList = new ArrayList();
  126 + ttInfoNormalList.addAll($ttInfoNormalList);
  127 + fact.setTtInfoNormalList(ttInfoNormalList);
  128 + // 注意:如果要赋值List,必须重新建ArrayList,直接用drools的变量有问题
  129 + List ttInfoSpecialList = new ArrayList();
  130 + ttInfoSpecialList.addAll($ttInfoSpecialList);
  131 + fact.setTtInfoSpecialList(ttInfoSpecialList);
  132 +
  133 + insert(fact);
  134 +
  135 + // 更新迭代对象
  136 + Integer new_calcu_day = Integer.valueOf($calcu_day + 1);
  137 + $cid.setCalcu_day(new_calcu_day);
  138 + DateTime new_calcu_date = $calcu_date.plusDays(1);
  139 + $cid.setCalcu_date(new_calcu_date);
  140 + $cid.setCalcu_weekday(Integer.valueOf(new_calcu_date.getDayOfWeek()));
  141 +
  142 + update($cid);
  143 +end
  144 +
  145 +//----------------- 第三阶段、组装待处理时刻表统计信息 ----------------//
  146 +rule "Calcu_StatInfo_wrap_special_not_conflict" // 当天有特殊日期匹配的时刻表,只有一张
  147 + salience 750
  148 + when
  149 + TTInfoList_wrap(
  150 + ttInfoSpecialList.size == 1,
  151 + $calcu_date: calcu_date,
  152 + $ttInfoSpecialList: ttInfoSpecialList
  153 + )
  154 + $ttInfo: KBaseValidateTimeTable_Fact_TTInfo($tid: id, $tname: name, $lineVersion: lineVersion) from $ttInfoSpecialList
  155 + then
  156 + LOGGER.debug("特殊日期匹配,同一天单一时刻表:" +
  157 + "时刻表id={} 日期={}",
  158 + $tid, $calcu_date);
  159 +
  160 + StatInfo statInfo = new StatInfo();
  161 + statInfo.setTtid($tid);
  162 + statInfo.setTtname($tname);
  163 + statInfo.setLineVersion($lineVersion);
  164 + statInfo.setConflict(false);
  165 + statInfo.setConflictAccumulate(false);
  166 + insert(statInfo);
  167 +end
  168 +
  169 +rule "Calcu_StatInfo_wrap_special_conflict" // 当天有特殊日期匹配的时刻表, 多张时刻表
  170 + salience 740
  171 + when
  172 + TTInfoList_wrap(
  173 + ttInfoSpecialList.size > 1,
  174 + $calcu_date: calcu_date,
  175 + $ttInfoSpecialList: ttInfoSpecialList
  176 + )
  177 + $ttInfo: KBaseValidateTimeTable_Fact_TTInfo($tid: id, $tname: name, $lineVersion: lineVersion) from $ttInfoSpecialList
  178 + then
  179 + LOGGER.debug("特殊日期匹配,同一天多张时刻表:" +
  180 + "时刻表id={} 日期={}",
  181 + $tid, $calcu_date);
  182 +
  183 + StatInfo statInfo = new StatInfo();
  184 + statInfo.setTtid($tid);
  185 + statInfo.setTtname($tname);
  186 + statInfo.setLineVersion($lineVersion);
  187 + statInfo.setConflict(true);
  188 + statInfo.setConflictDesc("特殊日期冲突_" + $calcu_date.toString("yyyy-MM-dd"));
  189 + statInfo.setConflictAccumulate(false);
  190 + insert(statInfo);
  191 +end
  192 +
  193 +rule "Calcu_StatInfo_wrap_normal_not_conflict" // 当天一般日期匹配的时刻表,只有一张
  194 + salience 730
  195 + when
  196 + TTInfoList_wrap(
  197 + ttInfoSpecialList.size < 1,
  198 + ttInfoNormalList.size == 1,
  199 + $calcu_date: calcu_date,
  200 + $ttInfoNormalList: ttInfoNormalList
  201 + )
  202 + $ttInfo: KBaseValidateTimeTable_Fact_TTInfo($tid: id, $tname: name, $lineVersion: lineVersion) from $ttInfoNormalList
  203 + then
  204 + LOGGER.debug("一般日期匹配,同一天单一时刻表:" +
  205 + "时刻表id={} 日期={}",
  206 + $tid, $calcu_date);
  207 +
  208 + StatInfo statInfo = new StatInfo();
  209 + statInfo.setTtid($tid);
  210 + statInfo.setTtname($tname);
  211 + statInfo.setLineVersion($lineVersion);
  212 + statInfo.setConflict(false);
  213 + statInfo.setConflictAccumulate(false);
  214 + insert(statInfo);
  215 +end
  216 +
  217 +rule "Calcu_StatInfo_wrap_normal_conflict" // 当天一般日期匹配的时刻表,多张时刻表
  218 + salience 730
  219 + when
  220 + TTInfoList_wrap(
  221 + ttInfoSpecialList.size < 1,
  222 + ttInfoNormalList.size > 1,
  223 + $calcu_date: calcu_date,
  224 + $ttInfoNormalList: ttInfoNormalList
  225 + )
  226 + $ttInfo: KBaseValidateTimeTable_Fact_TTInfo($tid: id, $tname: name, $lineVersion: lineVersion) from $ttInfoNormalList
  227 + then
  228 + LOGGER.debug("一般日期匹配,同一天多张时刻表:" +
  229 + "时刻表id={} 日期={}",
  230 + $tid, $calcu_date);
  231 +
  232 + StatInfo statInfo = new StatInfo();
  233 + statInfo.setTtid($tid);
  234 + statInfo.setTtname($tname);
  235 + statInfo.setLineVersion($lineVersion);
  236 + statInfo.setConflict(true);
  237 + statInfo.setConflictDesc("一般日期冲突_" + $calcu_date.toString("yyyy-MM-dd"));
  238 + statInfo.setConflictAccumulate(false);
  239 + insert(statInfo);
  240 +end
  241 +
  242 +//-------------- 第四阶段、时刻表聚合统计 ------------//
  243 +rule "statinfo_accumulate_conflict" // 聚合统计
  244 + salience 300
  245 + no-loop
  246 + when
  247 + $accList: List() from accumulate (
  248 + $statInfo: StatInfo(conflictAccumulate == false),
  249 + ac($statInfo)
  250 + )
  251 + StatInfo(
  252 + $tid: ttid,
  253 + $tname: ttname,
  254 + $lineVersion: lineVersion,
  255 + $conflict: conflict,
  256 + $conflictDesc: ConflictDesc) from $accList
  257 + then
  258 + LOGGER.info("ttid={}, conflictDesc={}", $tid, $conflictDesc);
  259 +
  260 + StatInfo statInfo = new StatInfo();
  261 + statInfo.setTtid($tid);
  262 + statInfo.setTtname($tname);
  263 + statInfo.setLineVersion($lineVersion);
  264 + statInfo.setConflict($conflict);
  265 + statInfo.setConflictDesc($conflictDesc);
  266 + statInfo.setConflictAccumulate(true);
  267 + insert(statInfo);
  268 +end
  269 +
  270 +rule "statinfo_result" // 统计计算结果
  271 + salience 300
  272 + no-loop
  273 + when
  274 + $statInfo: StatInfo(conflictAccumulate == true, $tid: ttid, $lineVersion: lineVersion, $conflict: conflict, $conflictDesc: conflictDesc)
  275 + $bcInfoList : ArrayList() from collect (KBaseValidateTimeTable_Fact_TTInfoDetail(ttinfo.id == $tid))
  276 + $allbc: Long() from accumulate (KBaseValidateTimeTable_Fact_TTInfoDetail() from $bcInfoList, count())
  277 + $inbc: Long() from accumulate (KBaseValidateTimeTable_Fact_TTInfoDetail(bcType == "in") from $bcInfoList, count())
  278 + $outbc: Long() from accumulate (KBaseValidateTimeTable_Fact_TTInfoDetail(bcType == "out") from $bcInfoList, count())
  279 + $yybc: Long() from accumulate (KBaseValidateTimeTable_Fact_TTInfoDetail(bcType != "out", bcType != "in") from $bcInfoList, count())
  280 + $errorbc: Long() from accumulate ($ttd: KBaseValidateTimeTable_Fact_TTInfoDetail() from $bcInfoList, ecount($ttd))
  281 + then
  282 + LOGGER.info("时刻表={},id={},线路版本={},班次数={},进场={},出场={},营运={},错误={},是否冲突={},冲突描述={}",
  283 + $statInfo.getTtname(), $statInfo.getTtid(), $lineVersion, $allbc, $inbc, $outbc, $yybc, $errorbc, $conflict, $conflictDesc);
  284 +
  285 + $statInfo.setAllbc($allbc);
  286 + $statInfo.setInbc($inbc);
  287 + $statInfo.setOutbc($outbc);
  288 + $statInfo.setYybc($yybc);
  289 + $statInfo.setErrorbc($errorbc);
  290 +
  291 + rs.getInfos().add($statInfo);
  292 +end
  293 +
  294 +
  295 +/*
  296 +rule "test"
  297 + when
  298 + $test: TTInfoList_wrap(
  299 + $calcu_date: calcu_date,
  300 + $ttInfoNormalList: ttInfoNormalList,
  301 + $ttInfoSpecialList: ttInfoSpecialList
  302 + )
  303 + then
  304 + LOGGER.debug("日期={}, nsize={}, ssize={}", $calcu_date, $ttInfoNormalList.size(), $ttInfoSpecialList.size());
  305 +
  306 +end
  307 +*/
src/main/resources/drools/KBase/validate/timetable/KBase_validate_timetable_old.drl 0 → 100644
  1 +package com.bsth.service.schedule.plan.process._1_validate._1_timetable.drools;
  2 +
  3 +import org.joda.time.*;
  4 +import org.joda.time.format.DateTimeFormat;
  5 +import java.util.*;
  6 +import org.apache.commons.lang3.StringUtils;
  7 +
  8 +import com.bsth.service.schedule.plan.process._1_validate._1_timetable.drools.KBaseValidateTimeTable_Fact_CalcuParam;
  9 +import com.bsth.service.schedule.plan.process._1_validate._1_timetable.drools.KBaseValidateTimeTable_Result;
  10 +import com.bsth.service.schedule.plan.process._1_validate._1_timetable.drools.KBaseValidateTimeTable_Result.StatInfo;
  11 +
  12 +import com.bsth.service.schedule.plan.process._1_validate._1_timetable.drools.KBaseValidateTimeTable_Fact_Line;
  13 +import com.bsth.service.schedule.plan.process._1_validate._1_timetable.drools.KBaseValidateTimeTable_Fact_TTInfo;
  14 +import com.bsth.service.schedule.plan.process._1_validate._1_timetable.drools.KBaseValidateTimeTable_Fact_TTInfoDetail;
  15 +
  16 +import org.slf4j.Logger;
  17 +
  18 +// 全局日志类(使用PlanPreValidateServiceImpl里定义的LOGGER)
  19 +global Logger LOGGER;
  20 +
  21 +// 输出
  22 +global KBaseValidateTimeTable_Result rs;
  23 +
  24 +/*
  25 + 规则说明:
  26 + 1、找出指定线路,指定时间范围的时刻表
  27 + 2、统计这些时刻表班次数据的情况
  28 +*/
  29 +
  30 +//-------------- 第一阶段、计算规则迭代数据(天数) ------------//
  31 +declare Calcu_iter_days_result
  32 + xlId: Integer // 线路Id
  33 + xlName: String // 线路名字
  34 +
  35 + // 迭代数据
  36 + calcu_day: Integer // 准备计算第几天
  37 + calcu_weekday: Integer // 准备计算星期几(1到7)
  38 + calcu_date: DateTime // 准备计算的具体日期
  39 +
  40 + // 范围数据
  41 + calcu_days: Integer // 总共需要计算的天数
  42 + calcu_start_date: DateTime // 开始计算日期
  43 + calcu_end_date: DateTime // 结束计算日期
  44 +
  45 + // 时刻表映射数据
  46 + ttinfomap: Map // 指定时间段内,用的时刻表id映射 Map<Long, Long>
  47 +end
  48 +
  49 +rule "calcu_iter_days"
  50 + salience 1900
  51 + when
  52 + KBaseValidateTimeTable_Fact_CalcuParam(
  53 + $xlId: xlId,
  54 + $fromDate: fromDate,
  55 + $toDate: toDate,
  56 + $fromDate.isBefore($toDate) || $fromDate.isEqual($toDate)
  57 + )
  58 + $line: KBaseValidateTimeTable_Fact_Line(id == $xlId)
  59 + then
  60 + // 构造Calcu_iter_days_result对象,进行下一步计算
  61 + Calcu_iter_days_result cidr = new Calcu_iter_days_result();
  62 + Period p = new Period($fromDate, $toDate, PeriodType.days());
  63 +
  64 + cidr.setXlId($xlId);
  65 + cidr.setXlName($line.getName());
  66 +
  67 + cidr.setCalcu_day(new Integer(1));
  68 + cidr.setCalcu_weekday(Integer.valueOf($fromDate.getDayOfWeek()));
  69 + cidr.setCalcu_date($fromDate);
  70 +
  71 + cidr.setCalcu_days(Integer.valueOf(p.getDays() + 1));
  72 + cidr.setCalcu_start_date($fromDate);
  73 + cidr.setCalcu_end_date($toDate);
  74 +
  75 + cidr.setTtinfomap(new HashMap());
  76 +
  77 + LOGGER.info(
  78 + "线路={}-id={},开始时间={},结束时间={},总共计算的天数={},将从开始时间迭代",
  79 + cidr.getXlName(),
  80 + cidr.getXlId(),
  81 + cidr.getCalcu_start_date(),
  82 + cidr.getCalcu_end_date(),
  83 + cidr.getCalcu_days()
  84 + );
  85 +
  86 + insert(cidr);
  87 +end
  88 +
  89 +//-------------- 第二阶段、时刻表的日期匹配 ------------//
  90 +declare TTInfoDetails_wrap
  91 + ttInfoId: Long // 时刻表id
  92 + lineVersion: Integer // 线路版本
  93 + bcInfoList: List // 班次信息列表 List<KBaseValidateTimeTable_Fact_TTInfoDetail>
  94 +end
  95 +
  96 +rule "Calcu_iter_days_special_day" // 特殊日期匹配(并且不在StatInfo中)
  97 + salience 800
  98 + when
  99 + $cid : Calcu_iter_days_result(
  100 + $calcu_date: calcu_date,
  101 + $calcu_day: calcu_day,
  102 + calcu_day <= calcu_days
  103 + )
  104 + KBaseValidateTimeTable_Fact_TTInfo(
  105 + $tid: id,
  106 + $tname: name,
  107 + $lineVersion: lineVersion,
  108 + specialDayList contains $calcu_date
  109 + )
  110 + not StatInfo(ttid == $tid)
  111 + $bcInfoList : ArrayList() from collect (KBaseValidateTimeTable_Fact_TTInfoDetail(ttinfo.id == $tid))
  112 + then
  113 + // 更新迭代对象
  114 + Integer new_calcu_day = Integer.valueOf($calcu_day + 1);
  115 + $cid.setCalcu_day(new_calcu_day);
  116 + DateTime new_calcu_date = $calcu_date.plusDays(1);
  117 + $cid.setCalcu_date(new_calcu_date);
  118 + $cid.setCalcu_weekday(Integer.valueOf(new_calcu_date.getDayOfWeek()));
  119 +
  120 + LOGGER.debug("启用特殊日期时刻表(设置StatInfo):" +
  121 + "时刻表id={} 特殊日期={}",
  122 + $tid, $calcu_date);
  123 +
  124 + StatInfo statInfo = new StatInfo();
  125 + statInfo.setTtid($tid);
  126 + statInfo.setTtname($tname);
  127 + insert(statInfo);
  128 +
  129 + TTInfoDetails_wrap ttInfoDetails_wrap = new TTInfoDetails_wrap();
  130 + ttInfoDetails_wrap.setTtInfoId($tid);
  131 + ttInfoDetails_wrap.setBcInfoList($bcInfoList);
  132 + ttInfoDetails_wrap.setLineVersion($lineVersion);
  133 + insert(ttInfoDetails_wrap);
  134 +
  135 + update($cid);
  136 +
  137 +end
  138 +
  139 +rule "Calcu_iter_days_special_day_exist" // 特殊日期匹配(已经在StatInfo中)
  140 + salience 800
  141 + when
  142 + $cid : Calcu_iter_days_result(
  143 + $calcu_date: calcu_date,
  144 + $calcu_day: calcu_day,
  145 + calcu_day <= calcu_days
  146 + )
  147 + KBaseValidateTimeTable_Fact_TTInfo(
  148 + $tid: id,
  149 + $tname: name,
  150 + $lineVersion: lineVersion,
  151 + specialDayList contains $calcu_date
  152 + )
  153 + StatInfo(ttid == $tid)
  154 + then
  155 + // 更新迭代对象
  156 + Integer new_calcu_day = Integer.valueOf($calcu_day + 1);
  157 + $cid.setCalcu_day(new_calcu_day);
  158 + DateTime new_calcu_date = $calcu_date.plusDays(1);
  159 + $cid.setCalcu_date(new_calcu_date);
  160 + $cid.setCalcu_weekday(Integer.valueOf(new_calcu_date.getDayOfWeek()));
  161 +
  162 + LOGGER.debug("启用特殊日期时刻表(已经设置过StatInfo):" +
  163 + "时刻表id={} 特殊日期={}",
  164 + $tid, $calcu_date);
  165 +
  166 + update($cid);
  167 +
  168 +end
  169 +
  170 +rule "Calcu_iter_days_normal_day" // 平日匹配(并且不在StatInfo中)
  171 + salience 700
  172 + when
  173 + $cid : Calcu_iter_days_result(
  174 + $calcu_date: calcu_date,
  175 + $calcu_weekday: calcu_weekday,
  176 + $calcu_day: calcu_day,
  177 + calcu_day <= calcu_days
  178 + )
  179 + KBaseValidateTimeTable_Fact_TTInfo(
  180 + $tid: id,
  181 + $tname: name,
  182 + $lineVersion: lineVersion,
  183 + specialDayList not contains $calcu_date,
  184 + weekdayList[$calcu_weekday - 1] == Boolean.TRUE
  185 + )
  186 + not StatInfo(ttid == $tid)
  187 + $bcInfoList : ArrayList() from collect (KBaseValidateTimeTable_Fact_TTInfoDetail(ttinfo.id == $tid))
  188 + then
  189 + // 更新迭代对象
  190 + Integer new_calcu_day = Integer.valueOf($calcu_day + 1);
  191 + $cid.setCalcu_day(new_calcu_day);
  192 + DateTime new_calcu_date = $calcu_date.plusDays(1);
  193 + $cid.setCalcu_date(new_calcu_date);
  194 + $cid.setCalcu_weekday(Integer.valueOf(new_calcu_date.getDayOfWeek()));
  195 +
  196 +
  197 + LOGGER.debug("启用常规日期时刻表(设置StatInfo):" +
  198 + "时刻表id={} 常规日期={} 星期几={}",
  199 + $tid, $calcu_date, $calcu_weekday);
  200 +
  201 + StatInfo statInfo = new StatInfo();
  202 + statInfo.setTtid($tid);
  203 + statInfo.setTtname($tname);
  204 + insert(statInfo);
  205 +
  206 + TTInfoDetails_wrap ttInfoDetails_wrap = new TTInfoDetails_wrap();
  207 + ttInfoDetails_wrap.setTtInfoId($tid);
  208 + ttInfoDetails_wrap.setBcInfoList($bcInfoList);
  209 + ttInfoDetails_wrap.setLineVersion($lineVersion);
  210 + insert(ttInfoDetails_wrap);
  211 +
  212 + update($cid);
  213 +
  214 +end
  215 +
  216 +rule "Calcu_iter_days_normal_day_exist" // 平日匹配(已经在StatInfo中)
  217 + salience 700
  218 + when
  219 + $cid : Calcu_iter_days_result(
  220 + $calcu_date: calcu_date,
  221 + $calcu_weekday: calcu_weekday,
  222 + $calcu_day: calcu_day,
  223 + calcu_day <= calcu_days
  224 + )
  225 + KBaseValidateTimeTable_Fact_TTInfo(
  226 + $tid: id,
  227 + $tname: name,
  228 + $lineVersion: lineVersion,
  229 + specialDayList not contains $calcu_date,
  230 + weekdayList[$calcu_weekday - 1] == Boolean.TRUE
  231 + )
  232 + StatInfo(ttid == $tid)
  233 + then
  234 + // 更新迭代对象
  235 + Integer new_calcu_day = Integer.valueOf($calcu_day + 1);
  236 + $cid.setCalcu_day(new_calcu_day);
  237 + DateTime new_calcu_date = $calcu_date.plusDays(1);
  238 + $cid.setCalcu_date(new_calcu_date);
  239 + $cid.setCalcu_weekday(Integer.valueOf(new_calcu_date.getDayOfWeek()));
  240 +
  241 + LOGGER.debug("启用常规日期时刻表(已经设置过StatInfo):" +
  242 + "时刻表id={} 常规日期={} 星期几={}",
  243 + $tid, $calcu_date, $calcu_weekday);
  244 +
  245 + update($cid);
  246 +
  247 +end
  248 +
  249 +rule "Calcu_iter_days_other_day" // 都没有的情况下,匹配
  250 + salience 500
  251 + when
  252 + $cid : Calcu_iter_days_result(
  253 + $calcu_date: calcu_date,
  254 + $calcu_weekday: calcu_weekday,
  255 + $calcu_day: calcu_day,
  256 + calcu_day <= calcu_days
  257 + )
  258 + not KBaseValidateTimeTable_Fact_TTInfo(
  259 + (specialDayList contains $calcu_date) ||
  260 + (weekdayList[$calcu_weekday - 1] == Boolean.TRUE)
  261 + )
  262 + then
  263 + // 更新迭代对象
  264 + Integer new_calcu_day = Integer.valueOf($calcu_day + 1);
  265 + $cid.setCalcu_day(new_calcu_day);
  266 + DateTime new_calcu_date = $calcu_date.plusDays(1);
  267 + $cid.setCalcu_date(new_calcu_date);
  268 + $cid.setCalcu_weekday(Integer.valueOf(new_calcu_date.getDayOfWeek()));
  269 +
  270 + LOGGER.debug("当前日期没有匹配的时刻表:日期={} 星期几={}", $calcu_date, $calcu_weekday);
  271 +
  272 + update($cid);
  273 +
  274 +end
  275 +
  276 +//-------------- 第三阶段、时刻表明细统计值 ------------//
  277 +
  278 +rule "statinfo_result" // 统计计算结果
  279 + salience 300
  280 + no-loop
  281 + when
  282 + $statInfo: StatInfo($tid: ttid)
  283 + $ttInfoDetails_wrap: TTInfoDetails_wrap(ttInfoId == $tid)
  284 + $allbc: Long() from accumulate (KBaseValidateTimeTable_Fact_TTInfoDetail() from $ttInfoDetails_wrap.getBcInfoList(), count())
  285 + $inbc: Long() from accumulate (KBaseValidateTimeTable_Fact_TTInfoDetail(bcType == "in") from $ttInfoDetails_wrap.getBcInfoList(), count())
  286 + $outbc: Long() from accumulate (KBaseValidateTimeTable_Fact_TTInfoDetail(bcType == "out") from $ttInfoDetails_wrap.getBcInfoList(), count())
  287 + $yybc: Long() from accumulate (KBaseValidateTimeTable_Fact_TTInfoDetail(bcType != "out", bcType != "in") from $ttInfoDetails_wrap.getBcInfoList(), count())
  288 + $errorbc: Long() from accumulate ($ttd: KBaseValidateTimeTable_Fact_TTInfoDetail() from $ttInfoDetails_wrap.getBcInfoList(), ecount($ttd))
  289 + then
  290 + LOGGER.info("时刻表={},id={},班次数={},进场={},出场={},营运={},错误={}", $statInfo.getTtname(), $statInfo.getTtid(), $allbc, $inbc, $outbc, $yybc, $errorbc);
  291 +
  292 + $statInfo.setAllbc($allbc);
  293 + $statInfo.setInbc($inbc);
  294 + $statInfo.setOutbc($outbc);
  295 + $statInfo.setYybc($yybc);
  296 + $statInfo.setErrorbc($errorbc);
  297 +
  298 + int lineVersion = $ttInfoDetails_wrap.getLineVersion();
  299 + $statInfo.setLineVersion(lineVersion);
  300 +
  301 + rs.getInfos().add($statInfo);
  302 +
  303 +end
  304 +
  305 +
  306 +
  307 +
src/main/resources/drools/config.properties 0 → 100644
  1 +# drools各个kBase的drl路径配置
  2 +#kbase.root.path=/Users/xu/resource/project_code/bsth_project/bsth_control_parent/bsth-control_v2-plan_module-service-schedule_generate/src/main/resources/drools/
  3 +#kbase.root.classpath=drools/
  4 +
  5 +# 排班前置验证规则
  6 +#kbase.validate.timetable.drl=kBase/validate/timetable/kBase_validate_timetable.drl
  7 +#kbase.validate.rule.drl=kBase/validate/rule/kBase_validate_rule.drl
  8 +
  9 +# 排班生成 - 1、计算时刻表相关信息
  10 +#kbase.generate.calcu.timetable.drl=kBase/generate/calcu/timetable/kBase_generate_calcu_timetable.drl
  11 +# 排班生成 - 2、计算排班规则翻班信息
  12 +#kbase.generate.calcu.shiftloop.drl=kBase/generate/calcu/shiftloop/kBase_generate_calcu_shiftloop.drl
  13 +# 排班生成 - 3、组合排班数据
  14 +#kbase.generate.plan.drl=kBase/generate/plan/kBase_generate_plan.drl
  15 +# 排班生成 - 4、套跑规则修正排班数据
  16 +#kbase.generate.rerun.drl=kBase/generate/rerun/kBase_generate_rerun.drl
  17 +# 排班生成 - 5、验证排班数据
  18 +#kbase.validate.plan.drl=kBase/validate/plan/kBase_validate_plan.drl
  19 +
  20 +# 排班前置验证规则
  21 +# 时刻表验证
  22 +drools.KBase.validate_timetable=drools/KBase/validate/timetable/KBase_validate_timetable.drl
  23 +
  24 +
src/test/java/com/bsth/BaseTest_junit4.java 0 → 100644
  1 +package com.bsth;
  2 +
  3 +import ch.qos.logback.classic.LoggerContext;
  4 +import ch.qos.logback.classic.joran.JoranConfigurator;
  5 +import ch.qos.logback.core.util.StatusPrinter;
  6 +import org.apache.commons.lang3.StringUtils;
  7 +import org.dbunit.database.DatabaseConfig;
  8 +import org.dbunit.database.DatabaseConnection;
  9 +import org.dbunit.database.DatabaseSequenceFilter;
  10 +import org.dbunit.database.IDatabaseConnection;
  11 +import org.dbunit.dataset.FilteredDataSet;
  12 +import org.dbunit.dataset.IDataSet;
  13 +import org.dbunit.dataset.xml.FlatXmlDataSetBuilder;
  14 +import org.dbunit.ext.h2.H2DataTypeFactory;
  15 +import org.dbunit.operation.DatabaseOperation;
  16 +import org.junit.After;
  17 +import org.junit.Before;
  18 +import org.junit.BeforeClass;
  19 +import org.junit.Rule;
  20 +import org.junit.rules.TestName;
  21 +import org.slf4j.Logger;
  22 +import org.slf4j.LoggerFactory;
  23 +import org.springframework.beans.factory.annotation.Autowired;
  24 +import org.springframework.core.io.ClassPathResource;
  25 +import org.springframework.core.io.Resource;
  26 +
  27 +import javax.sql.DataSource;
  28 +import java.io.File;
  29 +import java.util.Map;
  30 +
  31 +/**
  32 + * junit4基础测试类。
  33 + */
  34 +public abstract class BaseTest_junit4 {
  35 + /** 日志记录器 */
  36 + public static final Logger LOG = LoggerFactory.getLogger(BaseTest_junit4.class);
  37 +
  38 + @Rule
  39 + public TestName name = new TestName();
  40 +
  41 + @BeforeClass
  42 + public static void initLogConfig() throws Exception {
  43 + File logFile = new File(BaseTest_junit4.class.getResource("/logback.xml").toURI());
  44 + LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory();
  45 + JoranConfigurator configurator = new JoranConfigurator();
  46 + configurator.setContext(lc);
  47 + lc.reset();
  48 + configurator.doConfigure(logFile);
  49 + StatusPrinter.printInCaseOfErrorsOrWarnings(lc);
  50 + }
  51 +
  52 + /**
  53 + * 获取DBUnit数据源。
  54 + * @return
  55 + */
  56 + private IDataSet getDataSet() throws Exception {
  57 + Map<String, String> dbFileMap = getDbunitTestDbFileClassPathMap();
  58 + String methodName = name.getMethodName();
  59 + String dbunitClassPath = dbFileMap.get(methodName);
  60 + if (StringUtils.isEmpty(dbunitClassPath)) {
  61 + LOG.info("dbunit测试xml为空,key={}", methodName);
  62 + }
  63 + Resource res = new ClassPathResource(dbunitClassPath);
  64 + FlatXmlDataSetBuilder builder = new FlatXmlDataSetBuilder();
  65 + builder.setColumnSensing(true);
  66 + return builder.build(res.getInputStream());
  67 + }
  68 +
  69 + /**
  70 + * 获取数据库连接。
  71 + * @return
  72 + */
  73 + private IDatabaseConnection getConnection() throws Exception {
  74 + DatabaseConnection conn = new DatabaseConnection(getDataSource().getConnection());
  75 + DatabaseConfig config = conn.getConfig();
  76 + config.setProperty(DatabaseConfig.PROPERTY_DATATYPE_FACTORY, new H2DataTypeFactory());
  77 + return conn;
  78 + }
  79 +
  80 + /**
  81 + * 初始化数据。
  82 + * @throws Exception
  83 + */
  84 + @Before
  85 + public void initDbunitDataSet() throws Exception {
  86 + LOG.info("junit setup:dbunit-载入测试数据!===>");
  87 + IDatabaseConnection connection = getConnection();
  88 + DatabaseOperation.CLEAN_INSERT.execute(connection, getDataSet());
  89 + connection.close();
  90 + }
  91 +
  92 + /**
  93 + * 销毁测试数据。
  94 + * @throws Exception
  95 + */
  96 + @After
  97 + public void afterDbunitDataSet() throws Exception {
  98 + LOG.info("===>junit teardown:dbunit-销毁测试数据!");
  99 + IDatabaseConnection connection = getConnection();
  100 + // 使用FilteredDataSet重新定义数据库,否则删除的时候会发生外健依赖错误
  101 + // 因为默认删除是按照表名字母顺序删除的,如果外健关联的表先删除,则发生外健约束错误
  102 + IDataSet fullDataSet = new FilteredDataSet(new DatabaseSequenceFilter(connection), connection.createDataSet());
  103 + DatabaseOperation.DELETE_ALL.execute(connection, fullDataSet);
  104 + connection.close();
  105 + }
  106 +
  107 + @Autowired
  108 + private DataSource dataSource;
  109 + /**
  110 + * 获取数据源。
  111 + * @return
  112 + */
  113 + public DataSource getDataSource() {
  114 + return dataSource;
  115 + }
  116 +
  117 + /**
  118 + * 获取Dbunit测试数据文件xml映射,key=测试方法名,value=dbunit测试文件classpath
  119 + * key:子类testCase方法名
  120 + * value:dbunit数据文件classpath(如:db/testdata/dbunit_testdata1.xml)
  121 + * @return
  122 + */
  123 + public abstract Map<String, String> getDbunitTestDbFileClassPathMap();
  124 +}
src/test/java/com/bsth/TestApplication.java 0 → 100644
  1 +package com.bsth;
  2 +
  3 +import org.springframework.boot.CommandLineRunner;
  4 +import org.springframework.boot.SpringApplication;
  5 +import org.springframework.boot.autoconfigure.SpringBootApplication;
  6 +import org.springframework.context.annotation.ComponentScan;
  7 +import org.springframework.context.annotation.FilterType;
  8 +import org.springframework.transaction.annotation.EnableTransactionManagement;
  9 +
  10 +/**
  11 + * 测试用的SpringBoot启动类。
  12 + */
  13 +@EnableTransactionManagement
  14 +@SpringBootApplication
  15 +@ComponentScan(excludeFilters = {
  16 + @ComponentScan.Filter(
  17 + type = FilterType.ASSIGNABLE_TYPE,
  18 + value = { Application.class, StartCommand.class, WebAppConfiguration.class, XDApplication.class }
  19 + ),
  20 + @ComponentScan.Filter(
  21 + type = FilterType.CUSTOM,
  22 + classes = { TestApplicationTypeFillter.class }
  23 + )
  24 +})
  25 +public class TestApplication implements CommandLineRunner {
  26 + @Override
  27 + public void run(String... args) throws Exception {
  28 + // TODO:其他初始化代码
  29 + }
  30 +
  31 + public static void main(String[] args) throws Exception {
  32 + SpringApplication.run(TestApplication.class, args);
  33 + }
  34 +}
src/test/java/com/bsth/TestApplicationTypeFillter.java 0 → 100644
  1 +package com.bsth;
  2 +
  3 +import org.springframework.core.io.Resource;
  4 +import org.springframework.core.type.AnnotationMetadata;
  5 +import org.springframework.core.type.ClassMetadata;
  6 +import org.springframework.core.type.classreading.MetadataReader;
  7 +import org.springframework.core.type.classreading.MetadataReaderFactory;
  8 +import org.springframework.core.type.filter.TypeFilter;
  9 +
  10 +import java.io.IOException;
  11 +
  12 +public class TestApplicationTypeFillter implements TypeFilter {
  13 + private ClassMetadata classMetadata;
  14 +
  15 + /**
  16 + * MetadataReader 读取到当前正在扫描类的信息
  17 + * MetadataReaderFactory 可以获取到其他任何类信息
  18 + */
  19 + @Override
  20 + public boolean match(MetadataReader metadataReader, MetadataReaderFactory metadataReaderFactory) throws IOException {
  21 + //获取当前类注解的信息
  22 + AnnotationMetadata annotationMetadata = metadataReader.getAnnotationMetadata();
  23 + //获取当前正在扫描的类信息
  24 + classMetadata = metadataReader.getClassMetadata();
  25 + //获取当前类资源(类的路径)
  26 + Resource resource = metadataReader.getResource();
  27 +
  28 + String className = classMetadata.getClassName();
  29 + System.out.println("----->" + className);
  30 + //当类包含Buy字符, 则匹配成功,返回true
  31 + //excludeFilters返回true---->会被过滤掉
  32 + //includeFilters返回true---->会通过
  33 +// if (className.contains("Buy")) {
  34 +// return false;
  35 +// }
  36 + if (className.contains("com.bsth.repository")) {
  37 + return false;
  38 + }
  39 + if (className.contains("com.bsth.service.schedule.plan")) {
  40 + return false;
  41 + }
  42 + return true;
  43 +
  44 + }
  45 +}
src/test/java/com/bsth/entity/Business.java 0 → 100644
  1 +package com.bsth.entity;
  2 +
  3 +import javax.persistence.*;
  4 +import java.util.Date;
  5 +
  6 +/**
  7 + *
  8 + * @ClassName : Business(公司实体类)
  9 + *
  10 + * @Author : bsth@lq
  11 + *
  12 + * @Description : TODO(公司信息)
  13 + *
  14 + * @Data : 2016-04-27
  15 + *
  16 + * @Version 公交调度系统BS版 0.1
  17 + *
  18 + */
  19 +
  20 +@Entity
  21 +@Table(name = "bsth_c_business")
  22 +public class Business {
  23 +
  24 + // ID
  25 + @Id
  26 + @GeneratedValue(strategy = GenerationType.IDENTITY)
  27 + private Integer id;
  28 +
  29 + // 企业<公司>名称
  30 + private String businessName;
  31 +
  32 + // 企业<公司>代码
  33 + private String businessCode;
  34 +
  35 + // 所属企业<公司>代码
  36 + private String upCode;
  37 +
  38 + // 描述
  39 + private String descriptions;
  40 +
  41 + // 创建日期
  42 +// @Column(updatable = false, name = "create_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP")
  43 + @Column(updatable = false, name = "create_date")
  44 + private Date createDate;
  45 +
  46 + // 修改日期
  47 +// @Column(name = "update_date", columnDefinition = "timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP")
  48 + @Column(name = "update_date")
  49 + private Date updateDate;
  50 + public Date getCreateDate() {
  51 + return createDate;
  52 + }
  53 +
  54 + public void setCreateDate(Date createDate) {
  55 + this.createDate = createDate;
  56 + }
  57 +
  58 + public Date getUpdateDate() {
  59 + return updateDate;
  60 + }
  61 +
  62 + public void setUpdateDate(Date updateDate) {
  63 + this.updateDate = updateDate;
  64 + }
  65 +
  66 + public Integer getId() {
  67 + return id;
  68 + }
  69 +
  70 + public void setId(Integer id) {
  71 + this.id = id;
  72 + }
  73 +
  74 + public String getBusinessName() {
  75 + return businessName;
  76 + }
  77 +
  78 + public void setBusinessName(String businessName) {
  79 + this.businessName = businessName;
  80 + }
  81 +
  82 + public String getBusinessCode() {
  83 + return businessCode;
  84 + }
  85 +
  86 + public void setBusinessCode(String businessCode) {
  87 + this.businessCode = businessCode;
  88 + }
  89 +
  90 + public String getUpCode() {
  91 + return upCode;
  92 + }
  93 +
  94 + public void setUpCode(String upCode) {
  95 + this.upCode = upCode;
  96 + }
  97 +
  98 + public String getDescriptions() {
  99 + return descriptions;
  100 + }
  101 +
  102 + public void setDescriptions(String descriptions) {
  103 + this.descriptions = descriptions;
  104 + }
  105 +}
src/test/java/com/bsth/entity/CarPark.java 0 → 100644
  1 +package com.bsth.entity;
  2 +
  3 +import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
  4 +import org.hibernate.annotations.Formula;
  5 +
  6 +import javax.persistence.*;
  7 +import java.util.Date;
  8 +
  9 +
  10 +/**
  11 + *
  12 + * @ClassName: CarPark(停车场类)
  13 + *
  14 + * @Description: TODO(停车场)
  15 + *
  16 + * @Author bsth@lq
  17 + *
  18 + * @Date 2016-06-01 16:06:17
  19 + *
  20 + * @Version 公交调度系统BS版 0.1
  21 + *
  22 + */
  23 +
  24 +@Entity
  25 +@Table(name = "bsth_c_car_park")
  26 +@JsonIgnoreProperties(value={"hibernateLazyInitializer","handler","fieldHandler"})
  27 +public class CarPark {
  28 +
  29 + @Id
  30 + @GeneratedValue
  31 + private Integer id;
  32 +
  33 + // 停车场编号
  34 + private String parkCode;
  35 +
  36 + // 停车场名称
  37 + private String parkName;
  38 +
  39 + // 地理位置(百度坐标)
  40 + private String bParkPoint;
  41 +
  42 + // 地理位置中心点(百度坐标)
  43 + private String bCenterPoint;
  44 +
  45 + // 地理位置(WGS坐标)
  46 + private String gParkPoint;
  47 +
  48 + // 地理位置中心点(WGS坐标)
  49 + private String gCenterPoint;
  50 +
  51 + /**
  52 + * 经纬坐标类型
  53 + *
  54 + * --------- b:百度坐标系
  55 + *
  56 + * --------- d:高德坐标系
  57 + */
  58 + private String dbType;
  59 +
  60 + /**
  61 + * 图形类型
  62 + *
  63 + * ------ r:圆形
  64 + *
  65 + * ------ p:多边形
  66 + */
  67 + private String shapesType;
  68 +
  69 + // 圆形半径
  70 + private Integer radius;
  71 +
  72 + // 面积
  73 + private double area;
  74 +
  75 + // 所属公司
  76 + private String company;
  77 +
  78 + // 分公司
  79 + private String brancheCompany;
  80 +
  81 + /** 组合公司分公司编码 */
  82 + @Formula(" concat(company, '_', branche_company) ")
  83 + private String cgsbm;
  84 +
  85 + // 是否撤销
  86 + private Integer destroy;
  87 +
  88 + // 版本号
  89 + private Integer versions;
  90 +
  91 + // 描述
  92 + private String descriptions;
  93 +
  94 + // 创建人
  95 + private Integer createBy;
  96 +
  97 + // 修改人
  98 + private Integer updateBy;
  99 +
  100 + // 创建日期
  101 +// @Column(updatable = false, name = "create_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP")
  102 + @Column(updatable = false, name = "create_date")
  103 + private Date createDate;
  104 +
  105 + // 修改日期
  106 +// @Column(name = "update_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP")
  107 + @Column(name = "update_date")
  108 + private Date updateDate;
  109 +
  110 + public String getCgsbm() {
  111 + return cgsbm;
  112 + }
  113 +
  114 + public void setCgsbm(String cgsbm) {
  115 + this.cgsbm = cgsbm;
  116 + }
  117 +
  118 + public Integer getId() {
  119 + return id;
  120 + }
  121 +
  122 + public void setId(Integer id) {
  123 + this.id = id;
  124 + }
  125 +
  126 + public String getParkCode() {
  127 + return parkCode;
  128 + }
  129 +
  130 + public void setParkCode(String parkCode) {
  131 + this.parkCode = parkCode;
  132 + }
  133 +
  134 + public String getParkName() {
  135 + return parkName;
  136 + }
  137 +
  138 + public void setParkName(String parkName) {
  139 + this.parkName = parkName;
  140 + }
  141 +
  142 + public String getbParkPoint() {
  143 + return bParkPoint;
  144 + }
  145 +
  146 + public void setbParkPoint(String bParkPoint) {
  147 + this.bParkPoint = bParkPoint;
  148 + }
  149 +
  150 + public String getbCenterPoint() {
  151 + return bCenterPoint;
  152 + }
  153 +
  154 + public void setbCenterPoint(String bCenterPoint) {
  155 + this.bCenterPoint = bCenterPoint;
  156 + }
  157 +
  158 + public String getgParkPoint() {
  159 + return gParkPoint;
  160 + }
  161 +
  162 + public void setgParkPoint(String gParkPoint) {
  163 + this.gParkPoint = gParkPoint;
  164 + }
  165 +
  166 + public String getDbType() {
  167 + return dbType;
  168 + }
  169 +
  170 + public void setDbType(String dbType) {
  171 + this.dbType = dbType;
  172 + }
  173 +
  174 + public String getShapesType() {
  175 + return shapesType;
  176 + }
  177 +
  178 + public void setShapesType(String shapesType) {
  179 + this.shapesType = shapesType;
  180 + }
  181 +
  182 + public Integer getRadius() {
  183 + return radius;
  184 + }
  185 +
  186 + public void setRadius(Integer radius) {
  187 + this.radius = radius;
  188 + }
  189 +
  190 + public String getgCenterPoint() {
  191 + return gCenterPoint;
  192 + }
  193 +
  194 + public void setgCenterPoint(String gCenterPoint) {
  195 + this.gCenterPoint = gCenterPoint;
  196 + }
  197 +
  198 + public double getArea() {
  199 + return area;
  200 + }
  201 +
  202 + public void setArea(double area) {
  203 + this.area = area;
  204 + }
  205 +
  206 + public String getBrancheCompany() {
  207 + return brancheCompany;
  208 + }
  209 +
  210 + public void setBrancheCompany(String brancheCompany) {
  211 + this.brancheCompany = brancheCompany;
  212 + }
  213 +
  214 + public String getCompany() {
  215 + return company;
  216 + }
  217 +
  218 + public void setCompany(String company) {
  219 + this.company = company;
  220 + }
  221 +
  222 + public Integer getDestroy() {
  223 + return destroy;
  224 + }
  225 +
  226 + public void setDestroy(Integer destroy) {
  227 + this.destroy = destroy;
  228 + }
  229 +
  230 + public Integer getVersions() {
  231 + return versions;
  232 + }
  233 +
  234 + public void setVersions(Integer versions) {
  235 + this.versions = versions;
  236 + }
  237 +
  238 + public String getDescriptions() {
  239 + return descriptions;
  240 + }
  241 +
  242 + public void setDescriptions(String descriptions) {
  243 + this.descriptions = descriptions;
  244 + }
  245 +
  246 + public Integer getCreateBy() {
  247 + return createBy;
  248 + }
  249 +
  250 + public void setCreateBy(Integer createBy) {
  251 + this.createBy = createBy;
  252 + }
  253 +
  254 + public Integer getUpdateBy() {
  255 + return updateBy;
  256 + }
  257 +
  258 + public void setUpdateBy(Integer updateBy) {
  259 + this.updateBy = updateBy;
  260 + }
  261 +
  262 + public Date getCreateDate() {
  263 + return createDate;
  264 + }
  265 +
  266 + public void setCreateDate(Date createDate) {
  267 + this.createDate = createDate;
  268 + }
  269 +
  270 + public Date getUpdateDate() {
  271 + return updateDate;
  272 + }
  273 +
  274 + public void setUpdateDate(Date updateDate) {
  275 + this.updateDate = updateDate;
  276 + }
  277 +
  278 +}
src/test/java/com/bsth/entity/Line.java 0 → 100644
  1 +package com.bsth.entity;
  2 +
  3 +import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
  4 +import org.hibernate.annotations.Formula;
  5 +import org.springframework.format.annotation.DateTimeFormat;
  6 +
  7 +import javax.persistence.*;
  8 +import java.io.Serializable;
  9 +import java.util.Date;
  10 +
  11 +
  12 +/**
  13 + *
  14 + * @ClassName: Line(线路实体类)
  15 + *
  16 + * @Description: TODO(线路)
  17 + *
  18 + * @Author bsth@lq
  19 + *
  20 + * @Date 2016-4-11 16:06:17
  21 + *
  22 + * @Version 公交调度系统BS版 0.1
  23 + *
  24 + */
  25 +
  26 +@Entity
  27 +@Table(name = "bsth_c_line")
  28 +@JsonIgnoreProperties(value={"hibernateLazyInitializer","handler","fieldHandler"})
  29 +public class Line implements Serializable {
  30 +
  31 + @Id
  32 + /** 线路ID 主键(唯一标识符) int length(11) */
  33 + private Integer id;
  34 +
  35 + /** 线路名称 varchar length(50) 不能为空 */
  36 + private String name;
  37 +
  38 + /** 线路编码 varchar length(50) 不能为空 */
  39 + private String lineCode;
  40 +
  41 + /** 英文名 varchar length(50) */
  42 + private String es;
  43 +
  44 + /** 简称 varchar length(50) */
  45 + private String shortName;
  46 +
  47 + /** 起始站名称 varchar length(50) 不能为空
  48 + * 该字段值会在规划线路站点操作时会去验证是否有值。如果为空,则用线路规划站点的起点站。默认使用该字段填写值 */
  49 + private String startStationName;
  50 +
  51 + /** 终点站名称 varchar length(50) 不能为空
  52 + * 该字段值会在规划线路站点操作时会去验证是否有值。如果为空,则用线路规划站点的起点站。默认使用该字段填写值 */
  53 + private String endStationName;
  54 +
  55 + /** 起始站首班车时间 00:00 上海公交APP中某个接口所需要的字段值 varchar length(50) 不能为空 */
  56 + private String startStationFirstTime;
  57 +
  58 + /** 起始站末班车时间 00:00 上海公交APP中某个接口所需要的字段值 varchar length(50) 不能为空 */
  59 + private String startStationEndTime;
  60 +
  61 + /** 终点站首班时间 00:00 上海公交APP中某个接口所需要的字段值 varchar length(50) 不能为空*/
  62 + private String endStationFirstTime;
  63 +
  64 + /** 终点站末班时间 00:00 上海公交APP中某个接口所需要的字段值 */
  65 + private String endStationEndTime;
  66 +
  67 + /** 所属公司 varchar length(50) */
  68 + private String company;
  69 +
  70 + /** 分公司 varchar length(50)*/
  71 + private String brancheCompany;
  72 +
  73 + /** 组合公司分公司编码 */
  74 + @Formula(" concat(company, '_', branche_company) ")
  75 + private String cgsbm;
  76 +
  77 + /** 性质(线路类型) varchar length(50) */
  78 + private String nature;
  79 +
  80 + /** 线路等级 varchar length(50) */
  81 + private String level;
  82 +
  83 + /** 线路长度 */
  84 + private double length;
  85 +
  86 + /** 线路负责人 varchar length(50) */
  87 + private String chargeName;
  88 +
  89 + /** 负责人电话 varchar length(50) */
  90 + private String telephone;
  91 +
  92 + /** 是否撤销 <1:是;0:否> bit length(50) */
  93 + private Integer destroy;
  94 +
  95 + /** 是否夜宵线 <1:是;0:否> bit length(50)*/
  96 + private Integer supperLine;
  97 +
  98 + /** 是否营运 <1:是;0:否> bit length(50)*/
  99 + private Integer sfyy;
  100 +
  101 + /** 线路区域 <0:区内,1:区外> bit length(1)*/
  102 + private Integer region;
  103 +
  104 + /** 起始调度电话 varchar length(50) */
  105 + private String startPhone;
  106 +
  107 + /** 终点调度电话 varchar length(50) */
  108 + private String endPhone;
  109 +
  110 + /** 开辟日期 date*/
  111 + @DateTimeFormat(pattern ="yyyy-MM-dd")
  112 + private Date openDate;
  113 +
  114 + /** 大间隔等级 */
  115 + private Integer spacGrade;
  116 +
  117 + /** 线路沿革 varchar length(50) */
  118 + private String history;
  119 +
  120 + /** 上海市线路编码 varchar length(50) */
  121 + private String shanghaiLinecode;
  122 +
  123 + /** 设备线路编码 varchar length(50) */
  124 + private String eqLinecode;
  125 +
  126 + /** 配置车辆总数 老版本系统字段, 新版本系统业务需求暂时没用到该字段 ,这里暂时留着 int length(11)*/
  127 + private Integer carSumNumber;
  128 +
  129 + /** 空调车辆数量 老版本系统字段, 新版本系统业务需求暂时没用到该字段 ,这里暂时留着 int length(11) */
  130 + private Integer hvacCarNumber;
  131 +
  132 + /** 普通车辆数量 老版本系统字段, 新版本系统业务需求暂时没用到该字段 ,这里暂时留着 int length(11) */
  133 + private Integer ordCarNumber;
  134 +
  135 + /** 权证车辆数量 报表需要的字段值 */
  136 + private Integer warrantCar;
  137 +
  138 + /** 权证配车启用日期 报表需要的字段值 */
  139 + private Integer warrantDate;
  140 +
  141 + /** 停车场编码 老版本系统字段, 新版本系统业务需求暂时没用到该字段 ,这里暂时留着 int length(11) */
  142 + private String carParkCode;
  143 +
  144 + /** 线路规划类型 <0:双向;1:环线> int length(11) 运管处接口需要的字段 不能为空 */
  145 + private Integer linePlayType;
  146 +
  147 + /** 描述 varchar length(255) */
  148 + private String descriptions;
  149 +
  150 + /** 创建人 int length(11) */
  151 + private Integer createBy;
  152 +
  153 + /** 修改人 int length(11) */
  154 + private Integer updateBy;
  155 +
  156 + /** 创建日期 timestamp */
  157 +// @Column(updatable = false, name = "create_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP")
  158 + @Column(updatable = false, name = "create_date")
  159 + private Date createDate;
  160 +
  161 + /** 修改日期 timestamp */
  162 +// @Column(name = "update_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP")
  163 + @Column(name = "update_date")
  164 + private Date updateDate;
  165 +
  166 + /** 是否在使用 <1:是;0:否> bit length(50) */
  167 + private Integer inUse;
  168 +
  169 + /**
  170 + * 逻辑删除标记 为 1:标识已删除
  171 + */
  172 + private Integer remove = 0;
  173 +
  174 + public Integer getSpacGrade() {
  175 + return spacGrade;
  176 + }
  177 +
  178 + public void setSpacGrade(Integer spacGrade) {
  179 + this.spacGrade = spacGrade;
  180 + }
  181 +
  182 + public Integer getWarrantCar() {
  183 + return warrantCar;
  184 + }
  185 +
  186 + public void setWarrantCar(Integer warrantCar) {
  187 + this.warrantCar = warrantCar;
  188 + }
  189 +
  190 + public Integer getWarrantDate() {
  191 + return warrantDate;
  192 + }
  193 +
  194 + public void setWarrantDate(Integer warrantDate) {
  195 + this.warrantDate = warrantDate;
  196 + }
  197 +
  198 + public Integer getLinePlayType() {
  199 + return linePlayType;
  200 + }
  201 +
  202 + public void setLinePlayType(Integer linePlayType) {
  203 + this.linePlayType = linePlayType;
  204 + }
  205 +
  206 + public Integer getId() {
  207 + return id;
  208 + }
  209 +
  210 + public void setId(Integer id) {
  211 + this.id = id;
  212 + }
  213 +
  214 + public String getLineCode() {
  215 + return lineCode;
  216 + }
  217 +
  218 + public void setLineCode(String lineCode) {
  219 + this.lineCode = lineCode;
  220 + }
  221 +
  222 + public String getName() {
  223 + return name;
  224 + }
  225 +
  226 + public void setName(String name) {
  227 + this.name = name;
  228 + }
  229 +
  230 + public String getEs() {
  231 + return es;
  232 + }
  233 +
  234 + public void setEs(String es) {
  235 + this.es = es;
  236 + }
  237 +
  238 + public String getShortName() {
  239 + return shortName;
  240 + }
  241 +
  242 + public void setShortName(String shortName) {
  243 + this.shortName = shortName;
  244 + }
  245 +
  246 + public Integer getCarSumNumber() {
  247 + return carSumNumber;
  248 + }
  249 +
  250 + public void setCarSumNumber(Integer carSumNumber) {
  251 + this.carSumNumber = carSumNumber;
  252 + }
  253 +
  254 + public Integer getHvacCarNumber() {
  255 + return hvacCarNumber;
  256 + }
  257 +
  258 + public void setHvacCarNumber(Integer hvacCarNumber) {
  259 + this.hvacCarNumber = hvacCarNumber;
  260 + }
  261 +
  262 + public Integer getOrdCarNumber() {
  263 + return ordCarNumber;
  264 + }
  265 +
  266 + public void setOrdCarNumber(Integer ordCarNumber) {
  267 + this.ordCarNumber = ordCarNumber;
  268 + }
  269 +
  270 + public String getCarParkCode() {
  271 + return carParkCode;
  272 + }
  273 +
  274 + public void setCarParkCode(String carParkCode) {
  275 + this.carParkCode = carParkCode;
  276 + }
  277 +
  278 + public String getStartStationName() {
  279 + return startStationName;
  280 + }
  281 +
  282 + public void setStartStationName(String startStationName) {
  283 + this.startStationName = startStationName;
  284 + }
  285 +
  286 + public String getStartStationFirstTime() {
  287 + return startStationFirstTime;
  288 + }
  289 +
  290 + public void setStartStationFirstTime(String startStationFirstTime) {
  291 + this.startStationFirstTime = startStationFirstTime;
  292 + }
  293 +
  294 + public String getStartStationEndTime() {
  295 + return startStationEndTime;
  296 + }
  297 +
  298 + public void setStartStationEndTime(String startStationEndTime) {
  299 + this.startStationEndTime = startStationEndTime;
  300 + }
  301 +
  302 + public String getEndStationName() {
  303 + return endStationName;
  304 + }
  305 +
  306 + public void setEndStationName(String endStationName) {
  307 + this.endStationName = endStationName;
  308 + }
  309 +
  310 + public String getEndStationFirstTime() {
  311 + return endStationFirstTime;
  312 + }
  313 +
  314 + public void setEndStationFirstTime(String endStationFirstTime) {
  315 + this.endStationFirstTime = endStationFirstTime;
  316 + }
  317 +
  318 + public String getEndStationEndTime() {
  319 + return endStationEndTime;
  320 + }
  321 +
  322 + public void setEndStationEndTime(String endStationEndTime) {
  323 + this.endStationEndTime = endStationEndTime;
  324 + }
  325 +
  326 + public String getCompany() {
  327 + return company;
  328 + }
  329 +
  330 + public void setCompany(String company) {
  331 + this.company = company;
  332 + }
  333 +
  334 + public String getBrancheCompany() {
  335 + return brancheCompany;
  336 + }
  337 +
  338 + public void setBrancheCompany(String brancheCompany) {
  339 + this.brancheCompany = brancheCompany;
  340 + }
  341 +
  342 + public String getNature() {
  343 + return nature;
  344 + }
  345 +
  346 + public void setNature(String nature) {
  347 + this.nature = nature;
  348 + }
  349 +
  350 + public String getLevel() {
  351 + return level;
  352 + }
  353 +
  354 + public void setLevel(String level) {
  355 + this.level = level;
  356 + }
  357 +
  358 + public double getLength() {
  359 + return length;
  360 + }
  361 +
  362 + public void setLength(double length) {
  363 + this.length = length;
  364 + }
  365 +
  366 + public String getChargeName() {
  367 + return chargeName;
  368 + }
  369 +
  370 + public void setChargeName(String chargeName) {
  371 + this.chargeName = chargeName;
  372 + }
  373 +
  374 + public String getTelephone() {
  375 + return telephone;
  376 + }
  377 +
  378 + public void setTelephone(String telephone) {
  379 + this.telephone = telephone;
  380 + }
  381 +
  382 + public Integer getDestroy() {
  383 + return destroy;
  384 + }
  385 +
  386 + public void setDestroy(Integer destroy) {
  387 + this.destroy = destroy;
  388 + }
  389 +
  390 + public Integer getSupperLine() {
  391 + return supperLine;
  392 + }
  393 +
  394 + public void setSupperLine(Integer supperLine) {
  395 + this.supperLine = supperLine;
  396 + }
  397 +
  398 + public String getStartPhone() {
  399 + return startPhone;
  400 + }
  401 +
  402 + public void setStartPhone(String startPhone) {
  403 + this.startPhone = startPhone;
  404 + }
  405 +
  406 + public String getEndPhone() {
  407 + return endPhone;
  408 + }
  409 +
  410 + public void setEndPhone(String endPhone) {
  411 + this.endPhone = endPhone;
  412 + }
  413 +
  414 + public Date getOpenDate() {
  415 + return openDate;
  416 + }
  417 +
  418 + public void setOpenDate(Date openDate) {
  419 + this.openDate = openDate;
  420 + }
  421 +
  422 + public String getHistory() {
  423 + return history;
  424 + }
  425 +
  426 + public void setHistory(String history) {
  427 + this.history = history;
  428 + }
  429 +
  430 + public String getShanghaiLinecode() {
  431 + return shanghaiLinecode;
  432 + }
  433 +
  434 + public void setShanghaiLinecode(String shanghaiLinecode) {
  435 + this.shanghaiLinecode = shanghaiLinecode;
  436 + }
  437 +
  438 + public String getEqLinecode() {
  439 + return eqLinecode;
  440 + }
  441 +
  442 + public void setEqLinecode(String eqLinecode) {
  443 + this.eqLinecode = eqLinecode;
  444 + }
  445 +
  446 + public String getDescriptions() {
  447 + return descriptions;
  448 + }
  449 +
  450 + public void setDescriptions(String descriptions) {
  451 + this.descriptions = descriptions;
  452 + }
  453 +
  454 + public Integer getCreateBy() {
  455 + return createBy;
  456 + }
  457 +
  458 + public void setCreateBy(Integer createBy) {
  459 + this.createBy = createBy;
  460 + }
  461 +
  462 + public Integer getUpdateBy() {
  463 + return updateBy;
  464 + }
  465 +
  466 + public void setUpdateBy(Integer updateBy) {
  467 + this.updateBy = updateBy;
  468 + }
  469 +
  470 + public Date getCreateDate() {
  471 + return createDate;
  472 + }
  473 +
  474 + public void setCreateDate(Date createDate) {
  475 + this.createDate = createDate;
  476 + }
  477 +
  478 + public Date getUpdateDate() {
  479 + return updateDate;
  480 + }
  481 +
  482 + public void setUpdateDate(Date updateDate) {
  483 + this.updateDate = updateDate;
  484 + }
  485 +
  486 + public Integer getInUse() { return inUse; }
  487 +
  488 + public void setInUse(Integer inUse) { this.inUse = inUse; }
  489 +
  490 + public String getCgsbm() {
  491 + return cgsbm;
  492 + }
  493 +
  494 + public void setCgsbm(String cgsbm) {
  495 + this.cgsbm = cgsbm;
  496 + }
  497 +
  498 + public Integer getSfyy() {
  499 + return sfyy;
  500 + }
  501 +
  502 + public void setSfyy(Integer sfyy) {
  503 + this.sfyy = sfyy;
  504 + }
  505 +
  506 + public Integer getRegion() {
  507 + return region;
  508 + }
  509 +
  510 + public void setRegion(Integer region) {
  511 + this.region = region;
  512 + }
  513 +
  514 + public Integer getRemove() {
  515 + return remove;
  516 + }
  517 +
  518 + public void setRemove(Integer remove) {
  519 + this.remove = remove;
  520 + }
  521 +}
src/test/java/com/bsth/entity/LineInformation.java 0 → 100644
  1 +package com.bsth.entity;
  2 +
  3 +import javax.persistence.*;
  4 +import java.util.Date;
  5 +
  6 +/**
  7 + *
  8 + * @ClassName: LineInformation(线路标准信息实体类)
  9 + *
  10 + * @Description: TODO(线路标准信息)
  11 + *
  12 + * @Author bsth@lq
  13 + *
  14 + * @Date 2016-4-12 9:34:39
  15 + *
  16 + * @Version 公交调度系统BS版 0.1
  17 + *
  18 + */
  19 +@Entity
  20 +@Table(name = "bsth_c_line_information")
  21 +public class LineInformation {
  22 +
  23 + @Id
  24 + @GeneratedValue(strategy = GenerationType.IDENTITY)
  25 + private Integer id;
  26 +
  27 + // 线路标准信息类型
  28 + private String type;
  29 +
  30 + // 标准总里程
  31 + private Double totalMileage;
  32 +
  33 + // 空放里程
  34 + private Double emptyMileage;
  35 +
  36 + // 上行里程
  37 + private Double upMileage;
  38 +
  39 + // 下行里程
  40 + private Double downMileage;
  41 +
  42 + // 上行行驶时间
  43 + private Double upTravelTime;
  44 +
  45 + // 下行行驶时间
  46 + private Double downTravelTime;
  47 +
  48 + // 早高峰开始时间 00:00
  49 + private String earlyStartTime;
  50 +
  51 + // 早高峰结束时间 00:00
  52 + private String earlyEndTime;
  53 +
  54 + // 晚高峰开始时间 00:00
  55 + private String lateStartTime;
  56 +
  57 + // 晚高峰结束时间 00:00
  58 + private String lateEndTime;
  59 +
  60 + // 小夜高峰开始时间 00:00
  61 + private String xygfkssj;
  62 +
  63 + // 小夜高峰结束时间 00:00
  64 + private String xygfjssj;
  65 +
  66 + // 早高峰上行行驶时间
  67 + private Double earlyUpTime;
  68 +
  69 + // 早高峰下行行驶时间
  70 + private Double earlyDownTime;
  71 +
  72 + // 晚高峰上行行驶时间
  73 + private Double lateUpTime;
  74 +
  75 + // 晚高峰下行行驶时间
  76 + private Double lateDownTime;
  77 +
  78 + // 小夜高峰上行行驶时间
  79 + private Double nightStartTime;
  80 +
  81 + // 小夜高峰下行行驶时间
  82 + private Double nightEndTime;
  83 +
  84 + // 低谷上行行驶时间
  85 + private Double troughUpTime;
  86 +
  87 + // 低谷下行行驶时间
  88 + private Double troughDownTime;
  89 +
  90 + // 停车场
  91 + private String carPark;
  92 +
  93 + // 上行进场时间
  94 + private Double upInTimer;
  95 +
  96 + // 上行出场时间
  97 + private Double upOutTimer;
  98 +
  99 + // 下行进场时间
  100 + private Double downInTimer;
  101 +
  102 + // 下行出场时间
  103 + private Double downOutTimer;
  104 +
  105 + // 上行进场里程
  106 + private Double upInMileage;
  107 +
  108 + // 上行出场里程
  109 + private Double upOutMileage;
  110 +
  111 + // 下行进场里程
  112 + private Double downInMileage;
  113 +
  114 + // 下行出场里程
  115 + private Double downOutMileage;
  116 +
  117 + // 早高峰大间隔(分钟)老调度系统字段,暂时保留
  118 + private Double earlyIntervalLg;
  119 +
  120 + // 晚高峰大间隔(分钟)老调度系统字段,暂时保留
  121 + private Double lateIntervalLg;
  122 +
  123 + // 平时大间隔(分钟)老调度系统字段,暂时保留
  124 + private Double intervalLg;
  125 +
  126 + // 限速(平时)老调度系统字段,暂时保留
  127 + private Double speedLimit;
  128 +
  129 + // 限速(雨天)老调度系统字段,暂时保留
  130 + private Double rainLimit;
  131 +
  132 + // 限速(大雾)老调度系统字段,暂时保留
  133 + private Double fogLimit;
  134 +
  135 + // 限速(冰雪)老调度系统字段,暂时保留
  136 + private Double snowLimit;
  137 +
  138 + // 限速(节庆)老调度系统字段,暂时保留
  139 + private Double festivalSpeedLimit;
  140 +
  141 + // 滞站
  142 + private Integer lagStation;
  143 +
  144 + // 越站
  145 + private Integer skip;
  146 +
  147 + // 超速
  148 + private Integer speeding;
  149 +
  150 + // 串线
  151 + private Integer crossedLine;
  152 +
  153 + // 越界
  154 + private Integer overflights;
  155 +
  156 + // 描述
  157 + private String descriptions;
  158 +
  159 + // 创建人
  160 + private Integer createBy;
  161 +
  162 + // 修改人
  163 + private Integer updateBy;
  164 +
  165 + // 创建日期
  166 +// @Column(updatable = false, name = "create_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP")
  167 + @Column(updatable = false, name = "create_date")
  168 + private Date createDate;
  169 +
  170 + // 修改日期
  171 +// @Column(name = "update_date", columnDefinition = "timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP")
  172 + @Column(name = "update_date")
  173 + private Date updateDate;
  174 +
  175 + @ManyToOne
  176 + private Line line;
  177 +
  178 + public String getXygfkssj() {
  179 + return xygfkssj;
  180 + }
  181 +
  182 + public void setXygfkssj(String xygfkssj) {
  183 + this.xygfkssj = xygfkssj;
  184 + }
  185 +
  186 + public String getXygfjssj() {
  187 + return xygfjssj;
  188 + }
  189 +
  190 + public void setXygfjssj(String xygfjssj) {
  191 + this.xygfjssj = xygfjssj;
  192 + }
  193 +
  194 + public Double getUpInTimer() {
  195 + return upInTimer;
  196 + }
  197 +
  198 + public void setUpInTimer(Double upInTimer) {
  199 + this.upInTimer = upInTimer;
  200 + }
  201 +
  202 + public Double getUpOutTimer() {
  203 + return upOutTimer;
  204 + }
  205 +
  206 + public void setUpOutTimer(Double upOutTimer) {
  207 + this.upOutTimer = upOutTimer;
  208 + }
  209 +
  210 + public Double getDownInTimer() {
  211 + return downInTimer;
  212 + }
  213 +
  214 + public void setDownInTimer(Double downInTimer) {
  215 + this.downInTimer = downInTimer;
  216 + }
  217 +
  218 + public Double getDownOutTimer() {
  219 + return downOutTimer;
  220 + }
  221 +
  222 + public void setDownOutTimer(Double downOutTimer) {
  223 + this.downOutTimer = downOutTimer;
  224 + }
  225 +
  226 + public Double getUpInMileage() {
  227 + return upInMileage;
  228 + }
  229 +
  230 + public void setUpInMileage(Double upInMileage) {
  231 + this.upInMileage = upInMileage;
  232 + }
  233 +
  234 + public Double getUpOutMileage() {
  235 + return upOutMileage;
  236 + }
  237 +
  238 + public void setUpOutMileage(Double upOutMileage) {
  239 + this.upOutMileage = upOutMileage;
  240 + }
  241 +
  242 + public Double getDownInMileage() {
  243 + return downInMileage;
  244 + }
  245 +
  246 + public void setDownInMileage(Double downInMileage) {
  247 + this.downInMileage = downInMileage;
  248 + }
  249 +
  250 + public Double getDownOutMileage() {
  251 + return downOutMileage;
  252 + }
  253 +
  254 + public void setDownOutMileage(Double downOutMileage) {
  255 + this.downOutMileage = downOutMileage;
  256 + }
  257 +
  258 + public Integer getId() {
  259 + return id;
  260 + }
  261 +
  262 + public void setId(Integer id) {
  263 + this.id = id;
  264 + }
  265 +
  266 + public String getType() {
  267 + return type;
  268 + }
  269 +
  270 + public void setType(String type) {
  271 + this.type = type;
  272 + }
  273 +
  274 + public Double getTotalMileage() {
  275 + return totalMileage;
  276 + }
  277 +
  278 + public void setTotalMileage(Double totalMileage) {
  279 + this.totalMileage = totalMileage;
  280 + }
  281 +
  282 + public Double getEmptyMileage() {
  283 + return emptyMileage;
  284 + }
  285 +
  286 + public void setEmptyMileage(Double emptyMileage) {
  287 + this.emptyMileage = emptyMileage;
  288 + }
  289 +
  290 + public Double getUpMileage() {
  291 + return upMileage;
  292 + }
  293 +
  294 + public void setUpMileage(Double upMileage) {
  295 + this.upMileage = upMileage;
  296 + }
  297 +
  298 + public Double getDownMileage() {
  299 + return downMileage;
  300 + }
  301 +
  302 + public void setDownMileage(Double downMileage) {
  303 + this.downMileage = downMileage;
  304 + }
  305 +
  306 + public Double getUpTravelTime() {
  307 + return upTravelTime;
  308 + }
  309 +
  310 + public void setUpTravelTime(Double upTravelTime) {
  311 + this.upTravelTime = upTravelTime;
  312 + }
  313 +
  314 + public Double getDownTravelTime() {
  315 + return downTravelTime;
  316 + }
  317 +
  318 + public void setDownTravelTime(Double downTravelTime) {
  319 + this.downTravelTime = downTravelTime;
  320 + }
  321 +
  322 + public String getEarlyStartTime() {
  323 + return earlyStartTime;
  324 + }
  325 +
  326 + public void setEarlyStartTime(String earlyStartTime) {
  327 + this.earlyStartTime = earlyStartTime;
  328 + }
  329 +
  330 + public String getEarlyEndTime() {
  331 + return earlyEndTime;
  332 + }
  333 +
  334 + public void setEarlyEndTime(String earlyEndTime) {
  335 + this.earlyEndTime = earlyEndTime;
  336 + }
  337 +
  338 + public String getLateStartTime() {
  339 + return lateStartTime;
  340 + }
  341 +
  342 + public void setLateStartTime(String lateStartTime) {
  343 + this.lateStartTime = lateStartTime;
  344 + }
  345 +
  346 + public String getLateEndTime() {
  347 + return lateEndTime;
  348 + }
  349 +
  350 + public void setLateEndTime(String lateEndTime) {
  351 + this.lateEndTime = lateEndTime;
  352 + }
  353 +
  354 + public Double getEarlyUpTime() {
  355 + return earlyUpTime;
  356 + }
  357 +
  358 + public void setEarlyUpTime(Double earlyUpTime) {
  359 + this.earlyUpTime = earlyUpTime;
  360 + }
  361 +
  362 + public Double getEarlyDownTime() {
  363 + return earlyDownTime;
  364 + }
  365 +
  366 + public void setEarlyDownTime(Double earlyDownTime) {
  367 + this.earlyDownTime = earlyDownTime;
  368 + }
  369 +
  370 + public Double getLateUpTime() {
  371 + return lateUpTime;
  372 + }
  373 +
  374 + public void setLateUpTime(Double lateUpTime) {
  375 + this.lateUpTime = lateUpTime;
  376 + }
  377 +
  378 + public Double getLateDownTime() {
  379 + return lateDownTime;
  380 + }
  381 +
  382 + public void setLateDownTime(Double lateDownTime) {
  383 + this.lateDownTime = lateDownTime;
  384 + }
  385 +
  386 + public Double getNightStartTime() {
  387 + return nightStartTime;
  388 + }
  389 +
  390 + public void setNightStartTime(Double nightStartTime) {
  391 + this.nightStartTime = nightStartTime;
  392 + }
  393 +
  394 + public Double getNightEndTime() {
  395 + return nightEndTime;
  396 + }
  397 +
  398 + public void setNightEndTime(Double nightEndTime) {
  399 + this.nightEndTime = nightEndTime;
  400 + }
  401 +
  402 + public Double getTroughUpTime() {
  403 + return troughUpTime;
  404 + }
  405 +
  406 + public void setTroughUpTime(Double troughUpTime) {
  407 + this.troughUpTime = troughUpTime;
  408 + }
  409 +
  410 + public Double getTroughDownTime() {
  411 + return troughDownTime;
  412 + }
  413 +
  414 + public void setTroughDownTime(Double troughDownTime) {
  415 + this.troughDownTime = troughDownTime;
  416 + }
  417 + public String getCarPark() {
  418 + return carPark;
  419 + }
  420 +
  421 + public void setCarPark(String carPark) {
  422 + this.carPark = carPark;
  423 + }
  424 + public Double getEarlyIntervalLg() {
  425 + return earlyIntervalLg;
  426 + }
  427 +
  428 + public void setEarlyIntervalLg(Double earlyIntervalLg) {
  429 + this.earlyIntervalLg = earlyIntervalLg;
  430 + }
  431 +
  432 + public Double getLateIntervalLg() {
  433 + return lateIntervalLg;
  434 + }
  435 +
  436 + public void setLateIntervalLg(Double lateIntervalLg) {
  437 + this.lateIntervalLg = lateIntervalLg;
  438 + }
  439 +
  440 + public Double getIntervalLg() {
  441 + return intervalLg;
  442 + }
  443 +
  444 + public void setIntervalLg(Double intervalLg) {
  445 + this.intervalLg = intervalLg;
  446 + }
  447 +
  448 + public Double getSpeedLimit() {
  449 + return speedLimit;
  450 + }
  451 +
  452 + public void setSpeedLimit(Double speedLimit) {
  453 + this.speedLimit = speedLimit;
  454 + }
  455 +
  456 + public Double getRainLimit() {
  457 + return rainLimit;
  458 + }
  459 +
  460 + public void setRainLimit(Double rainLimit) {
  461 + this.rainLimit = rainLimit;
  462 + }
  463 +
  464 + public Double getFogLimit() {
  465 + return fogLimit;
  466 + }
  467 +
  468 + public void setFogLimit(Double fogLimit) {
  469 + this.fogLimit = fogLimit;
  470 + }
  471 +
  472 + public Double getSnowLimit() {
  473 + return snowLimit;
  474 + }
  475 +
  476 + public void setSnowLimit(Double snowLimit) {
  477 + this.snowLimit = snowLimit;
  478 + }
  479 +
  480 + public Double getFestivalSpeedLimit() {
  481 + return festivalSpeedLimit;
  482 + }
  483 +
  484 + public void setFestivalSpeedLimit(Double festivalSpeedLimit) {
  485 + this.festivalSpeedLimit = festivalSpeedLimit;
  486 + }
  487 +
  488 + public Integer getLagStation() {
  489 + return lagStation;
  490 + }
  491 +
  492 + public void setLagStation(Integer lagStation) {
  493 + this.lagStation = lagStation;
  494 + }
  495 +
  496 + public Integer getSkip() {
  497 + return skip;
  498 + }
  499 +
  500 + public void setSkip(Integer skip) {
  501 + this.skip = skip;
  502 + }
  503 +
  504 + public Integer getSpeeding() {
  505 + return speeding;
  506 + }
  507 +
  508 + public void setSpeeding(Integer speeding) {
  509 + this.speeding = speeding;
  510 + }
  511 +
  512 + public Integer getCrossedLine() {
  513 + return crossedLine;
  514 + }
  515 +
  516 + public void setCrossedLine(Integer crossedLine) {
  517 + this.crossedLine = crossedLine;
  518 + }
  519 +
  520 + public Integer getOverflights() {
  521 + return overflights;
  522 + }
  523 +
  524 + public void setOverflights(Integer overflights) {
  525 + this.overflights = overflights;
  526 + }
  527 +
  528 + public String getDescriptions() {
  529 + return descriptions;
  530 + }
  531 +
  532 + public void setDescriptions(String descriptions) {
  533 + this.descriptions = descriptions;
  534 + }
  535 +
  536 + public Integer getCreateBy() {
  537 + return createBy;
  538 + }
  539 +
  540 + public void setCreateBy(Integer createBy) {
  541 + this.createBy = createBy;
  542 + }
  543 +
  544 + public Integer getUpdateBy() {
  545 + return updateBy;
  546 + }
  547 +
  548 + public void setUpdateBy(Integer updateBy) {
  549 + this.updateBy = updateBy;
  550 + }
  551 +
  552 + public Date getCreateDate() {
  553 + return createDate;
  554 + }
  555 +
  556 + public void setCreateDate(Date createDate) {
  557 + this.createDate = createDate;
  558 + }
  559 +
  560 + public Date getUpdateDate() {
  561 + return updateDate;
  562 + }
  563 +
  564 + public void setUpdateDate(Date updateDate) {
  565 + this.updateDate = updateDate;
  566 + }
  567 +
  568 + public Line getLine() {
  569 + return line;
  570 + }
  571 +
  572 + public void setLine(Line line) {
  573 + this.line = line;
  574 + }
  575 +}
src/test/java/com/bsth/entity/LineVersions.java 0 → 100644
  1 +package com.bsth.entity;
  2 +
  3 +import javax.persistence.*;
  4 +import java.util.Date;
  5 +
  6 +
  7 +/**
  8 + *
  9 + * @ClassName: LineVersions(线路版本实体类)
  10 + *
  11 + * @Description: TODO(线路版本)
  12 + *
  13 + * @Author bsth@lq
  14 + *
  15 + * @Version 公交调度系统BS版 0.1
  16 + *
  17 + */
  18 +
  19 +@Entity
  20 +@Table(name = "bsth_c_line_versions")
  21 +public class LineVersions{
  22 +
  23 + @Id
  24 + @GeneratedValue(strategy = GenerationType.IDENTITY)
  25 + /** ID 主键(唯一标识符) int length(11) */
  26 + private Integer id;
  27 +
  28 + /** 线路版本名字 varchar length(50)
  29 + * 给排版人员选版本使用
  30 + * */
  31 + private String name;
  32 +
  33 + /** 线路ID int length(11) */
  34 + @ManyToOne
  35 + private Line line;
  36 +
  37 + /** 线路编码 varchar length(50) */
  38 + private String lineCode;
  39 +
  40 + /** 版本号 int length(11) */
  41 + private int versions;
  42 +
  43 + /** 启用日期 timestamp */
  44 + private Date startDate;
  45 +
  46 + /** 终止日期 timestamp */
  47 + private Date endDate;
  48 +
  49 + /** 创建日期 timestamp */
  50 +// @Column(updatable = false, name = "create_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP")
  51 + @Column(updatable = false, name = "create_date")
  52 + private Date createDate;
  53 +
  54 + /** 修改日期 timestamp */
  55 +// @Column(name = "update_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP")
  56 + @Column(name = "update_date")
  57 + private Date updateDate;
  58 +
  59 + /** 备注 varchar length(50) */
  60 + private String remark;
  61 +
  62 + /** 版本状态 int length(11)
  63 + * 0(历史版本),1(当前版本),2(待更新版本)
  64 + */
  65 + private int status;
  66 +
  67 + /**
  68 + * 是否发布 int length(1)
  69 + * 0(没有),1(发布)
  70 + */
  71 + private int isupdate = 0;
  72 +
  73 + public Integer getId() {
  74 + return id;
  75 + }
  76 +
  77 + public void setId(Integer id) {
  78 + this.id = id;
  79 + }
  80 +
  81 + public String getName() {
  82 + return name;
  83 + }
  84 +
  85 + public void setName(String name) {
  86 + this.name = name;
  87 + }
  88 +
  89 + public Line getLine() {
  90 + return line;
  91 + }
  92 +
  93 + public void setLine(Line line) {
  94 + this.line = line;
  95 + }
  96 +
  97 + public String getLineCode() {
  98 + return lineCode;
  99 + }
  100 +
  101 + public void setLineCode(String lineCode) {
  102 + this.lineCode = lineCode;
  103 + }
  104 +
  105 + public int getVersions() {
  106 + return versions;
  107 + }
  108 +
  109 + public void setVersions(int versions) {
  110 + this.versions = versions;
  111 + }
  112 +
  113 + public Date getStartDate() {
  114 + return startDate;
  115 + }
  116 +
  117 + public void setStartDate(Date startDate) {
  118 + this.startDate = startDate;
  119 + }
  120 +
  121 + public Date getEndDate() {
  122 + return endDate;
  123 + }
  124 +
  125 + public void setEndDate(Date endDate) {
  126 + this.endDate = endDate;
  127 + }
  128 +
  129 + public Date getCreateDate() {
  130 + return createDate;
  131 + }
  132 +
  133 + public void setCreateDate(Date createDate) {
  134 + this.createDate = createDate;
  135 + }
  136 +
  137 + public Date getUpdateDate() {
  138 + return updateDate;
  139 + }
  140 +
  141 + public void setUpdateDate(Date updateDate) {
  142 + this.updateDate = updateDate;
  143 + }
  144 +
  145 + public String getRemark() {
  146 + return remark;
  147 + }
  148 +
  149 + public void setRemark(String remark) {
  150 + this.remark = remark;
  151 + }
  152 +
  153 + public int getStatus() {
  154 + return status;
  155 + }
  156 +
  157 + public void setStatus(int status) {
  158 + this.status = status;
  159 + }
  160 +
  161 + public int getIsupdate() {
  162 + return isupdate;
  163 + }
  164 +
  165 + public void setIsupdate(int isupdate) {
  166 + this.isupdate = isupdate;
  167 + }
  168 +
  169 +}
src/test/java/com/bsth/entity/LsSectionRoute.java 0 → 100644
  1 +package com.bsth.entity;
  2 +
  3 +import javax.persistence.*;
  4 +import java.util.Date;
  5 +
  6 +
  7 +/**
  8 + *
  9 + * @ClassName : SectionRoute(历史路段路由实体类)
  10 + *
  11 + * @Author : bsth@lq
  12 + *
  13 + * @Description : TODO(历史路段路由)
  14 + *
  15 + * @Version 公交调度系统BS版 0.1
  16 + *
  17 + */
  18 +
  19 +@Entity
  20 +@Table(name = "bsth_c_ls_sectionroute")
  21 +public class LsSectionRoute {
  22 +
  23 + @Id
  24 + @GeneratedValue(strategy = GenerationType.IDENTITY)
  25 + private Integer id;
  26 +
  27 + // 路段路由序号
  28 + private Integer sectionrouteCode;
  29 +
  30 + // 线路编号
  31 + private String lineCode;
  32 +
  33 + // 路段编号
  34 + private String sectionCode;
  35 +
  36 + // 路段路由方向
  37 + private Integer directions;
  38 +
  39 + // 版本号
  40 + private Integer versions;
  41 +
  42 + // 是否撤销
  43 + private Integer destroy;
  44 +
  45 + /** 是否有路段限速数据 <0:分段;1:未分段>*/
  46 + private Integer isRoadeSpeed;
  47 +
  48 + // 描述
  49 + private String descriptions;
  50 +
  51 + // 创建人
  52 + private Integer createBy;
  53 +
  54 + // 修改人
  55 + private Integer updateBy;
  56 +
  57 + // 创建日期
  58 +// @Column(updatable = false, name = "create_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP")
  59 + @Column(updatable = false, name = "create_date")
  60 + private Date createDate;
  61 +
  62 + // 修改日期
  63 +// @Column(name = "update_date", columnDefinition = "timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP")
  64 + @Column(name = "update_date")
  65 + private Date updateDate;
  66 +
  67 + // 路段信息
  68 + @OneToOne
  69 + private Section section;
  70 +
  71 + // 线路信息
  72 + @ManyToOne
  73 + private Line line;
  74 +
  75 + public Integer getIsRoadeSpeed() {
  76 + return isRoadeSpeed;
  77 + }
  78 +
  79 + public void setIsRoadeSpeed(Integer isRoadeSpeed) {
  80 + this.isRoadeSpeed = isRoadeSpeed;
  81 + }
  82 +
  83 + public Integer getId() {
  84 + return id;
  85 + }
  86 +
  87 + public void setId(Integer id) {
  88 + this.id = id;
  89 + }
  90 +
  91 + public Integer getSectionrouteCode() {
  92 + return sectionrouteCode;
  93 + }
  94 +
  95 + public void setSectionrouteCode(Integer sectionrouteCode) {
  96 + this.sectionrouteCode = sectionrouteCode;
  97 + }
  98 +
  99 + public String getLineCode() {
  100 + return lineCode;
  101 + }
  102 +
  103 + public void setLineCode(String lineCode) {
  104 + this.lineCode = lineCode;
  105 + }
  106 +
  107 + public String getSectionCode() {
  108 + return sectionCode;
  109 + }
  110 +
  111 + public void setSectionCode(String sectionCode) {
  112 + this.sectionCode = sectionCode;
  113 + }
  114 +
  115 + public Integer getDirections() {
  116 + return directions;
  117 + }
  118 +
  119 + public void setDirections(Integer directions) {
  120 + this.directions = directions;
  121 + }
  122 +
  123 + public Integer getVersions() {
  124 + return versions;
  125 + }
  126 +
  127 + public void setVersions(Integer versions) {
  128 + this.versions = versions;
  129 + }
  130 +
  131 + public Integer getDestroy() {
  132 + return destroy;
  133 + }
  134 +
  135 + public void setDestroy(Integer destroy) {
  136 + this.destroy = destroy;
  137 + }
  138 +
  139 + public String getDescriptions() {
  140 + return descriptions;
  141 + }
  142 +
  143 + public void setDescriptions(String descriptions) {
  144 + this.descriptions = descriptions;
  145 + }
  146 +
  147 + public Integer getCreateBy() {
  148 + return createBy;
  149 + }
  150 +
  151 + public void setCreateBy(Integer createBy) {
  152 + this.createBy = createBy;
  153 + }
  154 +
  155 + public Integer getUpdateBy() {
  156 + return updateBy;
  157 + }
  158 +
  159 + public void setUpdateBy(Integer updateBy) {
  160 + this.updateBy = updateBy;
  161 + }
  162 +
  163 + public Date getCreateDate() {
  164 + return createDate;
  165 + }
  166 +
  167 + public void setCreateDate(Date createDate) {
  168 + this.createDate = createDate;
  169 + }
  170 +
  171 + public Date getUpdateDate() {
  172 + return updateDate;
  173 + }
  174 +
  175 + public void setUpdateDate(Date updateDate) {
  176 + this.updateDate = updateDate;
  177 + }
  178 +
  179 + public Section getSection() {
  180 + return section;
  181 + }
  182 +
  183 + public void setSection(Section section) {
  184 + this.section = section;
  185 + }
  186 +
  187 + public Line getLine() {
  188 + return line;
  189 + }
  190 +
  191 + public void setLine(Line line) {
  192 + this.line = line;
  193 + }
  194 +}
src/test/java/com/bsth/entity/LsStationRoute.java 0 → 100644
  1 +package com.bsth.entity;
  2 +
  3 +import javax.persistence.*;
  4 +import java.util.Date;
  5 +
  6 +/**
  7 + *
  8 + * @ClassName : StationRoute(历史站点路由实体类)
  9 + *
  10 + * @Author : bsth@lq
  11 + *
  12 + * @Description : TODO(历史站点路由)
  13 + *
  14 + * @Version 公交调度系统BS版 0.1
  15 + *
  16 + */
  17 +
  18 +@Entity
  19 +@Table(name = "bsth_c_ls_stationroute")
  20 +@NamedEntityGraphs({
  21 + @NamedEntityGraph(name = "ls_stationRoute_station", attributeNodes = {
  22 + @NamedAttributeNode("station"),
  23 + @NamedAttributeNode("line")
  24 + })
  25 +})
  26 +public class LsStationRoute {
  27 +
  28 + //站点路由ID
  29 + @Id
  30 + @GeneratedValue(strategy = GenerationType.IDENTITY)
  31 + private Integer id;
  32 +
  33 + // 站点路由序号
  34 + private Integer stationRouteCode;
  35 +
  36 + // 站点编码
  37 + private String stationCode;
  38 +
  39 + // 站点名称
  40 + private String stationName;
  41 +
  42 + // 线路编码
  43 + private String lineCode;
  44 +
  45 + // 行业编码
  46 + private String industryCode;
  47 + /**
  48 + * 站点类型
  49 + *
  50 + * ------ B:起点站
  51 + *
  52 + * ------ Z:中途站
  53 + *
  54 + * ------ E:终点站
  55 + *
  56 + * ------ T:停车场
  57 + *
  58 + */
  59 + private String stationMark;
  60 +
  61 + // 站点路由出站序号
  62 + private Integer outStationNmber;
  63 +
  64 + // 站点路由到站距离
  65 + private Double distances;
  66 +
  67 + // 站点路由到站时间
  68 + private Double toTime;
  69 +
  70 + // 首班时间
  71 + private String firstTime;
  72 +
  73 + // 末班时间
  74 + private String endTime;
  75 +
  76 + // 站点路由方向
  77 + private Integer directions;
  78 +
  79 + // 版本号
  80 + private Integer versions;
  81 +
  82 + // 是否撤销
  83 + private Integer destroy;
  84 +
  85 + // 描述
  86 + private String descriptions;
  87 +
  88 + // 创建人
  89 + private Integer createBy;
  90 +
  91 + // 修改人
  92 + private Integer updateBy;
  93 +
  94 + // 创建日期
  95 +// @Column(updatable = false, name = "create_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP")
  96 + @Column(updatable = false, name = "create_date")
  97 + private Date createDate;
  98 +
  99 + // 修改日期
  100 +// @Column(name = "update_date", columnDefinition = "timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP")
  101 + @Column(name = "update_date")
  102 + private Date updateDate;
  103 +
  104 + // 站点信息
  105 + @ManyToOne(fetch = FetchType.LAZY)
  106 + private Station station;
  107 +
  108 + // 线路信息
  109 + @ManyToOne
  110 + private Line line;
  111 +
  112 + public Integer getId() {
  113 + return id;
  114 + }
  115 +
  116 + public void setId(Integer id) {
  117 + this.id = id;
  118 + }
  119 +
  120 + public Integer getStationRouteCode() {
  121 + return stationRouteCode;
  122 + }
  123 +
  124 + public void setStationRouteCode(Integer stationRouteCode) {
  125 + this.stationRouteCode = stationRouteCode;
  126 + }
  127 +
  128 + public String getStationCode() {
  129 + return stationCode;
  130 + }
  131 +
  132 + public void setStationCode(String stationCode) {
  133 + this.stationCode = stationCode;
  134 + }
  135 +
  136 + public String getStationName() {
  137 + return stationName;
  138 + }
  139 +
  140 + public void setStationName(String stationName) {
  141 + this.stationName = stationName;
  142 + }
  143 +
  144 + public String getLineCode() {
  145 + return lineCode;
  146 + }
  147 +
  148 + public void setLineCode(String lineCode) {
  149 + this.lineCode = lineCode;
  150 + }
  151 +
  152 + public String getIndustryCode() {
  153 + return industryCode;
  154 + }
  155 +
  156 + public void setIndustryCode(String industryCode) {
  157 + this.industryCode = industryCode;
  158 + }
  159 +
  160 + public String getStationMark() {
  161 + return stationMark;
  162 + }
  163 +
  164 + public void setStationMark(String stationMark) {
  165 + this.stationMark = stationMark;
  166 + }
  167 +
  168 + public Integer getOutStationNmber() {
  169 + return outStationNmber;
  170 + }
  171 +
  172 + public void setOutStationNmber(Integer outStationNmber) {
  173 + this.outStationNmber = outStationNmber;
  174 + }
  175 +
  176 + public Double getDistances() {
  177 + return distances;
  178 + }
  179 +
  180 + public void setDistances(Double distances) {
  181 + this.distances = distances;
  182 + }
  183 +
  184 + public Double getToTime() {
  185 + return toTime;
  186 + }
  187 +
  188 + public void setToTime(Double toTime) {
  189 + this.toTime = toTime;
  190 + }
  191 +
  192 + public String getFirstTime() {
  193 + return firstTime;
  194 + }
  195 +
  196 + public void setFirstTime(String firstTime) {
  197 + this.firstTime = firstTime;
  198 + }
  199 +
  200 + public String getEndTime() {
  201 + return endTime;
  202 + }
  203 +
  204 + public void setEndTime(String endTime) {
  205 + this.endTime = endTime;
  206 + }
  207 +
  208 + public Integer getDirections() {
  209 + return directions;
  210 + }
  211 +
  212 + public void setDirections(Integer directions) {
  213 + this.directions = directions;
  214 + }
  215 +
  216 + public Integer getVersions() {
  217 + return versions;
  218 + }
  219 +
  220 + public void setVersions(Integer versions) {
  221 + this.versions = versions;
  222 + }
  223 +
  224 + public Integer getDestroy() {
  225 + return destroy;
  226 + }
  227 +
  228 + public void setDestroy(Integer destroy) {
  229 + this.destroy = destroy;
  230 + }
  231 +
  232 + public String getDescriptions() {
  233 + return descriptions;
  234 + }
  235 +
  236 + public void setDescriptions(String descriptions) {
  237 + this.descriptions = descriptions;
  238 + }
  239 +
  240 + public Integer getCreateBy() {
  241 + return createBy;
  242 + }
  243 +
  244 + public void setCreateBy(Integer createBy) {
  245 + this.createBy = createBy;
  246 + }
  247 +
  248 + public Integer getUpdateBy() {
  249 + return updateBy;
  250 + }
  251 +
  252 + public void setUpdateBy(Integer updateBy) {
  253 + this.updateBy = updateBy;
  254 + }
  255 +
  256 + public Date getCreateDate() {
  257 + return createDate;
  258 + }
  259 +
  260 + public void setCreateDate(Date createDate) {
  261 + this.createDate = createDate;
  262 + }
  263 +
  264 + public Date getUpdateDate() {
  265 + return updateDate;
  266 + }
  267 +
  268 + public void setUpdateDate(Date updateDate) {
  269 + this.updateDate = updateDate;
  270 + }
  271 +
  272 + public Station getStation() {
  273 + return station;
  274 + }
  275 +
  276 + public void setStation(Station station) {
  277 + this.station = station;
  278 + }
  279 +
  280 + public Line getLine() {
  281 + return line;
  282 + }
  283 +
  284 + public void setLine(Line line) {
  285 + this.line = line;
  286 + }
  287 +}
src/test/java/com/bsth/entity/RoadSpeed.java 0 → 100644
  1 +package com.bsth.entity;
  2 +
  3 +import javax.persistence.*;
  4 +import java.util.Date;
  5 +
  6 +@Entity
  7 +@Table(name = "bsth_c_road_speed")
  8 +public class RoadSpeed {
  9 +
  10 + @Id
  11 + @GeneratedValue(strategy = GenerationType.IDENTITY)
  12 + private Integer id;
  13 +
  14 + // 路段名称
  15 + private String name;
  16 +
  17 + // 路段矢量(空间坐标点集合)--GPS坐标点
  18 + private String bRoadVector;
  19 +
  20 + // 路段矢量(空间坐标点集合)--百度坐标点
  21 + private String gRoadVector;
  22 +
  23 + // 限速 (km/h)
  24 + private Double speed;
  25 +
  26 + // 限速开始时间
  27 + private String speedStartDate;
  28 +
  29 + // 限速结束时间
  30 + private String speedEndDate;
  31 +
  32 + // 是否启用限速(0:启用、1:未启用)
  33 + private int isStart;
  34 +
  35 + // 预留字段(限速的线路)
  36 + private String line;
  37 +
  38 + // 创建日期 timestamp
  39 +// @Column(updatable = false, name = "create_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP")
  40 + @Column(updatable = false, name = "create_date")
  41 + private Date createDate;
  42 +
  43 + // 修改日期 timestamp
  44 +// @Column(name = "update_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP")
  45 + @Column(name = "update_date")
  46 + private Date updateDate;
  47 +
  48 + public Integer getId() {
  49 + return id;
  50 + }
  51 +
  52 + public String getName() {
  53 + return name;
  54 + }
  55 +
  56 + public String getbRoadVector() {
  57 + return bRoadVector;
  58 + }
  59 +
  60 + public String getgRoadVector() {
  61 + return gRoadVector;
  62 + }
  63 +
  64 + public Double getSpeed() {
  65 + return speed;
  66 + }
  67 +
  68 + public String getSpeedStartDate() {
  69 + return speedStartDate;
  70 + }
  71 +
  72 + public String getSpeedEndDate() {
  73 + return speedEndDate;
  74 + }
  75 +
  76 + public int getIsStart() {
  77 + return isStart;
  78 + }
  79 +
  80 + public String getLine() {
  81 + return line;
  82 + }
  83 +
  84 + public Date getCreateDate() {
  85 + return createDate;
  86 + }
  87 +
  88 + public Date getUpdateDate() {
  89 + return updateDate;
  90 + }
  91 +
  92 + public void setId(Integer id) {
  93 + this.id = id;
  94 + }
  95 +
  96 + public void setName(String name) {
  97 + this.name = name;
  98 + }
  99 +
  100 + public void setbRoadVector(String bRoadVector) {
  101 + this.bRoadVector = bRoadVector;
  102 + }
  103 +
  104 + public void setgRoadVector(String gRoadVector) {
  105 + this.gRoadVector = gRoadVector;
  106 + }
  107 +
  108 + public void setSpeed(Double speed) {
  109 + this.speed = speed;
  110 + }
  111 +
  112 + public void setSpeedStartDate(String speedStartDate) {
  113 + this.speedStartDate = speedStartDate;
  114 + }
  115 +
  116 + public void setSpeedEndDate(String speedEndDate) {
  117 + this.speedEndDate = speedEndDate;
  118 + }
  119 +
  120 + public void setIsStart(int isStart) {
  121 + this.isStart = isStart;
  122 + }
  123 +
  124 + public void setLine(String line) {
  125 + this.line = line;
  126 + }
  127 +
  128 + public void setCreateDate(Date createDate) {
  129 + this.createDate = createDate;
  130 + }
  131 +
  132 + public void setUpdateDate(Date updateDate) {
  133 + this.updateDate = updateDate;
  134 + }
  135 +
  136 + @Override
  137 + public String toString() {
  138 + return "RoadSpeed [id=" + id + ", name=" + name + ", bRoadVector=" + bRoadVector + ", gRoadVector="
  139 + + gRoadVector + ", speed=" + speed + ", speedStartDate=" + speedStartDate + ", speedEndDate="
  140 + + speedEndDate + ", isStart=" + isStart + ", line=" + line + ", createDate=" + createDate
  141 + + ", updateDate=" + updateDate + "]";
  142 + }
  143 +
  144 +
  145 +}
src/test/java/com/bsth/entity/Section.java 0 → 100644
  1 +package com.bsth.entity;
  2 +
  3 +import javax.persistence.Column;
  4 +import javax.persistence.Entity;
  5 +import javax.persistence.Id;
  6 +import javax.persistence.Table;
  7 +import java.util.Date;
  8 +
  9 +/**
  10 + *
  11 + * @ClassName : Section(路段实体类)
  12 + *
  13 + * @Author : bsth@lq
  14 + *
  15 + * @Description : TODO(路段)
  16 + *
  17 + * @Data :2016-04-21
  18 + *
  19 + * @Version 公交调度系统BS版 0.1
  20 + *
  21 + */
  22 +
  23 +@Entity
  24 +@Table(name = "bsth_c_section")
  25 +public class Section {
  26 +
  27 + @Id
  28 + /*@GeneratedValue(strategy = GenerationType.IDENTITY)*/
  29 + private Integer id;
  30 +
  31 + // 路段编码
  32 + private String sectionCode;
  33 +
  34 + // 道路编码
  35 + private String roadCoding;
  36 +
  37 + // 路段名称
  38 + private String sectionName;
  39 +
  40 + // 路段距离
  41 + private Double sectionDistance;
  42 +
  43 + // 路段时间
  44 + private Double sectionTime;
  45 +
  46 + // 经纬坐标类型
  47 + private String dbType;
  48 +
  49 + // 路段类型
  50 + private String sectionType;
  51 +
  52 + // 路段矢量(空间坐标点集合)--GPS坐标点
  53 + private String gsectionVector;
  54 +
  55 + // 路段矢量(空间坐标点集合)--百度原始坐标坐标点
  56 + private String bsectionVector;
  57 +
  58 + // 路段矢量(空间坐标点集合)--城建坐标点
  59 + private String csectionVector;
  60 +
  61 + // 交叉路
  62 + private String crosesRoad;
  63 +
  64 + // 起始节点
  65 + private String startNode;
  66 +
  67 + // 中间节点
  68 + private String middleNode;
  69 +
  70 + // 终止节点
  71 + private String endNode;
  72 +
  73 + // 限速
  74 + private Double speedLimit;
  75 +
  76 + // 版本号
  77 + private Integer versions;
  78 +
  79 + // 描述
  80 + private String descriptions;
  81 +
  82 + // 创建人
  83 + private Integer createBy;
  84 +
  85 + // 修改人
  86 + private Integer updateBy;
  87 +
  88 + // 创建日期
  89 +// @Column(updatable = false, name = "create_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP")
  90 + @Column(updatable = false, name = "create_date")
  91 + private Date createDate;
  92 +
  93 + // 修改日期
  94 +// @Column(name = "update_date", columnDefinition = "timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP")
  95 + @Column(name = "update_date")
  96 + private Date updateDate;
  97 +
  98 + public Integer getId() {
  99 + return id;
  100 + }
  101 +
  102 + public void setId(Integer id) {
  103 + this.id = id;
  104 + }
  105 +
  106 + public String getSectionCode() {
  107 + return sectionCode;
  108 + }
  109 +
  110 + public void setSectionCode(String sectionCode) {
  111 + this.sectionCode = sectionCode;
  112 + }
  113 +
  114 + public String getRoadCoding() {
  115 + return roadCoding;
  116 + }
  117 +
  118 + public void setRoadCoding(String roadCoding) {
  119 + this.roadCoding = roadCoding;
  120 + }
  121 +
  122 + public String getSectionName() {
  123 + return sectionName;
  124 + }
  125 +
  126 + public void setSectionName(String sectionName) {
  127 + this.sectionName = sectionName;
  128 + }
  129 +
  130 + public Double getSectionDistance() {
  131 + return sectionDistance;
  132 + }
  133 +
  134 + public void setSectionDistance(Double sectionDistance) {
  135 + this.sectionDistance = sectionDistance;
  136 + }
  137 +
  138 + public Double getSectionTime() {
  139 + return sectionTime;
  140 + }
  141 +
  142 + public void setSectionTime(Double sectionTime) {
  143 + this.sectionTime = sectionTime;
  144 + }
  145 +
  146 + public String getDbType() {
  147 + return dbType;
  148 + }
  149 +
  150 + public void setDbType(String dbType) {
  151 + this.dbType = dbType;
  152 + }
  153 +
  154 + public String getSectionType() {
  155 + return sectionType;
  156 + }
  157 +
  158 + public void setSectionType(String sectionType) {
  159 + this.sectionType = sectionType;
  160 + }
  161 +
  162 + public String getGsectionVector() {
  163 + return gsectionVector;
  164 + }
  165 +
  166 + public void setGsectionVector(String gsectionVector) {
  167 + this.gsectionVector = gsectionVector;
  168 + }
  169 +
  170 + public String getBsectionVector() {
  171 + return bsectionVector;
  172 + }
  173 +
  174 + public void setBsectionVector(String bsectionVector) {
  175 + this.bsectionVector = bsectionVector;
  176 + }
  177 +
  178 + public String getCsectionVector() {
  179 + return csectionVector;
  180 + }
  181 +
  182 + public void setCsectionVector(String csectionVector) {
  183 + this.csectionVector = csectionVector;
  184 + }
  185 +
  186 + public String getCrosesRoad() {
  187 + return crosesRoad;
  188 + }
  189 +
  190 + public void setCrosesRoad(String crosesRoad) {
  191 + this.crosesRoad = crosesRoad;
  192 + }
  193 +
  194 + public String getStartNode() {
  195 + return startNode;
  196 + }
  197 +
  198 + public void setStartNode(String startNode) {
  199 + this.startNode = startNode;
  200 + }
  201 +
  202 + public String getMiddleNode() {
  203 + return middleNode;
  204 + }
  205 +
  206 + public void setMiddleNode(String middleNode) {
  207 + this.middleNode = middleNode;
  208 + }
  209 +
  210 + public String getEndNode() {
  211 + return endNode;
  212 + }
  213 +
  214 + public void setEndNode(String endNode) {
  215 + this.endNode = endNode;
  216 + }
  217 +
  218 + public Double getSpeedLimit() {
  219 + return speedLimit;
  220 + }
  221 +
  222 + public void setSpeedLimit(Double speedLimit) {
  223 + this.speedLimit = speedLimit;
  224 + }
  225 +
  226 + public Integer getVersions() {
  227 + return versions;
  228 + }
  229 +
  230 + public void setVersions(Integer versions) {
  231 + this.versions = versions;
  232 + }
  233 +
  234 + public String getDescriptions() {
  235 + return descriptions;
  236 + }
  237 +
  238 + public void setDescriptions(String descriptions) {
  239 + this.descriptions = descriptions;
  240 + }
  241 +
  242 + public Integer getCreateBy() {
  243 + return createBy;
  244 + }
  245 +
  246 + public void setCreateBy(Integer createBy) {
  247 + this.createBy = createBy;
  248 + }
  249 +
  250 + public Integer getUpdateBy() {
  251 + return updateBy;
  252 + }
  253 +
  254 + public void setUpdateBy(Integer updateBy) {
  255 + this.updateBy = updateBy;
  256 + }
  257 +
  258 + public Date getCreateDate() {
  259 + return createDate;
  260 + }
  261 +
  262 + public void setCreateDate(Date createDate) {
  263 + this.createDate = createDate;
  264 + }
  265 +
  266 + public Date getUpdateDate() {
  267 + return updateDate;
  268 + }
  269 +
  270 + public void setUpdateDate(Date updateDate) {
  271 + this.updateDate = updateDate;
  272 + }
  273 +}
src/test/java/com/bsth/entity/SectionRoute.java 0 → 100644
  1 +package com.bsth.entity;
  2 +
  3 +import javax.persistence.*;
  4 +import java.util.Date;
  5 +
  6 +
  7 +/**
  8 + *
  9 + * @ClassName : SectionRoute(路段路由实体类)
  10 + *
  11 + * @Author : bsth@lq
  12 + *
  13 + * @Description : TODO(路段路由)
  14 + *
  15 + * @Data :2016-04-21
  16 + *
  17 + * @Version 公交调度系统BS版 0.1
  18 + *
  19 + */
  20 +
  21 +@Entity
  22 +@Table(name = "bsth_c_sectionroute")
  23 +public class SectionRoute {
  24 +
  25 + @Id
  26 + @GeneratedValue(strategy = GenerationType.IDENTITY)
  27 + private Integer id;
  28 +
  29 + // 路段路由序号
  30 + private Integer sectionrouteCode;
  31 +
  32 + // 线路编号
  33 + private String lineCode;
  34 +
  35 + // 路段编号
  36 + private String sectionCode;
  37 +
  38 + // 路段路由方向
  39 + private Integer directions;
  40 +
  41 + // 版本号
  42 + private Integer versions;
  43 +
  44 + // 是否撤销
  45 + private Integer destroy;
  46 +
  47 + /** 是否有路段限速数据 <0:分段;1:未分段>*/
  48 + private Integer isRoadeSpeed;
  49 +
  50 + // 描述
  51 + private String descriptions;
  52 +
  53 + // 创建人
  54 + private Integer createBy;
  55 +
  56 + // 修改人
  57 + private Integer updateBy;
  58 +
  59 + // 创建日期
  60 +// @Column(updatable = false, name = "create_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP")
  61 + @Column(updatable = false, name = "create_date")
  62 + private Date createDate;
  63 +
  64 + // 修改日期
  65 +// @Column(name = "update_date", columnDefinition = "timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP")
  66 + @Column(name = "update_date")
  67 + private Date updateDate;
  68 +
  69 + // 路段信息
  70 + @OneToOne
  71 + private Section section;
  72 +
  73 + // 线路信息
  74 + @ManyToOne
  75 + private Line line;
  76 +
  77 + public Integer getIsRoadeSpeed() {
  78 + return isRoadeSpeed;
  79 + }
  80 +
  81 + public void setIsRoadeSpeed(Integer isRoadeSpeed) {
  82 + this.isRoadeSpeed = isRoadeSpeed;
  83 + }
  84 +
  85 + public Integer getId() {
  86 + return id;
  87 + }
  88 +
  89 + public void setId(Integer id) {
  90 + this.id = id;
  91 + }
  92 +
  93 + public Integer getSectionrouteCode() {
  94 + return sectionrouteCode;
  95 + }
  96 +
  97 + public void setSectionrouteCode(Integer sectionrouteCode) {
  98 + this.sectionrouteCode = sectionrouteCode;
  99 + }
  100 +
  101 + public String getLineCode() {
  102 + return lineCode;
  103 + }
  104 +
  105 + public void setLineCode(String lineCode) {
  106 + this.lineCode = lineCode;
  107 + }
  108 +
  109 + public String getSectionCode() {
  110 + return sectionCode;
  111 + }
  112 +
  113 + public void setSectionCode(String sectionCode) {
  114 + this.sectionCode = sectionCode;
  115 + }
  116 +
  117 + public Integer getDirections() {
  118 + return directions;
  119 + }
  120 +
  121 + public void setDirections(Integer directions) {
  122 + this.directions = directions;
  123 + }
  124 +
  125 + public Integer getVersions() {
  126 + return versions;
  127 + }
  128 +
  129 + public void setVersions(Integer versions) {
  130 + this.versions = versions;
  131 + }
  132 +
  133 + public Integer getDestroy() {
  134 + return destroy;
  135 + }
  136 +
  137 + public void setDestroy(Integer destroy) {
  138 + this.destroy = destroy;
  139 + }
  140 +
  141 + public String getDescriptions() {
  142 + return descriptions;
  143 + }
  144 +
  145 + public void setDescriptions(String descriptions) {
  146 + this.descriptions = descriptions;
  147 + }
  148 +
  149 + public Integer getCreateBy() {
  150 + return createBy;
  151 + }
  152 +
  153 + public void setCreateBy(Integer createBy) {
  154 + this.createBy = createBy;
  155 + }
  156 +
  157 + public Integer getUpdateBy() {
  158 + return updateBy;
  159 + }
  160 +
  161 + public void setUpdateBy(Integer updateBy) {
  162 + this.updateBy = updateBy;
  163 + }
  164 +
  165 + public Date getCreateDate() {
  166 + return createDate;
  167 + }
  168 +
  169 + public void setCreateDate(Date createDate) {
  170 + this.createDate = createDate;
  171 + }
  172 +
  173 + public Date getUpdateDate() {
  174 + return updateDate;
  175 + }
  176 +
  177 + public void setUpdateDate(Date updateDate) {
  178 + this.updateDate = updateDate;
  179 + }
  180 +
  181 + public Section getSection() {
  182 + return section;
  183 + }
  184 +
  185 + public void setSection(Section section) {
  186 + this.section = section;
  187 + }
  188 +
  189 + public Line getLine() {
  190 + return line;
  191 + }
  192 +
  193 + public void setLine(Line line) {
  194 + this.line = line;
  195 + }
  196 +}
src/test/java/com/bsth/entity/SectionRouteCache.java 0 → 100644
  1 +package com.bsth.entity;
  2 +
  3 +import javax.persistence.*;
  4 +import java.util.Date;
  5 +
  6 +
  7 +/**
  8 + *
  9 + * @ClassName : SectionRoute(路段路由缓存实体类)
  10 + *
  11 + * @Author : bsth@lq
  12 + *
  13 + * @Description : TODO(路段路由)
  14 + *
  15 + * @Data :2016-04-21
  16 + *
  17 + * @Version 公交调度系统BS版 0.1
  18 + *
  19 + */
  20 +
  21 +@Entity
  22 +@Table(name = "bsth_c_sectionroute_cache")
  23 +public class SectionRouteCache {
  24 +
  25 + @Id
  26 + @GeneratedValue(strategy = GenerationType.IDENTITY)
  27 + private Integer id;
  28 +
  29 + // 路段路由序号
  30 + private Integer sectionrouteCode;
  31 +
  32 + // 线路编号
  33 + private String lineCode;
  34 +
  35 + // 路段编号
  36 + private String sectionCode;
  37 +
  38 + // 路段路由方向
  39 + private Integer directions;
  40 +
  41 + // 版本号
  42 + private Integer versions;
  43 +
  44 + // 是否撤销
  45 + private Integer destroy;
  46 +
  47 + /** 是否有路段限速数据 <0:分段;1:未分段>*/
  48 + private Integer isRoadeSpeed;
  49 +
  50 + // 描述
  51 + private String descriptions;
  52 +
  53 + // 创建人
  54 + private Integer createBy;
  55 +
  56 + // 修改人
  57 + private Integer updateBy;
  58 +
  59 + // 创建日期
  60 +// @Column(updatable = false, name = "create_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP")
  61 + @Column(updatable = false, name = "create_date")
  62 + private Date createDate;
  63 +
  64 + // 修改日期
  65 +// @Column(name = "update_date", columnDefinition = "timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP")
  66 + @Column(name = "update_date")
  67 + private Date updateDate;
  68 +
  69 + // 路段信息
  70 + @OneToOne
  71 + private Section section;
  72 +
  73 + // 线路信息
  74 + @ManyToOne
  75 + private Line line;
  76 +
  77 + public Integer getIsRoadeSpeed() {
  78 + return isRoadeSpeed;
  79 + }
  80 +
  81 + public void setIsRoadeSpeed(Integer isRoadeSpeed) {
  82 + this.isRoadeSpeed = isRoadeSpeed;
  83 + }
  84 +
  85 + public Integer getId() {
  86 + return id;
  87 + }
  88 +
  89 + public void setId(Integer id) {
  90 + this.id = id;
  91 + }
  92 +
  93 + public Integer getSectionrouteCode() {
  94 + return sectionrouteCode;
  95 + }
  96 +
  97 + public void setSectionrouteCode(Integer sectionrouteCode) {
  98 + this.sectionrouteCode = sectionrouteCode;
  99 + }
  100 +
  101 + public String getLineCode() {
  102 + return lineCode;
  103 + }
  104 +
  105 + public void setLineCode(String lineCode) {
  106 + this.lineCode = lineCode;
  107 + }
  108 +
  109 + public String getSectionCode() {
  110 + return sectionCode;
  111 + }
  112 +
  113 + public void setSectionCode(String sectionCode) {
  114 + this.sectionCode = sectionCode;
  115 + }
  116 +
  117 + public Integer getDirections() {
  118 + return directions;
  119 + }
  120 +
  121 + public void setDirections(Integer directions) {
  122 + this.directions = directions;
  123 + }
  124 +
  125 + public Integer getVersions() {
  126 + return versions;
  127 + }
  128 +
  129 + public void setVersions(Integer versions) {
  130 + this.versions = versions;
  131 + }
  132 +
  133 + public Integer getDestroy() {
  134 + return destroy;
  135 + }
  136 +
  137 + public void setDestroy(Integer destroy) {
  138 + this.destroy = destroy;
  139 + }
  140 +
  141 + public String getDescriptions() {
  142 + return descriptions;
  143 + }
  144 +
  145 + public void setDescriptions(String descriptions) {
  146 + this.descriptions = descriptions;
  147 + }
  148 +
  149 + public Integer getCreateBy() {
  150 + return createBy;
  151 + }
  152 +
  153 + public void setCreateBy(Integer createBy) {
  154 + this.createBy = createBy;
  155 + }
  156 +
  157 + public Integer getUpdateBy() {
  158 + return updateBy;
  159 + }
  160 +
  161 + public void setUpdateBy(Integer updateBy) {
  162 + this.updateBy = updateBy;
  163 + }
  164 +
  165 + public Date getCreateDate() {
  166 + return createDate;
  167 + }
  168 +
  169 + public void setCreateDate(Date createDate) {
  170 + this.createDate = createDate;
  171 + }
  172 +
  173 + public Date getUpdateDate() {
  174 + return updateDate;
  175 + }
  176 +
  177 + public void setUpdateDate(Date updateDate) {
  178 + this.updateDate = updateDate;
  179 + }
  180 +
  181 + public Section getSection() {
  182 + return section;
  183 + }
  184 +
  185 + public void setSection(Section section) {
  186 + this.section = section;
  187 + }
  188 +
  189 + public Line getLine() {
  190 + return line;
  191 + }
  192 +
  193 + public void setLine(Line line) {
  194 + this.line = line;
  195 + }
  196 +}
src/test/java/com/bsth/entity/Station.java 0 → 100644
  1 +package com.bsth.entity;
  2 +
  3 +import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
  4 +
  5 +import javax.persistence.Column;
  6 +import javax.persistence.Entity;
  7 +import javax.persistence.Id;
  8 +import javax.persistence.Table;
  9 +
  10 +import java.util.Arrays;
  11 +import java.util.Date;
  12 +
  13 +
  14 +/**
  15 + *
  16 + * @ClassName : Station(站点实体类)
  17 + *
  18 + * @Author : bsth@lq
  19 + *
  20 + * @Description : TODO(站点)
  21 + *
  22 + * @Data :2016-04-19
  23 + *
  24 + * @Version 公交调度系统BS版 0.1
  25 + *
  26 + */
  27 +
  28 +@Entity
  29 +@Table(name = "bsth_c_station")
  30 +@JsonIgnoreProperties(value={"hibernateLazyInitializer","handler","fieldHandler"})
  31 +public class Station {
  32 +
  33 + @Id
  34 + /*@GeneratedValue(strategy = GenerationType.IDENTITY)*/
  35 + private Integer id;
  36 +
  37 + // 站点编码
  38 + private String stationCod;
  39 +
  40 + // 站点名称
  41 + private String stationName;
  42 +
  43 + // 所在道路编码
  44 + private String roadCoding;
  45 +
  46 + // 站点的具体地址
  47 + private String addr;
  48 +
  49 + /**
  50 + * 经纬坐标类型
  51 + *
  52 + * --------- b:百度坐标系
  53 + *
  54 + * --------- d:高德坐标系
  55 + */
  56 + private String dbType;
  57 +
  58 + // 百度经纬度坐标
  59 + private String bJwpoints;
  60 +
  61 + // 站点地理位置WGS坐标经度
  62 + private Float gLonx;
  63 +
  64 + // 站点地理位置WGS坐标纬度
  65 + private Float gLaty;
  66 +
  67 + // 城建坐标 x
  68 + private Float x;
  69 +
  70 + // 城建坐标 y
  71 + private Float y;
  72 +
  73 + /**
  74 + * 图形类型
  75 + *
  76 + * ------ r:圆形
  77 + *
  78 + * ------ p:多边形
  79 + */
  80 + private String shapesType;
  81 +
  82 + // 圆形半径
  83 + private Integer radius;
  84 +
  85 + // 多边形空间WGS坐标点集合
  86 + private byte[] gPolygonGrid;
  87 +
  88 + // 多边形空间原坐标坐标点集合
  89 + private byte[] bPolygonGrid;
  90 +
  91 + /**
  92 + * 是否撤销
  93 + *
  94 + * ------ 1:撤销
  95 + *
  96 + * ------ 0:不撤销
  97 + */
  98 + private Integer destroy;
  99 +
  100 + // 版本号
  101 + private Integer versions;
  102 +
  103 + /** 是否有电子站牌 这里是老调度系统的原始字段,暂时保留该字段。 */
  104 + private Integer isHaveLed;
  105 +
  106 + /** 是否有候车亭 这里是老调度系统的原始字段,暂时保留该字段。*/
  107 + private Integer isHaveShelter;
  108 +
  109 + /** 是否港湾式公交站 这里是老调度系统的原始字段,暂时保留该字段。*/
  110 + private Integer isHarbourStation;
  111 +
  112 + // 描述
  113 + private String descriptions;
  114 +
  115 + // 创建人
  116 + private Integer createBy;
  117 +
  118 + // 修改人
  119 + private Integer updateBy;
  120 +
  121 + // 创建日期
  122 +// @Column(updatable = false, name = "create_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP")
  123 + @Column(updatable = false, name = "create_date")
  124 + private Date createDate;
  125 +
  126 + // 修改日期
  127 +// @Column(name = "update_date", columnDefinition = "timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP")
  128 + @Column(name = "update_date")
  129 + private Date updateDate;
  130 +
  131 + public Integer getIsHaveLed() {
  132 + return isHaveLed;
  133 + }
  134 +
  135 + public void setIsHaveLed(Integer isHaveLed) {
  136 + this.isHaveLed = isHaveLed;
  137 + }
  138 +
  139 + public Integer getIsHaveShelter() {
  140 + return isHaveShelter;
  141 + }
  142 +
  143 + public void setIsHaveShelter(Integer isHaveShelter) {
  144 + this.isHaveShelter = isHaveShelter;
  145 + }
  146 +
  147 + public Integer getIsHarbourStation() {
  148 + return isHarbourStation;
  149 + }
  150 +
  151 + public void setIsHarbourStation(Integer isHarbourStation) {
  152 + this.isHarbourStation = isHarbourStation;
  153 + }
  154 +
  155 + public String getAddr() {
  156 + return addr;
  157 + }
  158 +
  159 + public void setAddr(String addr) {
  160 + this.addr = addr;
  161 + }
  162 +
  163 + public Integer getId() {
  164 + return id;
  165 + }
  166 +
  167 + public void setId(Integer id) {
  168 + this.id = id;
  169 + }
  170 +
  171 + public String getStationCod() {
  172 + return stationCod;
  173 + }
  174 +
  175 + public void setStationCod(String stationCod) {
  176 + this.stationCod = stationCod;
  177 + }
  178 +
  179 + public String getStationName() {
  180 + return stationName;
  181 + }
  182 +
  183 + public void setStationName(String stationName) {
  184 + this.stationName = stationName;
  185 + }
  186 +
  187 + public String getRoadCoding() {
  188 + return roadCoding;
  189 + }
  190 +
  191 + public void setRoadCoding(String roadCoding) {
  192 + this.roadCoding = roadCoding;
  193 + }
  194 +
  195 + public String getDbType() {
  196 + return dbType;
  197 + }
  198 +
  199 + public void setDbType(String dbType) {
  200 + this.dbType = dbType;
  201 + }
  202 +
  203 + public String getbJwpoints() {
  204 + return bJwpoints;
  205 + }
  206 +
  207 + public void setbJwpoints(String bJwpoints) {
  208 + this.bJwpoints = bJwpoints;
  209 + }
  210 +
  211 + public Float getgLonx() {
  212 + return gLonx;
  213 + }
  214 +
  215 + public void setgLonx(Float gLonx) {
  216 + this.gLonx = gLonx;
  217 + }
  218 +
  219 + public Float getgLaty() {
  220 + return gLaty;
  221 + }
  222 +
  223 + public void setgLaty(Float gLaty) {
  224 + this.gLaty = gLaty;
  225 + }
  226 +
  227 + public Float getX() {
  228 + return x;
  229 + }
  230 +
  231 + public void setX(Float x) {
  232 + this.x = x;
  233 + }
  234 +
  235 + public Float getY() {
  236 + return y;
  237 + }
  238 +
  239 + public void setY(Float y) {
  240 + this.y = y;
  241 + }
  242 +
  243 + public String getShapesType() {
  244 + return shapesType;
  245 + }
  246 +
  247 + public void setShapesType(String shapesType) {
  248 + this.shapesType = shapesType;
  249 + }
  250 +
  251 + public Integer getRadius() {
  252 + return radius;
  253 + }
  254 +
  255 + public void setRadius(Integer radius) {
  256 + this.radius = radius;
  257 + }
  258 +
  259 + public byte[] getgPolygonGrid() {
  260 + return gPolygonGrid;
  261 + }
  262 +
  263 + public void setgPolygonGrid(byte[] gPolygonGrid) {
  264 + this.gPolygonGrid = gPolygonGrid;
  265 + }
  266 +
  267 + public byte[] getbPolygonGrid() {
  268 + return bPolygonGrid;
  269 + }
  270 +
  271 + public void setbPolygonGrid(byte[] bPolygonGrid) {
  272 + this.bPolygonGrid = bPolygonGrid;
  273 + }
  274 +
  275 + public Integer getDestroy() {
  276 + return destroy;
  277 + }
  278 +
  279 + public void setDestroy(Integer destroy) {
  280 + this.destroy = destroy;
  281 + }
  282 +
  283 + public Integer getVersions() {
  284 + return versions;
  285 + }
  286 +
  287 + public void setVersions(Integer versions) {
  288 + this.versions = versions;
  289 + }
  290 +
  291 + public String getDescriptions() {
  292 + return descriptions;
  293 + }
  294 +
  295 + public void setDescriptions(String descriptions) {
  296 + this.descriptions = descriptions;
  297 + }
  298 +
  299 + public Integer getCreateBy() {
  300 + return createBy;
  301 + }
  302 +
  303 + public void setCreateBy(Integer createBy) {
  304 + this.createBy = createBy;
  305 + }
  306 +
  307 + public Integer getUpdateBy() {
  308 + return updateBy;
  309 + }
  310 +
  311 + public void setUpdateBy(Integer updateBy) {
  312 + this.updateBy = updateBy;
  313 + }
  314 +
  315 + public Date getCreateDate() {
  316 + return createDate;
  317 + }
  318 +
  319 + public void setCreateDate(Date createDate) {
  320 + this.createDate = createDate;
  321 + }
  322 +
  323 + public Date getUpdateDate() {
  324 + return updateDate;
  325 + }
  326 +
  327 + public void setUpdateDate(Date updateDate) {
  328 + this.updateDate = updateDate;
  329 + }
  330 +
  331 + @Override
  332 + public String toString() {
  333 + return "Station [id=" + id + ", stationCod=" + stationCod + ", stationName=" + stationName + ", roadCoding="
  334 + + roadCoding + ", addr=" + addr + ", dbType=" + dbType + ", bJwpoints=" + bJwpoints + ", gLonx=" + gLonx
  335 + + ", gLaty=" + gLaty + ", x=" + x + ", y=" + y + ", shapesType=" + shapesType + ", radius=" + radius
  336 + + ", gPolygonGrid=" + Arrays.toString(gPolygonGrid) + ", bPolygonGrid=" + Arrays.toString(bPolygonGrid)
  337 + + ", destroy=" + destroy + ", versions=" + versions + ", isHaveLed=" + isHaveLed + ", isHaveShelter="
  338 + + isHaveShelter + ", isHarbourStation=" + isHarbourStation + ", descriptions=" + descriptions
  339 + + ", createBy=" + createBy + ", updateBy=" + updateBy + ", createDate=" + createDate + ", updateDate="
  340 + + updateDate + "]";
  341 + }
  342 +
  343 +}
src/test/java/com/bsth/entity/StationRoute.java 0 → 100644
  1 +package com.bsth.entity;
  2 +
  3 +import javax.persistence.*;
  4 +import java.util.Date;
  5 +
  6 +/**
  7 + *
  8 + * @ClassName : StationRoute(站点路由实体类)
  9 + *
  10 + * @Author : bsth@lq
  11 + *
  12 + * @Description : TODO(站点路由)
  13 + *
  14 + * @Data :2016-04-19
  15 + *
  16 + * @Version 公交调度系统BS版 0.1
  17 + *
  18 + */
  19 +
  20 +@Entity
  21 +@Table(name = "bsth_c_stationroute")
  22 +@NamedEntityGraphs({
  23 + @NamedEntityGraph(name = "stationRoute_station", attributeNodes = {
  24 + @NamedAttributeNode("station"),
  25 + @NamedAttributeNode("line")
  26 + })
  27 +})
  28 +public class StationRoute {
  29 +
  30 + //站点路由ID
  31 + @Id
  32 + @GeneratedValue(strategy = GenerationType.IDENTITY)
  33 + private Integer id;
  34 +
  35 + // 站点路由序号
  36 + private Integer stationRouteCode;
  37 +
  38 + // 站点编码
  39 + private String stationCode;
  40 +
  41 + // 站点名称
  42 + private String stationName;
  43 +
  44 + // 线路编码
  45 + private String lineCode;
  46 +
  47 + // 行业编码
  48 + private String industryCode;
  49 +
  50 + /**
  51 + * 站点类型
  52 + *
  53 + * ------ B:起点站
  54 + *
  55 + * ------ Z:中途站
  56 + *
  57 + * ------ E:终点站
  58 + *
  59 + * ------ T:停车场
  60 + *
  61 + */
  62 + private String stationMark;
  63 +
  64 + // 站点路由出站序号
  65 + private Integer outStationNmber;
  66 +
  67 + // 站点路由到站距离
  68 + private Double distances;
  69 +
  70 + // 站点路由到站时间
  71 + private Double toTime;
  72 +
  73 + // 首班时间
  74 + private String firstTime;
  75 +
  76 + // 末班时间
  77 + private String endTime;
  78 +
  79 + // 站点路由方向
  80 + private Integer directions;
  81 +
  82 + // 版本号
  83 + private Integer versions;
  84 +
  85 + // 是否撤销
  86 + private Integer destroy;
  87 +
  88 + // 描述
  89 + private String descriptions;
  90 +
  91 + // 创建人
  92 + private Integer createBy;
  93 +
  94 + // 修改人
  95 + private Integer updateBy;
  96 +
  97 + // 创建日期
  98 +// @Column(updatable = false, name = "create_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP")
  99 + @Column(updatable = false, name = "create_date")
  100 + private Date createDate;
  101 +
  102 + // 修改日期
  103 +// @Column(name = "update_date", columnDefinition = "timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP")
  104 + @Column(name = "update_date")
  105 + private Date updateDate;
  106 +
  107 + // 站点信息
  108 + @ManyToOne(fetch = FetchType.LAZY)
  109 + private Station station;
  110 +
  111 + // 线路信息
  112 + @ManyToOne
  113 + private Line line;
  114 +
  115 + public Integer getId() {
  116 + return id;
  117 + }
  118 +
  119 + public void setId(Integer id) {
  120 + this.id = id;
  121 + }
  122 +
  123 + public Integer getStationRouteCode() {
  124 + return stationRouteCode;
  125 + }
  126 +
  127 + public void setStationRouteCode(Integer stationRouteCode) {
  128 + this.stationRouteCode = stationRouteCode;
  129 + }
  130 +
  131 + public String getStationCode() {
  132 + return stationCode;
  133 + }
  134 +
  135 + public void setStationCode(String stationCode) {
  136 + this.stationCode = stationCode;
  137 + }
  138 +
  139 + public String getStationName() {
  140 + return stationName;
  141 + }
  142 +
  143 + public void setStationName(String stationName) {
  144 + this.stationName = stationName;
  145 + }
  146 +
  147 + public String getLineCode() {
  148 + return lineCode;
  149 + }
  150 +
  151 + public void setLineCode(String lineCode) {
  152 + this.lineCode = lineCode;
  153 + }
  154 +
  155 + public String getIndustryCode() {
  156 + return industryCode;
  157 + }
  158 +
  159 + public void setIndustryCode(String industryCode) {
  160 + this.industryCode = industryCode;
  161 + }
  162 +
  163 + public String getStationMark() {
  164 + return stationMark;
  165 + }
  166 +
  167 + public void setStationMark(String stationMark) {
  168 + this.stationMark = stationMark;
  169 + }
  170 +
  171 + public Integer getOutStationNmber() {
  172 + return outStationNmber;
  173 + }
  174 +
  175 + public void setOutStationNmber(Integer outStationNmber) {
  176 + this.outStationNmber = outStationNmber;
  177 + }
  178 +
  179 + public Double getDistances() {
  180 + return distances;
  181 + }
  182 +
  183 + public void setDistances(Double distances) {
  184 + this.distances = distances;
  185 + }
  186 +
  187 + public Double getToTime() {
  188 + return toTime;
  189 + }
  190 +
  191 + public void setToTime(Double toTime) {
  192 + this.toTime = toTime;
  193 + }
  194 +
  195 + public String getFirstTime() {
  196 + return firstTime;
  197 + }
  198 +
  199 + public void setFirstTime(String firstTime) {
  200 + this.firstTime = firstTime;
  201 + }
  202 +
  203 + public String getEndTime() {
  204 + return endTime;
  205 + }
  206 +
  207 + public void setEndTime(String endTime) {
  208 + this.endTime = endTime;
  209 + }
  210 +
  211 + public Integer getDirections() {
  212 + return directions;
  213 + }
  214 +
  215 + public void setDirections(Integer directions) {
  216 + this.directions = directions;
  217 + }
  218 +
  219 + public Integer getVersions() {
  220 + return versions;
  221 + }
  222 +
  223 + public void setVersions(Integer versions) {
  224 + this.versions = versions;
  225 + }
  226 +
  227 + public Integer getDestroy() {
  228 + return destroy;
  229 + }
  230 +
  231 + public void setDestroy(Integer destroy) {
  232 + this.destroy = destroy;
  233 + }
  234 +
  235 + public String getDescriptions() {
  236 + return descriptions;
  237 + }
  238 +
  239 + public void setDescriptions(String descriptions) {
  240 + this.descriptions = descriptions;
  241 + }
  242 +
  243 + public Integer getCreateBy() {
  244 + return createBy;
  245 + }
  246 +
  247 + public void setCreateBy(Integer createBy) {
  248 + this.createBy = createBy;
  249 + }
  250 +
  251 + public Integer getUpdateBy() {
  252 + return updateBy;
  253 + }
  254 +
  255 + public void setUpdateBy(Integer updateBy) {
  256 + this.updateBy = updateBy;
  257 + }
  258 +
  259 + public Date getCreateDate() {
  260 + return createDate;
  261 + }
  262 +
  263 + public void setCreateDate(Date createDate) {
  264 + this.createDate = createDate;
  265 + }
  266 +
  267 + public Date getUpdateDate() {
  268 + return updateDate;
  269 + }
  270 +
  271 + public void setUpdateDate(Date updateDate) {
  272 + this.updateDate = updateDate;
  273 + }
  274 +
  275 + public Station getStation() {
  276 + return station;
  277 + }
  278 +
  279 + public void setStation(Station station) {
  280 + this.station = station;
  281 + }
  282 +
  283 + public Line getLine() {
  284 + return line;
  285 + }
  286 +
  287 + public void setLine(Line line) {
  288 + this.line = line;
  289 + }
  290 +}
src/test/java/com/bsth/entity/StationRouteCache.java 0 → 100644
  1 +package com.bsth.entity;
  2 +
  3 +import javax.persistence.*;
  4 +
  5 +import java.util.Date;
  6 +
  7 +/**
  8 + *
  9 + * @ClassName : StationRouteCache(站点路由缓存实体类)
  10 + *
  11 + * @Author : bsth@lq
  12 + *
  13 + * @Description : TODO(站点路由)
  14 + *
  15 + * @Data :2016-04-19
  16 + *
  17 + * @Version 公交调度系统BS版 0.1
  18 + *
  19 + */
  20 +
  21 +@Entity
  22 +@Table(name = "bsth_c_stationroute_cache")
  23 +@NamedEntityGraphs({
  24 + @NamedEntityGraph(name = "stationRoute_station_cache", attributeNodes = {
  25 + @NamedAttributeNode("station"),
  26 + @NamedAttributeNode("line")
  27 + })
  28 +})
  29 +public class StationRouteCache {
  30 +
  31 + //站点路由ID
  32 + @Id
  33 + @GeneratedValue(strategy = GenerationType.IDENTITY)
  34 + private Integer id;
  35 +
  36 + // 站点路由序号
  37 + private Integer stationRouteCode;
  38 +
  39 + // 站点编码
  40 + private String stationCode;
  41 +
  42 + // 站点名称
  43 + private String stationName;
  44 +
  45 + // 线路编码
  46 + private String lineCode;
  47 +
  48 + // 行业编码
  49 + private String industryCode;
  50 + /**
  51 + * 站点类型
  52 + *
  53 + * ------ B:起点站
  54 + *
  55 + * ------ Z:中途站
  56 + *
  57 + * ------ E:终点站
  58 + *
  59 + * ------ T:停车场
  60 + *
  61 + */
  62 + private String stationMark;
  63 +
  64 + // 站点路由出站序号
  65 + private Integer outStationNmber;
  66 +
  67 + // 站点路由到站距离
  68 + private Double distances;
  69 +
  70 + // 站点路由到站时间
  71 + private Double toTime;
  72 +
  73 + // 首班时间
  74 + private String firstTime;
  75 +
  76 + // 末班时间
  77 + private String endTime;
  78 +
  79 + // 站点路由方向
  80 + private Integer directions;
  81 +
  82 + // 版本号
  83 + private Integer versions;
  84 +
  85 + // 是否撤销
  86 + private Integer destroy;
  87 +
  88 + // 描述
  89 + private String descriptions;
  90 +
  91 + // 创建人
  92 + private Integer createBy;
  93 +
  94 + // 修改人
  95 + private Integer updateBy;
  96 +
  97 + // 创建日期
  98 +// @Column(updatable = false, name = "create_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP")
  99 + @Column(updatable = false, name = "create_date")
  100 + private Date createDate;
  101 +
  102 + // 修改日期
  103 +// @Column(name = "update_date", columnDefinition = "timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP")
  104 + @Column(name = "update_date")
  105 + private Date updateDate;
  106 +
  107 + // 站点信息
  108 + @ManyToOne(fetch = FetchType.LAZY)
  109 + private Station station;
  110 +
  111 + // 线路信息
  112 + @ManyToOne
  113 + private Line line;
  114 +
  115 + public Integer getId() {
  116 + return id;
  117 + }
  118 +
  119 + public void setId(Integer id) {
  120 + this.id = id;
  121 + }
  122 +
  123 + public Integer getStationRouteCode() {
  124 + return stationRouteCode;
  125 + }
  126 +
  127 + public void setStationRouteCode(Integer stationRouteCode) {
  128 + this.stationRouteCode = stationRouteCode;
  129 + }
  130 +
  131 + public String getStationCode() {
  132 + return stationCode;
  133 + }
  134 +
  135 + public void setStationCode(String stationCode) {
  136 + this.stationCode = stationCode;
  137 + }
  138 +
  139 + public String getStationName() {
  140 + return stationName;
  141 + }
  142 +
  143 + public void setStationName(String stationName) {
  144 + this.stationName = stationName;
  145 + }
  146 +
  147 + public String getLineCode() {
  148 + return lineCode;
  149 + }
  150 +
  151 + public void setLineCode(String lineCode) {
  152 + this.lineCode = lineCode;
  153 + }
  154 +
  155 + public String getIndustryCode() {
  156 + return industryCode;
  157 + }
  158 +
  159 + public void setIndustryCode(String industryCode) {
  160 + this.industryCode = industryCode;
  161 + }
  162 +
  163 + public String getStationMark() {
  164 + return stationMark;
  165 + }
  166 +
  167 + public void setStationMark(String stationMark) {
  168 + this.stationMark = stationMark;
  169 + }
  170 +
  171 + public Integer getOutStationNmber() {
  172 + return outStationNmber;
  173 + }
  174 +
  175 + public void setOutStationNmber(Integer outStationNmber) {
  176 + this.outStationNmber = outStationNmber;
  177 + }
  178 +
  179 + public Double getDistances() {
  180 + return distances;
  181 + }
  182 +
  183 + public void setDistances(Double distances) {
  184 + this.distances = distances;
  185 + }
  186 +
  187 + public Double getToTime() {
  188 + return toTime;
  189 + }
  190 +
  191 + public void setToTime(Double toTime) {
  192 + this.toTime = toTime;
  193 + }
  194 +
  195 + public String getFirstTime() {
  196 + return firstTime;
  197 + }
  198 +
  199 + public void setFirstTime(String firstTime) {
  200 + this.firstTime = firstTime;
  201 + }
  202 +
  203 + public String getEndTime() {
  204 + return endTime;
  205 + }
  206 +
  207 + public void setEndTime(String endTime) {
  208 + this.endTime = endTime;
  209 + }
  210 +
  211 + public Integer getDirections() {
  212 + return directions;
  213 + }
  214 +
  215 + public void setDirections(Integer directions) {
  216 + this.directions = directions;
  217 + }
  218 +
  219 + public Integer getVersions() {
  220 + return versions;
  221 + }
  222 +
  223 + public void setVersions(Integer versions) {
  224 + this.versions = versions;
  225 + }
  226 +
  227 + public Integer getDestroy() {
  228 + return destroy;
  229 + }
  230 +
  231 + public void setDestroy(Integer destroy) {
  232 + this.destroy = destroy;
  233 + }
  234 +
  235 + public String getDescriptions() {
  236 + return descriptions;
  237 + }
  238 +
  239 + public void setDescriptions(String descriptions) {
  240 + this.descriptions = descriptions;
  241 + }
  242 +
  243 + public Integer getCreateBy() {
  244 + return createBy;
  245 + }
  246 +
  247 + public void setCreateBy(Integer createBy) {
  248 + this.createBy = createBy;
  249 + }
  250 +
  251 + public Integer getUpdateBy() {
  252 + return updateBy;
  253 + }
  254 +
  255 + public void setUpdateBy(Integer updateBy) {
  256 + this.updateBy = updateBy;
  257 + }
  258 +
  259 + public Date getCreateDate() {
  260 + return createDate;
  261 + }
  262 +
  263 + public void setCreateDate(Date createDate) {
  264 + this.createDate = createDate;
  265 + }
  266 +
  267 + public Date getUpdateDate() {
  268 + return updateDate;
  269 + }
  270 +
  271 + public void setUpdateDate(Date updateDate) {
  272 + this.updateDate = updateDate;
  273 + }
  274 +
  275 + public Station getStation() {
  276 + return station;
  277 + }
  278 +
  279 + public void setStation(Station station) {
  280 + this.station = station;
  281 + }
  282 +
  283 + public Line getLine() {
  284 + return line;
  285 + }
  286 +
  287 + public void setLine(Line line) {
  288 + this.line = line;
  289 + }
  290 +}
src/test/java/com/bsth/entity/realcontrol/ChildTaskPlan.java 0 → 100644
  1 +package com.bsth.entity.realcontrol;
  2 +
  3 +import com.fasterxml.jackson.annotation.JsonIgnore;
  4 +
  5 +import javax.persistence.*;
  6 +import java.util.Date;
  7 +
  8 +
  9 +/**
  10 + *
  11 + * @ClassName: ChildTaskPlan
  12 + * @Description: TODO(子任务)
  13 + * @author PanZhao
  14 + * @date 2016年6月20日 上午11:22:22
  15 + *
  16 + */
  17 +@Entity
  18 +@Table(name = "bsth_c_s_child_task")
  19 +@NamedEntityGraphs({
  20 + @NamedEntityGraph(name = "childTaskPlan_schedule", attributeNodes = {
  21 + @NamedAttributeNode("schedule")
  22 + })
  23 +})
  24 +public class ChildTaskPlan {
  25 +
  26 + @Id
  27 + @GeneratedValue
  28 + private Long id;
  29 +
  30 + /**
  31 + * 任务类型1
  32 + * 正常,临加
  33 + */
  34 + private String type1;
  35 +
  36 + /**
  37 + * 任务类型2
  38 + * 1 正常 2 进场 3 出场
  39 + */
  40 + private String type2;
  41 +
  42 + /**
  43 + * 起点
  44 + */
  45 + private String startStation;
  46 +
  47 + /**
  48 + * 起点站名称
  49 + */
  50 + private String startStationName;
  51 +
  52 + /**
  53 + * 终点
  54 + */
  55 + private String endStation;
  56 +
  57 + /**
  58 + * 终点站名称
  59 + */
  60 + private String endStationName;
  61 +
  62 + /**
  63 + * 里程类型
  64 + */
  65 + private String mileageType;
  66 +
  67 + /**
  68 + * 里程
  69 + */
  70 + private Float mileage;
  71 +
  72 + /**
  73 + * 开始时间 HH:mm
  74 + */
  75 + private String startDate;
  76 +
  77 + /**
  78 + * 结束时间 HH:mm
  79 + */
  80 + private String endDate;
  81 +
  82 + /**
  83 + * 是否烂班
  84 + */
  85 + private boolean destroy;
  86 +
  87 + /**
  88 + * 烂班原因 -烂班时,该字段仍有值并 =reason
  89 + */
  90 + private String destroyReason;
  91 +
  92 + /**
  93 + * 包括 烂班原因、进出场原因、换车原因 等
  94 + */
  95 + private String reason;
  96 +
  97 + /**
  98 + * 车辆 如果为空,继承主任务
  99 + */
  100 + private String nbbm;
  101 +
  102 + /**
  103 + * 中途换车营运, 新车关联的主任务ID,子任务删除时,主任务ID将级联
  104 + */
  105 + private Long ccId;
  106 +
  107 + /**
  108 + * 为true 则无售票员, 否则继承主任务
  109 + */
  110 + private boolean noClerk;
  111 +
  112 + /** 创建日期 */
  113 +// @Column(updatable = false, name = "create_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP")
  114 + @Column(updatable = false, name = "create_date")
  115 + private Date createDate;
  116 +
  117 + /**
  118 + * 主排班计划
  119 + */
  120 + @JsonIgnore
  121 + @ManyToOne(fetch = FetchType.LAZY)
  122 + private ScheduleRealInfo schedule;
  123 +
  124 + private String remarks;
  125 +
  126 + public Long getId() {
  127 + return id;
  128 + }
  129 +
  130 + public void setId(Long id) {
  131 + this.id = id;
  132 + }
  133 +
  134 + public String getType1() {
  135 + return type1;
  136 + }
  137 +
  138 + public void setType1(String type1) {
  139 + this.type1 = type1;
  140 + }
  141 +
  142 + public String getType2() {
  143 + return type2;
  144 + }
  145 +
  146 + public void setType2(String type2) {
  147 + this.type2 = type2;
  148 + }
  149 +
  150 + public String getStartStation() {
  151 + return startStation;
  152 + }
  153 +
  154 + public void setStartStation(String startStation) {
  155 + this.startStation = startStation;
  156 + }
  157 +
  158 + public String getEndStation() {
  159 + return endStation;
  160 + }
  161 +
  162 + public void setEndStation(String endStation) {
  163 + this.endStation = endStation;
  164 + }
  165 +
  166 + public String getMileageType() {
  167 + return mileageType;
  168 + }
  169 +
  170 + public void setMileageType(String mileageType) {
  171 + this.mileageType = mileageType;
  172 + }
  173 +
  174 + public Float getMileage() {
  175 + return mileage;
  176 + }
  177 +
  178 + public void setMileage(Float mileage) {
  179 + this.mileage = mileage;
  180 + }
  181 +
  182 + public String getStartDate() {
  183 + return startDate;
  184 + }
  185 +
  186 + public void setStartDate(String startDate) {
  187 + this.startDate = startDate;
  188 + }
  189 +
  190 + public String getEndDate() {
  191 + return endDate;
  192 + }
  193 +
  194 + public void setEndDate(String endDate) {
  195 + this.endDate = endDate;
  196 + }
  197 +
  198 + public boolean isDestroy() {
  199 + return destroy;
  200 + }
  201 +
  202 + public void setDestroy(boolean destroy) {
  203 + this.destroy = destroy;
  204 + }
  205 +
  206 + public String getDestroyReason() {
  207 + return destroyReason;
  208 + }
  209 +
  210 + public void setDestroyReason(String destroyReason) {
  211 + this.destroyReason = destroyReason;
  212 + }
  213 +
  214 + public ScheduleRealInfo getSchedule() {
  215 + return schedule;
  216 + }
  217 +
  218 + public void setSchedule(ScheduleRealInfo schedule) {
  219 + this.schedule = schedule;
  220 + }
  221 +
  222 + public String getRemarks() {
  223 + return remarks;
  224 + }
  225 +
  226 + public void setRemarks(String remarks) {
  227 + this.remarks = remarks;
  228 + }
  229 +
  230 + public String getStartStationName() {
  231 + return startStationName;
  232 + }
  233 +
  234 + public void setStartStationName(String startStationName) {
  235 + this.startStationName = startStationName;
  236 + }
  237 +
  238 + public String getEndStationName() {
  239 + return endStationName;
  240 + }
  241 +
  242 + public void setEndStationName(String endStationName) {
  243 + this.endStationName = endStationName;
  244 + }
  245 +
  246 + @Override
  247 + public int hashCode() {
  248 + return ("cTask" + this.getId() + this.getSchedule().getId()).hashCode();
  249 + }
  250 +
  251 + @Override
  252 + public boolean equals(Object obj) {
  253 + return this.id.equals(((ChildTaskPlan)obj).getId());
  254 + }
  255 +
  256 + public Date getCreateDate() {
  257 + return createDate;
  258 + }
  259 +
  260 + public void setCreateDate(Date createDate) {
  261 + this.createDate = createDate;
  262 + }
  263 +
  264 + public String getReason() {
  265 + return reason;
  266 + }
  267 +
  268 + public void setReason(String reason) {
  269 + this.reason = reason;
  270 + }
  271 +
  272 + public String getNbbm() {
  273 + return nbbm;
  274 + }
  275 +
  276 + public void setNbbm(String nbbm) {
  277 + this.nbbm = nbbm;
  278 + }
  279 +
  280 + public boolean isNoClerk() {
  281 + return noClerk;
  282 + }
  283 +
  284 + public void setNoClerk(boolean noClerk) {
  285 + this.noClerk = noClerk;
  286 + }
  287 +
  288 + public Long getCcId() {
  289 + return ccId;
  290 + }
  291 +
  292 + public void setCcId(Long ccId) {
  293 + this.ccId = ccId;
  294 + }
  295 +}
src/test/java/com/bsth/entity/realcontrol/ScheduleRealInfo.java 0 → 100644
  1 +package com.bsth.entity.realcontrol;
  2 +
  3 +import com.bsth.entity.sys.SysUser;
  4 +import com.fasterxml.jackson.annotation.JsonIgnore;
  5 +import org.apache.commons.lang3.StringUtils;
  6 +import org.joda.time.format.DateTimeFormat;
  7 +import org.joda.time.format.DateTimeFormatter;
  8 +
  9 +import javax.persistence.*;
  10 +import java.util.Date;
  11 +import java.util.HashSet;
  12 +import java.util.Set;
  13 +
  14 +/**
  15 + * 实际排班计划明细。
  16 + */
  17 +@Entity
  18 +@Table(name = "bsth_c_s_sp_info_real")
  19 +@NamedEntityGraphs({
  20 + @NamedEntityGraph(name = "scheduleRealInfo_cTasks", attributeNodes = {
  21 + @NamedAttributeNode("cTasks")
  22 + })
  23 +})
  24 +public class ScheduleRealInfo {
  25 + /** 主键Id */
  26 + @Id
  27 + private Long id;
  28 +
  29 + /** 计划ID */
  30 + private Long spId;
  31 +
  32 + /** 排班计划日期 --no webSocket */
  33 + private Date scheduleDate;
  34 + /** 排班日期字符串 YYYY-MM-DD */
  35 + private String scheduleDateStr;
  36 +
  37 + /** 真实执行时间 yyyy-MM-dd */
  38 + private String realExecDate;
  39 +
  40 + /** 线路名称 */
  41 + private String xlName;
  42 + /** 线路编码 */
  43 + private String xlBm;
  44 +
  45 + /** 路牌名称 */
  46 + private String lpName;
  47 +
  48 + /** 车辆自编号 */
  49 + private String clZbh;
  50 +
  51 + /** 驾驶员工号 */
  52 + private String jGh;
  53 + /** 驾驶员名字 */
  54 + private String jName;
  55 + /** 售票员工号 */
  56 + private String sGh;
  57 + /** 售票员名字 */
  58 + private String sName;
  59 +
  60 + /** 线路方向 */
  61 + private String xlDir;
  62 + /** 起点站code*/
  63 + private String qdzCode;
  64 + /** 起点站名字 */
  65 + private String qdzName;
  66 +
  67 + /** 终点站code*/
  68 + private String zdzCode;
  69 + /** 终点站名字 */
  70 + private String zdzName;
  71 +
  72 + /** 计划发车时间(格式 HH:mm) */
  73 + private String fcsj;
  74 + /** 计划发车时间戳*/
  75 + @Transient
  76 + private Long fcsjT;
  77 +
  78 + /** 计划终点时间(格式 HH:mm) */
  79 + private String zdsj;
  80 + /** 计划终点时间戳*/
  81 + @Transient
  82 + private Long zdsjT;
  83 +
  84 + /** 发车顺序号 --no webSocket*/
  85 + private Integer fcno;
  86 + /** 对应班次数 --no webSocket*/
  87 + private Integer bcs;
  88 + /** 计划里程 */
  89 + private Double jhlc;
  90 +
  91 + /** 原始计划里程 (原计调的数据) */
  92 + private Double jhlcOrig;
  93 +
  94 + /** 实际里程 --no webSocket*/
  95 + @Transient
  96 + @JsonIgnore
  97 + private Double realMileage;
  98 +
  99 + /** 实际里程 --no webSocket */
  100 + @Transient
  101 + private String sjlc;
  102 + /** 班次历时 */
  103 + private Integer bcsj;
  104 +
  105 + /**
  106 + * 班次类型 TODO:正常班次、出场、进场、加油、区间班次、放空班次、放大站班次、两点间空驶
  107 + */
  108 + private String bcType;
  109 +
  110 + //放站班次 站点名称
  111 + private String majorStationName;
  112 +
  113 + /** 创建人 */
  114 + @JsonIgnore
  115 + @ManyToOne(fetch = FetchType.LAZY)
  116 + private SysUser createBy;
  117 + /** 修改人 */
  118 + @JsonIgnore
  119 + @ManyToOne(fetch = FetchType.LAZY)
  120 + private SysUser updateBy;
  121 + /** 创建日期 */
  122 +// @Column(updatable = false, name = "create_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP")
  123 + @Column(updatable = false, name = "create_date")
  124 + private Date createDate;
  125 + /** 修改日期 */
  126 +// @Column(name = "update_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP")
  127 + @Column(name = "update_date")
  128 + private Date updateDate;
  129 +
  130 + /** 实际发车时间*/
  131 + private String fcsjActual;
  132 + /** 实际发车时间戳*/
  133 + @Transient
  134 + private Long fcsjActualTime;
  135 + /**实际终点时间 */
  136 + private String zdsjActual;
  137 + /** 实际终点时间戳*/
  138 + @Transient
  139 + private Long zdsjActualTime;
  140 +
  141 + /**班次状态 0 未执行 1 正在执行 2 已执行 -1 已烂班 */
  142 + private int status;
  143 +
  144 + private String adjustExps;
  145 +
  146 + /** 是否是临加班次 */
  147 + private boolean sflj;
  148 +
  149 + /** 是否误点 (应发未发)*/
  150 + @Transient
  151 + private boolean late;
  152 +
  153 + /** 是否误点 (应发未到) */
  154 + @Transient
  155 + private boolean late2;
  156 + /** 误点停靠时间 */
  157 + @Transient
  158 + private float lateMinute;
  159 +
  160 + /** 备注*/
  161 + private String remarks;
  162 +
  163 + /** 原计划排班备注 --no webSocket */
  164 + @Transient
  165 + private String remark;
  166 +
  167 + /**待发时间(格式 HH:mm) */
  168 + private String dfsj;
  169 +
  170 + /**待发时间戳 */
  171 + @Transient
  172 + private Long dfsjT;
  173 +
  174 + /** 指令下发状态 60: 已发送, 100: 设备确认收到, 200:驾驶员确认 0:失败 */
  175 + private Integer directiveState = -1;
  176 +
  177 + /** 起点站计划到达时间 */
  178 + @Transient
  179 + private String qdzArrDatejh;
  180 +
  181 + /** 起点站实际到达时间 */
  182 + @Transient
  183 + private String qdzArrDatesj;
  184 +
  185 + /** 子任务 */
  186 + @OneToMany(fetch = FetchType.LAZY, mappedBy = "schedule")
  187 + private Set<ChildTaskPlan> cTasks = new HashSet<>();
  188 +
  189 + /** 关联的公司名称 */
  190 + private String gsName;
  191 + /** 关联的公司编码 */
  192 + private String gsBm;
  193 + /** 关联的分公司名称 */
  194 + private String fgsName;
  195 + /** 关联的分公司编码 */
  196 + private String fgsBm;
  197 + /** 出场顺序号 */
  198 + private Integer ccno;
  199 +
  200 + //待发调试(是否自动调整)
  201 + private boolean dfAuto;
  202 + //是否有GPS信号
  203 + private boolean online;
  204 +
  205 + /** 是否有补发GPS信号 */
  206 + private boolean reissue;
  207 +
  208 + /** 发车屏 发车顺序号,不持久化,会动态变化 --no webSocket*/
  209 + @Transient
  210 + private int fcpSn;
  211 +
  212 + /** 标记班次已被删除 */
  213 + @Transient
  214 + @JsonIgnore
  215 + private boolean deleted;
  216 +
  217 + @Transient
  218 + @JsonIgnore
  219 + private int saveFailCount=0;
  220 +
  221 + /** 是否需要补充GPS信号 (网关提交至运管处动态数据用) 1: 能发车, 2:能到达 3: 补发过*/
  222 + private int siginCompate;
  223 +
  224 + /**
  225 + * 漂移状态
  226 + * 1: 发车漂移
  227 + * 2:到站漂移
  228 + * 3:中途漂移
  229 + */
  230 + private Integer driftStatus = 0;
  231 +
  232 + /**
  233 + * 换车营运标记 true 表示该主任务由 【中途换车子任务】 级联生成
  234 + */
  235 + private boolean ccService;
  236 + private Integer lpChange;
  237 +
  238 + public Integer getLpChange() {
  239 + return lpChange;
  240 + }
  241 +
  242 + public void setLpChange(Integer lpChange) {
  243 + this.lpChange = lpChange;
  244 + }
  245 +
  246 + public boolean isDfAuto() {
  247 + return dfAuto;
  248 + }
  249 +
  250 + public void setDfAuto(boolean dfAuto) {
  251 + this.dfAuto = dfAuto;
  252 + }
  253 +
  254 + public boolean isOnline() {
  255 + return online;
  256 + }
  257 +
  258 + public void setOnline(boolean online) {
  259 + this.online = online;
  260 + }
  261 +
  262 + public String getQdzArrDatejh() {
  263 + return qdzArrDatejh;
  264 + }
  265 +
  266 + public void setQdzArrDatejh(String qdzArrDatejh) {
  267 + this.qdzArrDatejh = qdzArrDatejh;
  268 + }
  269 +
  270 + public String getQdzArrDatesj() {
  271 + return qdzArrDatesj;
  272 + }
  273 +
  274 + public void setQdzArrDatesj(String qdzArrDatesj) {
  275 + this.qdzArrDatesj = qdzArrDatesj;
  276 + }
  277 +
  278 + public void setcTasks(Set<ChildTaskPlan> cTasks) {
  279 + this.cTasks = cTasks;
  280 + }
  281 +
  282 + public String getGsName() {
  283 + return gsName;
  284 + }
  285 +
  286 + public void setGsName(String gsName) {
  287 + this.gsName = gsName;
  288 + }
  289 +
  290 + public String getGsBm() {
  291 + return gsBm;
  292 + }
  293 +
  294 + public void setGsBm(String gsBm) {
  295 + this.gsBm = gsBm;
  296 + }
  297 +
  298 + public String getFgsName() {
  299 + return fgsName;
  300 + }
  301 +
  302 + public void setFgsName(String fgsName) {
  303 + this.fgsName = fgsName;
  304 + }
  305 +
  306 + public String getFgsBm() {
  307 + return fgsBm;
  308 + }
  309 +
  310 + public void setFgsBm(String fgsBm) {
  311 + this.fgsBm = fgsBm;
  312 + }
  313 +
  314 + public Integer getCcno() {
  315 + return ccno;
  316 + }
  317 +
  318 + public void setCcno(Integer ccno) {
  319 + this.ccno = ccno;
  320 + }
  321 +
  322 +
  323 + /** ----------------
  324 + @OneToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
  325 + private RealTimeModel sjfcModel;
  326 + @OneToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
  327 + private RealTimeModel sjddModel;
  328 + */
  329 + public void addRemarks(String remark){
  330 + if(StringUtils.isBlank(remark))
  331 + return;
  332 + String old = this.getRemarks();
  333 + if(StringUtils.isBlank(old))
  334 + old = "";
  335 +
  336 + old += remark + ";";
  337 + this.setRemarks(old);
  338 +
  339 + }
  340 +
  341 + public Long getId() {
  342 + return id;
  343 + }
  344 +
  345 + public void setId(Long id) {
  346 + this.id = id;
  347 + }
  348 +
  349 + public Date getScheduleDate() {
  350 + return scheduleDate;
  351 + }
  352 +
  353 + public void setScheduleDate(Date scheduleDate) {
  354 + this.scheduleDate = scheduleDate;
  355 + }
  356 +
  357 + public String getXlName() {
  358 + return xlName;
  359 + }
  360 +
  361 + public void setXlName(String xlName) {
  362 + this.xlName = xlName;
  363 + }
  364 +
  365 + public String getXlBm() {
  366 + return xlBm;
  367 + }
  368 +
  369 + public void setXlBm(String xlBm) {
  370 + this.xlBm = xlBm;
  371 + }
  372 +
  373 + public String getLpName() {
  374 + return lpName;
  375 + }
  376 +
  377 + public void setLpName(String lpName) {
  378 + this.lpName = lpName;
  379 + }
  380 +
  381 + public String getClZbh() {
  382 + return clZbh;
  383 + }
  384 +
  385 + public void setClZbh(String clZbh) {
  386 + this.clZbh = clZbh;
  387 + }
  388 +
  389 + public String getjGh() {
  390 + return jGh;
  391 + }
  392 +
  393 + public void setjGh(String jGh) {
  394 + this.jGh = jGh;
  395 + }
  396 +
  397 + public String getjName() {
  398 + return jName;
  399 + }
  400 +
  401 + public void setjName(String jName) {
  402 + this.jName = jName;
  403 + }
  404 +
  405 + public String getsGh() {
  406 + if(sGh == null)
  407 + return "";
  408 + return sGh;
  409 + }
  410 +
  411 + public void setsGh(String sGh) {
  412 + this.sGh = sGh;
  413 + }
  414 +
  415 + public String getsName() {
  416 + if(sGh == null)
  417 + return "";
  418 + return sName;
  419 + }
  420 +
  421 + public void setsName(String sName) {
  422 + this.sName = sName;
  423 + }
  424 +
  425 + public String getXlDir() {
  426 + return xlDir;
  427 + }
  428 +
  429 + public void setXlDir(String xlDir) {
  430 + this.xlDir = xlDir;
  431 + }
  432 +
  433 + public String getQdzCode() {
  434 + return qdzCode;
  435 + }
  436 +
  437 + public void setQdzCode(String qdzCode) {
  438 + this.qdzCode = qdzCode;
  439 + }
  440 +
  441 + public String getQdzName() {
  442 + return qdzName;
  443 + }
  444 +
  445 + public void setQdzName(String qdzName) {
  446 + this.qdzName = qdzName;
  447 + }
  448 +
  449 + public String getZdzCode() {
  450 + return zdzCode;
  451 + }
  452 +
  453 + public void setZdzCode(String zdzCode) {
  454 + this.zdzCode = zdzCode;
  455 + }
  456 +
  457 + public String getZdzName() {
  458 + return zdzName;
  459 + }
  460 +
  461 + public void setZdzName(String zdzName) {
  462 + this.zdzName = zdzName;
  463 + }
  464 +
  465 + public String getFcsj() {
  466 + return fcsj;
  467 + }
  468 +
  469 + public void setFcsj(String fcsj) {
  470 + this.fcsj = fcsj;
  471 + }
  472 +
  473 + public Long getFcsjT() {
  474 + return fcsjT;
  475 + }
  476 +
  477 + public void setFcsjT(Long fcsjT) {
  478 + this.fcsjT = fcsjT;
  479 + }
  480 +
  481 + public String getZdsj() {
  482 + return zdsj;
  483 + }
  484 +
  485 + public void setZdsj(String zdsj) {
  486 + this.zdsj = zdsj;
  487 + }
  488 +
  489 + public Long getZdsjT() {
  490 + return zdsjT;
  491 + }
  492 +
  493 + public void setZdsjT(Long zdsjT) {
  494 + this.zdsjT = zdsjT;
  495 + }
  496 +
  497 + public Integer getFcno() {
  498 + return fcno;
  499 + }
  500 +
  501 + public void setFcno(Integer fcno) {
  502 + this.fcno = fcno;
  503 + }
  504 +
  505 + public Integer getBcs() {
  506 + return bcs;
  507 + }
  508 +
  509 + public void setBcs(Integer bcs) {
  510 + this.bcs = bcs;
  511 + }
  512 +
  513 + public Double getJhlc() {
  514 + return jhlc;
  515 + }
  516 +
  517 + public void setJhlc(Double jhlc) {
  518 + this.jhlc = jhlc;
  519 + //临加班次 计划公里 和 实际计划公里一样
  520 + if(this.isSflj())
  521 + this.setJhlcOrig(this.getJhlc());
  522 + }
  523 +
  524 + public String getSjlc() {
  525 + return sjlc;
  526 + }
  527 +
  528 + public void setSjlc(String sjlc) {
  529 + this.sjlc = sjlc;
  530 + }
  531 +
  532 + public Integer getBcsj() {
  533 + return bcsj;
  534 + }
  535 +
  536 + public void setBcsj(Integer bcsj) {
  537 + this.bcsj = bcsj;
  538 + }
  539 +
  540 + public String getBcType() {
  541 + return bcType;
  542 + }
  543 +
  544 + public void setBcType(String bcType) {
  545 + this.bcType = bcType;
  546 + }
  547 +
  548 + public SysUser getCreateBy() {
  549 + return createBy;
  550 + }
  551 +
  552 + public void setCreateBy(SysUser createBy) {
  553 + this.createBy = createBy;
  554 + }
  555 +
  556 + public SysUser getUpdateBy() {
  557 + return updateBy;
  558 + }
  559 +
  560 + public void setUpdateBy(SysUser updateBy) {
  561 + this.updateBy = updateBy;
  562 + }
  563 +
  564 + public Date getCreateDate() {
  565 + return createDate;
  566 + }
  567 +
  568 + public void setCreateDate(Date createDate) {
  569 + this.createDate = createDate;
  570 + }
  571 +
  572 + public Date getUpdateDate() {
  573 + return updateDate;
  574 + }
  575 +
  576 + public void setUpdateDate(Date updateDate) {
  577 + this.updateDate = updateDate;
  578 + }
  579 +
  580 + public String getFcsjActual() {
  581 + return fcsjActual;
  582 + }
  583 +
  584 + public void setFcsjActual(String fcsjActual) {
  585 + this.fcsjActual = fcsjActual;
  586 + }
  587 +
  588 + public Long getFcsjActualTime() {
  589 + return fcsjActualTime;
  590 + }
  591 +
  592 + public void setFcsjActualTime(Long fcsjActualTime) {
  593 + this.fcsjActualTime = fcsjActualTime;
  594 + }
  595 +
  596 + public String getZdsjActual() {
  597 + return zdsjActual;
  598 + }
  599 +
  600 + public void setZdsjActual(String zdsjActual) {
  601 + this.zdsjActual = zdsjActual;
  602 + }
  603 +
  604 + public Long getZdsjActualTime() {
  605 + return zdsjActualTime;
  606 + }
  607 +
  608 + public void setZdsjActualTime(Long zdsjActualTime) {
  609 + this.zdsjActualTime = zdsjActualTime;
  610 + }
  611 +
  612 + public int getStatus() {
  613 + return status;
  614 + }
  615 +
  616 + public void setStatus(int status) {
  617 + this.status = status;
  618 + }
  619 +
  620 + public String getRemarks() {
  621 + return remarks;
  622 + }
  623 +
  624 + public void setRemarks(String remarks) {
  625 + this.remarks = remarks;
  626 + }
  627 +
  628 + public String getDfsj() {
  629 + return dfsj;
  630 + }
  631 +
  632 + public void setDfsj(String dfsj) {
  633 + this.dfsj = dfsj;
  634 + }
  635 +
  636 + public Long getDfsjT() {
  637 + return dfsjT;
  638 + }
  639 +
  640 + public void setDfsjT(Long dfsjT) {
  641 + this.dfsjT = dfsjT;
  642 + }
  643 +
  644 +
  645 + @Transient
  646 + private static DateTimeFormatter fmtHHmm = DateTimeFormat.forPattern("HH:mm");
  647 + @Transient
  648 + private static DateTimeFormatter fmtyyyyMMddHHmm = DateTimeFormat.forPattern("yyyy-MM-ddHH:mm");
  649 +
  650 + public void setDfsjAll(Long dfsjT) {
  651 + this.dfsjT = dfsjT;
  652 + this.dfsj = fmtHHmm.print(this.dfsjT);
  653 + }
  654 +
  655 + public void setDfsjAll(String dfsj) {
  656 + this.dfsjT = fmtyyyyMMddHHmm.parseMillis(this.realExecDate + dfsj);
  657 + this.dfsj = dfsj;
  658 + }
  659 +
  660 + public void calcEndTime(){
  661 + //计划终点时间
  662 + if(this.getBcsj() != null){
  663 + //this.setZdsjT(this.getDfsjT() + (this.getBcsj() * 60 * 1000));
  664 + this.setZdsjT(this.getFcsjT() + (this.getBcsj() * 60 * 1000));//计划终点时间不变
  665 + this.setZdsj(fmtHHmm.print(this.zdsjT));
  666 + }
  667 + }
  668 +
  669 + public Integer getDirectiveState() {
  670 + return directiveState;
  671 + }
  672 +
  673 + public void setDirectiveState(Integer directiveState) {
  674 + this.directiveState = directiveState;
  675 + }
  676 +
  677 + @Override
  678 + public boolean equals(Object obj) {
  679 + try{
  680 + return this.id.equals(((ScheduleRealInfo)obj).getId());
  681 + }catch(Exception e){
  682 + return false;
  683 + }
  684 + }
  685 +
  686 + @Override
  687 + public int hashCode() {
  688 + return ("schedule_" + this.id).hashCode();
  689 + }
  690 +
  691 + public boolean isSflj() {
  692 + return sflj;
  693 + }
  694 +
  695 + public void setSflj(boolean sflj) {
  696 + this.sflj = sflj;
  697 + }
  698 +
  699 + /**
  700 + *
  701 + * @Title: setFcsjAll
  702 + * @Description: TODO(设置计划发车时间)
  703 + * @throws
  704 + */
  705 + public void setFcsjAll(String fcsj){
  706 + this.fcsjT = fmtyyyyMMddHHmm.parseMillis(this.realExecDate + fcsj);
  707 + this.fcsj = fcsj;
  708 + }
  709 +
  710 + /**
  711 + *
  712 + * @Title: setFcsjAll
  713 + * @Description: TODO(设置计划发车时间)
  714 + * @throws
  715 + */
  716 + public void setFcsjAll(Long fcsjT){
  717 + this.fcsjT = fcsjT;
  718 + this.fcsj = fmtHHmm.print(fcsjT);
  719 + }
  720 +
  721 + /**
  722 + *
  723 + * @Title: setFcsjActualAll
  724 + * @Description: TODO(设置实际发车时间 字符串)
  725 + * @throws
  726 + */
  727 + public void setFcsjActualAll(String fcsjActual){
  728 + this.fcsjActualTime = fmtyyyyMMddHHmm.parseMillis(this.realExecDate + fcsjActual);
  729 + this.fcsjActual = fcsjActual;
  730 + calcStatus();
  731 + }
  732 +
  733 + /**
  734 + *
  735 + * @Title: setFcsjActualAll
  736 + * @Description: TODO(设置实际发车时间 时间戳)
  737 + * @throws
  738 + */
  739 + public void setFcsjActualAll(Long t){
  740 +
  741 + this.fcsjActualTime = t;
  742 + if(null == t)
  743 + this.fcsjActual = null;
  744 + else
  745 + this.fcsjActual = fmtHHmm.print(t);
  746 +
  747 + //更新班次状态
  748 + calcStatus();
  749 + }
  750 +
  751 + /**
  752 + *
  753 + * @Title: setFcsjActualAll
  754 + * @Description: TODO(设置实际终点时间)
  755 + * @throws
  756 + */
  757 + public void setZdsjActualAll(Long t){
  758 + this.zdsjActualTime = t;
  759 +
  760 + if(null == t)
  761 + this.zdsjActual = null;
  762 + else
  763 + this.zdsjActual = fmtHHmm.print(t);
  764 +
  765 + //更新班次状态
  766 + calcStatus();
  767 + }
  768 +
  769 + /**
  770 + *
  771 + * @Title: setFcsjActualAll
  772 + * @Description: TODO(设置实际终点时间)
  773 + * @throws
  774 + */
  775 + public void setZdsjActualAll(String zdsjActual){
  776 + this.zdsjActualTime = fmtyyyyMMddHHmm.parseMillis(this.realExecDate + zdsjActual);
  777 + this.zdsjActual = zdsjActual;
  778 +
  779 + calcStatus();
  780 + }
  781 +
  782 + public Long getSpId() {
  783 + return spId;
  784 + }
  785 +
  786 + public void setSpId(Long spId) {
  787 + this.spId = spId;
  788 + }
  789 +
  790 + public String getRealExecDate() {
  791 + return realExecDate;
  792 + }
  793 +
  794 + public void setRealExecDate(String realExecDate) {
  795 + this.realExecDate = realExecDate;
  796 + }
  797 +
  798 + public void calcStatus() {
  799 + if(this.status == -1)
  800 + return;
  801 +
  802 + this.status = 0;
  803 + if(StringUtils.isNotBlank(this.fcsjActual)){
  804 + this.status = 1;
  805 +
  806 + //进出场班次并且没有计划里程的
  807 + if((this.bcType.equals("out") || this.bcType.equals("in"))
  808 + && this.jhlc == null){
  809 + this.status = 2;
  810 + }
  811 + }
  812 + if(StringUtils.isNotBlank(this.zdsjActual))
  813 + this.status = 2;
  814 + }
  815 +
  816 + public void destroy(){
  817 + this.jhlc = 0.0;
  818 + if(this.isSflj())
  819 + this.jhlcOrig = 0.0;
  820 + this.status = -1;
  821 + this.clearFcsjActual();
  822 + }
  823 +
  824 + public boolean isDestroy(){
  825 + return this.status == -1;
  826 + }
  827 +
  828 +/* public boolean isNotDestroy(){
  829 + return this.status != -1;
  830 + }*/
  831 +
  832 + public Set<ChildTaskPlan> getcTasks() {
  833 + return cTasks;
  834 + }
  835 +
  836 +/* public void setcTasks(Set<ChildTaskPlan> cTasks) {
  837 + this.cTasks = cTasks;
  838 + }*/
  839 +
  840 + public String getScheduleDateStr() {
  841 + return scheduleDateStr;
  842 + }
  843 +
  844 + public void setScheduleDateStr(String scheduleDateStr) {
  845 + this.scheduleDateStr = scheduleDateStr;
  846 + }
  847 +
  848 + public void clearFcsjActual(){
  849 + this.setFcsjActual(null);
  850 + this.setFcsjActualTime(null);
  851 + this.calcStatus();
  852 + }
  853 +
  854 + //清除实际终点时间
  855 + public void clearZdsjActual(){
  856 + this.setZdsjActual(null);
  857 + this.setZdsjActualTime(null);
  858 +
  859 + calcStatus();
  860 + }
  861 +
  862 + public boolean isLate() {
  863 + return late;
  864 + }
  865 +
  866 + public void setLate(boolean late) {
  867 + this.late = late;
  868 + }
  869 +
  870 + public String getAdjustExps() {
  871 + return adjustExps;
  872 + }
  873 +
  874 + public void setAdjustExps(String adjustExps) {
  875 + this.adjustExps = adjustExps;
  876 + }
  877 +
  878 + public boolean isReissue() {
  879 + return reissue;
  880 + }
  881 +
  882 + public void setReissue(boolean reissue) {
  883 + this.reissue = reissue;
  884 + }
  885 +
  886 + public Double getRealMileage() {
  887 + return realMileage;
  888 + }
  889 +
  890 + public void setRealMileage(Double realMileage) {
  891 + this.realMileage = realMileage;
  892 + }
  893 +
  894 + public Double getJhlcOrig() {
  895 + return jhlcOrig;
  896 + }
  897 +
  898 + public void setJhlcOrig(Double jhlcOrig) {
  899 + this.jhlcOrig = jhlcOrig;
  900 + }
  901 +
  902 + public void reCalcLate() {
  903 + if(this.getStatus() == 0
  904 + && this.getFcsjActual() == null
  905 + && this.dfsjT < System.currentTimeMillis()){
  906 + this.setLate(true);
  907 + }
  908 + else
  909 + this.setLate(false);
  910 + }
  911 +
  912 + public String getRemark() {
  913 + return remark;
  914 + }
  915 +
  916 + public void setRemark(String remark) {
  917 + this.remark = remark;
  918 + }
  919 +
  920 + public float getLateMinute() {
  921 + return lateMinute;
  922 + }
  923 +
  924 + public void setLateMinute(float lateMinute) {
  925 + this.lateMinute = lateMinute;
  926 + }
  927 +
  928 + public boolean isLate2() {
  929 + return late2;
  930 + }
  931 +
  932 + public void setLate2(boolean late2) {
  933 + this.late2 = late2;
  934 + }
  935 +
  936 + public int getFcpSn() {
  937 + return fcpSn;
  938 + }
  939 +
  940 + public void setFcpSn(int fcpSn) {
  941 + this.fcpSn = fcpSn;
  942 + }
  943 +
  944 + public boolean _isInout(){
  945 + return this.getBcType().equals("out") || this.getBcType().equals("in");
  946 + }
  947 +
  948 + public boolean isDeleted() {
  949 + return deleted;
  950 + }
  951 +
  952 + public void setDeleted(boolean deleted) {
  953 + this.deleted = deleted;
  954 + }
  955 +
  956 + public int getSaveFailCount() {
  957 + return saveFailCount;
  958 + }
  959 +
  960 + public void setSaveFailCount(int saveFailCount) {
  961 + this.saveFailCount = saveFailCount;
  962 + }
  963 +
  964 + public int getSiginCompate() {
  965 + return siginCompate;
  966 + }
  967 +
  968 + public void setSiginCompate(int siginCompate) {
  969 + this.siginCompate = siginCompate;
  970 + }
  971 +
  972 + public Integer getDriftStatus() {
  973 + return driftStatus;
  974 + }
  975 +
  976 + public void setDriftStatus(Integer driftStatus) {
  977 + this.driftStatus = driftStatus;
  978 + }
  979 +
  980 + public boolean isCcService() {
  981 + return ccService;
  982 + }
  983 +
  984 + public void setCcService(boolean ccService) {
  985 + this.ccService = ccService;
  986 + }
  987 +
  988 + public String getMajorStationName() {
  989 + return majorStationName;
  990 + }
  991 +
  992 + public void setMajorStationName(String majorStationName) {
  993 + this.majorStationName = majorStationName;
  994 + }
  995 +}
src/test/java/com/bsth/entity/schedule/BusinessInfo.java 0 → 100644
  1 +package com.bsth.entity.schedule;
  2 +
  3 +import javax.persistence.*;
  4 +import java.util.Date;
  5 +
  6 +/**
  7 + * 线路运营信息汇总。
  8 + * TODO:暂时这样写,演示后重新修正
  9 + */
  10 +@Entity
  11 +@Table(name = "bsth_c_s_bi")
  12 +public class BusinessInfo {
  13 +
  14 + /** 主键Id */
  15 + @Id
  16 + @GeneratedValue
  17 + private Long id;
  18 +
  19 + /** TODO:之后修正 */
  20 + /** 线路名称 */
  21 + private String xlName;
  22 + /** 线路编码 */
  23 + private String xlBm;
  24 + /** 公司名称 */
  25 + private String gsName;
  26 + /** 分公司名称 */
  27 + private String fgsName;
  28 +
  29 + /** 配车数 */
  30 + private int pcCount;
  31 + /** 人员数 */
  32 + private int ryCount;
  33 + /** 路牌数 */
  34 + private int lpCount;
  35 + /** 套跑数 */
  36 + private int tpCount;
  37 + /** 时刻表数 */
  38 + private int ttCount;
  39 + /** 调度规则数 */
  40 + private int srCount;
  41 + /** 调度计划数 */
  42 + private int spCount;
  43 +
  44 + // 创建日期
  45 +// @Column(updatable = false, name = "create_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP")
  46 + @Column(updatable = false, name = "create_date")
  47 + private Date createDate;
  48 + // 修改日期
  49 +// @Column(name = "update_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP")
  50 + @Column(name = "update_date")
  51 + private Date updateDate;
  52 +
  53 + public Long getId() {
  54 + return id;
  55 + }
  56 +
  57 + public void setId(Long id) {
  58 + this.id = id;
  59 + }
  60 +
  61 + public String getXlName() {
  62 + return xlName;
  63 + }
  64 +
  65 + public void setXlName(String xlName) {
  66 + this.xlName = xlName;
  67 + }
  68 +
  69 + public String getXlBm() {
  70 + return xlBm;
  71 + }
  72 +
  73 + public void setXlBm(String xlBm) {
  74 + this.xlBm = xlBm;
  75 + }
  76 +
  77 + public String getGsName() {
  78 + return gsName;
  79 + }
  80 +
  81 + public void setGsName(String gsName) {
  82 + this.gsName = gsName;
  83 + }
  84 +
  85 + public String getFgsName() {
  86 + return fgsName;
  87 + }
  88 +
  89 + public void setFgsName(String fgsName) {
  90 + this.fgsName = fgsName;
  91 + }
  92 +
  93 + public int getPcCount() {
  94 + return pcCount;
  95 + }
  96 +
  97 + public void setPcCount(int pcCount) {
  98 + this.pcCount = pcCount;
  99 + }
  100 +
  101 + public int getRyCount() {
  102 + return ryCount;
  103 + }
  104 +
  105 + public void setRyCount(int ryCount) {
  106 + this.ryCount = ryCount;
  107 + }
  108 +
  109 + public int getLpCount() {
  110 + return lpCount;
  111 + }
  112 +
  113 + public void setLpCount(int lpCount) {
  114 + this.lpCount = lpCount;
  115 + }
  116 +
  117 + public int getTpCount() {
  118 + return tpCount;
  119 + }
  120 +
  121 + public void setTpCount(int tpCount) {
  122 + this.tpCount = tpCount;
  123 + }
  124 +
  125 + public int getTtCount() {
  126 + return ttCount;
  127 + }
  128 +
  129 + public void setTtCount(int ttCount) {
  130 + this.ttCount = ttCount;
  131 + }
  132 +
  133 + public int getSrCount() {
  134 + return srCount;
  135 + }
  136 +
  137 + public void setSrCount(int srCount) {
  138 + this.srCount = srCount;
  139 + }
  140 +
  141 + public int getSpCount() {
  142 + return spCount;
  143 + }
  144 +
  145 + public void setSpCount(int spCount) {
  146 + this.spCount = spCount;
  147 + }
  148 +
  149 + public Date getCreateDate() {
  150 + return createDate;
  151 + }
  152 +
  153 + public void setCreateDate(Date createDate) {
  154 + this.createDate = createDate;
  155 + }
  156 +
  157 + public Date getUpdateDate() {
  158 + return updateDate;
  159 + }
  160 +
  161 + public void setUpdateDate(Date updateDate) {
  162 + this.updateDate = updateDate;
  163 + }
  164 +}
src/test/java/com/bsth/entity/schedule/rule/ScheduleRule1.java 0 → 100644
  1 +package com.bsth.entity.schedule.rule;
  2 +
  3 +import com.bsth.entity.Cars;
  4 +import com.bsth.entity.Line;
  5 +import com.bsth.entity.Personnel;
  6 +import com.bsth.entity.schedule.GuideboardInfo;
  7 +
  8 +import javax.persistence.*;
  9 +import java.util.Date;
  10 +import java.util.List;
  11 +
  12 +/**
  13 + * 排班规则1,
  14 + * 基于老系统的规则设定实体,
  15 + * 有所谓的路牌范围,就是关联多个路牌
  16 + * 有所谓的人员返回,就是关联多个人(可能带早晚班)
  17 + * 有起始路牌,起始人员,翻班格式
  18 + */
  19 +@Entity
  20 +@Table(name = "bsth_c_s_sr1")
  21 +public class ScheduleRule1 {
  22 +
  23 + /** 主键Id */
  24 + @Id
  25 + @GeneratedValue
  26 + private Long id;
  27 +
  28 + /** 关联线路 */
  29 + @ManyToOne(optional = false, cascade = CascadeType.PERSIST, fetch = FetchType.LAZY)
  30 + private Line xl;
  31 + /** 关联车辆 */
  32 + @ManyToOne(optional = false, cascade = CascadeType.PERSIST, fetch = FetchType.LAZY)
  33 + private Cars cl;
  34 + /** 启用日期 */
  35 + private Date qyrq;
  36 +
  37 + /** 起始路牌 */
  38 + @ManyToOne(optional = false, cascade = CascadeType.PERSIST, fetch = FetchType.LAZY)
  39 + private GuideboardInfo qslp;
  40 + /** 起始人员 */
  41 + @ManyToOne(optional = false, cascade = CascadeType.PERSIST, fetch = FetchType.LAZY)
  42 + private Personnel qsry;
  43 + /** 翻班格式(TODO:这个目前还不太明白)*/
  44 + private String fbgs;
  45 +
  46 + /** 路牌范围(TODO:路牌有序号的需要排序,这个再议了) */
  47 + @ManyToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
  48 + @JoinTable(
  49 + name = "bsth_c_s_sr1_lp",
  50 + joinColumns = @JoinColumn(name = "SR1_ID"),
  51 + inverseJoinColumns = @JoinColumn(name = "LP_ID")
  52 + )
  53 + private List<GuideboardInfo> guideboardInfos;
  54 +
  55 + // TODO:暂时不考虑早晚班
  56 +// /** 是否早晚班 */
  57 +// private boolean isZWB = false;
  58 +
  59 + /** 人员范围 */
  60 + @ManyToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
  61 + @JoinTable(
  62 + name = "bsth_c_s_sr1_ry",
  63 + joinColumns = @JoinColumn(name = "SR1_ID"),
  64 + inverseJoinColumns = @JoinColumn(name = "RY_ID")
  65 + )
  66 + private List<Personnel> personnels;
  67 +
  68 +
  69 + // 创建日期
  70 +// @Column(updatable = false, name = "create_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP")
  71 + @Column(updatable = false, name = "create_date")
  72 + private Date createDate;
  73 + // 修改日期
  74 +// @Column(name = "update_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP")
  75 + @Column(name = "update_date")
  76 + private Date updateDate;
  77 +
  78 + public Long getId() {
  79 + return id;
  80 + }
  81 +
  82 + public void setId(Long id) {
  83 + this.id = id;
  84 + }
  85 +
  86 + public Line getXl() {
  87 + return xl;
  88 + }
  89 +
  90 + public void setXl(Line xl) {
  91 + this.xl = xl;
  92 + }
  93 +
  94 + public Cars getCl() {
  95 + return cl;
  96 + }
  97 +
  98 + public void setCl(Cars cl) {
  99 + this.cl = cl;
  100 + }
  101 +
  102 + public Date getQyrq() {
  103 + return qyrq;
  104 + }
  105 +
  106 + public void setQyrq(Date qyrq) {
  107 + this.qyrq = qyrq;
  108 + }
  109 +
  110 + public GuideboardInfo getQslp() {
  111 + return qslp;
  112 + }
  113 +
  114 + public void setQslp(GuideboardInfo qslp) {
  115 + this.qslp = qslp;
  116 + }
  117 +
  118 + public Personnel getQsry() {
  119 + return qsry;
  120 + }
  121 +
  122 + public void setQsry(Personnel qsry) {
  123 + this.qsry = qsry;
  124 + }
  125 +
  126 + public String getFbgs() {
  127 + return fbgs;
  128 + }
  129 +
  130 + public void setFbgs(String fbgs) {
  131 + this.fbgs = fbgs;
  132 + }
  133 +
  134 + public List<GuideboardInfo> getGuideboardInfos() {
  135 + return guideboardInfos;
  136 + }
  137 +
  138 + public void setGuideboardInfos(List<GuideboardInfo> guideboardInfos) {
  139 + this.guideboardInfos = guideboardInfos;
  140 + }
  141 +
  142 + public List<Personnel> getPersonnels() {
  143 + return personnels;
  144 + }
  145 +
  146 + public void setPersonnels(List<Personnel> personnels) {
  147 + this.personnels = personnels;
  148 + }
  149 +
  150 + public Date getCreateDate() {
  151 + return createDate;
  152 + }
  153 +
  154 + public void setCreateDate(Date createDate) {
  155 + this.createDate = createDate;
  156 + }
  157 +
  158 + public Date getUpdateDate() {
  159 + return updateDate;
  160 + }
  161 +
  162 + public void setUpdateDate(Date updateDate) {
  163 + this.updateDate = updateDate;
  164 + }
  165 +}
src/test/java/com/bsth/entity/schedule/rule/ScheduleRule1Flat.java 0 → 100644
  1 +package com.bsth.entity.schedule.rule;
  2 +
  3 +import com.bsth.entity.Line;
  4 +import com.bsth.entity.schedule.BEntity;
  5 +import com.bsth.entity.schedule.CarConfigInfo;
  6 +
  7 +import javax.persistence.*;
  8 +import javax.validation.constraints.NotNull;
  9 +import java.util.Date;
  10 +
  11 +/**
  12 + * 排班规则1(flat,路牌,人员都不关联表,全部保存相关id),
  13 + * 基于老系统的规则设定实体,
  14 + * 有所谓的路牌范围,就是关联多个路牌
  15 + * 有所谓的人员返回,就是关联多个人(可能带早晚班)
  16 + * 有起始路牌,起始人员,翻班格式
  17 + */
  18 +@Entity
  19 +@Table(name = "bsth_c_s_sr1_flat")
  20 +@NamedEntityGraphs({
  21 + @NamedEntityGraph(
  22 + name = "scheduleRule1Flat_xl_carconfig",
  23 + attributeNodes = {
  24 + @NamedAttributeNode("xl"),
  25 + @NamedAttributeNode(value = "carConfigInfo", subgraph = "carConfigInfo_cl")
  26 + },
  27 + subgraphs = {
  28 + @NamedSubgraph(
  29 + name = "carConfigInfo_cl",
  30 + attributeNodes = {
  31 + @NamedAttributeNode("cl")
  32 + }
  33 + )
  34 + }
  35 +
  36 + )
  37 +})
  38 +public class ScheduleRule1Flat extends BEntity {
  39 + /** 主键Id */
  40 + @Id
  41 + @GeneratedValue
  42 + private Long id;
  43 +
  44 + /** 关联线路 */
  45 + @ManyToOne(optional = false, cascade = CascadeType.DETACH, fetch = FetchType.LAZY)
  46 + private Line xl;
  47 + /** 关联车辆配置id */
  48 + @ManyToOne(optional = false, cascade = CascadeType.DETACH, fetch = FetchType.LAZY)
  49 + private CarConfigInfo carConfigInfo;
  50 +
  51 + /** 启用日期 */
  52 + @NotNull
  53 + private Date qyrq;
  54 +
  55 + /** 路牌名称s(用逗号隔开) */
  56 + @NotNull
  57 + private String lpNames;
  58 + /** 对应的路牌ids(用逗号隔开) */
  59 + @NotNull
  60 + @Column(length = 1000)
  61 + private String lpIds;
  62 + /** 起始路牌(从0开始) */
  63 + @NotNull
  64 + private Integer lpStart;
  65 + /** 人员搭班编码s(用逗号隔开,如果分班,就先-隔开再逗号隔开) */
  66 + @NotNull
  67 + private String ryDbbms;
  68 + /** 对应的人员配置ids(用逗号隔开,如果分班,就先-隔开再逗号隔开) */
  69 + @NotNull
  70 + @Column(length = 1000)
  71 + private String ryConfigIds;
  72 + /** 起始人员(从0开始) */
  73 + @NotNull
  74 + private Integer ryStart;
  75 +
  76 + /** 翻班格式(类似格式:1110011),其中0表示当天不做跳过,1表示跳 */
  77 + private String fbgs;
  78 +
  79 + @Enumerated(EnumType.ORDINAL)
  80 + private FbgsTypeEnum fbtype = FbgsTypeEnum.TIMETABLEMODE;
  81 +
  82 + /** 备注 */
  83 + @Column(length = 1000)
  84 + private String remark;
  85 +
  86 + /** 翻班格式类型 */
  87 + public static enum FbgsTypeEnum {
  88 + /**
  89 + * 时刻表模式,当前翻到的路牌如果在当前时刻表中不存在,则跳过
  90 + */
  91 + TIMETABLEMODE,
  92 + /**
  93 + * 翻班格式模式,使用格式决定跳不跳过翻班,
  94 + * 翻班格式(类似格式:1110011),其中0表示当天不做跳过,1表示跳
  95 + */
  96 + FBGSMODE;
  97 + }
  98 +
  99 + public Long getId() {
  100 + return id;
  101 + }
  102 +
  103 + public void setId(Long id) {
  104 + this.id = id;
  105 + }
  106 +
  107 + public Line getXl() {
  108 + return xl;
  109 + }
  110 +
  111 + public void setXl(Line xl) {
  112 + this.xl = xl;
  113 + }
  114 +
  115 + public CarConfigInfo getCarConfigInfo() {
  116 + return carConfigInfo;
  117 + }
  118 +
  119 + public void setCarConfigInfo(CarConfigInfo carConfigInfo) {
  120 + this.carConfigInfo = carConfigInfo;
  121 + }
  122 +
  123 + public Date getQyrq() {
  124 + return qyrq;
  125 + }
  126 +
  127 + public void setQyrq(Date qyrq) {
  128 + this.qyrq = qyrq;
  129 + }
  130 +
  131 + public String getLpNames() {
  132 + return lpNames;
  133 + }
  134 +
  135 + public void setLpNames(String lpNames) {
  136 + this.lpNames = lpNames;
  137 + }
  138 +
  139 + public String getLpIds() {
  140 + return lpIds;
  141 + }
  142 +
  143 + public void setLpIds(String lpIds) {
  144 + this.lpIds = lpIds;
  145 + }
  146 +
  147 + public Integer getLpStart() {
  148 + return lpStart;
  149 + }
  150 +
  151 + public void setLpStart(Integer lpStart) {
  152 + this.lpStart = lpStart;
  153 + }
  154 +
  155 + public String getRyDbbms() {
  156 + return ryDbbms;
  157 + }
  158 +
  159 + public void setRyDbbms(String ryDbbms) {
  160 + this.ryDbbms = ryDbbms;
  161 + }
  162 +
  163 + public String getRyConfigIds() {
  164 + return ryConfigIds;
  165 + }
  166 +
  167 + public void setRyConfigIds(String ryConfigIds) {
  168 + this.ryConfigIds = ryConfigIds;
  169 + }
  170 +
  171 + public Integer getRyStart() {
  172 + return ryStart;
  173 + }
  174 +
  175 + public void setRyStart(Integer ryStart) {
  176 + this.ryStart = ryStart;
  177 + }
  178 +
  179 + public String getFbgs() {
  180 + return fbgs;
  181 + }
  182 +
  183 + public void setFbgs(String fbgs) {
  184 + this.fbgs = fbgs;
  185 + }
  186 +
  187 + public String getRemark() {
  188 + return remark;
  189 + }
  190 +
  191 + public void setRemark(String remark) {
  192 + this.remark = remark;
  193 + }
  194 +
  195 + public FbgsTypeEnum getFbtype() {
  196 + return fbtype;
  197 + }
  198 +
  199 + public void setFbtype(FbgsTypeEnum fbtype) {
  200 + this.fbtype = fbtype;
  201 + }
  202 +}
src/test/java/com/bsth/entity/schedule/rule/ScheduleRule1_LP.java 0 → 100644
  1 +package com.bsth.entity.schedule.rule;
  2 +
  3 +import javax.persistence.Column;
  4 +import javax.persistence.EmbeddedId;
  5 +import javax.persistence.Entity;
  6 +import javax.persistence.Table;
  7 +import java.util.Date;
  8 +
  9 +/**
  10 + * 排班规则1关联的路牌。
  11 + */
  12 +@Entity
  13 +@Table(name = "bsth_c_s_sr1_lp")
  14 +public class ScheduleRule1_LP {
  15 +
  16 + /** 业务主键 */
  17 + @EmbeddedId
  18 + private ScheduleRule1_LP_PK pk;
  19 +
  20 + // 创建日期
  21 +// @Column(updatable = false, name = "create_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP")
  22 + @Column(updatable = false, name = "create_date")
  23 + private Date createDate;
  24 + // 修改日期
  25 +// @Column(name = "update_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP")
  26 + @Column(name = "update_date")
  27 + private Date updateDate;
  28 +
  29 + public ScheduleRule1_LP_PK getPk() {
  30 + return pk;
  31 + }
  32 +
  33 + public void setPk(ScheduleRule1_LP_PK pk) {
  34 + this.pk = pk;
  35 + }
  36 +
  37 + public Date getCreateDate() {
  38 + return createDate;
  39 + }
  40 +
  41 + public void setCreateDate(Date createDate) {
  42 + this.createDate = createDate;
  43 + }
  44 +
  45 + public Date getUpdateDate() {
  46 + return updateDate;
  47 + }
  48 +
  49 + public void setUpdateDate(Date updateDate) {
  50 + this.updateDate = updateDate;
  51 + }
  52 +}
src/test/java/com/bsth/entity/schedule/rule/ScheduleRule1_LP_PK.java 0 → 100644
  1 +package com.bsth.entity.schedule.rule;
  2 +
  3 +import com.bsth.entity.schedule.GuideboardInfo;
  4 +
  5 +import javax.persistence.*;
  6 +import java.io.Serializable;
  7 +
  8 +/**
  9 + * 排班规则1 路牌范围 主键。
  10 + */
  11 +@Embeddable
  12 +public class ScheduleRule1_LP_PK implements Serializable {
  13 +
  14 + /** 关联的排班规则1 */
  15 + @ManyToOne(optional = false, cascade = CascadeType.PERSIST, fetch = FetchType.LAZY)
  16 + @JoinColumn(name = "SR1_ID")
  17 + private ScheduleRule1 scheduleRule1;
  18 +
  19 + /** 关联的路牌 */
  20 + @ManyToOne(optional = false, cascade = CascadeType.PERSIST, fetch = FetchType.LAZY)
  21 + @JoinColumn(name = "LP_ID")
  22 + private GuideboardInfo guideboardInfo;
  23 +
  24 + /** 顺序号 */
  25 + private Integer orderNo;
  26 +
  27 + public ScheduleRule1_LP_PK() {}
  28 +
  29 + public ScheduleRule1_LP_PK(ScheduleRule1 scheduleRule1, GuideboardInfo guideboardInfo, Integer orderNo) {
  30 + this.scheduleRule1 = scheduleRule1;
  31 + this.guideboardInfo = guideboardInfo;
  32 + this.orderNo = orderNo;
  33 + }
  34 +
  35 + public ScheduleRule1 getScheduleRule1() {
  36 + return scheduleRule1;
  37 + }
  38 +
  39 + public void setScheduleRule1(ScheduleRule1 scheduleRule1) {
  40 + this.scheduleRule1 = scheduleRule1;
  41 + }
  42 +
  43 + public GuideboardInfo getGuideboardInfo() {
  44 + return guideboardInfo;
  45 + }
  46 +
  47 + public void setGuideboardInfo(GuideboardInfo guideboardInfo) {
  48 + this.guideboardInfo = guideboardInfo;
  49 + }
  50 +
  51 + public Integer getOrderNo() {
  52 + return orderNo;
  53 + }
  54 +
  55 + public void setOrderNo(Integer orderNo) {
  56 + this.orderNo = orderNo;
  57 + }
  58 +}
src/test/java/com/bsth/entity/schedule/rule/ScheduleRule1_RY.java 0 → 100644
  1 +package com.bsth.entity.schedule.rule;
  2 +
  3 +import javax.persistence.Column;
  4 +import javax.persistence.EmbeddedId;
  5 +import javax.persistence.Entity;
  6 +import javax.persistence.Table;
  7 +import java.util.Date;
  8 +
  9 +/**
  10 + * 排班规则1关联的人员。
  11 + */
  12 +@Entity
  13 +@Table(name = "bsth_c_s_sr1_ry")
  14 +public class ScheduleRule1_RY {
  15 +
  16 + /** 业务主键 */
  17 + @EmbeddedId
  18 + private ScheduleRule1_RY_PK pk;
  19 +
  20 + // 创建日期
  21 +// @Column(updatable = false, name = "create_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP")
  22 + @Column(updatable = false, name = "create_date")
  23 + private Date createDate;
  24 + // 修改日期
  25 +// @Column(name = "update_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP")
  26 + @Column(name = "update_date")
  27 + private Date updateDate;
  28 +
  29 + public ScheduleRule1_RY_PK getPk() {
  30 + return pk;
  31 + }
  32 +
  33 + public void setPk(ScheduleRule1_RY_PK pk) {
  34 + this.pk = pk;
  35 + }
  36 +
  37 + public Date getCreateDate() {
  38 + return createDate;
  39 + }
  40 +
  41 + public void setCreateDate(Date createDate) {
  42 + this.createDate = createDate;
  43 + }
  44 +
  45 + public Date getUpdateDate() {
  46 + return updateDate;
  47 + }
  48 +
  49 + public void setUpdateDate(Date updateDate) {
  50 + this.updateDate = updateDate;
  51 + }
  52 +}
src/test/java/com/bsth/entity/sys/Dictionary.java 0 → 100644
  1 +package com.bsth.entity.sys;
  2 +
  3 +import javax.persistence.*;
  4 +import java.util.Date;
  5 +
  6 +@Entity
  7 +@Table(name = "bsth_c_sys_dictionary")
  8 +public class Dictionary {
  9 +
  10 + @Id
  11 + @GeneratedValue(strategy = GenerationType.IDENTITY)
  12 + private Integer id;
  13 +
  14 + private String dCode;
  15 +
  16 + private String dName;
  17 +
  18 + private String descriptions;
  19 +
  20 + private String dGroup;
  21 +
  22 + /**
  23 + * 固化的字典不能修改
  24 + */
  25 + private boolean fixed;
  26 +
  27 +// @Column(name = "update_date", columnDefinition = "timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP")
  28 + @Column(name = "update_date")
  29 + private Date updateDate;
  30 +
  31 +
  32 + public Integer getId() {
  33 + return id;
  34 + }
  35 +
  36 + public void setId(Integer id) {
  37 + this.id = id;
  38 + }
  39 +
  40 + public boolean isFixed() {
  41 + return fixed;
  42 + }
  43 +
  44 + public void setFixed(boolean fixed) {
  45 + this.fixed = fixed;
  46 + }
  47 +
  48 + public String getdCode() {
  49 + return dCode;
  50 + }
  51 +
  52 + public void setdCode(String dCode) {
  53 + this.dCode = dCode;
  54 + }
  55 +
  56 + public String getdName() {
  57 + return dName;
  58 + }
  59 +
  60 + public void setdName(String dName) {
  61 + this.dName = dName;
  62 + }
  63 +
  64 + public String getDescriptions() {
  65 + return descriptions;
  66 + }
  67 +
  68 + public void setDescriptions(String descriptions) {
  69 + this.descriptions = descriptions;
  70 + }
  71 +
  72 + public String getdGroup() {
  73 + return dGroup;
  74 + }
  75 +
  76 + public void setdGroup(String dGroup) {
  77 + this.dGroup = dGroup;
  78 + }
  79 +
  80 + public Date getUpdateDate() {
  81 + return updateDate;
  82 + }
  83 +
  84 + public void setUpdateDate(Date updateDate) {
  85 + this.updateDate = updateDate;
  86 + }
  87 +}
src/test/java/com/bsth/entity/sys/Interval.java 0 → 100644
  1 +package com.bsth.entity.sys;
  2 +
  3 +import javax.persistence.*;
  4 +import java.util.Date;
  5 +
  6 +
  7 +@Entity
  8 +@Table(name = "bsth_c_interval")
  9 +public class Interval {
  10 +
  11 + @Id
  12 + @GeneratedValue(strategy = GenerationType.IDENTITY)
  13 + private Integer id;
  14 +
  15 + /** 大间隔等级 */
  16 + private String level;
  17 + /** 高峰*/
  18 + private Integer peak;
  19 + public Integer getPeak() {
  20 + return peak;
  21 + }
  22 +
  23 + public void setPeak(Integer peak) {
  24 + this.peak = peak;
  25 + }
  26 +
  27 + public Integer getTrough() {
  28 + return trough;
  29 + }
  30 +
  31 + public void setTrough(Integer trough) {
  32 + this.trough = trough;
  33 + }
  34 +
  35 +
  36 + public String getCreateBy() {
  37 + return createBy;
  38 + }
  39 +
  40 + public void setCreateBy(String createBy) {
  41 + this.createBy = createBy;
  42 + }
  43 +
  44 + public Date getCreateDate() {
  45 + return createDate;
  46 + }
  47 +
  48 + public void setCreateDate(Date createDate) {
  49 + this.createDate = createDate;
  50 + }
  51 +
  52 + public String getUpdateBy() {
  53 + return updateBy;
  54 + }
  55 +
  56 + public void setUpdateBy(String updateBy) {
  57 + this.updateBy = updateBy;
  58 + }
  59 +
  60 + public Date getUpdateDate() {
  61 + return updateDate;
  62 + }
  63 +
  64 + public void setUpdateDate(Date updateDate) {
  65 + this.updateDate = updateDate;
  66 + }
  67 +
  68 + /** 低谷 */
  69 + private Integer trough;
  70 +
  71 + @Column(name = "create_by")
  72 + private String createBy;
  73 +
  74 +// @Column(updatable = false, name = "create_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP")
  75 + @Column(updatable = false, name = "create_date")
  76 + private Date createDate;
  77 +
  78 + @Column(name = "update_by")
  79 + private String updateBy;
  80 +
  81 +// @Column(name = "update_date", columnDefinition = "timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP")
  82 + @Column(name = "update_date")
  83 + private Date updateDate;
  84 +
  85 + public Integer getId() {
  86 + return id;
  87 + }
  88 +
  89 + public void setId(Integer id) {
  90 + this.id = id;
  91 + }
  92 +
  93 + public String getLevel() {
  94 + return level;
  95 + }
  96 +
  97 + public void setLevel(String level) {
  98 + this.level = level;
  99 + }
  100 +
  101 +}
src/test/java/com/bsth/entity/sys/Module.java 0 → 100644
  1 +package com.bsth.entity.sys;
  2 +
  3 +import javax.persistence.*;
  4 +import java.util.Date;
  5 +import java.util.LinkedHashSet;
  6 +import java.util.Set;
  7 +
  8 +@Entity
  9 +@Table(name = "bsth_c_sys_module")
  10 +@NamedEntityGraphs({
  11 + @NamedEntityGraph(name = "module_role", attributeNodes = {
  12 + @NamedAttributeNode("roles")
  13 + })
  14 +})
  15 +public class Module {
  16 +
  17 + @Id
  18 + @GeneratedValue(strategy = GenerationType.IDENTITY)
  19 + private Integer id;
  20 +
  21 + private Integer pId;
  22 +
  23 + private String name;
  24 +
  25 + private String descriptions;
  26 +
  27 + private String path;
  28 +
  29 + private String mappSymbol;
  30 +
  31 + private boolean enable;
  32 +
  33 + private String icon;
  34 +
  35 + //页面容器
  36 + private String container;
  37 +
  38 + /**
  39 + * 1:组
  40 + * 2:目录
  41 + * 3:功能模块
  42 + */
  43 + private String groupType;
  44 +
  45 + @ManyToMany(mappedBy = "modules")
  46 + private Set<Role> roles = new LinkedHashSet<>();
  47 +
  48 +// @Column(updatable = false,name = "create_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP")
  49 + @Column(updatable = false,name = "create_date")
  50 + private Date createDate;
  51 +
  52 +// @Column(name = "update_date", columnDefinition = "timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP")
  53 + @Column(name = "update_date")
  54 + private Date updateDate;
  55 +
  56 + public Integer getId() {
  57 + return id;
  58 + }
  59 +
  60 + public void setId(Integer id) {
  61 + this.id = id;
  62 + }
  63 +
  64 + public String getName() {
  65 + return name;
  66 + }
  67 +
  68 + public void setName(String name) {
  69 + this.name = name;
  70 + }
  71 +
  72 + public String getDescriptions() {
  73 + return descriptions;
  74 + }
  75 +
  76 + public void setDescriptions(String descriptions) {
  77 + this.descriptions = descriptions;
  78 + }
  79 +
  80 + public Set<Role> getRoles() {
  81 + return roles;
  82 + }
  83 +
  84 + public void setRoles(Set<Role> roles) {
  85 + this.roles = roles;
  86 + }
  87 +
  88 + public String getPath() {
  89 + return path;
  90 + }
  91 +
  92 + public void setPath(String path) {
  93 + this.path = path;
  94 + }
  95 +
  96 + public String getMappSymbol() {
  97 + return mappSymbol;
  98 + }
  99 +
  100 + public void setMappSymbol(String mappSymbol) {
  101 + this.mappSymbol = mappSymbol;
  102 + }
  103 +
  104 + public boolean isEnable() {
  105 + return enable;
  106 + }
  107 +
  108 + public void setEnable(boolean enable) {
  109 + this.enable = enable;
  110 + }
  111 +
  112 + public String getIcon() {
  113 + return icon;
  114 + }
  115 +
  116 + public void setIcon(String icon) {
  117 + this.icon = icon;
  118 + }
  119 +
  120 + public Integer getpId() {
  121 + return pId;
  122 + }
  123 +
  124 + public void setpId(Integer pId) {
  125 + this.pId = pId;
  126 + }
  127 +
  128 + public String getGroupType() {
  129 + return groupType;
  130 + }
  131 +
  132 + public void setGroupType(String groupType) {
  133 + this.groupType = groupType;
  134 + }
  135 +
  136 + public Date getCreateDate() {
  137 + return createDate;
  138 + }
  139 +
  140 + public void setCreateDate(Date createDate) {
  141 + this.createDate = createDate;
  142 + }
  143 +
  144 + public Date getUpdateDate() {
  145 + return updateDate;
  146 + }
  147 +
  148 + public void setUpdateDate(Date updateDate) {
  149 + this.updateDate = updateDate;
  150 + }
  151 +
  152 + @Override
  153 + public boolean equals(Object obj) {
  154 + // TODO Auto-generated method stub
  155 + return this.id.equals(((Module)obj).getId());
  156 + }
  157 +
  158 + public String getContainer() {
  159 + return container;
  160 + }
  161 +
  162 + public void setContainer(String container) {
  163 + this.container = container;
  164 + }
  165 +}
src/test/java/com/bsth/entity/sys/Resource.java 0 → 100644
  1 +package com.bsth.entity.sys;
  2 +
  3 +import com.fasterxml.jackson.annotation.JsonIgnore;
  4 +
  5 +import javax.persistence.*;
  6 +import java.util.Date;
  7 +import java.util.LinkedHashSet;
  8 +import java.util.Set;
  9 +
  10 +@Entity
  11 +@Table(name = "bsth_c_sys_resource")
  12 +public class Resource {
  13 +
  14 + @Id
  15 + @GeneratedValue(strategy = GenerationType.IDENTITY)
  16 + private Integer id;
  17 +
  18 + private String name;
  19 +
  20 + private String url;
  21 +
  22 + private String method;
  23 +
  24 + private String descriptions;
  25 +
  26 + @ManyToOne
  27 + private Module module;
  28 +
  29 + private boolean enable;
  30 +
  31 + @JsonIgnore
  32 + @ManyToMany(fetch = FetchType.EAGER)
  33 + private Set<Role> roles = new LinkedHashSet<>();
  34 +
  35 +// @Column(updatable = false, name = "create_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP")
  36 + @Column(updatable = false, name = "create_date")
  37 + private Date createDate;
  38 +
  39 +// @Column(name = "update_date", columnDefinition = "timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP")
  40 + @Column(name = "update_date")
  41 + private Date updateDate;
  42 +
  43 + public Integer getId() {
  44 + return id;
  45 + }
  46 +
  47 + public void setId(Integer id) {
  48 + this.id = id;
  49 + }
  50 +
  51 + public String getName() {
  52 + return name;
  53 + }
  54 +
  55 + public void setName(String name) {
  56 + this.name = name;
  57 + }
  58 +
  59 + public String getDescriptions() {
  60 + return descriptions;
  61 + }
  62 +
  63 + public void setDescriptions(String descriptions) {
  64 + this.descriptions = descriptions;
  65 + }
  66 +
  67 + public Set<Role> getRoles() {
  68 + return roles;
  69 + }
  70 +
  71 + public void setRoles(Set<Role> roles) {
  72 + this.roles = roles;
  73 + }
  74 +
  75 + public Module getModule() {
  76 + return module;
  77 + }
  78 +
  79 + public void setModule(Module module) {
  80 + this.module = module;
  81 + }
  82 +
  83 + public boolean isEnable() {
  84 + return enable;
  85 + }
  86 +
  87 + public void setEnable(boolean enable) {
  88 + this.enable = enable;
  89 + }
  90 +
  91 + public String getUrl() {
  92 + return url;
  93 + }
  94 +
  95 + public void setUrl(String url) {
  96 + this.url = url;
  97 + }
  98 +
  99 + public String getMethod() {
  100 + return method;
  101 + }
  102 +
  103 + public void setMethod(String method) {
  104 + this.method = method;
  105 + }
  106 +
  107 + public Date getCreateDate() {
  108 + return createDate;
  109 + }
  110 +
  111 + public void setCreateDate(Date createDate) {
  112 + this.createDate = createDate;
  113 + }
  114 +
  115 + public Date getUpdateDate() {
  116 + return updateDate;
  117 + }
  118 +
  119 + public void setUpdateDate(Date updateDate) {
  120 + this.updateDate = updateDate;
  121 + }
  122 +}
src/test/java/com/bsth/entity/sys/Role.java 0 → 100644
  1 +package com.bsth.entity.sys;
  2 +
  3 +import com.fasterxml.jackson.annotation.JsonIgnore;
  4 +
  5 +import javax.persistence.*;
  6 +import java.util.Date;
  7 +import java.util.LinkedHashSet;
  8 +import java.util.Set;
  9 +
  10 +@Entity
  11 +@Table(name = "bsth_c_sys_role")
  12 +public class Role {
  13 +
  14 + @Id
  15 + @GeneratedValue(strategy = GenerationType.IDENTITY)
  16 + private Integer id;
  17 +
  18 + private String codeName;
  19 +
  20 + private String roleName;
  21 +
  22 + private String descriptions;
  23 +
  24 + private boolean isSuperAdmin;
  25 +
  26 + private boolean enable;
  27 +
  28 + @JsonIgnore
  29 + @ManyToMany(fetch = FetchType.LAZY, mappedBy = "roles")
  30 + private Set<SysUser> users = new LinkedHashSet<>();
  31 +
  32 + @JsonIgnore
  33 + @ManyToMany
  34 + private Set<Module> modules = new LinkedHashSet<>();
  35 +
  36 + @JsonIgnore
  37 + @ManyToMany(mappedBy = "roles")
  38 + private Set<Resource> resources = new LinkedHashSet<>();
  39 +
  40 +// @Column(updatable = false, name = "create_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP")
  41 + @Column(updatable = false, name = "create_date")
  42 + private Date createDate;
  43 +
  44 +// @Column(name = "update_date", columnDefinition = "timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP")
  45 + @Column(name = "update_date")
  46 + private Date updateDate;
  47 +
  48 + private int pic;
  49 +
  50 + public Integer getId() {
  51 + return id;
  52 + }
  53 +
  54 + public void setId(Integer id) {
  55 + this.id = id;
  56 + }
  57 +
  58 + public String getRoleName() {
  59 + return roleName;
  60 + }
  61 +
  62 + public String getDescriptions() {
  63 + return descriptions;
  64 + }
  65 +
  66 + public void setDescriptions(String descriptions) {
  67 + this.descriptions = descriptions;
  68 + }
  69 +
  70 + public void setRoleName(String roleName) {
  71 + this.roleName = roleName;
  72 + }
  73 +
  74 + public boolean isEnable() {
  75 + return enable;
  76 + }
  77 +
  78 + public void setEnable(boolean enable) {
  79 + this.enable = enable;
  80 + }
  81 +
  82 + public Set<SysUser> getUsers() {
  83 + return users;
  84 + }
  85 +
  86 + public void setUsers(Set<SysUser> users) {
  87 + this.users = users;
  88 + }
  89 +
  90 + public boolean isSuperAdmin() {
  91 + return isSuperAdmin;
  92 + }
  93 +
  94 + public void setSuperAdmin(boolean isSuperAdmin) {
  95 + this.isSuperAdmin = isSuperAdmin;
  96 + }
  97 +
  98 + public Set<Module> getModules() {
  99 + return modules;
  100 + }
  101 +
  102 + public void setModules(Set<Module> modules) {
  103 + this.modules = modules;
  104 + }
  105 +
  106 + public Set<Resource> getResources() {
  107 + return resources;
  108 + }
  109 +
  110 + public void setResources(Set<Resource> resources) {
  111 + this.resources = resources;
  112 + }
  113 +
  114 + public Date getCreateDate() {
  115 + return createDate;
  116 + }
  117 +
  118 + public void setCreateDate(Date createDate) {
  119 + this.createDate = createDate;
  120 + }
  121 +
  122 + public Date getUpdateDate() {
  123 + return updateDate;
  124 + }
  125 +
  126 + public void setUpdateDate(Date updateDate) {
  127 + this.updateDate = updateDate;
  128 + }
  129 +
  130 + public String getCodeName() {
  131 + return codeName;
  132 + }
  133 +
  134 + public void setCodeName(String codeName) {
  135 + this.codeName = codeName;
  136 + }
  137 +
  138 + public int getPic() {
  139 + return pic;
  140 + }
  141 +
  142 + public void setPic(int pic) {
  143 + this.pic = pic;
  144 + }
  145 +
  146 + @Override
  147 + public boolean equals(Object obj) {
  148 + return this.id.equals(((Role)obj).getId());
  149 + }
  150 +
  151 + @Override
  152 + public int hashCode() {
  153 + return this.toString().hashCode();
  154 + }
  155 +
  156 + @Override
  157 + public String toString() {
  158 + return this.id + "" + this.getCodeName();
  159 + }
  160 +}
src/test/java/com/bsth/entity/sys/SysUser.java 0 → 100644
  1 +package com.bsth.entity.sys;
  2 +
  3 +import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
  4 +
  5 +import javax.persistence.*;
  6 +import java.util.Date;
  7 +import java.util.LinkedHashSet;
  8 +import java.util.Set;
  9 +
  10 +@Entity
  11 +@Table(name = "bsth_c_sys_user")
  12 +@JsonIgnoreProperties(ignoreUnknown = true)
  13 +@NamedEntityGraphs({
  14 + @NamedEntityGraph(name = "sysUser_role", attributeNodes = {
  15 + @NamedAttributeNode("roles")
  16 + })
  17 +})
  18 +public class SysUser {
  19 +
  20 + @Id
  21 + @GeneratedValue(strategy = GenerationType.IDENTITY)
  22 + private Integer id;
  23 +
  24 + private String userName;
  25 +
  26 + private String name;
  27 +
  28 + private String password;
  29 +
  30 +// @Column(updatable = false, name = "create_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP")
  31 + @Column(updatable = false, name = "create_date")
  32 + private Date createDate;
  33 +
  34 +// @Column(name = "last_loginDate", columnDefinition = "timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP")
  35 + @Column(name = "last_loginDate")
  36 + private Date lastLoginDate;
  37 +
  38 + /** 最近密码更新时间 */
  39 + private Date lastPwdDate;
  40 + /** 密码有效期 */
  41 + private Integer pwdValidPeriod;
  42 +
  43 + private String agencies;
  44 +
  45 + private boolean enabled;
  46 +
  47 + @ManyToMany(fetch = FetchType.EAGER)
  48 + private Set<Role> roles = new LinkedHashSet<>();
  49 +
  50 +
  51 + public Integer getId() {
  52 + return id;
  53 + }
  54 +
  55 + public void setId(Integer id) {
  56 + this.id = id;
  57 + }
  58 +
  59 + public String getUserName() {
  60 + return userName;
  61 + }
  62 +
  63 + public void setUserName(String userName) {
  64 + this.userName = userName;
  65 + }
  66 +
  67 + public String getName() {
  68 + return name;
  69 + }
  70 +
  71 + public void setName(String name) {
  72 + this.name = name;
  73 + }
  74 +
  75 + public Date getCreateDate() {
  76 + return createDate;
  77 + }
  78 +
  79 + public void setCreateDate(Date createDate) {
  80 + this.createDate = createDate;
  81 + }
  82 +
  83 + public Date getLastLoginDate() {
  84 + return lastLoginDate;
  85 + }
  86 +
  87 + public void setLastLoginDate(Date lastLoginDate) {
  88 + this.lastLoginDate = lastLoginDate;
  89 + }
  90 +
  91 + public String getAgencies() {
  92 + return agencies;
  93 + }
  94 +
  95 + public void setAgencies(String agencies) {
  96 + this.agencies = agencies;
  97 + }
  98 +
  99 + public boolean isEnabled() {
  100 + return enabled;
  101 + }
  102 +
  103 + public void setEnabled(boolean enabled) {
  104 + this.enabled = enabled;
  105 + }
  106 +
  107 + public String getPassword() {
  108 + return password;
  109 + }
  110 +
  111 + public void setPassword(String password) {
  112 + this.password = password;
  113 + }
  114 +
  115 + public Set<Role> getRoles() {
  116 + return roles;
  117 + }
  118 +
  119 + public void setRoles(Set<Role> roles) {
  120 + this.roles = roles;
  121 + }
  122 +
  123 + public Date getLastPwdDate() {
  124 + return lastPwdDate;
  125 + }
  126 +
  127 + public void setLastPwdDate(Date lastPwdDate) {
  128 + this.lastPwdDate = lastPwdDate;
  129 + }
  130 +
  131 + public Integer getPwdValidPeriod() {
  132 + return pwdValidPeriod;
  133 + }
  134 +
  135 + public void setPwdValidPeriod(Integer pwdValidPeriod) {
  136 + this.pwdValidPeriod = pwdValidPeriod;
  137 + }
  138 +}
src/test/java/com/bsth/entity/traffic/SKBUploadLogger.java 0 → 100644
  1 +package com.bsth.entity.traffic;
  2 +
  3 +import com.bsth.entity.Line;
  4 +import com.bsth.entity.sys.SysUser;
  5 +import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
  6 +
  7 +import javax.persistence.*;
  8 +import java.util.Date;
  9 +
  10 +/**
  11 + *
  12 + * @ClassName : SKBUploadLogger(时刻表上传日志实体类)
  13 + *
  14 + * @Author : bsth@zq
  15 + *
  16 + * @Description :
  17 + *
  18 + * @Data : 2016-04-27
  19 + *
  20 + * @Version 公交调度系统BS版 0.1
  21 + *
  22 + */
  23 +
  24 +@Entity
  25 +@Table(name = "bsth_t_upload_logger")
  26 +@JsonIgnoreProperties(value={"hibernateLazyInitializer","handler","fieldHandler"})
  27 +public class SKBUploadLogger {
  28 +
  29 + // ID
  30 + @Id
  31 + @GeneratedValue(strategy = GenerationType.IDENTITY)
  32 + private Integer id;
  33 +
  34 + /** 时刻表信息 */
  35 + @ManyToOne(optional = false, cascade = CascadeType.DETACH, fetch = FetchType.LAZY)
  36 + private Line line;
  37 +
  38 + /** 用户 关联 */
  39 + @ManyToOne(optional = false, cascade = CascadeType.DETACH, fetch = FetchType.LAZY)
  40 + private SysUser user;
  41 +
  42 + // 创建日期
  43 +// @Column(updatable = false, name = "create_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP")
  44 + @Column(updatable = false, name = "create_date")
  45 + private Date createDate;
  46 +
  47 + // 上传的参数
  48 + @Column( name = "upload_xml" , columnDefinition="TEXT")
  49 + private String uploadXml;
  50 +
  51 + // 上传的参数2
  52 + @Column( name = "upload_xml_sub" , columnDefinition="TEXT")
  53 + private String uploadXmlSub;
  54 +
  55 + // 日志类型 1:时刻表;2:上传线路;3:上传路单
  56 + private String type;
  57 +
  58 + // 模板名称
  59 + private String name;
  60 +
  61 + // 上传状态:是否成功 1:成功;0:失败
  62 + private String state;
  63 +
  64 + public Integer getId() {
  65 + return id;
  66 + }
  67 +
  68 + public void setId(Integer id) {
  69 + this.id = id;
  70 + }
  71 +
  72 + public SysUser getUser() {
  73 + return user;
  74 + }
  75 +
  76 + public void setUser(SysUser user) {
  77 + this.user = user;
  78 + }
  79 +
  80 + public Date getCreateDate() {
  81 + return createDate;
  82 + }
  83 +
  84 + public void setCreateDate(Date createDate) { this.createDate = createDate; }
  85 +
  86 + public String getUploadXml() { return uploadXml; }
  87 +
  88 + public void setUploadXml(String uploadXml) { this.uploadXml = uploadXml; }
  89 +
  90 + public String getState() { return state; }
  91 +
  92 + public void setState(String state) { this.state = state; }
  93 +
  94 + public Line getLine() { return line;}
  95 +
  96 + public void setLine(Line line) { this.line = line; }
  97 +
  98 + public String getType() { return type; }
  99 +
  100 + public void setType(String type) { this.type = type; }
  101 +
  102 + public String getName() { return name; }
  103 +
  104 + public void setName(String name) { this.name = name; }
  105 +
  106 + public String getUploadXmlSub() {return uploadXmlSub;}
  107 +
  108 + public void setUploadXmlSub(String uploadXmlSub) {this.uploadXmlSub = uploadXmlSub; }
  109 +}
src/test/java/com/bsth/service/schedule/Plan_0_validateTimetableTest.java 0 → 100644
  1 +package com.bsth.service.schedule;
  2 +
  3 +import com.bsth.BaseTest_junit4;
  4 +import com.bsth.TestApplication;
  5 +import com.bsth.service.schedule.plan.process._1_validate._1_timetable.PlanProcessValidateTimetableService;
  6 +import com.bsth.service.schedule.plan.process._1_validate._1_timetable.PlanProcessValidateTimetableServiceDroolsImpl;
  7 +import com.bsth.service.schedule.plan.process._1_validate._1_timetable.drools.KBaseValidateTimeTable_Result;
  8 +import org.joda.time.format.DateTimeFormat;
  9 +import org.junit.Assert;
  10 +import org.junit.Test;
  11 +import org.junit.runner.RunWith;
  12 +import org.kie.api.KieBase;
  13 +import org.springframework.beans.factory.annotation.Autowired;
  14 +import org.springframework.beans.factory.annotation.Qualifier;
  15 +import org.springframework.boot.test.SpringApplicationConfiguration;
  16 +import org.springframework.jdbc.core.JdbcTemplate;
  17 +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
  18 +
  19 +import java.util.HashMap;
  20 +import java.util.Map;
  21 +
  22 +/**
  23 + * 排班计划,验证时刻表测试。
  24 + */
  25 +@RunWith(SpringJUnit4ClassRunner.class)
  26 +@SpringApplicationConfiguration(classes = {TestApplication.class})
  27 +public class Plan_0_validateTimetableTest extends BaseTest_junit4 {
  28 + @Override
  29 + public Map<String, String> getDbunitTestDbFileClassPathMap() {
  30 + Map<String, String> dbFileMap = new HashMap<>();
  31 + dbFileMap.put("testCase1", "testdata/_0_validate_timetable.xml");
  32 + return dbFileMap;
  33 + }
  34 +
  35 + @Autowired
  36 + @Qualifier("kBaseValidateTimetable")
  37 + private KieBase validateTimetableKBase;
  38 +
  39 + @Autowired
  40 + private JdbcTemplate jdbcTemplate;
  41 +
  42 +
  43 + @Test
  44 + public void testCase1() {
  45 + LOG.info("---------------时刻表验证测试--------------");
  46 +
  47 + // 使用builder创建服务
  48 + PlanProcessValidateTimetableService planProcessValidateTimetableService =
  49 + PlanProcessValidateTimetableServiceDroolsImpl.getBuilder()
  50 + .setValidateTimetableKBase(validateTimetableKBase)
  51 + .setJdbcTemplate(jdbcTemplate)
  52 + .build();
  53 +
  54 + /*
  55 + 验证时刻表信息服务:
  56 + 计算指定时间范围内所有的匹配时刻表,并计算时刻表的详细信息
  57 +
  58 + */
  59 + KBaseValidateTimeTable_Result result = planProcessValidateTimetableService.validateTTInfovalidateTTInfo(
  60 + 1,
  61 + DateTimeFormat.forPattern("yyyy-MM-dd").parseDateTime("2019-01-01").toDate(),
  62 + DateTimeFormat.forPattern("yyyy-MM-dd").parseDateTime("2019-01-14").toDate()
  63 + );
  64 +
  65 + Assert.assertArrayEquals(
  66 + "时刻表数量不一致",
  67 + new Object[] {4},
  68 + new Object[] {result.getInfos().size()});
  69 + }
  70 +}
src/test/resources/META-INF/drools.packagebuilder.conf 0 → 100644
  1 +# 貌似用import accumulate报错,使用配置文件方式
  2 +
  3 +# kBase_validate_timetable.drl使用
  4 +drools.accumulate.function.ecount = com.bsth.service.schedule.plan.process._1_validate._1_timetable.drools.KBaseValidateTimeTable_Function_ErrorBcCount
  5 +drools.accumulate.function.ac = com.bsth.service.schedule.plan.process._1_validate._1_timetable.drools.KBaseValidateTimeTable_Function_AccumulateConflict
src/test/resources/application-test.properties 0 → 100644
  1 +server.port=9088
  2 +management.port= 9001
  3 +management.address= 127.0.0.1
  4 +
  5 +spring.jpa.hibernate.ddl-auto= update
  6 +spring.jpa.hibernate.naming_strategy= org.hibernate.cfg.ImprovedNamingStrategy
  7 +#DATABASE
  8 +spring.jpa.database= H2
  9 +spring.jpa.show-sql= true
  10 +spring.datasource.driver-class-name= org.h2.Driver
  11 +spring.datasource.url= jdbc:h2:mem:core;DB_CLOSE_DELAY=1000;MVCC=TRUE;LOCK_TIMEOUT=10000
  12 +spring.datasource.username= sa
  13 +spring.datasource.password=
  14 +#DATASOURCE
  15 +spring.datasource.max-active=100
  16 +spring.datasource.max-idle=8
  17 +spring.datasource.min-idle=8
  18 +spring.datasource.initial-size=5
  19 +
  20 +spring.datasource.test-on-borrow=true
  21 +spring.datasource.test-on-connect=true
  22 +spring.datasource.test-on-return=true
  23 +spring.datasource.test-while-idle=true
  24 +spring.datasource.validation-query=select 1
  25 +
  26 +## gps client data
  27 +http.gps.real.cache.url= http://10.10.150.24:12580/realGps/all
  28 +## gateway real data
  29 +http.gps.real.url= http://114.80.178.12:18080/transport_server/rtgps/
  30 +## gateway send directive
  31 +http.send.directive = http://192.168.168.201:9090/transport_server/message/
src/test/resources/application.properties 0 → 100644
  1 +spring.profiles: test
  2 +spring.profiles.active: test
  3 +
  4 +spring.view.suffix=.html
  5 +server.session-timeout=-1
  6 +security.basic.enabled=false
  7 +
  8 +# \u4E0A\u4F20\u6587\u4EF6\u5927\u5C0F\u9650\u5236\u914D\u7F6E
  9 +# File size limit
  10 +multipart.maxFileSize = -1
  11 +# Total request size for a multipart/form-data
  12 +multipart.maxRequestSize = -1
  13 +
  14 +server.compression.enabled=true
  15 +server.compression.mime-types=application/json,application/xml,text/html,text/xml,text/plain,text/javascript,text/css,application/javascript
  16 +
  17 +# batch insert
  18 +hibernate.jdbc.batch_size = 50
src/test/resources/logback.xml 0 → 100644
  1 +<?xml version="1.0" encoding="UTF-8" ?>
  2 +<!-- scan="true" 当此属性设置为true时,配置文件如果发生改变,将会被重新加载,默认值为true。 -->
  3 +<!-- scanPeriod="30 seconds" 设置每30秒自动扫描,若没有指定具体单位则以milliseconds为标准(单位:milliseconds, seconds, minutes or hours) -->
  4 +<!-- debug="false"当此属性设置为true时,将打印出logback内部日志信息,实时查看logback运行状态。默认值为false。-->
  5 +<configuration scan="true" scanPeriod="30 seconds">
  6 + <!-- 控制台输出 -->
  7 + <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
  8 + <encoder>
  9 + <!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符 -->
  10 + <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] [%file:%line] %-5level-%msg%n</pattern>
  11 + </encoder>
  12 + </appender>
  13 +
  14 + <!-- 日志输出级别 -->
  15 + <root level="INFO">
  16 + <appender-ref ref="STDOUT" />
  17 + </root>
  18 +
  19 + <logger name="org.hibernate.tool.hbm2ddl"
  20 + level="DEBUG" additivity="false">
  21 + <appender-ref ref="STDOUT" />
  22 + </logger>
  23 +
  24 + <logger name="com.bsth.service.schedule"
  25 + level="DEBUG" additivity="false">
  26 + <appender-ref ref="STDOUT" />
  27 + </logger>
  28 +
  29 +</configuration>
src/test/resources/testdata/_0_validate_timetable.xml 0 → 100644
  1 +<?xml version='1.0' encoding='UTF-8'?>
  2 +<dataset>
  3 + <!-- 用户信息 -->
  4 + <bsth_c_sys_user id="1" user_name="管理员1" name="vip" password="vip" enabled="1" />
  5 + <!-- 角色信息 -->
  6 + <bsth_c_sys_role id="1" role_name="管理员组" enable="1" is_super_admin="1" pic="0" />
  7 + <!-- 用户角色关联信息 -->
  8 + <bsth_c_sys_user_roles users="1" roles="1" />
  9 + <!-- 公司信息(关联角色) -->
  10 + <bsth_c_sys_company_auth id="1" company_code="22" company_name="金高公司"
  11 + sub_company_code="01" sub_company_name="一分公司" />
  12 +
  13 + <!-- 车辆基础信息 -->
  14 + <bsth_c_cars id="1" inside_code="SSS-01"
  15 + business_code="22" company="金高公司" branche_company_code="01" branche_company="一分公司"
  16 + car_code="11111" car_plate="沪88888" supplier_name="bsth" equipment_code="123456"
  17 + hvac_car="1" ticket_type="1" led_screen="1" tv_video_type="1" scrap_state="0" />
  18 + <bsth_c_cars id="2" inside_code="SSS-02"
  19 + business_code="22" company="金高公司" branche_company_code="01" branche_company="一分公司"
  20 + car_code="11111" car_plate="沪88888" supplier_name="bsth" equipment_code="123456"
  21 + hvac_car="1" ticket_type="1" led_screen="1" tv_video_type="1" scrap_state="0" />
  22 + <bsth_c_cars id="3" inside_code="SSS-03"
  23 + business_code="55" company="南汇公司" branche_company_code="01" branche_company="一分公司"
  24 + car_code="11111" car_plate="沪88888" supplier_name="bsth" equipment_code="123456"
  25 + hvac_car="1" ticket_type="1" led_screen="1" tv_video_type="1" scrap_state="0" />
  26 + <bsth_c_cars id="4" inside_code="SSS-04"
  27 + business_code="22" company="金高公司" branche_company_code="02" branche_company="二分公司"
  28 + car_code="11111" car_plate="沪88888" supplier_name="bsth" equipment_code="123456"
  29 + hvac_car="1" ticket_type="1" led_screen="1" tv_video_type="1" scrap_state="0" />
  30 +
  31 + <!-- 线路基础信息 -->
  32 + <bsth_c_line id="1" name="线路1" company="22" branche_company="01" length="20" destroy="0" />
  33 +
  34 + <!-- 停车场基础信息 -->
  35 + <bsth_c_car_park id="1" park_name="停车场1" company="05" branche_company="01" area="100" />
  36 +
  37 + <!-- 车辆配置信息 -->
  38 + <bsth_c_s_ccinfo id="1" xl="1" cl="1" qyrq="2019-01-01" tcd="停车场1" is_switch="0" is_cancel="0" />
  39 +
  40 + <!-- 排班计划信息 -->
  41 + <bsth_c_s_sp id="1" xl="1" schedule_from_time="2019-01-01" schedule_to_time="2019-01-10"
  42 + create_by="1" create_date="2019-02-01" update_by="1" update_date="2019-02-01"/>
  43 +
  44 + <!-- 路牌信息 -->
  45 + <bsth_c_s_gbi id="1" xl="1" lp_no="1" lp_name="路牌1" lp_type="普通路牌" is_cancel="0"
  46 + create_by="1" create_date="2019-02-01" update_by="1" update_date="2019-02-01"
  47 + />
  48 + <bsth_c_s_gbi id="2" xl="1" lp_no="2" lp_name="路牌2" lp_type="普通路牌" is_cancel="0"
  49 + create_by="1" create_date="2019-02-01" update_by="1" update_date="2019-02-01"
  50 + />
  51 + <bsth_c_s_gbi id="3" xl="1" lp_no="3" lp_name="路牌3" lp_type="普通路牌" is_cancel="0"
  52 + create_by="1" create_date="2019-02-01" update_by="1" update_date="2019-02-01"
  53 + />
  54 +
  55 + <!-- 时刻表信息 -->
  56 + <bsth_c_s_ttinfo id="1" xl="1" name="时刻表1" xl_dir="2" qyrq="2019-01-01" is_enable_dis_template="1"
  57 + is_cancel="0" line_version="1" lp_count = "10" loop_count = "6"
  58 + rule_days="1,1,1,1,1,0,0"
  59 + create_by="1" create_date="2019-02-01" update_by="1" update_date="2019-02-01"
  60 + />
  61 + <bsth_c_s_ttinfo id="2" xl="1" name="时刻表2" xl_dir="2" qyrq="2019-01-01" is_enable_dis_template="1"
  62 + is_cancel="0" line_version="1" lp_count = "10" loop_count = "6"
  63 + rule_days="0,0,0,0,1,1,1"
  64 + create_by="1" create_date="2019-02-01" update_by="1" update_date="2019-02-01"
  65 + />
  66 + <bsth_c_s_ttinfo id="3" xl="1" name="时刻表3" xl_dir="2" qyrq="2019-01-01" is_enable_dis_template="1"
  67 + is_cancel="0" line_version="1" lp_count = "10" loop_count = "6"
  68 + special_days="2019-01-05,2019-01-06,2019-01-07"
  69 + create_by="1" create_date="2019-02-01" update_by="1" update_date="2019-02-01"
  70 + />
  71 + <bsth_c_s_ttinfo id="4" xl="1" name="时刻表4" xl_dir="2" qyrq="2019-01-01" is_enable_dis_template="1"
  72 + is_cancel="0" line_version="1" lp_count = "10" loop_count = "6"
  73 + special_days="2019-01-05,2019-01-06,2019-01-07"
  74 + create_by="1" create_date="2019-02-01" update_by="1" update_date="2019-02-01"
  75 + />
  76 + <!-- 时刻表明细信息 -->
  77 + <bsth_c_s_ttinfo_detail id="1" xl="1" ttinfo="1" lp="1" fcno="1" xl_dir="0"
  78 + qdz_code="#1" qdz_name="上行起点站" zdz_code="#2" zdz_name="上行终点站"
  79 + fcsj="08:30" bcs="1" jhlc="30" bcsj="30" bc_type="normal"
  80 + line_version="1"
  81 + create_by="1" create_date="2019-02-01" update_by="1" update_date="2019-02-01"
  82 + />
  83 + <bsth_c_s_ttinfo_detail id="2" xl="1" ttinfo="1" lp="2" fcno="2" xl_dir="0"
  84 + qdz_code="#1" qdz_name="上行起点站" zdz_code="#2" zdz_name="上行终点站"
  85 + fcsj="08:40" bcs="2" jhlc="30" bcsj="30" bc_type="normal"
  86 + line_version="1"
  87 + create_by="1" create_date="2019-02-01" update_by="1" update_date="2019-02-01"
  88 + />
  89 + <bsth_c_s_ttinfo_detail id="3" xl="1" ttinfo="1" lp="3" fcno="3" xl_dir="0"
  90 + qdz_code="#1" qdz_name="上行起点站" zdz_code="#2" zdz_name="上行终点站"
  91 + fcsj="08:50" bcs="3" jhlc="30" bcsj="30" bc_type="normal"
  92 + line_version="1"
  93 + create_by="1" create_date="2019-02-01" update_by="1" update_date="2019-02-01"
  94 + />
  95 + <bsth_c_s_ttinfo_detail id="4" xl="1" ttinfo="1" lp="1" fcno="4" xl_dir="1"
  96 + qdz_code="#3" qdz_name="下行起点站" zdz_code="#4" zdz_name="下行终点站"
  97 + fcsj="09:10" bcs="4" jhlc="30" bcsj="30" bc_type="normal"
  98 + line_version="1"
  99 + create_by="1" create_date="2019-02-01" update_by="1" update_date="2019-02-01"
  100 + />
  101 + <bsth_c_s_ttinfo_detail id="5" xl="1" ttinfo="1" lp="2" fcno="5" xl_dir="1"
  102 + qdz_code="#3" qdz_name="下行起点站" zdz_code="#4" zdz_name="下行终点站"
  103 + fcsj="09:20" bcs="5" jhlc="30" bcsj="30" bc_type="normal"
  104 + line_version="1"
  105 + create_by="1" create_date="2019-02-01" update_by="1" update_date="2019-02-01"
  106 + />
  107 +
  108 + <bsth_c_s_ttinfo_detail id="6" xl="1" ttinfo="2" lp="1" fcno="1" xl_dir="0"
  109 + qdz_code="#1" qdz_name="上行起点站" zdz_code="#2" zdz_name="上行终点站"
  110 + fcsj="08:30" bcs="1" jhlc="30" bcsj="30" bc_type="normal"
  111 + line_version="1"
  112 + create_by="1" create_date="2019-02-01" update_by="1" update_date="2019-02-01"
  113 + />
  114 + <bsth_c_s_ttinfo_detail id="7" xl="1" ttinfo="2" lp="2" fcno="2" xl_dir="0"
  115 + qdz_code="#1" qdz_name="上行起点站" zdz_code="#2" zdz_name="上行终点站"
  116 + fcsj="08:40" bcs="2" jhlc="30" bcsj="30" bc_type="normal"
  117 + line_version="1"
  118 + create_by="1" create_date="2019-02-01" update_by="1" update_date="2019-02-01"
  119 + />
  120 +
  121 + <bsth_c_s_ttinfo_detail id="8" xl="1" ttinfo="3" lp="1" fcno="1" xl_dir="0"
  122 + qdz_code="#1" qdz_name="上行起点站" zdz_code="#2" zdz_name="上行终点站"
  123 + fcsj="08:30" bcs="1" jhlc="30" bcsj="30" bc_type="normal"
  124 + line_version="1"
  125 + create_by="1" create_date="2019-02-01" update_by="1" update_date="2019-02-01"
  126 + />
  127 +
  128 +
  129 +</dataset>