Commit 8912e3af9232be8c9d59e11edd7e19eea9e80913
Merge branch 'master' of http://222.66.0.204:8090/panzhaov5/bsth_control
Showing
5 changed files
with
39 additions
and
22 deletions
src/main/resources/datatools/config-dev.properties
| @@ -12,11 +12,11 @@ datatools.kettle_properties=/datatools/kettle.properties | @@ -12,11 +12,11 @@ datatools.kettle_properties=/datatools/kettle.properties | ||
| 12 | 12 | ||
| 13 | ##------------------ ktr通用变量 ------------------ | 13 | ##------------------ ktr通用变量 ------------------ |
| 14 | #数据库ip地址 | 14 | #数据库ip地址 |
| 15 | -datatools.kvars_dbip=192.168.168.201 | 15 | +datatools.kvars_dbip=192.168.168.171 |
| 16 | #数据库用户名 | 16 | #数据库用户名 |
| 17 | datatools.kvars_dbuname=root | 17 | datatools.kvars_dbuname=root |
| 18 | #数据库密码 | 18 | #数据库密码 |
| 19 | -datatools.kvars_dbpwd=123456 | 19 | +datatools.kvars_dbpwd=root2jsp |
| 20 | 20 | ||
| 21 | # 以下是封装数据导入导出逻辑的ktr转换文件,类路径,以后考虑放到数据库中 | 21 | # 以下是封装数据导入导出逻辑的ktr转换文件,类路径,以后考虑放到数据库中 |
| 22 | # 测试temp的ktr转换文件 | 22 | # 测试temp的ktr转换文件 |
src/main/resources/rules/shiftloop.drl
| @@ -40,12 +40,12 @@ rule "calcu_days_1" | @@ -40,12 +40,12 @@ rule "calcu_days_1" | ||
| 40 | Period p1 = new Period($qyrq, $fromDate, PeriodType.days()); | 40 | Period p1 = new Period($qyrq, $fromDate, PeriodType.days()); |
| 41 | cdr.setQyrq_days(p1.getDays()); | 41 | cdr.setQyrq_days(p1.getDays()); |
| 42 | Period p2 = new Period($fromDate, $toDate, PeriodType.days()); | 42 | Period p2 = new Period($fromDate, $toDate, PeriodType.days()); |
| 43 | - cdr.setSdays(p2.getDays()); | 43 | + cdr.setSdays(p2.getDays() + 1); |
| 44 | cdr.setCalcu_start_date($fromDate); | 44 | cdr.setCalcu_start_date($fromDate); |
| 45 | cdr.setCalcu_end_date($toDate); | 45 | cdr.setCalcu_end_date($toDate); |
| 46 | 46 | ||
| 47 | - System.out.println("qyrq_days=" + p1.getDays()); | ||
| 48 | - System.out.println("sdays=" + p2.getDays()); | 47 | + System.out.println("开始日期离启用日期的天数 qyrq_days=" + p1.getDays()); |
| 48 | + System.out.println("总共需要排班的天数 sdays=" + (p2.getDays() + 1)); | ||
| 49 | 49 | ||
| 50 | insert(cdr); // 插入fact数据,进入下一个阶段 | 50 | insert(cdr); // 插入fact数据,进入下一个阶段 |
| 51 | end | 51 | end |
| @@ -66,8 +66,8 @@ rule "calcu_days_2" | @@ -66,8 +66,8 @@ rule "calcu_days_2" | ||
| 66 | cdr.setCalcu_start_date($qyrq); | 66 | cdr.setCalcu_start_date($qyrq); |
| 67 | cdr.setCalcu_end_date($toDate); | 67 | cdr.setCalcu_end_date($toDate); |
| 68 | 68 | ||
| 69 | - System.out.println("qyrq_days=0"); | ||
| 70 | - System.out.println("sdays=" + p2.getDays()); | 69 | + System.out.println("开始日期离启用日期的天数 qyrq_days=0"); |
| 70 | + System.out.println("总共需要排班的天数 sdays=" + (p2.getDays() + 1)); | ||
| 71 | 71 | ||
| 72 | insert(cdr); // 插入fact数据,进入下一个阶段 | 72 | insert(cdr); // 插入fact数据,进入下一个阶段 |
| 73 | end | 73 | end |
| @@ -87,7 +87,8 @@ end | @@ -87,7 +87,8 @@ end | ||
| 87 | // int temp = rangsize - 1 - oindex; | 87 | // int temp = rangsize - 1 - oindex; |
| 88 | // int days_temp = days - temp; | 88 | // int days_temp = days - temp; |
| 89 | // if (days_temp <= 0) { | 89 | // if (days_temp <= 0) { |
| 90 | -// return oindex + days_temp; | 90 | +// //return oindex + days_temp; |
| 91 | +// return oindex + days; | ||
| 91 | // } else { | 92 | // } else { |
| 92 | // int s_value = (int) (days_temp / rangsize); // 商 | 93 | // int s_value = (int) (days_temp / rangsize); // 商 |
| 93 | // int y_value = days_temp % rangsize; // 余 | 94 | // int y_value = days_temp % rangsize; // 余 |
| @@ -155,12 +156,13 @@ rule "calcu_guideboard_index_2_1_result" | @@ -155,12 +156,13 @@ rule "calcu_guideboard_index_2_1_result" | ||
| 155 | when | 156 | when |
| 156 | $calcu_days_result : Calcu_days_result($ruleId: ruleId, qyrq_days > 0) | 157 | $calcu_days_result : Calcu_days_result($ruleId: ruleId, qyrq_days > 0) |
| 157 | $param1 : Calcu_guideboard_index_param_1(ruleId == $ruleId, | 158 | $param1 : Calcu_guideboard_index_param_1(ruleId == $ruleId, |
| 158 | - $oindex : oindex, | 159 | + $oindex : oindex, $range_size : range_size, |
| 159 | $days_temp : days_temp, days_temp <= 0) | 160 | $days_temp : days_temp, days_temp <= 0) |
| 160 | then | 161 | then |
| 161 | Calcu_guideboard_index_result cgir = new Calcu_guideboard_index_result(); | 162 | Calcu_guideboard_index_result cgir = new Calcu_guideboard_index_result(); |
| 162 | cgir.setRuleId($ruleId); | 163 | cgir.setRuleId($ruleId); |
| 163 | - cgir.setCalcu_index($oindex + $days_temp); | 164 | +// cgir.setCalcu_index($oindex + $days_temp); |
| 165 | + cgir.setCalcu_index($range_size - 1 + $days_temp); | ||
| 164 | 166 | ||
| 165 | System.out.println("guideboard ruleId=" + $ruleId + ", calcu_index=" + cgir.getCalcu_index()); | 167 | System.out.println("guideboard ruleId=" + $ruleId + ", calcu_index=" + cgir.getCalcu_index()); |
| 166 | 168 | ||
| @@ -266,12 +268,13 @@ rule "calcu_employee_index_2_1_result" | @@ -266,12 +268,13 @@ rule "calcu_employee_index_2_1_result" | ||
| 266 | when | 268 | when |
| 267 | $calcu_days_result : Calcu_days_result($ruleId: ruleId, qyrq_days > 0) | 269 | $calcu_days_result : Calcu_days_result($ruleId: ruleId, qyrq_days > 0) |
| 268 | $param1 : Calcu_employee_index_param_1(ruleId == $ruleId, | 270 | $param1 : Calcu_employee_index_param_1(ruleId == $ruleId, |
| 269 | - $oindex : oindex, | 271 | + $oindex : oindex, $range_size : range_size, |
| 270 | $days_temp : days_temp, days_temp <= 0) | 272 | $days_temp : days_temp, days_temp <= 0) |
| 271 | then | 273 | then |
| 272 | Calcu_employee_index_result cgir = new Calcu_employee_index_result(); | 274 | Calcu_employee_index_result cgir = new Calcu_employee_index_result(); |
| 273 | cgir.setRuleId($ruleId); | 275 | cgir.setRuleId($ruleId); |
| 274 | - cgir.setCalcu_index($oindex + $days_temp); | 276 | +// cgir.setCalcu_index($oindex + $days_temp); |
| 277 | + cgir.setCalcu_index($range_size - 1 + $days_temp); | ||
| 275 | 278 | ||
| 276 | System.out.println("employee ruleId=" + $ruleId + ", calcu_index=" + cgir.getCalcu_index()); | 279 | System.out.println("employee ruleId=" + $ruleId + ", calcu_index=" + cgir.getCalcu_index()); |
| 277 | 280 |
src/main/resources/static/pages/scheduleApp/module/core/scheduleRuleManage/list.html
| @@ -6,8 +6,8 @@ | @@ -6,8 +6,8 @@ | ||
| 6 | <th style="width: 5%;">序号</th> | 6 | <th style="width: 5%;">序号</th> |
| 7 | <th style="width: 15%;">线路</th> | 7 | <th style="width: 15%;">线路</th> |
| 8 | <th style="width: 15%;">修改时间</th> | 8 | <th style="width: 15%;">修改时间</th> |
| 9 | - <th style="width: 12%;">启用日期</th> | ||
| 10 | - <th>车辆</th> | 9 | + <th style="width: 10%;">启用日期</th> |
| 10 | + <th style="width: 10%;">车辆</th> | ||
| 11 | <th>翻版模式</th> | 11 | <th>翻版模式</th> |
| 12 | <th>起始路牌</th> | 12 | <th>起始路牌</th> |
| 13 | <th>路牌范围</th> | 13 | <th>路牌范围</th> |
src/main/resources/static/pages/scheduleApp/module/core/timeTableManage/timeTableManage.js
| @@ -189,7 +189,7 @@ angular.module('ScheduleApp').controller('TimeTableManageListCtrl', ['TimeTableM | @@ -189,7 +189,7 @@ angular.module('ScheduleApp').controller('TimeTableManageListCtrl', ['TimeTableM | ||
| 189 | // 时刻表名称 | 189 | // 时刻表名称 |
| 190 | var ttinfoname = self.pageInfo.infos[$index]["name"]; | 190 | var ttinfoname = self.pageInfo.infos[$index]["name"]; |
| 191 | // 停车场名称(TODO:暂时写死) | 191 | // 停车场名称(TODO:暂时写死) |
| 192 | - var tccname = "江南旅游服务有限公司浦西停车保养场"; | 192 | + var tccname = "东川路地铁站停车场"; |
| 193 | 193 | ||
| 194 | // large方式弹出模态对话框 | 194 | // large方式弹出模态对话框 |
| 195 | var modalInstance = $uibModal.open({ | 195 | var modalInstance = $uibModal.open({ |
src/test/java/com/bsth/service/schedule/rules/DroolsRulesTest.java
| @@ -64,21 +64,35 @@ public class DroolsRulesTest { | @@ -64,21 +64,35 @@ public class DroolsRulesTest { | ||
| 64 | // 2、创建fact对象 | 64 | // 2、创建fact对象 |
| 65 | 65 | ||
| 66 | ScheduleCalcuParam_input scheduleCalcuParam_input = new ScheduleCalcuParam_input(); | 66 | ScheduleCalcuParam_input scheduleCalcuParam_input = new ScheduleCalcuParam_input(); |
| 67 | - scheduleCalcuParam_input.setFromDate(new DateTime(2016, 1, 1, 0, 0)); | ||
| 68 | - scheduleCalcuParam_input.setToDate(new DateTime(2016, 1, 17, 0, 0)); | 67 | + scheduleCalcuParam_input.setFromDate(new DateTime(2016, 7, 1, 0, 0)); |
| 68 | + scheduleCalcuParam_input.setToDate(new DateTime(2016, 7, 31, 0, 0)); | ||
| 69 | scheduleCalcuParam_input.setTtinfoId(1L); | 69 | scheduleCalcuParam_input.setTtinfoId(1L); |
| 70 | 70 | ||
| 71 | ScheduleRule_input scheduleRule_input1 = new ScheduleRule_input(); | 71 | ScheduleRule_input scheduleRule_input1 = new ScheduleRule_input(); |
| 72 | scheduleRule_input1.setRuleId(1L); | 72 | scheduleRule_input1.setRuleId(1L); |
| 73 | - scheduleRule_input1.setQyrq(new DateTime(2015, 12, 21, 0, 0)); | ||
| 74 | - scheduleRule_input1.getGuideboardIds().addAll(Arrays.asList(1L, 2L, 3L, 4L)); | ||
| 75 | - scheduleRule_input1.setStartGbdIndex(2); | ||
| 76 | - scheduleRule_input1.getEmployeeConfigIds().addAll(Arrays.asList(1L, 2L)); | ||
| 77 | - scheduleRule_input1.setStartEIndex(0); | 73 | + scheduleRule_input1.setQyrq(new DateTime(2016, 6, 12, 0, 0)); |
| 74 | + scheduleRule_input1.getGuideboardIds().addAll(Arrays.asList( | ||
| 75 | + 1L, 1L, 2L, 2L, 3L, 3L, 4L, 4L, 5L, 5L, 6L, 6L, 7L, 7L, 8L, 8L, 9L, 9L, 10L, 10L, | ||
| 76 | + 11L, 11L, 12L, 12L, 13L, 13L)); | ||
| 77 | + scheduleRule_input1.setStartGbdIndex(3); | ||
| 78 | + scheduleRule_input1.getEmployeeConfigIds().addAll(Arrays.asList(7L, 8L)); | ||
| 79 | + scheduleRule_input1.setStartEIndex(1); | ||
| 78 | scheduleRule_input1.setCarConfigId(1L); | 80 | scheduleRule_input1.setCarConfigId(1L); |
| 79 | 81 | ||
| 82 | + ScheduleRule_input scheduleRule_input2 = new ScheduleRule_input(); | ||
| 83 | + scheduleRule_input2.setRuleId(2L); | ||
| 84 | + scheduleRule_input2.setQyrq(new DateTime(2016, 6, 12, 0, 0)); | ||
| 85 | + scheduleRule_input2.getGuideboardIds().addAll(Arrays.asList( | ||
| 86 | + 1L, 1L, 2L, 2L, 3L, 3L, 4L, 4L, 5L, 5L, 6L, 6L, 7L, 7L, 8L, 8L, 9L, 9L, 10L, 10L, | ||
| 87 | + 11L, 11L, 12L, 12L, 13L, 13L)); | ||
| 88 | + scheduleRule_input2.setStartGbdIndex(7); | ||
| 89 | + scheduleRule_input2.getEmployeeConfigIds().addAll(Arrays.asList(11L, 12L)); | ||
| 90 | + scheduleRule_input2.setStartEIndex(1); | ||
| 91 | + scheduleRule_input2.setCarConfigId(2L); | ||
| 92 | + | ||
| 80 | session.insert(scheduleCalcuParam_input); | 93 | session.insert(scheduleCalcuParam_input); |
| 81 | session.insert(scheduleRule_input1); | 94 | session.insert(scheduleRule_input1); |
| 95 | + session.insert(scheduleRule_input2); | ||
| 82 | 96 | ||
| 83 | 97 | ||
| 84 | // 3、执行rule | 98 | // 3、执行rule |