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