Commit 44bac07fe72b2b378ff769d5de1cc955bb86c596

Authored by 徐烜
1 parent b6957fef

PSM-12

src/main/java/com/bsth/entity/schedule/SchedulePlanInfo.java
@@ -240,6 +240,11 @@ public class SchedulePlanInfo { @@ -240,6 +240,11 @@ public class SchedulePlanInfo {
240 this.jhlc = ttInfoDetail.getJhlc(); // 计划里程 240 this.jhlc = ttInfoDetail.getJhlc(); // 计划里程
241 this.bcsj = ttInfoDetail.getBcsj(); // 班次时间 241 this.bcsj = ttInfoDetail.getBcsj(); // 班次时间
242 242
  243 + // 使用的时刻表id
  244 + this.ttInfo = ttInfoDetail.getTtinfo().getId();
  245 + // 使用的时刻表名字
  246 + this.ttInfoName = ttInfoDetail.getTtinfo().getName();
  247 +
243 } 248 }
244 249
245 250
src/main/java/com/bsth/entity/search/PredicatesBuilder.java
@@ -38,6 +38,9 @@ public class PredicatesBuilder { @@ -38,6 +38,9 @@ public class PredicatesBuilder {
38 } else if (String.class.isAssignableFrom(leftType) && 38 } else if (String.class.isAssignableFrom(leftType) &&
39 (String.class.isAssignableFrom(rightType) || Number.class.isAssignableFrom(rightType))) { // String == String/Number 39 (String.class.isAssignableFrom(rightType) || Number.class.isAssignableFrom(rightType))) { // String == String/Number
40 return cb.equal(expression, object); 40 return cb.equal(expression, object);
  41 + } else if (Boolean.class.isAssignableFrom(leftType) &&
  42 + Boolean.class.isAssignableFrom(rightType)) {
  43 + return cb.equal(expression, object);
41 } else if (Date.class.isAssignableFrom(leftType) && 44 } else if (Date.class.isAssignableFrom(leftType) &&
42 Date.class.isAssignableFrom(rightType)) { // Date == Date 45 Date.class.isAssignableFrom(rightType)) { // Date == Date
43 return cb.equal(expression, object); 46 return cb.equal(expression, object);
src/main/java/com/bsth/service/schedule/rules/strategy/IStrategyImpl.java
@@ -21,6 +21,7 @@ import org.slf4j.Logger; @@ -21,6 +21,7 @@ import org.slf4j.Logger;
21 import org.slf4j.LoggerFactory; 21 import org.slf4j.LoggerFactory;
22 import org.springframework.beans.factory.annotation.Autowired; 22 import org.springframework.beans.factory.annotation.Autowired;
23 import org.springframework.stereotype.Service; 23 import org.springframework.stereotype.Service;
  24 +import org.springframework.util.CollectionUtils;
24 25
25 import java.util.*; 26 import java.util.*;
26 27
@@ -50,8 +51,14 @@ public class IStrategyImpl implements IStrategy { @@ -50,8 +51,14 @@ public class IStrategyImpl implements IStrategy {
50 51
51 @Override 52 @Override
52 public Line getLine(Integer xlId) { 53 public Line getLine(Integer xlId) {
53 - Line xl = lineService.findById(xlId); // 查找线路具体信息  
54 - return xl; 54 + Map<String, Object> param = new HashMap<>();
  55 + param.put("id_eq", xlId);
  56 + param.put("destroy_eq", 0); // 未撤销
  57 + List<Line> lines = (List<Line>) lineService.list(param);
  58 + if (CollectionUtils.isEmpty(lines)) {
  59 + throw new RuntimeException("线路找不到,可能已经撤销!");
  60 + }
  61 + return lines.get(0);
55 } 62 }
56 63
57 @Override 64 @Override
src/main/resources/static/pages/scheduleApp/module/core/ttInfoDetailManage/edit-detail.html
1 <div ng-controller="TimeTableDetailManageFormCtrl_old as ctrl"> 1 <div ng-controller="TimeTableDetailManageFormCtrl_old as ctrl">
2 <div class="page-head"> 2 <div class="page-head">
3 <div class="page-title"> 3 <div class="page-title">
4 - <h1>修改班次信息2</h1> 4 + <h1>修改班次信息</h1>
5 </div> 5 </div>
6 </div> 6 </div>
7 7
src/main/resources/static/pages/scheduleApp/module/core/ttInfoDetailManage/edit.html
1 <div class="page-head"> 1 <div class="page-head">
2 <div class="page-title"> 2 <div class="page-title">
3 - <h1>时刻表管理2</h1> 3 + <h1>时刻表管理</h1>
4 </div> 4 </div>
5 </div> 5 </div>
6 6
src/main/resources/static/pages/scheduleApp/module/core/ttInfoDetailManage/form.html
1 <div class="page-head"> 1 <div class="page-head">
2 <div class="page-title"> 2 <div class="page-title">
3 - <h1>时刻表管理2</h1> 3 + <h1>时刻表管理</h1>
4 </div> 4 </div>
5 </div> 5 </div>
6 6
src/main/resources/static/pages/scheduleApp/module/core/ttInfoManage/detail.html
1 <div class="page-head"> 1 <div class="page-head">
2 <div class="page-title"> 2 <div class="page-title">
3 - <h1>时刻表管理2</h1> 3 + <h1>时刻表管理</h1>
4 </div> 4 </div>
5 </div> 5 </div>
6 6
src/main/resources/static/pages/scheduleApp/module/core/ttInfoManage/edit.html
1 <div class="page-head"> 1 <div class="page-head">
2 <div class="page-title"> 2 <div class="page-title">
3 - <h1>时刻表管理2</h1> 3 + <h1>时刻表管理</h1>
4 </div> 4 </div>
5 </div> 5 </div>
6 6
src/main/resources/static/pages/scheduleApp/module/core/ttInfoManage/form.html
1 <div class="page-head"> 1 <div class="page-head">
2 <div class="page-title"> 2 <div class="page-title">
3 - <h1>时刻表管理2</h1> 3 + <h1>时刻表管理</h1>
4 </div> 4 </div>
5 </div> 5 </div>
6 6
src/main/resources/static/pages/scheduleApp/module/core/ttInfoManage/index.html
1 <div class="page-head"> 1 <div class="page-head">
2 <div class="page-title"> 2 <div class="page-title">
3 - <h1>时刻表管理2</h1> 3 + <h1>时刻表管理</h1>
4 </div> 4 </div>
5 </div> 5 </div>
6 6
src/test/java/com/bsth/service/schedule/rules/DroolsRulesTest.java
@@ -58,7 +58,7 @@ public class DroolsRulesTest { @@ -58,7 +58,7 @@ public class DroolsRulesTest {
58 session.dispose(); 58 session.dispose();
59 } 59 }
60 60
61 - @Test 61 +// @Test
62 public void ttinfoDrlTest() throws Exception { 62 public void ttinfoDrlTest() throws Exception {
63 logger.info("------------ttinfoDrlTest 测试---------------"); 63 logger.info("------------ttinfoDrlTest 测试---------------");
64 64
@@ -133,7 +133,7 @@ public class DroolsRulesTest { @@ -133,7 +133,7 @@ public class DroolsRulesTest {
133 133
134 } 134 }
135 135
136 -// @Test 136 + @Test
137 public void shiftloopDrlTest() throws Exception { 137 public void shiftloopDrlTest() throws Exception {
138 // 1、创建session,内部配置的是stateful 138 // 1、创建session,内部配置的是stateful
139 KieSession session = kieBase.newKieSession(); 139 KieSession session = kieBase.newKieSession();