Commit 296c85f7fdebc9e35c714c1a141e988cdcefffbb
1 parent
9d845b5e
update
Showing
6 changed files
with
41 additions
and
24 deletions
src/main/resources/application-dev.properties
| ... | ... | @@ -8,9 +8,9 @@ spring.jpa.hibernate.naming_strategy= org.hibernate.cfg.ImprovedNamingStrategy |
| 8 | 8 | spring.jpa.database= MYSQL |
| 9 | 9 | spring.jpa.show-sql= true |
| 10 | 10 | spring.datasource.driver-class-name= com.mysql.jdbc.Driver |
| 11 | -spring.datasource.url= jdbc:mysql://192.168.168.201:3306/control | |
| 11 | +spring.datasource.url= jdbc:mysql://192.168.168.171:3306/control | |
| 12 | 12 | spring.datasource.username= root |
| 13 | -spring.datasource.password= 123456 | |
| 13 | +spring.datasource.password= root2jsp | |
| 14 | 14 | #DATASOURCE |
| 15 | 15 | spring.datasource.max-active=100 |
| 16 | 16 | spring.datasource.max-idle=8 | ... | ... |
src/main/resources/datatools/config-dev.properties
| ... | ... | @@ -12,11 +12,11 @@ datatools.kettle_properties=/datatools/kettle.properties |
| 12 | 12 | |
| 13 | 13 | ##------------------ ktr通用变量 ------------------ |
| 14 | 14 | #数据库ip地址 |
| 15 | -datatools.kvars_dbip=192.168.168.201 | |
| 15 | +datatools.kvars_dbip=192.168.168.171 | |
| 16 | 16 | #数据库用户名 |
| 17 | 17 | datatools.kvars_dbuname=root |
| 18 | 18 | #数据库密码 |
| 19 | -datatools.kvars_dbpwd=123456 | |
| 19 | +datatools.kvars_dbpwd=root2jsp | |
| 20 | 20 | |
| 21 | 21 | # 以下是封装数据导入导出逻辑的ktr转换文件,类路径,以后考虑放到数据库中 |
| 22 | 22 | # 测试temp的ktr转换文件 | ... | ... |
src/main/resources/rules/shiftloop.drl
| ... | ... | @@ -40,12 +40,12 @@ rule "calcu_days_1" |
| 40 | 40 | Period p1 = new Period($qyrq, $fromDate, PeriodType.days()); |
| 41 | 41 | cdr.setQyrq_days(p1.getDays()); |
| 42 | 42 | Period p2 = new Period($fromDate, $toDate, PeriodType.days()); |
| 43 | - cdr.setSdays(p2.getDays()); | |
| 43 | + cdr.setSdays(p2.getDays() + 1); | |
| 44 | 44 | cdr.setCalcu_start_date($fromDate); |
| 45 | 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 | 50 | insert(cdr); // 插入fact数据,进入下一个阶段 |
| 51 | 51 | end |
| ... | ... | @@ -66,8 +66,8 @@ rule "calcu_days_2" |
| 66 | 66 | cdr.setCalcu_start_date($qyrq); |
| 67 | 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 | 72 | insert(cdr); // 插入fact数据,进入下一个阶段 |
| 73 | 73 | end |
| ... | ... | @@ -87,7 +87,8 @@ end |
| 87 | 87 | // int temp = rangsize - 1 - oindex; |
| 88 | 88 | // int days_temp = days - temp; |
| 89 | 89 | // if (days_temp <= 0) { |
| 90 | -// return oindex + days_temp; | |
| 90 | +// //return oindex + days_temp; | |
| 91 | +// return oindex + days; | |
| 91 | 92 | // } else { |
| 92 | 93 | // int s_value = (int) (days_temp / rangsize); // 商 |
| 93 | 94 | // int y_value = days_temp % rangsize; // 余 |
| ... | ... | @@ -155,12 +156,13 @@ rule "calcu_guideboard_index_2_1_result" |
| 155 | 156 | when |
| 156 | 157 | $calcu_days_result : Calcu_days_result($ruleId: ruleId, qyrq_days > 0) |
| 157 | 158 | $param1 : Calcu_guideboard_index_param_1(ruleId == $ruleId, |
| 158 | - $oindex : oindex, | |
| 159 | + $oindex : oindex, $range_size : range_size, | |
| 159 | 160 | $days_temp : days_temp, days_temp <= 0) |
| 160 | 161 | then |
| 161 | 162 | Calcu_guideboard_index_result cgir = new Calcu_guideboard_index_result(); |
| 162 | 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 | 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 | 268 | when |
| 267 | 269 | $calcu_days_result : Calcu_days_result($ruleId: ruleId, qyrq_days > 0) |
| 268 | 270 | $param1 : Calcu_employee_index_param_1(ruleId == $ruleId, |
| 269 | - $oindex : oindex, | |
| 271 | + $oindex : oindex, $range_size : range_size, | |
| 270 | 272 | $days_temp : days_temp, days_temp <= 0) |
| 271 | 273 | then |
| 272 | 274 | Calcu_employee_index_result cgir = new Calcu_employee_index_result(); |
| 273 | 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 | 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 | 6 | <th style="width: 5%;">序号</th> |
| 7 | 7 | <th style="width: 15%;">线路</th> |
| 8 | 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 | 11 | <th>翻版模式</th> |
| 12 | 12 | <th>起始路牌</th> |
| 13 | 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 | 189 | // 时刻表名称 |
| 190 | 190 | var ttinfoname = self.pageInfo.infos[$index]["name"]; |
| 191 | 191 | // 停车场名称(TODO:暂时写死) |
| 192 | - var tccname = "江南旅游服务有限公司浦西停车保养场"; | |
| 192 | + var tccname = "东川路地铁站停车场"; | |
| 193 | 193 | |
| 194 | 194 | // large方式弹出模态对话框 |
| 195 | 195 | var modalInstance = $uibModal.open({ | ... | ... |
src/test/java/com/bsth/service/schedule/rules/DroolsRulesTest.java
| ... | ... | @@ -64,21 +64,35 @@ public class DroolsRulesTest { |
| 64 | 64 | // 2、创建fact对象 |
| 65 | 65 | |
| 66 | 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 | 69 | scheduleCalcuParam_input.setTtinfoId(1L); |
| 70 | 70 | |
| 71 | 71 | ScheduleRule_input scheduleRule_input1 = new ScheduleRule_input(); |
| 72 | 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 | 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 | 93 | session.insert(scheduleCalcuParam_input); |
| 81 | 94 | session.insert(scheduleRule_input1); |
| 95 | + session.insert(scheduleRule_input2); | |
| 82 | 96 | |
| 83 | 97 | |
| 84 | 98 | // 3、执行rule | ... | ... |