Commit 3e5c5262238e801f00f51530fde93dac2425c6ed

Authored by 徐烜
1 parent adf2a1d2

修改validate_timetable.drlq

src/main/resources/rules/kBase3_validate_timetable.drl
... ... @@ -100,6 +100,7 @@ declare TTInfo_wrap
100 100 weekdays: List // 周一到周日是否启用 List<Boolean>
101 101 specialDays: List // 特殊节假日 List<DateTime>
102 102 updateDate: DateTime // 最新修改时间
  103 + lineVersion : Integer // 线路版本
103 104 end
104 105  
105 106 rule "TTInfo_wrap_result"
... ... @@ -118,6 +119,7 @@ rule &quot;TTInfo_wrap_result&quot;
118 119 ttInfo_wrap.setUpdateDate(new DateTime($ttinfo.getUpdateDate()));
119 120 ttInfo_wrap.setWeekdays(new ArrayList());
120 121 ttInfo_wrap.setSpecialDays(new ArrayList());
  122 + ttInfo_wrap.setLineVersion($ttinfo.getLineVersion());
121 123  
122 124 String[] days = $ttinfo.getRule_days().split(",");
123 125 for (int i = 0; i < 7; i++) {
... ... @@ -151,6 +153,7 @@ end
151 153  
152 154 declare TTInfoDetails_wrap
153 155 ttInfoId: Long // 时刻表id
  156 + lineVersion: Integer // 线路版本
154 157 bcInfoList: List // 班次信息列表 List<TTInfoDetail>
155 158 end
156 159  
... ... @@ -165,6 +168,7 @@ rule &quot;Calcu_iter_days_special_day&quot; // 特殊日期匹配
165 168 TTInfo_wrap(
166 169 $tid: id,
167 170 $tname: name,
  171 + $lineVersion: lineVersion,
168 172 specialDays contains $calcu_date
169 173 )
170 174 then
... ... @@ -189,6 +193,7 @@ rule &quot;Calcu_iter_days_special_day&quot; // 特殊日期匹配
189 193  
190 194 TTInfoDetails_wrap ttInfoDetails_wrap = new TTInfoDetails_wrap();
191 195 ttInfoDetails_wrap.setTtInfoId($tid);
  196 + ttInfoDetails_wrap.setLineVersion($lineVersion);
192 197 ttInfoDetails_wrap.setBcInfoList(tTInfoDetailRepository.findByTtinfoId($tid));
193 198 insert(ttInfoDetails_wrap);
194 199 }
... ... @@ -208,6 +213,7 @@ rule &quot;Calcu_iter_days_normal_day&quot; // 平日匹配
208 213 TTInfo_wrap(
209 214 $tid: id,
210 215 $tname: name,
  216 + $lineVersion: lineVersion,
211 217 specialDays not contains $calcu_date,
212 218 weekdays[$calcu_weekday - 1] == Boolean.TRUE
213 219 )
... ... @@ -234,6 +240,7 @@ rule &quot;Calcu_iter_days_normal_day&quot; // 平日匹配
234 240  
235 241 TTInfoDetails_wrap ttInfoDetails_wrap = new TTInfoDetails_wrap();
236 242 ttInfoDetails_wrap.setTtInfoId($tid);
  243 + ttInfoDetails_wrap.setLineVersion($lineVersion);
237 244 ttInfoDetails_wrap.setBcInfoList(tTInfoDetailRepository.findByTtinfoId($tid));
238 245 insert(ttInfoDetails_wrap);
239 246 }
... ... @@ -253,6 +260,7 @@ rule &quot;Calcu_iter_days_other_day&quot; // 都没有的情况下,匹配
253 260 TTInfo_wrap(
254 261 $tid: id,
255 262 $tname: name,
  263 + $lineVersion: lineVersion,
256 264 specialDays not contains $calcu_date,
257 265 weekdays[$calcu_weekday - 1] == false
258 266 )
... ... @@ -278,6 +286,7 @@ rule &quot;Calcu_iter_days_other_day&quot; // 都没有的情况下,匹配
278 286  
279 287 TTInfoDetails_wrap ttInfoDetails_wrap = new TTInfoDetails_wrap();
280 288 ttInfoDetails_wrap.setTtInfoId($tid);
  289 + ttInfoDetails_wrap.setLineVersion($lineVersion);
281 290 Map<String, Object> param = new HashMap<String, Object>();
282 291 ttInfoDetails_wrap.setBcInfoList(tTInfoDetailRepository.findByTtinfoId($tid));
283 292 insert(ttInfoDetails_wrap);
... ... @@ -308,7 +317,7 @@ rule &quot;statinfo_result&quot; // 统计计算结果
308 317 $statInfo.setYybc($yybc);
309 318 $statInfo.setErrorbc($errorbc);
310 319  
311   - int lineVersion = ((TTInfoDetail) $ttInfoDetails_wrap.getBcInfoList().get(0)).getLineVersion();
  320 + int lineVersion = $ttInfoDetails_wrap.getLineVersion();
312 321 $statInfo.setLineVersion(lineVersion);
313 322  
314 323 rs.getInfos().add($statInfo);
... ...