Commit ce4e5383b1c3b8d233d30c61ed93b90781092bb0

Authored by 廖磊
2 parents b72d453e a2d14a12

Merge branch 'minhang' of

http://222.66.0.204:8090/panzhaov5/bsth_control into minhang

# Conflicts:
#	src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
src/main/java/com/bsth/data/car_out_info/CarOutInfoHandler.java
1 package com.bsth.data.car_out_info; 1 package com.bsth.data.car_out_info;
2 2
3 -import com.bsth.Application;  
4 import com.bsth.data.BasicData; 3 import com.bsth.data.BasicData;
5 import com.bsth.data.schedule.DayOfSchedule; 4 import com.bsth.data.schedule.DayOfSchedule;
6 import com.bsth.data.schedule.ScheduleComparator; 5 import com.bsth.data.schedule.ScheduleComparator;
@@ -24,7 +23,6 @@ import org.springframework.transaction.support.DefaultTransactionDefinition; @@ -24,7 +23,6 @@ import org.springframework.transaction.support.DefaultTransactionDefinition;
24 import java.sql.PreparedStatement; 23 import java.sql.PreparedStatement;
25 import java.sql.SQLException; 24 import java.sql.SQLException;
26 import java.util.*; 25 import java.util.*;
27 -import java.util.concurrent.TimeUnit;  
28 26
29 /** 27 /**
30 * 发车信息表处理程序 28 * 发车信息表处理程序
@@ -208,7 +206,7 @@ public class CarOutInfoHandler implements CommandLineRunner, CarOutInfo { @@ -208,7 +206,7 @@ public class CarOutInfoHandler implements CommandLineRunner, CarOutInfo {
208 bcTypeMap.put("venting", "直放"); 206 bcTypeMap.put("venting", "直放");
209 bcTypeMap.put("major", "放站"); 207 bcTypeMap.put("major", "放站");
210 bcTypeMap.put("ldks", "两点间空驶"); 208 bcTypeMap.put("ldks", "两点间空驶");
211 - Application.mainServices.scheduleWithFixedDelay(updateInfoThread, 60, 40, TimeUnit.SECONDS); 209 + //Application.mainServices.scheduleWithFixedDelay(updateInfoThread, 60, 40, TimeUnit.SECONDS);
212 } 210 }
213 211
214 @Component 212 @Component
src/main/java/com/bsth/data/directive/DirectivesPstThread.java
1 package com.bsth.data.directive; 1 package com.bsth.data.directive;
2 2
  3 +import com.bsth.data.schedule.DayOfSchedule;
3 import com.bsth.entity.directive.D60; 4 import com.bsth.entity.directive.D60;
4 import com.bsth.entity.directive.D64; 5 import com.bsth.entity.directive.D64;
5 import com.bsth.entity.directive.Directive; 6 import com.bsth.entity.directive.Directive;
  7 +import com.bsth.entity.realcontrol.ScheduleRealInfo;
6 import com.bsth.repository.directive.D60Repository; 8 import com.bsth.repository.directive.D60Repository;
7 import com.bsth.repository.directive.D64Repository; 9 import com.bsth.repository.directive.D64Repository;
8 import org.slf4j.Logger; 10 import org.slf4j.Logger;
@@ -27,6 +29,9 @@ public class DirectivesPstThread extends Thread { @@ -27,6 +29,9 @@ public class DirectivesPstThread extends Thread {
27 @Autowired 29 @Autowired
28 D64Repository d64Repository; 30 D64Repository d64Repository;
29 31
  32 + @Autowired
  33 + DayOfSchedule dayOfSchedule;
  34 +
30 @Override 35 @Override
31 public void run() { 36 public void run() {
32 LinkedList<Directive> list = DayOfDirectives.pstDirectives; 37 LinkedList<Directive> list = DayOfDirectives.pstDirectives;
@@ -37,7 +42,14 @@ public class DirectivesPstThread extends Thread { @@ -37,7 +42,14 @@ public class DirectivesPstThread extends Thread {
37 directive = list.poll(); 42 directive = list.poll();
38 43
39 if (directive instanceof D60) { 44 if (directive instanceof D60) {
40 - d60Repository.save((D60) directive); 45 + D60 d60 = (D60) directive;
  46 + if(d60.isDispatch()){
  47 + ScheduleRealInfo sch = d60.getSch();
  48 + //如果关联的班次已经不存在了,放弃入库
  49 + if(dayOfSchedule.get(sch.getId()) == null)
  50 + continue;
  51 + }
  52 + d60Repository.save(d60);
41 } 53 }
42 54
43 if (directive instanceof D64) { 55 if (directive instanceof D64) {
src/main/java/com/bsth/entity/directive/D60.java
1 package com.bsth.entity.directive; 1 package com.bsth.entity.directive;
2 2
3 -import javax.persistence.Embeddable;  
4 -import javax.persistence.Entity;  
5 -import javax.persistence.FetchType;  
6 -import javax.persistence.GeneratedValue;  
7 -import javax.persistence.Id;  
8 -import javax.persistence.ManyToOne;  
9 -import javax.persistence.NamedAttributeNode;  
10 -import javax.persistence.NamedEntityGraph;  
11 -import javax.persistence.NamedEntityGraphs;  
12 -import javax.persistence.Table;  
13 -import javax.persistence.Transient;  
14 -  
15 import com.bsth.entity.realcontrol.ScheduleRealInfo; 3 import com.bsth.entity.realcontrol.ScheduleRealInfo;
16 import com.fasterxml.jackson.annotation.JsonIgnore; 4 import com.fasterxml.jackson.annotation.JsonIgnore;
17 5
  6 +import javax.persistence.*;
  7 +
18 8
19 /** 9 /**
20 * @author PanZhao 10 * @author PanZhao
@@ -75,7 +65,7 @@ public class D60 extends Directive { @@ -75,7 +65,7 @@ public class D60 extends Directive {
75 * 相关联的班次 65 * 相关联的班次
76 */ 66 */
77 @JsonIgnore 67 @JsonIgnore
78 - @ManyToOne(fetch = FetchType.LAZY) 68 + @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.REFRESH)
79 private ScheduleRealInfo sch; 69 private ScheduleRealInfo sch;
80 70
81 public Long getReply46Time() { 71 public Long getReply46Time() {
src/main/java/com/bsth/service/directive/DirectiveServiceImpl.java
@@ -132,14 +132,14 @@ public class DirectiveServiceImpl extends BaseServiceImpl&lt;D60, Integer&gt; implemen @@ -132,14 +132,14 @@ public class DirectiveServiceImpl extends BaseServiceImpl&lt;D60, Integer&gt; implemen
132 // 发送指令 132 // 发送指令
133 int code = GatewayHttpUtils.postJson(jObj.toJSONString()); 133 int code = GatewayHttpUtils.postJson(jObj.toJSONString());
134 134
135 - // 添加到缓存,等待入库  
136 d60.setDispatch(true); 135 d60.setDispatch(true);
137 d60.setSch(sch); 136 d60.setSch(sch);
138 d60.setHttpCode(code); 137 d60.setHttpCode(code);
139 - dayOfDirectives.put60(d60);  
140 138
141 if (code == 0) { 139 if (code == 0) {
142 sch.setDirectiveState(60); 140 sch.setDirectiveState(60);
  141 + // 添加到缓存,延迟入库
  142 + dayOfDirectives.put60(d60);
143 // 通知页面 143 // 通知页面
144 sendD60ToPage(sch); 144 sendD60ToPage(sch);
145 } 145 }
src/main/java/com/bsth/service/realcontrol/impl/ChildTaskPlanServiceImpl.java
@@ -51,11 +51,11 @@ public class ChildTaskPlanServiceImpl extends BaseServiceImpl&lt;ChildTaskPlan, Lon @@ -51,11 +51,11 @@ public class ChildTaskPlanServiceImpl extends BaseServiceImpl&lt;ChildTaskPlan, Lon
51 51
52 if(StringUtils.isEmpty(t.getEndStationName())) 52 if(StringUtils.isEmpty(t.getEndStationName()))
53 t.setEndStationName(BasicData.getStationNameByCode(t.getEndStation(), prefix)); 53 t.setEndStationName(BasicData.getStationNameByCode(t.getEndStation(), prefix));
  54 + if(t.getDestroyReason() == null)
  55 + t.setDestroyReason("");
54 //先持久化子任务 56 //先持久化子任务
55 rs = super.save(t); 57 rs = super.save(t);
56 //关联主任务 58 //关联主任务
57 - System.out.println("schschsch: " + sch);  
58 - System.out.println("sch.getcTasks()sch.getcTasks(): " + sch.getcTasks());  
59 sch.getcTasks().add(t); 59 sch.getcTasks().add(t);
60 dayOfSchedule.save(sch); 60 dayOfSchedule.save(sch);
61 //直接持久化 61 //直接持久化
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
@@ -41,6 +41,7 @@ import com.bsth.repository.schedule.EmployeeConfigInfoRepository; @@ -41,6 +41,7 @@ import com.bsth.repository.schedule.EmployeeConfigInfoRepository;
41 import com.bsth.repository.schedule.GuideboardInfoRepository; 41 import com.bsth.repository.schedule.GuideboardInfoRepository;
42 import com.bsth.security.util.SecurityUtils; 42 import com.bsth.security.util.SecurityUtils;
43 import com.bsth.service.SectionRouteService; 43 import com.bsth.service.SectionRouteService;
  44 +import com.bsth.service.directive.DirectiveService;
44 import com.bsth.service.impl.BaseServiceImpl; 45 import com.bsth.service.impl.BaseServiceImpl;
45 import com.bsth.service.realcontrol.ScheduleRealInfoService; 46 import com.bsth.service.realcontrol.ScheduleRealInfoService;
46 import com.bsth.service.report.CulateMileageService; 47 import com.bsth.service.report.CulateMileageService;
@@ -89,7 +90,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -89,7 +90,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
89 90
90 @Autowired 91 @Autowired
91 SectionRouteService sectionRouteService; 92 SectionRouteService sectionRouteService;
92 - 93 +
93 @Autowired 94 @Autowired
94 CulateMileageService culateMieageService; 95 CulateMileageService culateMieageService;
95 96
@@ -125,16 +126,19 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -125,16 +126,19 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
125 126
126 @Autowired 127 @Autowired
127 YlbRepository ylbRepository; 128 YlbRepository ylbRepository;
128 - 129 +
129 @Autowired 130 @Autowired
130 ReportService reposrService; 131 ReportService reposrService;
131 - 132 +
132 @Autowired 133 @Autowired
133 CulateMileageService culateService; 134 CulateMileageService culateService;
134 135
135 @Autowired 136 @Autowired
136 SchModifyLog schModifyLog; 137 SchModifyLog schModifyLog;
137 138
  139 + @Autowired
  140 + DirectiveService directiveService;
  141 +
138 Logger logger = LoggerFactory.getLogger(this.getClass()); 142 Logger logger = LoggerFactory.getLogger(this.getClass());
139 143
140 SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), 144 SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"),
@@ -620,6 +624,13 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -620,6 +624,13 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
620 //数据库删除 624 //数据库删除
621 rs = super.delete(id); 625 rs = super.delete(id);
622 if(rs.get("status").equals(ResponseCode.SUCCESS)){ 626 if(rs.get("status").equals(ResponseCode.SUCCESS)){
  627 + /*ScheduleRealInfo temp = super.findById(id);
  628 + if(temp != null){
  629 + rs.put("status", ResponseCode.ERROR);
  630 + rs.put("msg", "删除失败,请重试!");
  631 + return rs;
  632 + }*/
  633 +
623 dayOfSchedule.delete(sch); 634 dayOfSchedule.delete(sch);
624 //更新起点应到时间 635 //更新起点应到时间
625 List<ScheduleRealInfo> ts = dayOfSchedule.updateQdzTimePlan(sch); 636 List<ScheduleRealInfo> ts = dayOfSchedule.updateQdzTimePlan(sch);
@@ -729,39 +740,39 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -729,39 +740,39 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
729 List<ScheduleRealInfo> listNew = new ArrayList<ScheduleRealInfo>(); 740 List<ScheduleRealInfo> listNew = new ArrayList<ScheduleRealInfo>();
730 Pattern pattern = Pattern.compile("^[-\\+]?[\\d]*$"); 741 Pattern pattern = Pattern.compile("^[-\\+]?[\\d]*$");
731 // if (px.equals("desc")) { 742 // if (px.equals("desc")) {
732 - int zt = 0;  
733 - for (int l = 0; l < 2; l++) {  
734 - for (int i = 0; i < list.size(); i++) {  
735 - ScheduleRealInfo t = list.get(i);  
736 - if (t.getLpName().indexOf("+") != -1) {  
737 - if (zt == 0) {  
738 - listNew.add(t);  
739 - }  
740 - } else if (pattern.matcher(t.getLpName()).matches()) {  
741 - if (zt == 1) {  
742 - listNew.add(t);  
743 - }  
744 - } else { 743 + int zt = 0;
  744 + for (int l = 0; l < 2; l++) {
  745 + for (int i = 0; i < list.size(); i++) {
  746 + ScheduleRealInfo t = list.get(i);
  747 + if (t.getLpName().indexOf("+") != -1) {
  748 + if (zt == 0) {
  749 + listNew.add(t);
  750 + }
  751 + } else if (pattern.matcher(t.getLpName()).matches()) {
  752 + if (zt == 1) {
  753 + listNew.add(t);
  754 + }
  755 + } else {
745 // if (zt == 2) { 756 // if (zt == 2) {
746 // listNew.add(t); 757 // listNew.add(t);
747 // } 758 // }
748 - continue;  
749 - } 759 + continue;
750 } 760 }
751 - zt++;  
752 } 761 }
753 -  
754 - Collections.sort(list, new ComparableLp());  
755 - for (int i = 0; i < list.size(); i++) {  
756 - ScheduleRealInfo t = list.get(i);  
757 - if (t.getLpName().indexOf("+") != -1) {  
758 - continue;  
759 - } else if (pattern.matcher(t.getLpName()).matches()) {  
760 - continue;  
761 - } else {  
762 - listNew.add(t);  
763 - }  
764 - } 762 + zt++;
  763 + }
  764 +
  765 + Collections.sort(list, new ComparableLp());
  766 + for (int i = 0; i < list.size(); i++) {
  767 + ScheduleRealInfo t = list.get(i);
  768 + if (t.getLpName().indexOf("+") != -1) {
  769 + continue;
  770 + } else if (pattern.matcher(t.getLpName()).matches()) {
  771 + continue;
  772 + } else {
  773 + listNew.add(t);
  774 + }
  775 + }
765 /*} else { 776 /*} else {
766 int zt = 0; 777 int zt = 0;
767 for (int l = 0; l < 3; l++) { 778 for (int l = 0; l < 3; l++) {
@@ -804,17 +815,17 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -804,17 +815,17 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
804 List<ScheduleRealInfo> scheduleRealInfos = scheduleRealInfoRepository.queryListWaybill(jName, clZbh, lpName, date, line); 815 List<ScheduleRealInfo> scheduleRealInfos = scheduleRealInfoRepository.queryListWaybill(jName, clZbh, lpName, date, line);
805 List<Map<String, Object>> listMap = new ArrayList<Map<String, Object>>(); 816 List<Map<String, Object>> listMap = new ArrayList<Map<String, Object>>();
806 // List<ScheduleRealInfo> scheduleRealInfos=scheduleRealInfoRepository.queryListWaybillXcld(jName, clZbh, lpName, date, line); 817 // List<ScheduleRealInfo> scheduleRealInfos=scheduleRealInfoRepository.queryListWaybillXcld(jName, clZbh, lpName, date, line);
807 - List<ScheduleRealInfo> lists=new ArrayList<ScheduleRealInfo>();  
808 - for (int i = 0; i < scheduleRealInfos.size(); i++) {  
809 - ScheduleRealInfo s=scheduleRealInfos.get(i);  
810 - if(s.getZdsjActual()!=null){  
811 - lists.add(s);  
812 - }  
813 - } 818 + List<ScheduleRealInfo> lists=new ArrayList<ScheduleRealInfo>();
  819 + for (int i = 0; i < scheduleRealInfos.size(); i++) {
  820 + ScheduleRealInfo s=scheduleRealInfos.get(i);
  821 + if(s.getZdsjActual()!=null){
  822 + lists.add(s);
  823 + }
  824 + }
814 DecimalFormat format = new DecimalFormat("0.00"); 825 DecimalFormat format = new DecimalFormat("0.00");
815 // int cjbc = scheduleRealInfoRepository.findCjbc(jName, clZbh, lpName); 826 // int cjbc = scheduleRealInfoRepository.findCjbc(jName, clZbh, lpName);
816 // int ljbc = scheduleRealInfoRepository.findLjbc(jName, clZbh, lpName); 827 // int ljbc = scheduleRealInfoRepository.findLjbc(jName, clZbh, lpName);
817 - //计算里程和班次数,并放入Map里 828 + //计算里程和班次数,并放入Map里
818 Map<String, Object> map = this.MapById(scheduleRealInfos.get(0).getId()); 829 Map<String, Object> map = this.MapById(scheduleRealInfos.get(0).getId());
819 830
820 map.put("jhlc",Arith.add(culateMieageService.culateJhgl(scheduleRealInfos),culateMieageService.culateJhJccgl(scheduleRealInfos))); 831 map.put("jhlc",Arith.add(culateMieageService.culateJhgl(scheduleRealInfos),culateMieageService.culateJhJccgl(scheduleRealInfos)));
@@ -833,33 +844,33 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -833,33 +844,33 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
833 // map=new HashMap<String,Object>(); 844 // map=new HashMap<String,Object>();
834 Map<String, Object> maps; 845 Map<String, Object> maps;
835 for (ScheduleRealInfo scheduleRealInfo : scheduleRealInfos) { 846 for (ScheduleRealInfo scheduleRealInfo : scheduleRealInfos) {
836 - maps = new HashMap<String, Object>();  
837 - try {  
838 - scheduleRealInfo.setjName(scheduleRealInfo.getjGh() + scheduleRealInfo.getjName());  
839 - scheduleRealInfo.setsName(scheduleRealInfo.getsGh() + scheduleRealInfo.getsName());  
840 - maps = rru.getMapValue(scheduleRealInfo);  
841 - String zdsj = scheduleRealInfo.getZdsj();  
842 - String zdsjActual = scheduleRealInfo.getZdsjActual();  
843 - if (zdsj != null && zdsjActual != null &&  
844 - !zdsj.equals(zdsjActual)) {  
845 - if (zdsj.compareTo(zdsjActual) > 0) {  
846 - maps.put("fast", TimeUtils.getTimeDifference(zdsj, zdsjActual));  
847 - maps.put("slow", "");  
848 - } else {  
849 - maps.put("fast", "");  
850 - maps.put("slow", TimeUtils.getTimeDifference(zdsj, zdsjActual));  
851 - } 847 + maps = new HashMap<String, Object>();
  848 + try {
  849 + scheduleRealInfo.setjName(scheduleRealInfo.getjGh() + scheduleRealInfo.getjName());
  850 + scheduleRealInfo.setsName(scheduleRealInfo.getsGh() + scheduleRealInfo.getsName());
  851 + maps = rru.getMapValue(scheduleRealInfo);
  852 + String zdsj = scheduleRealInfo.getZdsj();
  853 + String zdsjActual = scheduleRealInfo.getZdsjActual();
  854 + if (zdsj != null && zdsjActual != null &&
  855 + !zdsj.equals(zdsjActual)) {
  856 + if (zdsj.compareTo(zdsjActual) > 0) {
  857 + maps.put("fast", TimeUtils.getTimeDifference(zdsj, zdsjActual));
  858 + maps.put("slow", "");
852 } else { 859 } else {
853 - maps.put("fast", "");  
854 - maps.put("slow", ""); 860 + maps.put("fast", "");
  861 + maps.put("slow", TimeUtils.getTimeDifference(zdsj, zdsjActual));
855 } 862 }
856 - listMap.add(maps);  
857 - } catch (Exception e) {  
858 - e.printStackTrace(); 863 + } else {
  864 + maps.put("fast", "");
  865 + maps.put("slow", "");
859 } 866 }
  867 + listMap.add(maps);
  868 + } catch (Exception e) {
  869 + e.printStackTrace();
  870 + }
860 } 871 }
861 872
862 - 873 +
863 874
864 String path = this.getClass().getResource("/").getPath() + "static/pages/forms/"; 875 String path = this.getClass().getResource("/").getPath() + "static/pages/forms/";
865 876
@@ -1269,6 +1280,10 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -1269,6 +1280,10 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1269 ts.add(next); 1280 ts.add(next);
1270 } 1281 }
1271 1282
  1283 + if(!next.getXlBm().equals(sch.getXlBm())){
  1284 + directiveService.lineChange(next.getClZbh(), next.getXlBm(), "套跑@系统");
  1285 + }
  1286 +
1272 //重新计算车辆执行班次 1287 //重新计算车辆执行班次
1273 dayOfSchedule.reCalcExecPlan(sch.getClZbh()); 1288 dayOfSchedule.reCalcExecPlan(sch.getClZbh());
1274 } else if(StringUtils.isNotEmpty(sch.getZdsjActual()) && StringUtils.isEmpty(zdsjActual)){ 1289 } else if(StringUtils.isNotEmpty(sch.getZdsjActual()) && StringUtils.isEmpty(zdsjActual)){
@@ -1638,38 +1653,38 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -1638,38 +1653,38 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1638 // map.put("zkslc", format.format(ksgl + jcclc+addMileageJc)); 1653 // map.put("zkslc", format.format(ksgl + jcclc+addMileageJc));
1639 return map; 1654 return map;
1640 }*/ 1655 }*/
1641 - 1656 +
1642 public Map<String, Object> findKMBC(String jGh, String clZbh, 1657 public Map<String, Object> findKMBC(String jGh, String clZbh,
1643 - String lpName, String date, String line) {  
1644 - Map<String, Object> map = new HashMap<String, Object>();  
1645 - List<ScheduleRealInfo> list=scheduleRealInfoRepository.queryListWaybillXcld(jGh, clZbh, lpName, date, line);  
1646 - List<ScheduleRealInfo> lists=new ArrayList<ScheduleRealInfo>();  
1647 - for (int i = 0; i < list.size(); i++) {  
1648 - ScheduleRealInfo s=list.get(i);  
1649 - if(s.getZdsjActual()!=null){  
1650 - lists.add(s);  
1651 - }  
1652 - }  
1653 - double ksgl=culateService.culateKsgl(list);  
1654 - double sjgl=culateService.culateSjgl(lists);  
1655 - double jccgl=culateService.culateJccgl(lists);  
1656 - double ljgl=culateService.culateLjgl(lists);  
1657 -  
1658 - map.put("jhlc", Arith.add(culateService.culateJhgl(list),culateService.culateJhJccgl(list))); //计划里程  
1659 - map.put("remMileage", culateService.culateLbgl(list)); //烂班公里  
1660 - map.put("addMileage", ljgl); //临加公里  
1661 - map.put("yygl",Arith.add(sjgl,ljgl)); //实际公里  
1662 - map.put("ksgl", ksgl);//空驶公里  
1663 - map.put("realMileage",Arith.add(Arith.add(ksgl,jccgl ),Arith.add(sjgl,ljgl))); 1658 + String lpName, String date, String line) {
  1659 + Map<String, Object> map = new HashMap<String, Object>();
  1660 + List<ScheduleRealInfo> list=scheduleRealInfoRepository.queryListWaybillXcld(jGh, clZbh, lpName, date, line);
  1661 + List<ScheduleRealInfo> lists=new ArrayList<ScheduleRealInfo>();
  1662 + for (int i = 0; i < list.size(); i++) {
  1663 + ScheduleRealInfo s=list.get(i);
  1664 + if(s.getZdsjActual()!=null){
  1665 + lists.add(s);
  1666 + }
  1667 + }
  1668 + double ksgl=culateService.culateKsgl(list);
  1669 + double sjgl=culateService.culateSjgl(lists);
  1670 + double jccgl=culateService.culateJccgl(lists);
  1671 + double ljgl=culateService.culateLjgl(lists);
  1672 +
  1673 + map.put("jhlc", Arith.add(culateService.culateJhgl(list),culateService.culateJhJccgl(list))); //计划里程
  1674 + map.put("remMileage", culateService.culateLbgl(list)); //烂班公里
  1675 + map.put("addMileage", ljgl); //临加公里
  1676 + map.put("yygl",Arith.add(sjgl,ljgl)); //实际公里
  1677 + map.put("ksgl", ksgl);//空驶公里
  1678 + map.put("realMileage",Arith.add(Arith.add(ksgl,jccgl ),Arith.add(sjgl,ljgl)));
1664 // map.put("realMileage", format.format(yygl + ksgl + jcclc+addMileage)); 1679 // map.put("realMileage", format.format(yygl + ksgl + jcclc+addMileage));
1665 - map.put("jhbc", culateService.culateJhbc(list,""));  
1666 - map.put("cjbc", culateService.culateLbbc(list));  
1667 - map.put("ljbc", culateService.culateLjbc(lists,""));  
1668 - map.put("sjbc", culateService.culateJhbc(lists,"") - culateService.culateLbbc(lists) + culateService.culateLjbc(lists,""));  
1669 - map.put("jcclc", jccgl);  
1670 - map.put("zkslc", Arith.add(ksgl,jccgl)); 1680 + map.put("jhbc", culateService.culateJhbc(list,""));
  1681 + map.put("cjbc", culateService.culateLbbc(list));
  1682 + map.put("ljbc", culateService.culateLjbc(lists,""));
  1683 + map.put("sjbc", culateService.culateJhbc(lists,"") - culateService.culateLbbc(lists) + culateService.culateLjbc(lists,""));
  1684 + map.put("jcclc", jccgl);
  1685 + map.put("zkslc", Arith.add(ksgl,jccgl));
1671 // map.put("zkslc", format.format(ksgl + jcclc+addMileageJc)); 1686 // map.put("zkslc", format.format(ksgl + jcclc+addMileageJc));
1672 - return map; 1687 + return map;
1673 } 1688 }
1674 1689
1675 1690
@@ -1800,33 +1815,33 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -1800,33 +1815,33 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1800 Long minSj=Long.parseLong(minSjs[0])*60+Long.parseLong(minSjs[1]); 1815 Long minSj=Long.parseLong(minSjs[0])*60+Long.parseLong(minSjs[1]);
1801 1816
1802 for (int i = 0; i < list.size(); i++) { 1817 for (int i = 0; i < list.size(); i++) {
1803 - ScheduleRealInfo s=list.get(i);  
1804 - String[] fcsj= s.getFcsj().split(":");  
1805 - Long fcsjL=Long.parseLong(fcsj[0])*60+Long.parseLong(fcsj[1]);  
1806 -  
1807 - Long fscjT=0L;  
1808 - if(fcsjL<minSj){  
1809 - Calendar calendar = new GregorianCalendar();  
1810 - calendar.setTime(s.getScheduleDate());  
1811 - calendar.add(calendar.DATE,1);  
1812 - s.setScheduleDate(calendar.getTime());  
1813 - try {  
1814 - fscjT = sdf.parse(sdf.format(s.getScheduleDate())+" "+s.getFcsj()).getTime();  
1815 - } catch (ParseException e) {  
1816 - // TODO Auto-generated catch block  
1817 - e.printStackTrace();  
1818 - }  
1819 -  
1820 - }else{  
1821 - try {  
1822 - fscjT =sdf.parse(s.getScheduleDateStr()+" "+s.getFcsj()).getTime();  
1823 - } catch (ParseException e) {  
1824 - // TODO Auto-generated catch block  
1825 - e.printStackTrace();  
1826 - };  
1827 - }  
1828 - s.setFcsjT(fscjT);  
1829 - } 1818 + ScheduleRealInfo s=list.get(i);
  1819 + String[] fcsj= s.getFcsj().split(":");
  1820 + Long fcsjL=Long.parseLong(fcsj[0])*60+Long.parseLong(fcsj[1]);
  1821 +
  1822 + Long fscjT=0L;
  1823 + if(fcsjL<minSj){
  1824 + Calendar calendar = new GregorianCalendar();
  1825 + calendar.setTime(s.getScheduleDate());
  1826 + calendar.add(calendar.DATE,1);
  1827 + s.setScheduleDate(calendar.getTime());
  1828 + try {
  1829 + fscjT = sdf.parse(sdf.format(s.getScheduleDate())+" "+s.getFcsj()).getTime();
  1830 + } catch (ParseException e) {
  1831 + // TODO Auto-generated catch block
  1832 + e.printStackTrace();
  1833 + }
  1834 +
  1835 + }else{
  1836 + try {
  1837 + fscjT =sdf.parse(s.getScheduleDateStr()+" "+s.getFcsj()).getTime();
  1838 + } catch (ParseException e) {
  1839 + // TODO Auto-generated catch block
  1840 + e.printStackTrace();
  1841 + };
  1842 + }
  1843 + s.setFcsjT(fscjT);
  1844 + }
1830 Collections.sort(list, new ComparableReal()); 1845 Collections.sort(list, new ComparableReal());
1831 for (int i = 0; i < list.size(); i++) { 1846 for (int i = 0; i < list.size(); i++) {
1832 ScheduleRealInfo s = list.get(i); 1847 ScheduleRealInfo s = list.get(i);
@@ -1850,31 +1865,31 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -1850,31 +1865,31 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1850 remarks += "(烂班)"; 1865 remarks += "(烂班)";
1851 s.setRemarks(remarks); 1866 s.setRemarks(remarks);
1852 } 1867 }
1853 - 1868 +
1854 listSchedule.add(s); 1869 listSchedule.add(s);
1855 //计算营运里程,空驶里程 1870 //计算营运里程,空驶里程
1856 if (!childTaskPlans.isEmpty()) { 1871 if (!childTaskPlans.isEmpty()) {
1857 // Iterator<ChildTaskPlan> it = childTaskPlans.iterator(); 1872 // Iterator<ChildTaskPlan> it = childTaskPlans.iterator();
1858 - List<ChildTaskPlan> listit=new ArrayList<ChildTaskPlan>(childTaskPlans);  
1859 - Collections.sort(listit, new ComparableChild());  
1860 - for (int j = 0; j < listit.size(); j++) {  
1861 - ScheduleRealInfo t = new ScheduleRealInfo();  
1862 - ChildTaskPlan childTaskPlan = listit.get(j);  
1863 - if (childTaskPlan.isDestroy()) {  
1864 - t.setFcsjActual("");  
1865 - t.setZdsjActual("");  
1866 - t.setJhlc(0.0);  
1867 - } else {  
1868 - t.setFcsjActual(childTaskPlan.getStartDate());  
1869 - t.setZdsjActual(childTaskPlan.getEndDate());  
1870 - t.setJhlc(Double.parseDouble(String.valueOf(childTaskPlan.getMileage())));  
1871 - }  
1872 - t.setQdzName(childTaskPlan.getStartStationName());  
1873 - t.setZdzName(childTaskPlan.getEndStationName());  
1874 - t.setRemarks(childTaskPlan.getRemarks());  
1875 - t.setAdjustExps("子");  
1876 - listSchedule.add(t);  
1877 - } 1873 + List<ChildTaskPlan> listit=new ArrayList<ChildTaskPlan>(childTaskPlans);
  1874 + Collections.sort(listit, new ComparableChild());
  1875 + for (int j = 0; j < listit.size(); j++) {
  1876 + ScheduleRealInfo t = new ScheduleRealInfo();
  1877 + ChildTaskPlan childTaskPlan = listit.get(j);
  1878 + if (childTaskPlan.isDestroy()) {
  1879 + t.setFcsjActual("");
  1880 + t.setZdsjActual("");
  1881 + t.setJhlc(0.0);
  1882 + } else {
  1883 + t.setFcsjActual(childTaskPlan.getStartDate());
  1884 + t.setZdsjActual(childTaskPlan.getEndDate());
  1885 + t.setJhlc(Double.parseDouble(String.valueOf(childTaskPlan.getMileage())));
  1886 + }
  1887 + t.setQdzName(childTaskPlan.getStartStationName());
  1888 + t.setZdzName(childTaskPlan.getEndStationName());
  1889 + t.setRemarks(childTaskPlan.getRemarks());
  1890 + t.setAdjustExps("子");
  1891 + listSchedule.add(t);
  1892 + }
1878 /* String sqlPc = "select * from bsth_c_s_child_task where schedule=" + s.getId() + " order by start_date "; 1893 /* String sqlPc = "select * from bsth_c_s_child_task where schedule=" + s.getId() + " order by start_date ";
1879 List<ScheduleRealInfo> lists = jdbcTemplate.query(sqlPc, 1894 List<ScheduleRealInfo> lists = jdbcTemplate.query(sqlPc,
1880 new RowMapper<ScheduleRealInfo>() { 1895 new RowMapper<ScheduleRealInfo>() {
@@ -1927,62 +1942,62 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -1927,62 +1942,62 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1927 @Override 1942 @Override
1928 public List<Map<String, Object>> statisticsDaily(String line, String date, 1943 public List<Map<String, Object>> statisticsDaily(String line, String date,
1929 String xlName, String type) { 1944 String xlName, String type) {
1930 - List<Map<String, Object>> lMap= new ArrayList<Map<String, Object>>();  
1931 - List<ScheduleRealInfo>list_s=scheduleRealInfoRepository.scheduleByDateAndLine2(line, date);  
1932 - List<ScheduleRealInfo> lists =new ArrayList<ScheduleRealInfo>();  
1933 - for (int i = 0; i < list_s.size(); i++) {  
1934 - ScheduleRealInfo s=list_s.get(i);  
1935 - if(s.getZdsjActual()!=null){  
1936 - lists.add(s);  
1937 - }  
1938 - }  
1939 - Map<String, Object> map = new HashMap<String, Object>();  
1940 - map.put("xlName", xlName);  
1941 - double jhlc=culateService.culateJhgl(list_s);  
1942 - map.put("jhlc",jhlc);  
1943 - map.put("sjgl", Arith.add(culateService.culateSjgl(lists),culateService.culateLjgl(lists)));  
1944 - double lbgl=culateService.culateLbgl(list_s);  
1945 - map.put("ssgl", lbgl);  
1946 - map.put("ssgl_lz", culateService.culateCJLC(list_s, "路阻"));  
1947 - map.put("ssgl_dm", culateService.culateCJLC(list_s, "吊慢"));  
1948 - map.put("ssgl_gz", culateService.culateCJLC(list_s, "故障"));  
1949 - map.put("ssgl_jf", culateService.culateCJLC(list_s, "纠纷"));  
1950 - map.put("ssgl_zs", culateService.culateCJLC(list_s, "肇事"));  
1951 - map.put("ssgl_qr", culateService.culateCJLC(list_s, "缺人"));  
1952 - map.put("ssgl_qc", culateService.culateCJLC(list_s, "缺车"));  
1953 - map.put("ssgl_kx", culateService.culateCJLC(list_s, "客稀"));  
1954 - map.put("ssgl_qh", culateService.culateCJLC(list_s, "气候"));  
1955 - map.put("ssgl_yw", culateService.culateCJLC(list_s, "援外"));  
1956 - double ssgl_pc=culateService.culateCJLC(list_s, "配车");  
1957 - double ssgl_by=culateService.culateCJLC(list_s, "保养");  
1958 - double ssgl_cj=culateService.culateCJLC(list_s, "抽减");  
1959 - double ssgl_qt=culateService.culateCJLC(list_s, "其他");  
1960 - map.put("ssgl_other", Arith.add(Arith.add(ssgl_pc, ssgl_by),Arith.add(ssgl_cj, ssgl_qt)));  
1961 - map.put("ssbc", culateService.culateLbbc(list_s));  
1962 - double ljgl=culateService.culateLjgl(lists);  
1963 - map.put("ljgl", ljgl);  
1964 - map.put("jhbc", culateService.culateJhbc(list_s,""));  
1965 - map.put("jhbc_m", culateService.culateJhbc(list_s, "zgf"));  
1966 - map.put("jhbc_a", culateService.culateJhbc(list_s, "wgf"));  
1967 - map.put("sjbc", culateService.culateSjbc(lists,""));  
1968 - map.put("sjbc_m", culateService.culateSjbc(lists,"zgf"));  
1969 - map.put("sjbc_a", culateService.culateSjbc(lists,"wgf"));  
1970 - map.put("ljbc", culateService.culateLjbc(lists,""));  
1971 - map.put("ljbc_m", culateService.culateLjbc(lists,"zgf"));  
1972 - map.put("ljbc_a", culateService.culateLjbc(lists,"wgf"));  
1973 - map.put("fzbc", culateService.culateFzbc(lists, ""));  
1974 - map.put("fzbc_m", culateService.culateFzbc(lists, "zgf"));  
1975 - map.put("fzbc_a", culateService.culateFzbc(lists, "wgf"));  
1976 - map.put("dtbc", 0);  
1977 - map.put("dtbc_m", 0);  
1978 - map.put("dtbc_a", 0);  
1979 - map.put("djg", 0);  
1980 - map.put("djg_m", 0);  
1981 - map.put("djg_a", 0);  
1982 - map.put("djg_time", 0);  
1983 - map.put("jls", Arith.sub(Arith.add(jhlc, ljgl), lbgl));  
1984 - lMap.add(map);  
1985 - return lMap; 1945 + List<Map<String, Object>> lMap= new ArrayList<Map<String, Object>>();
  1946 + List<ScheduleRealInfo>list_s=scheduleRealInfoRepository.scheduleByDateAndLine2(line, date);
  1947 + List<ScheduleRealInfo> lists =new ArrayList<ScheduleRealInfo>();
  1948 + for (int i = 0; i < list_s.size(); i++) {
  1949 + ScheduleRealInfo s=list_s.get(i);
  1950 + if(s.getZdsjActual()!=null){
  1951 + lists.add(s);
  1952 + }
  1953 + }
  1954 + Map<String, Object> map = new HashMap<String, Object>();
  1955 + map.put("xlName", xlName);
  1956 + double jhlc=culateService.culateJhgl(list_s);
  1957 + map.put("jhlc",jhlc);
  1958 + map.put("sjgl", Arith.add(culateService.culateSjgl(lists),culateService.culateLjgl(lists)));
  1959 + double lbgl=culateService.culateLbgl(list_s);
  1960 + map.put("ssgl", lbgl);
  1961 + map.put("ssgl_lz", culateService.culateCJLC(list_s, "路阻"));
  1962 + map.put("ssgl_dm", culateService.culateCJLC(list_s, "吊慢"));
  1963 + map.put("ssgl_gz", culateService.culateCJLC(list_s, "故障"));
  1964 + map.put("ssgl_jf", culateService.culateCJLC(list_s, "纠纷"));
  1965 + map.put("ssgl_zs", culateService.culateCJLC(list_s, "肇事"));
  1966 + map.put("ssgl_qr", culateService.culateCJLC(list_s, "缺人"));
  1967 + map.put("ssgl_qc", culateService.culateCJLC(list_s, "缺车"));
  1968 + map.put("ssgl_kx", culateService.culateCJLC(list_s, "客稀"));
  1969 + map.put("ssgl_qh", culateService.culateCJLC(list_s, "气候"));
  1970 + map.put("ssgl_yw", culateService.culateCJLC(list_s, "援外"));
  1971 + double ssgl_pc=culateService.culateCJLC(list_s, "配车");
  1972 + double ssgl_by=culateService.culateCJLC(list_s, "保养");
  1973 + double ssgl_cj=culateService.culateCJLC(list_s, "抽减");
  1974 + double ssgl_qt=culateService.culateCJLC(list_s, "其他");
  1975 + map.put("ssgl_other", Arith.add(Arith.add(ssgl_pc, ssgl_by),Arith.add(ssgl_cj, ssgl_qt)));
  1976 + map.put("ssbc", culateService.culateLbbc(list_s));
  1977 + double ljgl=culateService.culateLjgl(lists);
  1978 + map.put("ljgl", ljgl);
  1979 + map.put("jhbc", culateService.culateJhbc(list_s,""));
  1980 + map.put("jhbc_m", culateService.culateJhbc(list_s, "zgf"));
  1981 + map.put("jhbc_a", culateService.culateJhbc(list_s, "wgf"));
  1982 + map.put("sjbc", culateService.culateSjbc(lists,""));
  1983 + map.put("sjbc_m", culateService.culateSjbc(lists,"zgf"));
  1984 + map.put("sjbc_a", culateService.culateSjbc(lists,"wgf"));
  1985 + map.put("ljbc", culateService.culateLjbc(lists,""));
  1986 + map.put("ljbc_m", culateService.culateLjbc(lists,"zgf"));
  1987 + map.put("ljbc_a", culateService.culateLjbc(lists,"wgf"));
  1988 + map.put("fzbc", culateService.culateFzbc(lists, ""));
  1989 + map.put("fzbc_m", culateService.culateFzbc(lists, "zgf"));
  1990 + map.put("fzbc_a", culateService.culateFzbc(lists, "wgf"));
  1991 + map.put("dtbc", 0);
  1992 + map.put("dtbc_m", 0);
  1993 + map.put("dtbc_a", 0);
  1994 + map.put("djg", 0);
  1995 + map.put("djg_m", 0);
  1996 + map.put("djg_a", 0);
  1997 + map.put("djg_time", 0);
  1998 + map.put("jls", Arith.sub(Arith.add(jhlc, ljgl), lbgl));
  1999 + lMap.add(map);
  2000 + return lMap;
1986 } 2001 }
1987 2002
1988 /* @Override 2003 /* @Override
@@ -2530,34 +2545,34 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -2530,34 +2545,34 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
2530 2545
2531 return lMap; 2546 return lMap;
2532 }*/ 2547 }*/
2533 - 2548 +
2534 public final Map<String, Object> staticTj(List<ScheduleRealInfo> list){ 2549 public final Map<String, Object> staticTj(List<ScheduleRealInfo> list){
2535 - List<ScheduleRealInfo> lists=new ArrayList<ScheduleRealInfo>();  
2536 - for(int i=0;i<list.size();i++){  
2537 - ScheduleRealInfo s=list.get(i);  
2538 - if(s.getZdsjActual()!=null){  
2539 - lists.add(s);  
2540 - }  
2541 - }  
2542 - Map<String, Object> map = new HashMap<String, Object>();  
2543 - map.put("xlName", lists.get(0).getXlName());  
2544 - double jhyygl=culateService.culateJhgl(list);//计划营运公里  
2545 - double jhjcclc= culateService.culateJhJccgl(list);//计划进出场公里(计划空驶公里)  
2546 - map.put("jhlc", jhyygl);  
2547 - map.put("jcclc", jhjcclc);  
2548 - map.put("jhzlc", Arith.add(jhyygl, jhjcclc));  
2549 -  
2550 - double ljgl= culateService.culateLjgl(lists);  
2551 - double sjyygl= culateService.culateSjgl(lists);  
2552 - double zyygl= Arith.add(sjyygl,ljgl);  
2553 -  
2554 - double sjjccgl=culateService.culateJccgl(lists);  
2555 - double sjksgl=culateService.culateKsgl(lists);  
2556 - double zksgl=Arith.add(sjjccgl, sjksgl);  
2557 - map.put("sjzgl", Arith.add(zyygl, zksgl));  
2558 - map.put("sjgl",zyygl);  
2559 - map.put("sjksgl", zksgl);  
2560 - 2550 + List<ScheduleRealInfo> lists=new ArrayList<ScheduleRealInfo>();
  2551 + for(int i=0;i<list.size();i++){
  2552 + ScheduleRealInfo s=list.get(i);
  2553 + if(s.getZdsjActual()!=null){
  2554 + lists.add(s);
  2555 + }
  2556 + }
  2557 + Map<String, Object> map = new HashMap<String, Object>();
  2558 + map.put("xlName", lists.get(0).getXlName());
  2559 + double jhyygl=culateService.culateJhgl(list);//计划营运公里
  2560 + double jhjcclc= culateService.culateJhJccgl(list);//计划进出场公里(计划空驶公里)
  2561 + map.put("jhlc", jhyygl);
  2562 + map.put("jcclc", jhjcclc);
  2563 + map.put("jhzlc", Arith.add(jhyygl, jhjcclc));
  2564 +
  2565 + double ljgl= culateService.culateLjgl(lists);
  2566 + double sjyygl= culateService.culateSjgl(lists);
  2567 + double zyygl= Arith.add(sjyygl,ljgl);
  2568 +
  2569 + double sjjccgl=culateService.culateJccgl(lists);
  2570 + double sjksgl=culateService.culateKsgl(lists);
  2571 + double zksgl=Arith.add(sjjccgl, sjksgl);
  2572 + map.put("sjzgl", Arith.add(zyygl, zksgl));
  2573 + map.put("sjgl",zyygl);
  2574 + map.put("sjksgl", zksgl);
  2575 +
2561 map.put("ssgl", culateService.culateLbgl(list)); 2576 map.put("ssgl", culateService.culateLbgl(list));
2562 map.put("ssgl_lz", culateService.culateCJLC(list, "路阻")); 2577 map.put("ssgl_lz", culateService.culateCJLC(list, "路阻"));
2563 map.put("ssgl_dm", culateService.culateCJLC(list, "吊慢")); 2578 map.put("ssgl_dm", culateService.culateCJLC(list, "吊慢"));
@@ -2591,66 +2606,66 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -2591,66 +2606,66 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
2591 map.put("djg_m", 0); 2606 map.put("djg_m", 0);
2592 map.put("djg_a", 0); 2607 map.put("djg_a", 0);
2593 map.put("djg_time", 0); 2608 map.put("djg_time", 0);
2594 - return map; 2609 + return map;
2595 } 2610 }
2596 - 2611 +
2597 @Override 2612 @Override
2598 public List<Map<String, Object>> statisticsDailyTj(String gsdm,String fgsdm,String line, String date,String date2, 2613 public List<Map<String, Object>> statisticsDailyTj(String gsdm,String fgsdm,String line, String date,String date2,
2599 - String xlName, String type) { 2614 + String xlName, String type) {
2600 List<ScheduleRealInfo> list = new ArrayList<ScheduleRealInfo>(); 2615 List<ScheduleRealInfo> list = new ArrayList<ScheduleRealInfo>();
2601 List<ScheduleRealInfo> list_s = new ArrayList<ScheduleRealInfo>(); 2616 List<ScheduleRealInfo> list_s = new ArrayList<ScheduleRealInfo>();
2602 List<ScheduleRealInfo> lists = new ArrayList<ScheduleRealInfo>(); 2617 List<ScheduleRealInfo> lists = new ArrayList<ScheduleRealInfo>();
2603 line =line.trim(); 2618 line =line.trim();
2604 if(line.equals("")){ 2619 if(line.equals("")){
2605 - //查询所有线路  
2606 - list = scheduleRealInfoRepository.scheduleByDateAndLineTj(line, date,date2,gsdm,fgsdm); 2620 + //查询所有线路
  2621 + list = scheduleRealInfoRepository.scheduleByDateAndLineTj(line, date,date2,gsdm,fgsdm);
2607 }else{ 2622 }else{
2608 - //查询单条线路  
2609 - list = scheduleRealInfoRepository.scheduleByDateAndLineTj2(line, date,date2); 2623 + //查询单条线路
  2624 + list = scheduleRealInfoRepository.scheduleByDateAndLineTj2(line, date,date2);
2610 } 2625 }
2611 for (int i = 0; i < list.size(); i++) { 2626 for (int i = 0; i < list.size(); i++) {
2612 - ScheduleRealInfo s=list.get(i);  
2613 - if(s.getZdsjActual()!=null){  
2614 - list_s.add(s);  
2615 - }  
2616 - } 2627 + ScheduleRealInfo s=list.get(i);
  2628 + if(s.getZdsjActual()!=null){
  2629 + list_s.add(s);
  2630 + }
  2631 + }
2617 List<Map<String, Object>> lMap = new ArrayList<Map<String, Object>>(); 2632 List<Map<String, Object>> lMap = new ArrayList<Map<String, Object>>();
2618 for (int i = 0; i < list.size(); i++) { 2633 for (int i = 0; i < list.size(); i++) {
2619 - if(i<list.size()-1){  
2620 - if(list.get(i+1).getXlBm().equals(list.get(i).getXlBm())){  
2621 - lists.add(list.get(i));  
2622 - }else{  
2623 - lists.add(list.get(i));  
2624 - Map<String, Object> map=staticTj(lists);  
2625 - lMap.add(map);  
2626 - lists=new ArrayList<ScheduleRealInfo>();  
2627 - }  
2628 - }else{  
2629 - if(list.get(i).getXlBm().equals(list.get(i-1).getXlBm())){  
2630 - lists.add(list.get(i));  
2631 - Map<String, Object> map=staticTj(lists);  
2632 - lMap.add(map);  
2633 - }else{  
2634 - lists=new ArrayList<ScheduleRealInfo>();  
2635 - lists.add(list.get(i));  
2636 - Map<String, Object> map=staticTj(lists);  
2637 - lMap.add(map);  
2638 - }  
2639 - } 2634 + if(i<list.size()-1){
  2635 + if(list.get(i+1).getXlBm().equals(list.get(i).getXlBm())){
  2636 + lists.add(list.get(i));
  2637 + }else{
  2638 + lists.add(list.get(i));
  2639 + Map<String, Object> map=staticTj(lists);
  2640 + lMap.add(map);
  2641 + lists=new ArrayList<ScheduleRealInfo>();
  2642 + }
  2643 + }else{
  2644 + if(list.get(i).getXlBm().equals(list.get(i-1).getXlBm())){
  2645 + lists.add(list.get(i));
  2646 + Map<String, Object> map=staticTj(lists);
  2647 + lMap.add(map);
  2648 + }else{
  2649 + lists=new ArrayList<ScheduleRealInfo>();
  2650 + lists.add(list.get(i));
  2651 + Map<String, Object> map=staticTj(lists);
  2652 + lMap.add(map);
  2653 + }
  2654 + }
2640 } 2655 }
2641 - 2656 +
2642 Map<String, Object> map = new HashMap<String, Object>(); 2657 Map<String, Object> map = new HashMap<String, Object>();
2643 - map.put("xlName", "合计");  
2644 - double jhyygl=culateService.culateJhgl(list);//计划营运公里  
2645 - double jhjcclc= culateService.culateJhJccgl(list);//计划进出场公里(计划空驶公里) 2658 + map.put("xlName", "合计");
  2659 + double jhyygl=culateService.culateJhgl(list);//计划营运公里
  2660 + double jhjcclc= culateService.culateJhJccgl(list);//计划进出场公里(计划空驶公里)
2646 map.put("jhlc", jhyygl); 2661 map.put("jhlc", jhyygl);
2647 map.put("jcclc", jhjcclc); 2662 map.put("jcclc", jhjcclc);
2648 map.put("jhzlc", Arith.add(jhyygl, jhjcclc)); 2663 map.put("jhzlc", Arith.add(jhyygl, jhjcclc));
2649 - 2664 +
2650 double ljgl= culateService.culateLjgl(list_s); 2665 double ljgl= culateService.culateLjgl(list_s);
2651 double sjyygl= culateService.culateSjgl(list_s); 2666 double sjyygl= culateService.culateSjgl(list_s);
2652 double zyygl= Arith.add(sjyygl,ljgl); 2667 double zyygl= Arith.add(sjyygl,ljgl);
2653 - 2668 +
2654 double sjjccgl=culateService.culateJccgl(list_s); 2669 double sjjccgl=culateService.culateJccgl(list_s);
2655 double sjksgl=culateService.culateKsgl(list_s); 2670 double sjksgl=culateService.culateKsgl(list_s);
2656 double zksgl=Arith.add(sjjccgl, sjksgl); 2671 double zksgl=Arith.add(sjjccgl, sjksgl);
@@ -2968,10 +2983,10 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -2968,10 +2983,10 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
2968 List<ScheduleRealInfo> lists = scheduleRealInfoRepository.queryListWaybill3(jGh, nbbm, date,gsbm,fgsbm); 2983 List<ScheduleRealInfo> lists = scheduleRealInfoRepository.queryListWaybill3(jGh, nbbm, date,gsbm,fgsbm);
2969 // System.out.println("shijian3:"+new Date()); 2984 // System.out.println("shijian3:"+new Date());
2970 for (int x = 0; x < yesterdayDataList.size(); x++) { 2985 for (int x = 0; x < yesterdayDataList.size(); x++) {
2971 - 2986 +
2972 String jName = yesterdayDataList.get(x).get("jGh").toString(); 2987 String jName = yesterdayDataList.get(x).get("jGh").toString();
2973 String clZbh = yesterdayDataList.get(x).get("clZbh").toString(); 2988 String clZbh = yesterdayDataList.get(x).get("clZbh").toString();
2974 - 2989 +
2975 // double jhlc = 0, yygl = 0, ksgl = 0, tempJhlc = 0, jcclc = 0; 2990 // double jhlc = 0, yygl = 0, ksgl = 0, tempJhlc = 0, jcclc = 0;
2976 double addMileage = 0, remMileage = 0; 2991 double addMileage = 0, remMileage = 0;
2977 Map<String, Object> map = new HashMap<String, Object>(); 2992 Map<String, Object> map = new HashMap<String, Object>();
@@ -2980,14 +2995,14 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -2980,14 +2995,14 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
2980 String bCompany=""; 2995 String bCompany="";
2981 List<ScheduleRealInfo> listS=new ArrayList<ScheduleRealInfo>(); 2996 List<ScheduleRealInfo> listS=new ArrayList<ScheduleRealInfo>();
2982 for (ScheduleRealInfo scheduleRealInfo : lists) { 2997 for (ScheduleRealInfo scheduleRealInfo : lists) {
2983 - if(scheduleRealInfo.getjGh().equals(jName) && scheduleRealInfo.getClZbh().equals(clZbh)){  
2984 - if (fage) {  
2985 - //根据线路代码获取公司  
2986 - company=scheduleRealInfo.getGsBm();  
2987 - bCompany=scheduleRealInfo.getFgsBm();  
2988 - fage = false;  
2989 - }  
2990 - listS.add(scheduleRealInfo); 2998 + if(scheduleRealInfo.getjGh().equals(jName) && scheduleRealInfo.getClZbh().equals(clZbh)){
  2999 + if (fage) {
  3000 + //根据线路代码获取公司
  3001 + company=scheduleRealInfo.getGsBm();
  3002 + bCompany=scheduleRealInfo.getFgsBm();
  3003 + fage = false;
  3004 + }
  3005 + listS.add(scheduleRealInfo);
2991 3006
2992 /* if (scheduleRealInfo != null) { 3007 /* if (scheduleRealInfo != null) {
2993 //计划里程(主任务过滤掉临加班次), 3008 //计划里程(主任务过滤掉临加班次),
@@ -3049,9 +3064,9 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -3049,9 +3064,9 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
3049 } 3064 }
3050 } 3065 }
3051 }*/ 3066 }*/
3052 - } 3067 + }
3053 } 3068 }
3054 - 3069 +
3055 yesterdayDataList.get(x).put("company", company); 3070 yesterdayDataList.get(x).put("company", company);
3056 yesterdayDataList.get(x).put("bCompany", bCompany); 3071 yesterdayDataList.get(x).put("bCompany", bCompany);
3057 // Double zgl=Arith.add(yygl,ksgl); 3072 // Double zgl=Arith.add(yygl,ksgl);
@@ -3803,9 +3818,9 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -3803,9 +3818,9 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
3803 } 3818 }
3804 3819
3805 if (!c.isDestroy()) { 3820 if (!c.isDestroy()) {
3806 - if(c.getMileageType().equals("service")){  
3807 - sjlc += c.getMileage() == null ? 0 : c.getMileage();  
3808 - } 3821 + if(c.getMileageType().equals("service")){
  3822 + sjlc += c.getMileage() == null ? 0 : c.getMileage();
  3823 + }
3809 } 3824 }
3810 3825
3811 } 3826 }
@@ -3869,14 +3884,14 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -3869,14 +3884,14 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
3869 Long fcsj2 = sdf.parse(fcrq + " 11:00").getTime(); 3884 Long fcsj2 = sdf.parse(fcrq + " 11:00").getTime();
3870 Long fcsj3 = sdf.parse(fcrq + " 23:59").getTime(); 3885 Long fcsj3 = sdf.parse(fcrq + " 23:59").getTime();
3871 for (int i = 0; i < list.size(); i++) { 3886 for (int i = 0; i < list.size(); i++) {
3872 - DutyEmployee t = list.get(i);  
3873 - if(!(dbdp.indexOf(",")>0)){  
3874 - if(!(dbdp.length()>0)){  
3875 - dbdp =t.getuName();  
3876 - }else{  
3877 - dbdp +=","+t.getuName();  
3878 - }  
3879 - } 3887 + DutyEmployee t = list.get(i);
  3888 + if(!(dbdp.indexOf(",")>0)){
  3889 + if(!(dbdp.length()>0)){
  3890 + dbdp =t.getuName();
  3891 + }else{
  3892 + dbdp +=","+t.getuName();
  3893 + }
  3894 + }
3880 Long ts = t.getTs(); 3895 Long ts = t.getTs();
3881 if (ts > fcsj1 && ts < fcsj2) { 3896 if (ts > fcsj1 && ts < fcsj2) {
3882 if (zdp.indexOf(t.getuName()) == -1) { 3897 if (zdp.indexOf(t.getuName()) == -1) {
@@ -3961,18 +3976,18 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -3961,18 +3976,18 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
3961 if (!scheduleRealInfo.getsGh().equals(sgh)) { 3976 if (!scheduleRealInfo.getsGh().equals(sgh)) {
3962 sgh = scheduleRealInfo.getsGh()==null?"":scheduleRealInfo.getsGh(); 3977 sgh = scheduleRealInfo.getsGh()==null?"":scheduleRealInfo.getsGh();
3963 if(!sgh.equals("")){ 3978 if(!sgh.equals("")){
3964 - if (map.get("sjb1") != null) {  
3965 - if (map.get("sjb2") != null) {  
3966 - map.put("sjb3", scheduleRealInfo.getsGh() + "/" +  
3967 - scheduleRealInfo.getFcsjActual());  
3968 - } else {  
3969 - map.put("sjb2", scheduleRealInfo.getsGh() + "/" +  
3970 - scheduleRealInfo.getFcsjActual());  
3971 - }  
3972 - } else {  
3973 - map.put("sjb1", scheduleRealInfo.getsGh() + "/" +  
3974 - scheduleRealInfo.getFcsjActual());  
3975 - } 3979 + if (map.get("sjb1") != null) {
  3980 + if (map.get("sjb2") != null) {
  3981 + map.put("sjb3", scheduleRealInfo.getsGh() + "/" +
  3982 + scheduleRealInfo.getFcsjActual());
  3983 + } else {
  3984 + map.put("sjb2", scheduleRealInfo.getsGh() + "/" +
  3985 + scheduleRealInfo.getFcsjActual());
  3986 + }
  3987 + } else {
  3988 + map.put("sjb1", scheduleRealInfo.getsGh() + "/" +
  3989 + scheduleRealInfo.getFcsjActual());
  3990 + }
3976 } 3991 }
3977 } 3992 }
3978 } 3993 }
@@ -4062,7 +4077,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -4062,7 +4077,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
4062 String xlName = map.get("xlName").toString(); 4077 String xlName = map.get("xlName").toString();
4063 String state = map.get("state").toString(); 4078 String state = map.get("state").toString();
4064 String type = map.get("type").toString(); 4079 String type = map.get("type").toString();
4065 - 4080 +
4066 List<Map<String, Object>> dataList2 = new ArrayList<Map<String, Object>>(); 4081 List<Map<String, Object>> dataList2 = new ArrayList<Map<String, Object>>();
4067 List<Map<String, Object>> dataList3 = new ArrayList<Map<String, Object>>(); 4082 List<Map<String, Object>> dataList3 = new ArrayList<Map<String, Object>>();
4068 List<Map<String, Object>> list1 = this.statisticsDaily(line, date, xlName, null); 4083 List<Map<String, Object>> list1 = this.statisticsDaily(line, date, xlName, null);
@@ -4139,10 +4154,10 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -4139,10 +4154,10 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
4139 String fcsjActural=schedule.getFcsjActual() != null ? schedule.getFcsjActual() : ""; 4154 String fcsjActural=schedule.getFcsjActual() != null ? schedule.getFcsjActual() : "";
4140 String bcType=schedule.getBcType()!=null?schedule.getBcType():""; 4155 String bcType=schedule.getBcType()!=null?schedule.getBcType():"";
4141 if(bcType.equals("in")){ 4156 if(bcType.equals("in")){
4142 - fcsjActural=fcsjActural+"(进)"; 4157 + fcsjActural=fcsjActural+"(进)";
4143 } 4158 }
4144 if(bcType.equals("out")){ 4159 if(bcType.equals("out")){
4145 - fcsjActural=fcsjActural+"(出)"; 4160 + fcsjActural=fcsjActural+"(出)";
4146 } 4161 }
4147 tempMap.put("fcsjActual" + size, fcsjActural); 4162 tempMap.put("fcsjActual" + size, fcsjActural);
4148 tempMap.put("fcsjk" + size, ""); 4163 tempMap.put("fcsjk" + size, "");
@@ -4204,13 +4219,13 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -4204,13 +4219,13 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
4204 List<ScheduleRealInfo> scheduleRealInfos = listpl; 4219 List<ScheduleRealInfo> scheduleRealInfos = listpl;
4205 List<Map<String, Object>> listMap = new ArrayList<Map<String, Object>>(); 4220 List<Map<String, Object>> listMap = new ArrayList<Map<String, Object>>();
4206 // List<ScheduleRealInfo> scheduleRealInfos=scheduleRealInfoRepository.queryListWaybillXcld(jName, clZbh, lpName, date, line); 4221 // List<ScheduleRealInfo> scheduleRealInfos=scheduleRealInfoRepository.queryListWaybillXcld(jName, clZbh, lpName, date, line);
4207 - List<ScheduleRealInfo> lists=new ArrayList<ScheduleRealInfo>();  
4208 - for (int i = 0; i < scheduleRealInfos.size(); i++) {  
4209 - ScheduleRealInfo s=scheduleRealInfos.get(i);  
4210 - if(s.getZdsjActual()!=null){  
4211 - lists.add(s);  
4212 - }  
4213 - } 4222 + List<ScheduleRealInfo> lists=new ArrayList<ScheduleRealInfo>();
  4223 + for (int i = 0; i < scheduleRealInfos.size(); i++) {
  4224 + ScheduleRealInfo s=scheduleRealInfos.get(i);
  4225 + if(s.getZdsjActual()!=null){
  4226 + lists.add(s);
  4227 + }
  4228 + }
4214 DecimalFormat format = new DecimalFormat("0.00"); 4229 DecimalFormat format = new DecimalFormat("0.00");
4215 // int cjbc = scheduleRealInfoRepository.findCjbc(jName, clZbh, lpName); 4230 // int cjbc = scheduleRealInfoRepository.findCjbc(jName, clZbh, lpName);
4216 // int ljbc = scheduleRealInfoRepository.findLjbc(jName, clZbh, lpName); 4231 // int ljbc = scheduleRealInfoRepository.findLjbc(jName, clZbh, lpName);
@@ -4232,33 +4247,33 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -4232,33 +4247,33 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
4232 4247
4233 Map<String, Object> maps; 4248 Map<String, Object> maps;
4234 for (ScheduleRealInfo scheduleRealInfo : scheduleRealInfos) { 4249 for (ScheduleRealInfo scheduleRealInfo : scheduleRealInfos) {
4235 - maps = new HashMap<String, Object>();  
4236 - try {  
4237 - scheduleRealInfo.setjName(scheduleRealInfo.getjGh() + scheduleRealInfo.getjName());  
4238 - scheduleRealInfo.setsName(scheduleRealInfo.getsGh() + scheduleRealInfo.getsName());  
4239 - maps = rru.getMapValue(scheduleRealInfo);  
4240 - String zdsj = scheduleRealInfo.getZdsj();  
4241 - String zdsjActual = scheduleRealInfo.getZdsjActual();  
4242 - if (zdsj != null && zdsjActual != null &&  
4243 - !zdsj.equals(zdsjActual)) {  
4244 - if (zdsj.compareTo(zdsjActual) > 0) {  
4245 - maps.put("fast", TimeUtils.getTimeDifference(zdsj, zdsjActual));  
4246 - maps.put("slow", "");  
4247 - } else {  
4248 - maps.put("fast", "");  
4249 - maps.put("slow", TimeUtils.getTimeDifference(zdsj, zdsjActual));  
4250 - } 4250 + maps = new HashMap<String, Object>();
  4251 + try {
  4252 + scheduleRealInfo.setjName(scheduleRealInfo.getjGh() + scheduleRealInfo.getjName());
  4253 + scheduleRealInfo.setsName(scheduleRealInfo.getsGh() + scheduleRealInfo.getsName());
  4254 + maps = rru.getMapValue(scheduleRealInfo);
  4255 + String zdsj = scheduleRealInfo.getZdsj();
  4256 + String zdsjActual = scheduleRealInfo.getZdsjActual();
  4257 + if (zdsj != null && zdsjActual != null &&
  4258 + !zdsj.equals(zdsjActual)) {
  4259 + if (zdsj.compareTo(zdsjActual) > 0) {
  4260 + maps.put("fast", TimeUtils.getTimeDifference(zdsj, zdsjActual));
  4261 + maps.put("slow", "");
4251 } else { 4262 } else {
4252 maps.put("fast", ""); 4263 maps.put("fast", "");
4253 - maps.put("slow", ""); 4264 + maps.put("slow", TimeUtils.getTimeDifference(zdsj, zdsjActual));
4254 } 4265 }
4255 - listMap.add(maps);  
4256 - } catch (Exception e) {  
4257 - e.printStackTrace(); 4266 + } else {
  4267 + maps.put("fast", "");
  4268 + maps.put("slow", "");
4258 } 4269 }
  4270 + listMap.add(maps);
  4271 + } catch (Exception e) {
  4272 + e.printStackTrace();
  4273 + }
4259 } 4274 }
4260 4275
4261 - 4276 +
4262 String path = this.getClass().getResource("/").getPath() + "static/pages/forms/"; 4277 String path = this.getClass().getResource("/").getPath() + "static/pages/forms/";
4263 4278
4264 list.add(listMap.iterator()); 4279 list.add(listMap.iterator());
@@ -4266,7 +4281,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -4266,7 +4281,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
4266 path + "export/" + date + "-" + jName + "-" + clZbh + "-" + lpName + "-行车路单.xls"); 4281 path + "export/" + date + "-" + jName + "-" + clZbh + "-" + lpName + "-行车路单.xls");
4267 // return scheduleRealInfos; 4282 // return scheduleRealInfos;
4268 } 4283 }
4269 - 4284 +
4270 @Override 4285 @Override
4271 public Map<String, Object> exportWaybillMore(Map<String, Object> map) { 4286 public Map<String, Object> exportWaybillMore(Map<String, Object> map) {
4272 String date = map.get("date").toString(); 4287 String date = map.get("date").toString();
@@ -4290,17 +4305,17 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -4290,17 +4305,17 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
4290 file.mkdirs(); 4305 file.mkdirs();
4291 List<ScheduleRealInfo> lists_line=scheduleRealInfoRepository.scheduleByDateAndLineTjrb(line, date); 4306 List<ScheduleRealInfo> lists_line=scheduleRealInfoRepository.scheduleByDateAndLineTjrb(line, date);
4292 for (List<String> list : lists) { 4307 for (List<String> list : lists) {
4293 - List<ScheduleRealInfo> newList=new ArrayList<ScheduleRealInfo>(); 4308 + List<ScheduleRealInfo> newList=new ArrayList<ScheduleRealInfo>();
4294 String jName = list.get(0); 4309 String jName = list.get(0);
4295 String clZbh = list.get(1); 4310 String clZbh = list.get(1);
4296 String lpName = list.get(2); 4311 String lpName = list.get(2);
4297 String jGh =list.get(3); 4312 String jGh =list.get(3);
4298 for (int i = 0; i < lists_line.size(); i++) { 4313 for (int i = 0; i < lists_line.size(); i++) {
4299 - ScheduleRealInfo s=lists_line.get(i);  
4300 - if(s.getjGh().equals(jGh) && s.getClZbh().equals(clZbh) && s.getLpName().equals(lpName)){  
4301 - newList.add(s);  
4302 - }  
4303 - } 4314 + ScheduleRealInfo s=lists_line.get(i);
  4315 + if(s.getjGh().equals(jGh) && s.getClZbh().equals(clZbh) && s.getLpName().equals(lpName)){
  4316 + newList.add(s);
  4317 + }
  4318 + }
4304 this.exportWaybill_pl(newList, date, jName, clZbh, lpName); 4319 this.exportWaybill_pl(newList, date, jName, clZbh, lpName);
4305 File temp = new File(path + date + "-" + jName + "-" + clZbh + "-" + lpName + "-行车路单.xls"); 4320 File temp = new File(path + date + "-" + jName + "-" + clZbh + "-" + lpName + "-行车路单.xls");
4306 String fileName = file.getName(); 4321 String fileName = file.getName();
src/main/java/com/bsth/service/schedule/rules/shiftloop/ScheduleRule_input.java
1 package com.bsth.service.schedule.rules.shiftloop; 1 package com.bsth.service.schedule.rules.shiftloop;
2 2
3 import com.bsth.entity.schedule.rule.ScheduleRule1Flat; 3 import com.bsth.entity.schedule.rule.ScheduleRule1Flat;
4 -import com.bsth.service.schedule.utils.Md5Util;  
5 import com.google.common.base.Splitter; 4 import com.google.common.base.Splitter;
6 import org.apache.commons.lang3.StringUtils; 5 import org.apache.commons.lang3.StringUtils;
7 import org.joda.time.DateTime; 6 import org.joda.time.DateTime;
@@ -18,11 +17,6 @@ public class ScheduleRule_input { @@ -18,11 +17,6 @@ public class ScheduleRule_input {
18 17
19 /** 规则Id */ 18 /** 规则Id */
20 private String ruleId; 19 private String ruleId;
21 - /**  
22 - * 规则md5值(不使用id判定,使用md5判定)  
23 - * 使用,启用日期,路牌范围,人员范围 结合生成md5编码  
24 - */  
25 - private String ruleMd5;  
26 20
27 /** 规则启用日期 */ 21 /** 规则启用日期 */
28 private DateTime qyrq; 22 private DateTime qyrq;
@@ -85,15 +79,6 @@ public class ScheduleRule_input { @@ -85,15 +79,6 @@ public class ScheduleRule_input {
85 } 79 }
86 } 80 }
87 81
88 - /** 生成规则md5编码 */  
89 - ruleMd5 = Md5Util.getMd5(  
90 - String.valueOf(qyrq.getMillis()) + "_" +  
91 - scheduleRule1Flat.getLpIds() + "_" +  
92 - scheduleRule1Flat.getRyConfigIds()  
93 - );  
94 -  
95 -// System.out.println("rule的md5:" + ruleMd5 + " 车辆:" + scheduleRule1Flat.getCarConfigInfo().getCl().getInsideCode());  
96 -  
97 this.self = scheduleRule1Flat; 82 this.self = scheduleRule1Flat;
98 } 83 }
99 84
@@ -179,11 +164,4 @@ public class ScheduleRule_input { @@ -179,11 +164,4 @@ public class ScheduleRule_input {
179 this.self = self; 164 this.self = self;
180 } 165 }
181 166
182 - public String getRuleMd5() {  
183 - return ruleMd5;  
184 - }  
185 -  
186 - public void setRuleMd5(String ruleMd5) {  
187 - this.ruleMd5 = ruleMd5;  
188 - }  
189 } 167 }
src/main/java/com/bsth/service/schedule/rules/validate/ValidateParam.java 0 → 100644
  1 +package com.bsth.service.schedule.rules.validate;
  2 +
  3 +import org.joda.time.DateTime;
  4 +import org.joda.time.Period;
  5 +import org.joda.time.PeriodType;
  6 +
  7 +/**
  8 + * Created by xu on 17/5/11.
  9 + */
  10 +public class ValidateParam {
  11 + /** 开始计算日期 */
  12 + private DateTime fromDate;
  13 + /** 结束计算日期 */
  14 + private DateTime toDate;
  15 +
  16 + /** 间隔天数 */
  17 + private Integer days;
  18 +
  19 + public ValidateParam() {
  20 + Period period = new Period(fromDate, toDate, PeriodType.days());
  21 + days = period.getDays() + 1;
  22 + }
  23 +
  24 + public DateTime getFromDate() {
  25 + return fromDate;
  26 + }
  27 +
  28 + public void setFromDate(DateTime fromDate) {
  29 + this.fromDate = fromDate;
  30 + }
  31 +
  32 + public DateTime getToDate() {
  33 + return toDate;
  34 + }
  35 +
  36 + public void setToDate(DateTime toDate) {
  37 + this.toDate = toDate;
  38 + }
  39 +
  40 + public Integer getDays() {
  41 + return days;
  42 + }
  43 +
  44 + public void setDays(Integer days) {
  45 + this.days = days;
  46 + }
  47 +}
src/main/java/com/bsth/service/schedule/rules/validate/ValidateResults_output.java 0 → 100644
  1 +package com.bsth.service.schedule.rules.validate;
  2 +
  3 +import java.util.ArrayList;
  4 +import java.util.Date;
  5 +import java.util.List;
  6 +
  7 +/**
  8 + * 验证输出。
  9 + */
  10 +public class ValidateResults_output {
  11 + private List<ValidInfo> infos = new ArrayList<>();
  12 +
  13 + static class ValidInfo {
  14 + /** 日期 */
  15 + private Date sd;
  16 + /** 描述 */
  17 + private String desc;
  18 +
  19 + public Date getSd() {
  20 + return sd;
  21 + }
  22 +
  23 + public void setSd(Date sd) {
  24 + this.sd = sd;
  25 + }
  26 +
  27 + public String getDesc() {
  28 + return desc;
  29 + }
  30 +
  31 + public void setDesc(String desc) {
  32 + this.desc = desc;
  33 + }
  34 + }
  35 +
  36 + public List<ValidInfo> getInfos() {
  37 + return infos;
  38 + }
  39 +
  40 + public void setInfos(List<ValidInfo> infos) {
  41 + this.infos = infos;
  42 + }
  43 +}
src/main/java/com/bsth/websocket/handler/RealControlSocketHandler.java
@@ -6,29 +6,29 @@ import com.bsth.data.BasicData; @@ -6,29 +6,29 @@ import com.bsth.data.BasicData;
6 import com.google.common.base.Splitter; 6 import com.google.common.base.Splitter;
7 import org.slf4j.Logger; 7 import org.slf4j.Logger;
8 import org.slf4j.LoggerFactory; 8 import org.slf4j.LoggerFactory;
9 -import org.springframework.context.annotation.Scope;  
10 import org.springframework.stereotype.Component; 9 import org.springframework.stereotype.Component;
11 import org.springframework.web.socket.*; 10 import org.springframework.web.socket.*;
12 11
13 -import java.util.*; 12 +import java.util.ArrayList;
  13 +import java.util.Collection;
  14 +import java.util.Iterator;
  15 +import java.util.List;
14 import java.util.concurrent.ConcurrentHashMap; 16 import java.util.concurrent.ConcurrentHashMap;
  17 +import java.util.concurrent.CopyOnWriteArrayList;
15 18
16 /** 19 /**
17 * @author PanZhao 20 * @author PanZhao
18 */ 21 */
19 @Component 22 @Component
20 -@Scope("prototype")  
21 public class RealControlSocketHandler implements WebSocketHandler { 23 public class RealControlSocketHandler implements WebSocketHandler {
22 24
23 Logger logger = LoggerFactory.getLogger(this.getClass()); 25 Logger logger = LoggerFactory.getLogger(this.getClass());
24 26
25 private static ArrayList<WebSocketSession> users; 27 private static ArrayList<WebSocketSession> users;
26 - //private static final ArrayListMultimap<String, WebSocketSession> listenMap;  
27 - private static ConcurrentHashMap<String, List<WebSocketSession>> listenMap; 28 + private static ConcurrentHashMap<String, CopyOnWriteArrayList<WebSocketSession>> listenMap;
28 29
29 static { 30 static {
30 users = new ArrayList<WebSocketSession>(); 31 users = new ArrayList<WebSocketSession>();
31 - //listenMap = ArrayListMultimap.create();  
32 listenMap = new ConcurrentHashMap(); 32 listenMap = new ConcurrentHashMap();
33 } 33 }
34 34
@@ -37,30 +37,13 @@ public class RealControlSocketHandler implements WebSocketHandler { @@ -37,30 +37,13 @@ public class RealControlSocketHandler implements WebSocketHandler {
37 throws Exception { 37 throws Exception {
38 users.remove(session); 38 users.remove(session);
39 //清理监听 39 //清理监听
40 - //Set<String> keys = listenMap.keySet();  
41 - //Map<String, WebSocketSession> remMap = new HashMap<>();  
42 -  
43 int vsCount=0; 40 int vsCount=0;
44 - Collection<List<WebSocketSession>> vs = listenMap.values();  
45 - for(List<WebSocketSession> list : vs){ 41 + Collection<CopyOnWriteArrayList<WebSocketSession>> vs = listenMap.values();
  42 + for(CopyOnWriteArrayList<WebSocketSession> list : vs){
46 list.remove(session); 43 list.remove(session);
47 44
48 vsCount += list.size(); 45 vsCount += list.size();
49 } 46 }
50 - /*List<WebSocketSession> vs;  
51 - for(String k : keys){  
52 - //vs = listenMap.get(k);  
53 - //vs.remove(session);  
54 - listenMap.get(k).remove()  
55 - *//*if(listenMap.get(k).contains(session))  
56 - remMap.put(k, session);*//*  
57 - }*/  
58 -  
59 - /*Set<String> remSet = remMap.keySet();  
60 - for(String k : remSet){  
61 - listenMap.remove(k, remMap.get(k));  
62 - logger.info("web socket close, remove listen K: "+ k);  
63 - }*/  
64 logger.info("listen values size: " + vsCount + " -CloseStatus:" + arg1); 47 logger.info("listen values size: " + vsCount + " -CloseStatus:" + arg1);
65 } 48 }
66 49
@@ -81,7 +64,7 @@ public class RealControlSocketHandler implements WebSocketHandler { @@ -81,7 +64,7 @@ public class RealControlSocketHandler implements WebSocketHandler {
81 for(String lineCode : idx){ 64 for(String lineCode : idx){
82 if(BasicData.lineCode2NameMap.containsKey(lineCode)){ 65 if(BasicData.lineCode2NameMap.containsKey(lineCode)){
83 if(!listenMap.containsKey(lineCode)){ 66 if(!listenMap.containsKey(lineCode)){
84 - listenMap.put(lineCode, new ArrayList<WebSocketSession>()); 67 + listenMap.put(lineCode, new CopyOnWriteArrayList<WebSocketSession>());
85 } 68 }
86 listenMap.get(lineCode).add(session); 69 listenMap.get(lineCode).add(session);
87 } 70 }
src/main/resources/datatools/ktrs/scheduleRuleDataInput.ktr
@@ -429,7 +429,7 @@ @@ -429,7 +429,7 @@
429 <name>cid</name> 429 <name>cid</name>
430 </field> 430 </field>
431 <field> 431 <field>
432 - <name>&#x8def;&#x724c;&#x8303;&#x56f4;</name> 432 + <name>lpnames</name>
433 </field> 433 </field>
434 <field> 434 <field>
435 <name>lpids</name> 435 <name>lpids</name>
@@ -460,6 +460,12 @@ @@ -460,6 +460,12 @@
460 <type>CONCAT_STRING</type> 460 <type>CONCAT_STRING</type>
461 <valuefield>,</valuefield> 461 <valuefield>,</valuefield>
462 </field> 462 </field>
  463 + <field>
  464 + <aggregate>rybms</aggregate>
  465 + <subject>rybm</subject>
  466 + <type>CONCAT_STRING</type>
  467 + <valuefield>,</valuefield>
  468 + </field>
463 </fields> 469 </fields>
464 <cluster_schema/> 470 <cluster_schema/>
465 <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI> 471 <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
@@ -496,9 +502,6 @@ @@ -496,9 +502,6 @@
496 <name>cid</name> 502 <name>cid</name>
497 </field> 503 </field>
498 <field> 504 <field>
499 - <name>&#x8def;&#x724c;&#x8303;&#x56f4;</name>  
500 - </field>  
501 - <field>  
502 <name>&#x8d77;&#x59cb;&#x8def;&#x724c;</name> 505 <name>&#x8d77;&#x59cb;&#x8def;&#x724c;</name>
503 </field> 506 </field>
504 <field> 507 <field>
@@ -524,6 +527,12 @@ @@ -524,6 +527,12 @@
524 <type>CONCAT_STRING</type> 527 <type>CONCAT_STRING</type>
525 <valuefield>,</valuefield> 528 <valuefield>,</valuefield>
526 </field> 529 </field>
  530 + <field>
  531 + <aggregate>lpnames</aggregate>
  532 + <subject>lpname</subject>
  533 + <type>CONCAT_STRING</type>
  534 + <valuefield>,</valuefield>
  535 + </field>
527 </fields> 536 </fields>
528 <cluster_schema/> 537 <cluster_schema/>
529 <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI> 538 <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
@@ -712,13 +721,19 @@ @@ -712,13 +721,19 @@
712 <optimizationLevel>9</optimizationLevel> 721 <optimizationLevel>9</optimizationLevel>
713 <jsScripts> <jsScript> <jsScript_type>0</jsScript_type> 722 <jsScripts> <jsScript> <jsScript_type>0</jsScript_type>
714 <jsScript_name>Script 1</jsScript_name> 723 <jsScript_name>Script 1</jsScript_name>
715 - <jsScript_script>&#x2f;&#x2f;Script here&#xa;&#xa;var rycid&#x3b;&#xa;&#xa;if &#x28;rycid2 &#x3d;&#x3d; null&#x29; &#x7b;&#xa; rycid &#x3d; rycid1&#x3b;&#xa;&#x7d; else &#x7b;&#xa; rycid &#x3d; rycid1 &#x2b; &#x22;-&#x22; &#x2b; rycid2&#x3b;&#xa;&#x7d;</jsScript_script> 724 + <jsScript_script>&#x2f;&#x2f;Script here&#xa;&#xa;var rycid&#x3b;&#xa;var rybm&#x3b;&#xa;&#xa;if &#x28;rycid2 &#x3d;&#x3d; null&#x29; &#x7b;&#xa; rycid &#x3d; rycid1&#x3b;&#xa; rybm &#x3d; dbbm1&#x3b;&#xa;&#x7d; else &#x7b;&#xa; rycid &#x3d; rycid1 &#x2b; &#x22;-&#x22; &#x2b; rycid2&#x3b;&#xa; rybm &#x3d; dbbm1 &#x2b; &#x22;-&#x22; &#x2b; dbbm2&#x3b;&#xa;&#x7d;</jsScript_script>
716 </jsScript> </jsScripts> <fields> <field> <name>rycid</name> 725 </jsScript> </jsScripts> <fields> <field> <name>rycid</name>
717 <rename>rycid</rename> 726 <rename>rycid</rename>
718 <type>String</type> 727 <type>String</type>
719 <length>-1</length> 728 <length>-1</length>
720 <precision>-1</precision> 729 <precision>-1</precision>
721 <replace>N</replace> 730 <replace>N</replace>
  731 + </field> <field> <name>rybm</name>
  732 + <rename>rybm</rename>
  733 + <type>String</type>
  734 + <length>-1</length>
  735 + <precision>-1</precision>
  736 + <replace>N</replace>
722 </field> </fields> <cluster_schema/> 737 </field> </fields> <cluster_schema/>
723 <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI> 738 <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
724 <xloc>917</xloc> 739 <xloc>917</xloc>
@@ -927,12 +942,6 @@ @@ -927,12 +942,6 @@
927 <presorted>N</presorted> 942 <presorted>N</presorted>
928 </field> 943 </field>
929 <field> 944 <field>
930 - <name>&#x8def;&#x724c;&#x8303;&#x56f4;</name>  
931 - <ascending>Y</ascending>  
932 - <case_sensitive>N</case_sensitive>  
933 - <presorted>N</presorted>  
934 - </field>  
935 - <field>  
936 <name>&#x8d77;&#x59cb;&#x8def;&#x724c;</name> 945 <name>&#x8d77;&#x59cb;&#x8def;&#x724c;</name>
937 <ascending>Y</ascending> 946 <ascending>Y</ascending>
938 <case_sensitive>N</case_sensitive> 947 <case_sensitive>N</case_sensitive>
@@ -1009,7 +1018,7 @@ @@ -1009,7 +1018,7 @@
1009 <presorted>N</presorted> 1018 <presorted>N</presorted>
1010 </field> 1019 </field>
1011 <field> 1020 <field>
1012 - <name>&#x8def;&#x724c;&#x8303;&#x56f4;</name> 1021 + <name>lpnames</name>
1013 <ascending>Y</ascending> 1022 <ascending>Y</ascending>
1014 <case_sensitive>N</case_sensitive> 1023 <case_sensitive>N</case_sensitive>
1015 <presorted>N</presorted> 1024 <presorted>N</presorted>
@@ -1106,7 +1115,7 @@ @@ -1106,7 +1115,7 @@
1106 </value> 1115 </value>
1107 <value> 1116 <value>
1108 <name>lp_names</name> 1117 <name>lp_names</name>
1109 - <rename>&#x8def;&#x724c;&#x8303;&#x56f4;</rename> 1118 + <rename>lpnames</rename>
1110 <update>Y</update> 1119 <update>Y</update>
1111 </value> 1120 </value>
1112 <value> 1121 <value>
@@ -1126,7 +1135,7 @@ @@ -1126,7 +1135,7 @@
1126 </value> 1135 </value>
1127 <value> 1136 <value>
1128 <name>ry_dbbms</name> 1137 <name>ry_dbbms</name>
1129 - <rename>&#x4eba;&#x5458;&#x8303;&#x56f4;</rename> 1138 + <rename>rybms</rename>
1130 <update>Y</update> 1139 <update>Y</update>
1131 </value> 1140 </value>
1132 <value> 1141 <value>
src/main/resources/rules/shiftloop_fb_2.drl
@@ -31,6 +31,7 @@ global ScheduleRuleService scheduleRuleService; @@ -31,6 +31,7 @@ global ScheduleRuleService scheduleRuleService;
31 declare Calcu_days_result_pre 31 declare Calcu_days_result_pre
32 ruleId: String // 规则Id 32 ruleId: String // 规则Id
33 ruleMd5: String // 规则md5 33 ruleMd5: String // 规则md5
  34 + ruleEcCount: Integer // 人员范围个数
34 35
35 calcu_index_lp : Integer // 计算之后路牌的起始索引 36 calcu_index_lp : Integer // 计算之后路牌的起始索引
36 calcu_index_ry : Integer // 计算之后人员的起始索引 37 calcu_index_ry : Integer // 计算之后人员的起始索引
@@ -61,8 +62,8 @@ rule &quot;calcu_days_1_&quot; @@ -61,8 +62,8 @@ rule &quot;calcu_days_1_&quot;
61 $toDate : toDate, 62 $toDate : toDate,
62 $xlId: xlId 63 $xlId: xlId
63 ) 64 )
64 - ScheduleRule_input(  
65 - $ruleId : ruleId, $qyrq : qyrq, $ruleMd5: ruleMd5, 65 + $sri: ScheduleRule_input(
  66 + $ruleId : ruleId, $qyrq : qyrq,
66 $lpindex : startGbdIndex, $ryindex: startEIndex) 67 $lpindex : startGbdIndex, $ryindex: startEIndex)
67 eval($qyrq.isBefore($fromDate)) 68 eval($qyrq.isBefore($fromDate))
68 then 69 then
@@ -71,7 +72,6 @@ rule &quot;calcu_days_1_&quot; @@ -71,7 +72,6 @@ rule &quot;calcu_days_1_&quot;
71 // 构造Calcu_days_result_pre,用于路牌 72 // 构造Calcu_days_result_pre,用于路牌
72 Calcu_days_result_pre cdrp = new Calcu_days_result_pre(); 73 Calcu_days_result_pre cdrp = new Calcu_days_result_pre();
73 cdrp.setRuleId($ruleId); 74 cdrp.setRuleId($ruleId);
74 - cdrp.setRuleMd5($ruleMd5);  
75 cdrp.setCalcu_index_lp($lpindex); 75 cdrp.setCalcu_index_lp($lpindex);
76 cdrp.setCalcu_index_ry($ryindex); 76 cdrp.setCalcu_index_ry($ryindex);
77 cdrp.setCalcu_start_date_1($qyrq); 77 cdrp.setCalcu_start_date_1($qyrq);
@@ -81,6 +81,19 @@ rule &quot;calcu_days_1_&quot; @@ -81,6 +81,19 @@ rule &quot;calcu_days_1_&quot;
81 cdrp.setCalcu_start_date_2($fromDate); 81 cdrp.setCalcu_start_date_2($fromDate);
82 cdrp.setCalcu_end_date_2($toDate); 82 cdrp.setCalcu_end_date_2($toDate);
83 83
  84 + /**
  85 + * 规则md5值(不使用id判定,使用md5判定)
  86 + * 使用,启用日期,路牌范围,结合生成md5编码
  87 + */
  88 + String ruleMd5 = Md5Util.getMd5(
  89 + String.valueOf($qyrq.getMillis()) +
  90 + "_" +
  91 + $sri.getSelf().getLpIds()
  92 + );
  93 + cdrp.setRuleMd5(ruleMd5);
  94 + // 人员范围个数
  95 + cdrp.setRuleEcCount($sri.getEmployeeConfigIds().size());
  96 +
84 insert(cdrp); 97 insert(cdrp);
85 98
86 // log.info("总共需要排班的天数 sdays={} ruleId={} from={} to={}", (p2.getDays() + 1), $ruleId, $fromDate, $toDate); 99 // log.info("总共需要排班的天数 sdays={} ruleId={} from={} to={}", (p2.getDays() + 1), $ruleId, $fromDate, $toDate);
@@ -97,8 +110,8 @@ rule &quot;calcu_days_2_&quot; @@ -97,8 +110,8 @@ rule &quot;calcu_days_2_&quot;
97 $toDate : toDate, 110 $toDate : toDate,
98 $xlId: xlId 111 $xlId: xlId
99 ) 112 )
100 - ScheduleRule_input(  
101 - $ruleId : ruleId, $qyrq : qyrq, $ruleMd5: ruleMd5, 113 + $sri: ScheduleRule_input(
  114 + $ruleId : ruleId, $qyrq : qyrq,
102 $lpindex : startGbdIndex, $ryindex: startEIndex) 115 $lpindex : startGbdIndex, $ryindex: startEIndex)
103 eval((!$qyrq.isBefore($fromDate)) && (!$qyrq.isAfter($toDate))) 116 eval((!$qyrq.isBefore($fromDate)) && (!$qyrq.isAfter($toDate)))
104 then 117 then
@@ -107,7 +120,6 @@ rule &quot;calcu_days_2_&quot; @@ -107,7 +120,6 @@ rule &quot;calcu_days_2_&quot;
107 // 构造Calcu_days_result_pre,用于路牌 120 // 构造Calcu_days_result_pre,用于路牌
108 Calcu_days_result_pre cdrp = new Calcu_days_result_pre(); 121 Calcu_days_result_pre cdrp = new Calcu_days_result_pre();
109 cdrp.setRuleId($ruleId); 122 cdrp.setRuleId($ruleId);
110 - cdrp.setRuleMd5($ruleMd5);  
111 cdrp.setCalcu_index_lp($lpindex); 123 cdrp.setCalcu_index_lp($lpindex);
112 cdrp.setCalcu_index_ry($ryindex); 124 cdrp.setCalcu_index_ry($ryindex);
113 cdrp.setCalcu_start_date_1($qyrq); 125 cdrp.setCalcu_start_date_1($qyrq);
@@ -117,6 +129,19 @@ rule &quot;calcu_days_2_&quot; @@ -117,6 +129,19 @@ rule &quot;calcu_days_2_&quot;
117 cdrp.setCalcu_start_date_2($qyrq); 129 cdrp.setCalcu_start_date_2($qyrq);
118 cdrp.setCalcu_end_date_2($toDate); 130 cdrp.setCalcu_end_date_2($toDate);
119 131
  132 + /**
  133 + * 规则md5值(不使用id判定,使用md5判定)
  134 + * 使用,启用日期,路牌范围,结合生成md5编码
  135 + */
  136 + String ruleMd5 = Md5Util.getMd5(
  137 + String.valueOf($qyrq.getMillis()) +
  138 + "_" +
  139 + $sri.getSelf().getLpIds()
  140 + );
  141 + cdrp.setRuleMd5(ruleMd5);
  142 + // 人员范围个数
  143 + cdrp.setRuleEcCount($sri.getEmployeeConfigIds().size());
  144 +
120 insert(cdrp); 145 insert(cdrp);
121 146
122 // log.info("总共需要排班的天数 sdays={} ruleId={} from={} to={}", (p2.getDays() + 1), $ruleId, $qyrq, $toDate); 147 // log.info("总共需要排班的天数 sdays={} ruleId={} from={} to={}", (p2.getDays() + 1), $ruleId, $qyrq, $toDate);
@@ -160,8 +185,9 @@ rule &quot;Calcu_SchedulePlanRuleResult_wrap&quot; @@ -160,8 +185,9 @@ rule &quot;Calcu_SchedulePlanRuleResult_wrap&quot;
160 185
161 // 规则Md5编码 186 // 规则Md5编码
162 String md5 = Md5Util.getMd5( 187 String md5 = Md5Util.getMd5(
163 - String.valueOf($sprr.getQyrq().getTime()) + "_" +  
164 - $sprr.getGids() + "_" + $sprr.getEcids() 188 + String.valueOf($sprr.getQyrq().getTime()) +
  189 + "_" +
  190 + $sprr.getGids()
165 ); 191 );
166 192
167 // System.out.println("修改后的md5:" + md5 + "车辆:" + $sprr.getCcZbh()); 193 // System.out.println("修改后的md5:" + md5 + "车辆:" + $sprr.getCcZbh());
@@ -181,7 +207,8 @@ rule &quot;calcu_days_1_with_result&quot; @@ -181,7 +207,8 @@ rule &quot;calcu_days_1_with_result&quot;
181 $cdrp: Calcu_days_result_pre( 207 $cdrp: Calcu_days_result_pre(
182 calcu_start_date_1.isBefore(calcu_start_date_2), 208 calcu_start_date_1.isBefore(calcu_start_date_2),
183 $ruleId: ruleId, 209 $ruleId: ruleId,
184 - $ruleMd5: ruleMd5 210 + $ruleMd5: ruleMd5,
  211 + $ruleEcCount: ruleEcCount
185 ) 212 )
186 $srrr_wrap: SchedulePlanRuleResult_wrap( 213 $srrr_wrap: SchedulePlanRuleResult_wrap(
187 // ruleId == $ruleId, 214 // ruleId == $ruleId,
@@ -196,8 +223,14 @@ rule &quot;calcu_days_1_with_result&quot; @@ -196,8 +223,14 @@ rule &quot;calcu_days_1_with_result&quot;
196 // 修正排班数据 223 // 修正排班数据
197 // log.info("准备修正 ruleId={} historyDate={}", $ruleId, $scheduleDate); 224 // log.info("准备修正 ruleId={} historyDate={}", $ruleId, $scheduleDate);
198 225
  226 + // 路牌范围起始index使用历史数据
199 $cdrp.setCalcu_index_lp(Integer.valueOf($self.getGidindex())); 227 $cdrp.setCalcu_index_lp(Integer.valueOf($self.getGidindex()));
200 - $cdrp.setCalcu_index_ry(Integer.valueOf($self.getEcindex())); 228 + // 人员范围起始index,需要判定,如果长度都是一样的,使用历史的,否则不更新,使用最新的
  229 + String history_ecids = $self.getEcids();
  230 + if ($ruleEcCount == history_ecids.split(",").length) {
  231 + $cdrp.setCalcu_index_ry(Integer.valueOf($self.getEcindex()));
  232 + }
  233 +
201 $cdrp.setCalcu_start_date_1($scheduleDate); 234 $cdrp.setCalcu_start_date_1($scheduleDate);
202 update($cdrp); 235 update($cdrp);
203 236
src/main/resources/static/pages/scheduleApp/module/core/ttInfoManage/detailedit/edit3.html
@@ -40,51 +40,78 @@ @@ -40,51 +40,78 @@
40 <!--<i class="fa fa-adjust" aria-hidden="true"></i>--> 40 <!--<i class="fa fa-adjust" aria-hidden="true"></i>-->
41 <span style="padding-right: 10px;background: #adff00;color: #501a1a;text-align: center;">分班班次</span> 41 <span style="padding-right: 10px;background: #adff00;color: #501a1a;text-align: center;">分班班次</span>
42 42
43 - <div class="btn-group">  
44 - <a href="javascript:" class="btn red btn-outline btn-circle" data-toggle="dropdown">  
45 - <i class="fa fa-share"></i>  
46 - <span>数据工具</span>  
47 - <i class="fa fa-angle-down"></i>  
48 - </a>  
49 - <ul class="dropdown-menu pull-right">  
50 - <li>  
51 - <a href="javascript:" class="tool-action" ng-click="ctrl.multiselect()">  
52 - <i class="fa fa-file-excel-o"></i>  
53 - 批量选择  
54 - </a>  
55 - </li>  
56 - <li>  
57 - <a href="javascript:" class="tool-action" ng-click="ctrl.editInfos()">  
58 - <i class="fa fa-file-excel-o"></i>  
59 - 批量修改  
60 - </a>  
61 - </li>  
62 - <li>  
63 - <a href="javascript:" class="tool-action" ng-click="ctrl.deleteInfos()">  
64 - <i class="fa fa-file-excel-o"></i>  
65 - 批量删除  
66 - </a>  
67 - </li>  
68 - <li class="divider"></li>  
69 - <li>  
70 - <a href="javascript:" class="tool-action" ng-click="ctrl.clearsel()">  
71 - <i class="fa fa-refresh"></i>  
72 - 清除选择  
73 - </a>  
74 - </li>  
75 - <li>  
76 - <a href="javascript:" class="tool-action" ng-click="ctrl.refresh()">  
77 - <i class="fa fa-refresh"></i>  
78 - 刷行数据  
79 - </a>  
80 - </li>  
81 - </ul>  
82 - </div> 43 + <!--<div class="btn-group">-->
  44 + <!--<a href="javascript:" class="btn red btn-outline btn-circle" data-toggle="dropdown">-->
  45 + <!--<i class="fa fa-share"></i>-->
  46 + <!--<span>数据工具</span>-->
  47 + <!--<i class="fa fa-angle-down"></i>-->
  48 + <!--</a>-->
  49 + <!--<ul class="dropdown-menu pull-right">-->
  50 + <!--<li>-->
  51 + <!--<a href="javascript:" class="tool-action" ng-click="ctrl.multiselect()">-->
  52 + <!--<i class="fa fa-file-excel-o"></i>-->
  53 + <!--批量选择-->
  54 + <!--</a>-->
  55 + <!--</li>-->
  56 + <!--<li>-->
  57 + <!--<a href="javascript:" class="tool-action" ng-click="ctrl.editInfos()">-->
  58 + <!--<i class="fa fa-file-excel-o"></i>-->
  59 + <!--批量修改-->
  60 + <!--</a>-->
  61 + <!--</li>-->
  62 + <!--<li>-->
  63 + <!--<a href="javascript:" class="tool-action" ng-click="ctrl.deleteInfos()">-->
  64 + <!--<i class="fa fa-file-excel-o"></i>-->
  65 + <!--批量删除-->
  66 + <!--</a>-->
  67 + <!--</li>-->
  68 + <!--<li class="divider"></li>-->
  69 + <!--<li>-->
  70 + <!--<a href="javascript:" class="tool-action" ng-click="ctrl.clearsel()">-->
  71 + <!--<i class="fa fa-refresh"></i>-->
  72 + <!--清除选择-->
  73 + <!--</a>-->
  74 + <!--</li>-->
  75 + <!--<li>-->
  76 + <!--<a href="javascript:" class="tool-action" ng-click="ctrl.refresh()">-->
  77 + <!--<i class="fa fa-refresh"></i>-->
  78 + <!--刷行数据-->
  79 + <!--</a>-->
  80 + <!--</li>-->
  81 + <!--</ul>-->
  82 + <!--</div>-->
83 83
84 </div> 84 </div>
85 </div> 85 </div>
86 86
87 <div class="portlet-body"> 87 <div class="portlet-body">
  88 + <div style="padding-bottom: 5px;">
  89 + <a href="javascript:" style="padding-right: 5px;" ng-click="ctrl.multiselect()">
  90 + <i class="fa fa-file-excel-o"></i>
  91 + 批量选择
  92 + </a>
  93 + <a href="javascript:" style="padding-right: 5px;" ng-click="ctrl.editInfos()">
  94 + <i class="fa fa-pencil-square-o"></i>
  95 + 批量修改
  96 + </a>
  97 +
  98 + <a sweetalert
  99 + sweet-options="{title: '是否删除选定的班次?',text: '线路:' + ctrl.xlname + '</br>时刻表:' + ctrl.ttname + '</br>谨慎删除!', html: true,type: 'warning',showCancelButton: true,confirmButtonColor: '#DD6B55',confirmButtonText: '是',cancelButtonText: '取消'}"
  100 + sweet-on-confirm="ctrl.deleteInfos()"
  101 + style="padding-right: 5px;" >
  102 + <i class="fa fa-trash"></i>
  103 + 批量删除
  104 + </a>
  105 + <a href="javascript:" style="padding-right: 5px;" ng-click="ctrl.clearsel()">
  106 + <i class="fa fa-eraser"></i>
  107 + 取消选择
  108 + </a>
  109 + <a href="javascript:" style="padding-right: 5px;" ng-click="ctrl.refresh()">
  110 + <i class="fa fa-refresh"></i>
  111 + 刷行数据
  112 + </a>
  113 + </div>
  114 +
88 <!--<div ng-view></div>--> 115 <!--<div ng-view></div>-->
89 <div style="height: {{ctrl.ttHeight}}px;"> 116 <div style="height: {{ctrl.ttHeight}}px;">
90 <sa-Timetable name="tt" ng-model="ctrl.editInfo" ng-model-options="{ getterSetter: true }" celldbclick="ctrl.singleEditBcDetail"> 117 <sa-Timetable name="tt" ng-model="ctrl.editInfo" ng-model-options="{ getterSetter: true }" celldbclick="ctrl.singleEditBcDetail">
src/main/resources/static/real_control_v2/fragments/north/nav/directive_history.html
1 -<div class="uk-modal" id="directive-history-modal"> 1 +<div class="uk-modal ct_move_modal" id="directive-history-modal">
2 <div class="uk-modal-dialog" style="width: 1040px;"> 2 <div class="uk-modal-dialog" style="width: 1040px;">
3 <a href="" class="uk-modal-close uk-close"></a> 3 <a href="" class="uk-modal-close uk-close"></a>
4 <div class="uk-modal-header"> 4 <div class="uk-modal-header">
@@ -15,12 +15,12 @@ @@ -15,12 +15,12 @@
15 </legend> 15 </legend>
16 <span class="horizontal-field">指令类型</span> 16 <span class="horizontal-field">指令类型</span>
17 <select name="dType"> 17 <select name="dType">
18 - <option value="-1">全部</option>  
19 - <option value="3">消息短语</option>  
20 - <option value="0">调度指令</option>  
21 - <option value="1">运营指令</option>  
22 - <option value="2">线路切换指令</option>  
23 - </select> 18 + <option value="-1">全部</option>
  19 + <option value="3">消息短语</option>
  20 + <option value="0">调度指令</option>
  21 + <option value="1">运营指令</option>
  22 + <option value="2">线路切换指令</option>
  23 + </select>
24 <span class="horizontal-field">车辆</span> 24 <span class="horizontal-field">车辆</span>
25 <div class="uk-autocomplete uk-form" id="uk-autocomplete-cars"> 25 <div class="uk-autocomplete uk-form" id="uk-autocomplete-cars">
26 <input type="text" name="nbbm" placeholder="车辆自编号"> 26 <input type="text" name="nbbm" placeholder="车辆自编号">
@@ -33,13 +33,13 @@ @@ -33,13 +33,13 @@
33 <div style="height: 495px;margin:5px 0 -18px;"> 33 <div style="height: 495px;margin:5px 0 -18px;">
34 <table class="ct-fixed-table uk-table uk-table-hover"> 34 <table class="ct-fixed-table uk-table uk-table-hover">
35 <thead> 35 <thead>
36 - <tr>  
37 - <th style="width: 6%;">时间</th>  
38 - <th style="width: 8%;">车辆</th>  
39 - <th style="width: 44%;">指令内容</th>  
40 - <th style="width: 7%;">发送人</th>  
41 - <th style="width: 15%;">状态</th>  
42 - </tr> 36 + <tr>
  37 + <th style="width: 6%;">时间</th>
  38 + <th style="width: 8%;">车辆</th>
  39 + <th style="width: 44%;">指令内容</th>
  40 + <th style="width: 7%;">发送人</th>
  41 + <th style="width: 15%;">状态</th>
  42 + </tr>
43 </thead> 43 </thead>
44 <tbody> 44 <tbody>
45 </tbody> 45 </tbody>
@@ -61,14 +61,14 @@ @@ -61,14 +61,14 @@
61 <td> 61 <td>
62 {{if obj.errorText != null}} 62 {{if obj.errorText != null}}
63 <div class="uk-badge uk-badge-danger"> {{obj.errorText}}</div> 63 <div class="uk-badge uk-badge-danger"> {{obj.errorText}}</div>
64 - {{else}}  
65 - {{if obj.reply46 != 0}}  
66 - <div class="uk-badge uk-badge-danger"> 设备未响应</div>  
67 - {{else if obj.reply47 != 0}}  
68 - <div class="uk-badge uk-badge-warning"> 设备已响应</div>  
69 - {{else if obj.reply46 == 0 && obj.reply47 == 0}}  
70 - <div class="uk-badge"> 驾驶员已确认</div>  
71 - {{/if}} 64 + {{else if obj.operCode==96}}
  65 + {{if obj.reply46 != 0}}
  66 + <div class="uk-badge uk-badge-danger"> 设备未响应</div>
  67 + {{else if obj.reply47 != 0}}
  68 + <div class="uk-badge uk-badge-warning"> 设备已响应</div>
  69 + {{else if obj.reply46 == 0 && obj.reply47 == 0}}
  70 + <div class="uk-badge"> 驾驶员已确认</div>
  71 + {{/if}}
72 {{/if}} 72 {{/if}}
73 </td> 73 </td>
74 </tr> 74 </tr>
@@ -87,17 +87,17 @@ @@ -87,17 +87,17 @@
87 var carInput = $('#uk-autocomplete-cars input'); 87 var carInput = $('#uk-autocomplete-cars input');
88 var search_nbbm = function(release) { 88 var search_nbbm = function(release) {
89 var q = carInput.val().toUpperCase(), 89 var q = carInput.val().toUpperCase(),
90 - rs = [],  
91 - max = 12,  
92 - count = 0; 90 + rs = [],
  91 + max = 12,
  92 + count = 0;
93 93
94 $.each(cars, function(i, item) { 94 $.each(cars, function(i, item) {
95 if (item.indexOf(q) != -1){ 95 if (item.indexOf(q) != -1){
96 - rs.push({  
97 - value: item,  
98 - title: item  
99 - });  
100 - count ++; 96 + rs.push({
  97 + value: item,
  98 + title: item
  99 + });
  100 + count ++;
101 } 101 }
102 if (count >= max) 102 if (count >= max)
103 return false; 103 return false;
@@ -156,7 +156,7 @@ @@ -156,7 +156,7 @@
156 var resetPagination = true; 156 var resetPagination = true;
157 var pagination = function(pages, currentPage) { 157 var pagination = function(pages, currentPage) {
158 var wrap = $('.pagination-wrap', modal).empty() 158 var wrap = $('.pagination-wrap', modal).empty()
159 - ,e = $('<ul class="uk-pagination"></ul>').appendTo(wrap); 159 + ,e = $('<ul class="uk-pagination"></ul>').appendTo(wrap);
160 160
161 var pagination = UIkit.pagination(e, { 161 var pagination = UIkit.pagination(e, {
162 pages: pages, 162 pages: pages,
@@ -164,8 +164,8 @@ @@ -164,8 +164,8 @@
164 }); 164 });
165 165
166 e.on('select.uk.pagination', function(e, pageIndex){ 166 e.on('select.uk.pagination', function(e, pageIndex){
167 - page = pageIndex;  
168 - query(); 167 + page = pageIndex;
  168 + query();
169 }); 169 });
170 170
171 resetPagination = false; 171 resetPagination = false;
src/test/resources/testdata/problem.properties
1 ##1=时刻表明细导入,线路标准里所有的高峰低谷时间需要带入时刻表班次时间里,标准可以点击切换到线路标准界面 1 ##1=时刻表明细导入,线路标准里所有的高峰低谷时间需要带入时刻表班次时间里,标准可以点击切换到线路标准界面
2 -2=时刻表明细编辑功能,数据工具移到时刻表里,类似工具栏的样子 2 +##2=时刻表明细编辑功能,数据工具移到时刻表里,类似工具栏的样子
3 3=时刻表导入,可以选一个已经存在的时刻表导入,而不是excel文件 3 3=时刻表导入,可以选一个已经存在的时刻表导入,而不是excel文件
4 ##4=所有的删除,作废,都要有提示框操作 4 ##4=所有的删除,作废,都要有提示框操作
5 5=排班计划错误提示,如果选的排班日期之前没有排班,提示错误,排班结果有重复与时刻表不符合,显示错误 5 5=排班计划错误提示,如果选的排班日期之前没有排班,提示错误,排班结果有重复与时刻表不符合,显示错误
@@ -31,4 +31,4 @@ @@ -31,4 +31,4 @@
31 ##30=时刻表公里数 三位数 31 ##30=时刻表公里数 三位数
32 32
33 31=规则修改,路牌范围,人员范围可以拖动 33 31=规则修改,路牌范围,人员范围可以拖动
34 -32=人员配置不存在的情况下,导入规则ktr,找不到的人员不添加,人员范围不存在的,规则不导入 34 +#32=人员配置不存在的情况下,导入规则ktr,找不到的人员不添加,人员范围不存在的,规则不导入