Commit 406146b1f516be7a38ebed09864df0e6a668b1c3
Merge branch 'minhang' of
http://222.66.0.204:8090/panzhaov5/bsth_control into minhang
Showing
12 changed files
with
179 additions
and
140 deletions
src/main/java/com/bsth/data/gpsdata/arrival/handlers/CorrectSignalHandle.java
| ... | ... | @@ -6,6 +6,9 @@ import com.bsth.data.gpsdata.arrival.utils.CircleQueue; |
| 6 | 6 | import com.bsth.data.schedule.DayOfSchedule; |
| 7 | 7 | import com.bsth.entity.realcontrol.ChildTaskPlan; |
| 8 | 8 | import com.bsth.entity.realcontrol.ScheduleRealInfo; |
| 9 | +import com.bsth.service.directive.DirectiveService; | |
| 10 | +import org.slf4j.Logger; | |
| 11 | +import org.slf4j.LoggerFactory; | |
| 9 | 12 | import org.springframework.beans.factory.annotation.Autowired; |
| 10 | 13 | import org.springframework.stereotype.Component; |
| 11 | 14 | |
| ... | ... | @@ -18,6 +21,10 @@ public class CorrectSignalHandle extends SignalHandle { |
| 18 | 21 | |
| 19 | 22 | @Autowired |
| 20 | 23 | DayOfSchedule dayOfSchedule; |
| 24 | + @Autowired | |
| 25 | + DirectiveService directiveService; | |
| 26 | + | |
| 27 | + Logger logger = LoggerFactory.getLogger(this.getClass()); | |
| 21 | 28 | |
| 22 | 29 | @Override |
| 23 | 30 | public boolean handle(GpsEntity gps, CircleQueue<GpsEntity> prevs) { |
| ... | ... | @@ -41,6 +48,11 @@ public class CorrectSignalHandle extends SignalHandle { |
| 41 | 48 | gps.setState(0); |
| 42 | 49 | } |
| 43 | 50 | |
| 51 | + /*if(gps.getState() != 0){ | |
| 52 | + logger.info(gps.getNbbm() + " 纠正状态到营运"); | |
| 53 | + //切换到营运状态 | |
| 54 | + directiveService.send60Operation(sch.getClZbh(), 0, Integer.parseInt(sch.getXlDir()), null, "纠正@系统"); | |
| 55 | + }*/ | |
| 44 | 56 | |
| 45 | 57 | return true; |
| 46 | 58 | } | ... | ... |
src/main/java/com/bsth/entity/schedule/SchedulePlan.java
| ... | ... | @@ -41,6 +41,13 @@ public class SchedulePlan extends BEntity { |
| 41 | 41 | /** 使用的时刻表id列表(用逗号连接) */ |
| 42 | 42 | private String ttInfoIds; |
| 43 | 43 | |
| 44 | + /** 是否 排班计划优先 */ | |
| 45 | + private Boolean isHistoryPlanFirst; | |
| 46 | + | |
| 47 | + /** 每次排班的结果数据(错误,正确提示都在这里) */ | |
| 48 | + @Column(length = 2000) | |
| 49 | + private String planResult; | |
| 50 | + | |
| 44 | 51 | @JsonIgnore |
| 45 | 52 | /** 使用中间表的一对多关联 明细信息 */ |
| 46 | 53 | @OneToMany(mappedBy = "schedulePlan", cascade = CascadeType.ALL, fetch = FetchType.LAZY) |
| ... | ... | @@ -101,4 +108,20 @@ public class SchedulePlan extends BEntity { |
| 101 | 108 | public void setTtInfoIds(String ttInfoIds) { |
| 102 | 109 | this.ttInfoIds = ttInfoIds; |
| 103 | 110 | } |
| 111 | + | |
| 112 | + public Boolean getIsHistoryPlanFirst() { | |
| 113 | + return isHistoryPlanFirst; | |
| 114 | + } | |
| 115 | + | |
| 116 | + public void setIsHistoryPlanFirst(Boolean isHistoryPlanFirst) { | |
| 117 | + this.isHistoryPlanFirst = isHistoryPlanFirst; | |
| 118 | + } | |
| 119 | + | |
| 120 | + public String getPlanResult() { | |
| 121 | + return planResult; | |
| 122 | + } | |
| 123 | + | |
| 124 | + public void setPlanResult(String planResult) { | |
| 125 | + this.planResult = planResult; | |
| 126 | + } | |
| 104 | 127 | } | ... | ... |
src/main/java/com/bsth/service/schedule/rules/ttinfo/MinRuleQyrqFunction.java
| ... | ... | @@ -21,6 +21,7 @@ public class MinRuleQyrqFunction implements AccumulateFunction { |
| 21 | 21 | |
| 22 | 22 | protected static class MinRuleQyrqData implements Externalizable { |
| 23 | 23 | public DateTime min; |
| 24 | + public DateTime maxMin = new DateTime(2014,1,1,0,0); // 最大的最小值,比它小的不计算 | |
| 24 | 25 | |
| 25 | 26 | public MinRuleQyrqData() {} |
| 26 | 27 | |
| ... | ... | @@ -42,7 +43,7 @@ public class MinRuleQyrqFunction implements AccumulateFunction { |
| 42 | 43 | |
| 43 | 44 | @Override |
| 44 | 45 | public void init(Serializable context) throws Exception { |
| 45 | - // TODO: | |
| 46 | + MinRuleQyrqData minRuleQyrqData = (MinRuleQyrqData) context; | |
| 46 | 47 | } |
| 47 | 48 | |
| 48 | 49 | @Override |
| ... | ... | @@ -50,11 +51,14 @@ public class MinRuleQyrqFunction implements AccumulateFunction { |
| 50 | 51 | MinRuleQyrqData minRuleQyrqData = (MinRuleQyrqData) context; |
| 51 | 52 | ScheduleRule_input scheduleRule_input = (ScheduleRule_input) value; |
| 52 | 53 | |
| 53 | - if (minRuleQyrqData.min == null) { | |
| 54 | - minRuleQyrqData.min = scheduleRule_input.getQyrq(); | |
| 55 | - } else if (scheduleRule_input.getQyrq().isBefore(minRuleQyrqData.min)) { | |
| 56 | - minRuleQyrqData.min = scheduleRule_input.getQyrq(); | |
| 54 | + if (scheduleRule_input.getQyrq().isAfter(minRuleQyrqData.maxMin)) { | |
| 55 | + if (minRuleQyrqData.min == null) { | |
| 56 | + minRuleQyrqData.min = scheduleRule_input.getQyrq(); | |
| 57 | + } else if (scheduleRule_input.getQyrq().isBefore(minRuleQyrqData.min)) { | |
| 58 | + minRuleQyrqData.min = scheduleRule_input.getQyrq(); | |
| 59 | + } | |
| 57 | 60 | } |
| 61 | + | |
| 58 | 62 | } |
| 59 | 63 | |
| 60 | 64 | @Override | ... | ... |
src/main/resources/datatools/ktrs/carsDataInput.ktr
| ... | ... | @@ -433,12 +433,6 @@ |
| 433 | 433 | <schema/> |
| 434 | 434 | <table>bsth_c_cars</table> |
| 435 | 435 | <key> |
| 436 | - <name>所属公司代码</name> | |
| 437 | - <field>business_code</field> | |
| 438 | - <condition>=</condition> | |
| 439 | - <name2/> | |
| 440 | - </key> | |
| 441 | - <key> | |
| 442 | 436 | <name>内部编码</name> |
| 443 | 437 | <field>inside_code</field> |
| 444 | 438 | <condition>=</condition> |
| ... | ... | @@ -689,3 +683,4 @@ |
| 689 | 683 | <slave_transformation>N</slave_transformation> |
| 690 | 684 | |
| 691 | 685 | </transformation> |
| 686 | + | ... | ... |
src/main/resources/datatools/ktrs/employeesDataInput.ktr
| ... | ... | @@ -254,6 +254,36 @@ |
| 254 | 254 | <hop> <from>JavaScript代码</from><to>插入/更新bsth_c_personnel</to><enabled>Y</enabled> </hop> |
| 255 | 255 | </order> |
| 256 | 256 | <step> |
| 257 | + <name>JavaScript代码</name> | |
| 258 | + <type>ScriptValueMod</type> | |
| 259 | + <description/> | |
| 260 | + <distribute>Y</distribute> | |
| 261 | + <custom_distribution/> | |
| 262 | + <copies>1</copies> | |
| 263 | + <partitioning> | |
| 264 | + <method>none</method> | |
| 265 | + <schema_name/> | |
| 266 | + </partitioning> | |
| 267 | + <compatible>N</compatible> | |
| 268 | + <optimizationLevel>9</optimizationLevel> | |
| 269 | + <jsScripts> <jsScript> <jsScript_type>0</jsScript_type> | |
| 270 | + <jsScript_name>Script 1</jsScript_name> | |
| 271 | + <jsScript_script>//Script here

var gh_calcu = 所属公司代码 + "-" + 工号;</jsScript_script> | |
| 272 | + </jsScript> </jsScripts> <fields> <field> <name>gh_calcu</name> | |
| 273 | + <rename>gh_calcu</rename> | |
| 274 | + <type>String</type> | |
| 275 | + <length>-1</length> | |
| 276 | + <precision>-1</precision> | |
| 277 | + <replace>N</replace> | |
| 278 | + </field> </fields> <cluster_schema/> | |
| 279 | + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI> | |
| 280 | + <xloc>362</xloc> | |
| 281 | + <yloc>190</yloc> | |
| 282 | + <draw>Y</draw> | |
| 283 | + </GUI> | |
| 284 | + </step> | |
| 285 | + | |
| 286 | + <step> | |
| 257 | 287 | <name>原始系统导出的Excel输入</name> |
| 258 | 288 | <type>ExcelInput</type> |
| 259 | 289 | <description/> |
| ... | ... | @@ -411,12 +441,6 @@ |
| 411 | 441 | <schema/> |
| 412 | 442 | <table>bsth_c_personnel</table> |
| 413 | 443 | <key> |
| 414 | - <name>所属公司代码</name> | |
| 415 | - <field>company_code</field> | |
| 416 | - <condition>=</condition> | |
| 417 | - <name2/> | |
| 418 | - </key> | |
| 419 | - <key> | |
| 420 | 444 | <name>gh_calcu</name> |
| 421 | 445 | <field>job_code</field> |
| 422 | 446 | <condition>=</condition> |
| ... | ... | @@ -462,6 +486,92 @@ |
| 462 | 486 | </step> |
| 463 | 487 | |
| 464 | 488 | <step> |
| 489 | + <name>获取变量</name> | |
| 490 | + <type>GetVariable</type> | |
| 491 | + <description/> | |
| 492 | + <distribute>Y</distribute> | |
| 493 | + <custom_distribution/> | |
| 494 | + <copies>1</copies> | |
| 495 | + <partitioning> | |
| 496 | + <method>none</method> | |
| 497 | + <schema_name/> | |
| 498 | + </partitioning> | |
| 499 | + <fields> | |
| 500 | + <field> | |
| 501 | + <name>filepath_</name> | |
| 502 | + <variable>${filepath}</variable> | |
| 503 | + <type>String</type> | |
| 504 | + <format/> | |
| 505 | + <currency/> | |
| 506 | + <decimal/> | |
| 507 | + <group/> | |
| 508 | + <length>-1</length> | |
| 509 | + <precision>-1</precision> | |
| 510 | + <trim_type>none</trim_type> | |
| 511 | + </field> | |
| 512 | + <field> | |
| 513 | + <name>erroroutputdir_</name> | |
| 514 | + <variable>${erroroutputdir}</variable> | |
| 515 | + <type>String</type> | |
| 516 | + <format/> | |
| 517 | + <currency/> | |
| 518 | + <decimal/> | |
| 519 | + <group/> | |
| 520 | + <length>-1</length> | |
| 521 | + <precision>-1</precision> | |
| 522 | + <trim_type>none</trim_type> | |
| 523 | + </field> | |
| 524 | + </fields> | |
| 525 | + <cluster_schema/> | |
| 526 | + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI> | |
| 527 | + <xloc>90</xloc> | |
| 528 | + <yloc>148</yloc> | |
| 529 | + <draw>Y</draw> | |
| 530 | + </GUI> | |
| 531 | + </step> | |
| 532 | + | |
| 533 | + <step> | |
| 534 | + <name>过滤记录</name> | |
| 535 | + <type>FilterRows</type> | |
| 536 | + <description/> | |
| 537 | + <distribute>Y</distribute> | |
| 538 | + <custom_distribution/> | |
| 539 | + <copies>1</copies> | |
| 540 | + <partitioning> | |
| 541 | + <method>none</method> | |
| 542 | + <schema_name/> | |
| 543 | + </partitioning> | |
| 544 | +<send_true_to/> | |
| 545 | +<send_false_to/> | |
| 546 | + <compare> | |
| 547 | +<condition> | |
| 548 | + <negated>N</negated> | |
| 549 | + <conditions> | |
| 550 | + <condition> | |
| 551 | + <negated>N</negated> | |
| 552 | + <leftvalue>工号</leftvalue> | |
| 553 | + <function>IS NOT NULL</function> | |
| 554 | + <rightvalue/> | |
| 555 | + </condition> | |
| 556 | + <condition> | |
| 557 | + <negated>N</negated> | |
| 558 | + <operator>AND</operator> | |
| 559 | + <leftvalue>所属公司代码</leftvalue> | |
| 560 | + <function>IS NOT NULL</function> | |
| 561 | + <rightvalue/> | |
| 562 | + </condition> | |
| 563 | + </conditions> | |
| 564 | + </condition> | |
| 565 | + </compare> | |
| 566 | + <cluster_schema/> | |
| 567 | + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI> | |
| 568 | + <xloc>358</xloc> | |
| 569 | + <yloc>57</yloc> | |
| 570 | + <draw>Y</draw> | |
| 571 | + </GUI> | |
| 572 | + </step> | |
| 573 | + | |
| 574 | + <step> | |
| 465 | 575 | <name>错误输出</name> |
| 466 | 576 | <type>ExcelOutput</type> |
| 467 | 577 | <description/> |
| ... | ... | @@ -583,122 +693,6 @@ |
| 583 | 693 | </GUI> |
| 584 | 694 | </step> |
| 585 | 695 | |
| 586 | - <step> | |
| 587 | - <name>获取变量</name> | |
| 588 | - <type>GetVariable</type> | |
| 589 | - <description/> | |
| 590 | - <distribute>Y</distribute> | |
| 591 | - <custom_distribution/> | |
| 592 | - <copies>1</copies> | |
| 593 | - <partitioning> | |
| 594 | - <method>none</method> | |
| 595 | - <schema_name/> | |
| 596 | - </partitioning> | |
| 597 | - <fields> | |
| 598 | - <field> | |
| 599 | - <name>filepath_</name> | |
| 600 | - <variable>${filepath}</variable> | |
| 601 | - <type>String</type> | |
| 602 | - <format/> | |
| 603 | - <currency/> | |
| 604 | - <decimal/> | |
| 605 | - <group/> | |
| 606 | - <length>-1</length> | |
| 607 | - <precision>-1</precision> | |
| 608 | - <trim_type>none</trim_type> | |
| 609 | - </field> | |
| 610 | - <field> | |
| 611 | - <name>erroroutputdir_</name> | |
| 612 | - <variable>${erroroutputdir}</variable> | |
| 613 | - <type>String</type> | |
| 614 | - <format/> | |
| 615 | - <currency/> | |
| 616 | - <decimal/> | |
| 617 | - <group/> | |
| 618 | - <length>-1</length> | |
| 619 | - <precision>-1</precision> | |
| 620 | - <trim_type>none</trim_type> | |
| 621 | - </field> | |
| 622 | - </fields> | |
| 623 | - <cluster_schema/> | |
| 624 | - <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI> | |
| 625 | - <xloc>90</xloc> | |
| 626 | - <yloc>148</yloc> | |
| 627 | - <draw>Y</draw> | |
| 628 | - </GUI> | |
| 629 | - </step> | |
| 630 | - | |
| 631 | - <step> | |
| 632 | - <name>过滤记录</name> | |
| 633 | - <type>FilterRows</type> | |
| 634 | - <description/> | |
| 635 | - <distribute>Y</distribute> | |
| 636 | - <custom_distribution/> | |
| 637 | - <copies>1</copies> | |
| 638 | - <partitioning> | |
| 639 | - <method>none</method> | |
| 640 | - <schema_name/> | |
| 641 | - </partitioning> | |
| 642 | -<send_true_to/> | |
| 643 | -<send_false_to/> | |
| 644 | - <compare> | |
| 645 | -<condition> | |
| 646 | - <negated>N</negated> | |
| 647 | - <conditions> | |
| 648 | - <condition> | |
| 649 | - <negated>N</negated> | |
| 650 | - <leftvalue>工号</leftvalue> | |
| 651 | - <function>IS NOT NULL</function> | |
| 652 | - <rightvalue/> | |
| 653 | - </condition> | |
| 654 | - <condition> | |
| 655 | - <negated>N</negated> | |
| 656 | - <operator>AND</operator> | |
| 657 | - <leftvalue>所属公司代码</leftvalue> | |
| 658 | - <function>IS NOT NULL</function> | |
| 659 | - <rightvalue/> | |
| 660 | - </condition> | |
| 661 | - </conditions> | |
| 662 | - </condition> | |
| 663 | - </compare> | |
| 664 | - <cluster_schema/> | |
| 665 | - <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI> | |
| 666 | - <xloc>358</xloc> | |
| 667 | - <yloc>57</yloc> | |
| 668 | - <draw>Y</draw> | |
| 669 | - </GUI> | |
| 670 | - </step> | |
| 671 | - | |
| 672 | - <step> | |
| 673 | - <name>JavaScript代码</name> | |
| 674 | - <type>ScriptValueMod</type> | |
| 675 | - <description/> | |
| 676 | - <distribute>Y</distribute> | |
| 677 | - <custom_distribution/> | |
| 678 | - <copies>1</copies> | |
| 679 | - <partitioning> | |
| 680 | - <method>none</method> | |
| 681 | - <schema_name/> | |
| 682 | - </partitioning> | |
| 683 | - <compatible>N</compatible> | |
| 684 | - <optimizationLevel>9</optimizationLevel> | |
| 685 | - <jsScripts> <jsScript> <jsScript_type>0</jsScript_type> | |
| 686 | - <jsScript_name>Script 1</jsScript_name> | |
| 687 | - <jsScript_script>//Script here

var gh_calcu = 所属公司代码 + "-" + 工号;</jsScript_script> | |
| 688 | - </jsScript> </jsScripts> <fields> <field> <name>gh_calcu</name> | |
| 689 | - <rename>gh_calcu</rename> | |
| 690 | - <type>String</type> | |
| 691 | - <length>-1</length> | |
| 692 | - <precision>-1</precision> | |
| 693 | - <replace>N</replace> | |
| 694 | - </field> </fields> <cluster_schema/> | |
| 695 | - <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI> | |
| 696 | - <xloc>362</xloc> | |
| 697 | - <yloc>190</yloc> | |
| 698 | - <draw>Y</draw> | |
| 699 | - </GUI> | |
| 700 | - </step> | |
| 701 | - | |
| 702 | 696 | <step_error_handling> |
| 703 | 697 | <error> |
| 704 | 698 | <source_step>插入/更新bsth_c_personnel</source_step> |
| ... | ... | @@ -718,3 +712,4 @@ |
| 718 | 712 | <slave_transformation>N</slave_transformation> |
| 719 | 713 | |
| 720 | 714 | </transformation> |
| 715 | + | ... | ... |
src/main/resources/datatools/ktrs/scheduleRuleDataInput.ktr
| ... | ... | @@ -1091,12 +1091,6 @@ |
| 1091 | 1091 | <condition>=</condition> |
| 1092 | 1092 | <name2/> |
| 1093 | 1093 | </key> |
| 1094 | - <key> | |
| 1095 | - <name>路牌范围</name> | |
| 1096 | - <field>lp_names</field> | |
| 1097 | - <condition>=</condition> | |
| 1098 | - <name2/> | |
| 1099 | - </key> | |
| 1100 | 1094 | <value> |
| 1101 | 1095 | <name>xl</name> |
| 1102 | 1096 | <rename>xlid</rename> | ... | ... |
src/main/resources/rules/shiftloop.drl renamed to src/main/resources/rules/legacy/shiftloop.drl
src/main/resources/rules/shiftloop_fb.drl renamed to src/main/resources/rules/legacy/shiftloop_fb.drl
src/main/resources/rules/shiftloop_fb_2.drl
| ... | ... | @@ -131,8 +131,10 @@ rule "Calcu_SchedulePlanRuleResult_wrap" |
| 131 | 131 | fromDate.isBefore(toDate) || fromDate.isEqual(toDate), |
| 132 | 132 | $fromDate : fromDate, |
| 133 | 133 | $toDate : toDate, |
| 134 | - $xlId: xlId | |
| 134 | + $xlId: xlId, | |
| 135 | + $self: schedulePlan | |
| 135 | 136 | ) |
| 137 | + eval($self.getIsHistoryPlanFirst() == true) // 是否使用历史排班标识 | |
| 136 | 138 | $sprr: SchedulePlanRuleResult() from schedulePlanRuleResultRepository.findLastByXl($xlId, $fromDate.toDate()) |
| 137 | 139 | |
| 138 | 140 | then | ... | ... |
src/main/resources/static/pages/scheduleApp/module/core/schedulePlanManage/form.html
| ... | ... | @@ -126,6 +126,14 @@ |
| 126 | 126 | </div> |
| 127 | 127 | </div> |
| 128 | 128 | |
| 129 | + <div class="form-group has-success has-feedback"> | |
| 130 | + <label class="col-md-2 control-label">模式1(历史排班优先):</label> | |
| 131 | + <div class="col-md-3"> | |
| 132 | + <sa-Radiogroup model="ctrl.schedulePlanManageForSave.isHistoryPlanFirst" dicgroup="truefalseType" name="isHistoryPlanFirst"></sa-Radiogroup> | |
| 133 | + </div> | |
| 134 | + </div> | |
| 135 | + | |
| 136 | + | |
| 129 | 137 | <!-- 其他form-group --> |
| 130 | 138 | |
| 131 | 139 | </div> | ... | ... |
src/main/resources/static/pages/scheduleApp/module/core/schedulePlanManage/module.js
| ... | ... | @@ -206,6 +206,9 @@ angular.module('ScheduleApp').controller( |
| 206 | 206 | self.schedulePlanManageForSave.xl.id = service.getSearchCondition()['xl.id_eq']; |
| 207 | 207 | self.schedulePlanManageForSave.xl.name = service.getSearchCondition()['xl.name_eq']; |
| 208 | 208 | |
| 209 | + // 默认使用历史排班数据 | |
| 210 | + self.schedulePlanManageForSave.isHistoryPlanFirst = true; | |
| 211 | + | |
| 209 | 212 | // 提交方法 |
| 210 | 213 | self.submit = function() { |
| 211 | 214 | console.log(self.schedulePlanManageForSave); | ... | ... |
src/main/resources/static/real_control_v2/js/north/toolbar.js
| ... | ... | @@ -102,6 +102,9 @@ var gb_northToolbar = (function () { |
| 102 | 102 | form_waybill: function () { |
| 103 | 103 | gb_embed_form_hanlde.open_modal_form_fragment('/pages/forms/statement/waybill.html', '行车路单'); |
| 104 | 104 | }, |
| 105 | + form_waybillQp: function () { | |
| 106 | + gb_embed_form_hanlde.open_modal_form_fragment('/pages/forms/statement/waybillQp.html', '行车路单'); | |
| 107 | + }, | |
| 105 | 108 | form_history_message: function () { |
| 106 | 109 | gb_embed_form_hanlde.open_modal_form_fragment('/pages/forms/statement/historyMessage.html', '调度历史消息'); |
| 107 | 110 | }, | ... | ... |