Commit 52b3c0529be821b10cc2fec9ad3660ffbd8de75e

Authored by 徐烜
2 parents bdacb353 db92728e

Merge branch 'minhang' of http://222.66.0.204:8090//panzhaov5/bsth_control into minhang

Showing 22 changed files with 1287 additions and 1211 deletions
src/main/java/com/bsth/controller/realcontrol/ServiceDataInterface.java
@@ -12,7 +12,7 @@ import java.util.ArrayList; @@ -12,7 +12,7 @@ import java.util.ArrayList;
12 import java.util.List; 12 import java.util.List;
13 13
14 /** 14 /**
15 - * 对外的营运数据接口,主要输出当日的数据 15 + * 对外的营运数据接口
16 * Created by panzhao on 2017/3/15. 16 * Created by panzhao on 2017/3/15.
17 */ 17 */
18 @RestController 18 @RestController
@@ -78,4 +78,24 @@ public class ServiceDataInterface { @@ -78,4 +78,24 @@ public class ServiceDataInterface {
78 } 78 }
79 return rs; 79 return rs;
80 } 80 }
  81 +
  82 + /**
  83 + * 获取全量的进出场数据, 仅供接口项目调用。 由接口项目负责对外所有场站输出
  84 + * @return
  85 + */
  86 + @RequestMapping("/findCurrInAndOut")
  87 + public List<ScheduleRealInfo> findCurrInAndOut(@RequestParam String secretKey){
  88 + if (StringUtils.isEmpty(secretKey) || !secretKey.equals(SECRE_KEY))
  89 + return null;
  90 +
  91 +
  92 + List<ScheduleRealInfo> all = new ArrayList<>(dayOfSchedule.findAll()), rs = new ArrayList<>();
  93 + for (ScheduleRealInfo sch : all) {
  94 + if (sch.getBcType().equals("in")
  95 + || sch.getBcType().equals("out")) {
  96 + rs.add(sch);
  97 + }
  98 + }
  99 + return rs;
  100 + }
81 } 101 }
src/main/java/com/bsth/controller/traffic/VehicleInoutStopController.java
@@ -2,8 +2,17 @@ package com.bsth.controller.traffic; @@ -2,8 +2,17 @@ package com.bsth.controller.traffic;
2 2
3 import com.bsth.controller.BaseController; 3 import com.bsth.controller.BaseController;
4 import com.bsth.entity.traffic.VehicleInoutStop; 4 import com.bsth.entity.traffic.VehicleInoutStop;
  5 +import com.bsth.service.traffic.VehicleInoutStopService;
  6 +import org.springframework.beans.factory.annotation.Autowired;
  7 +import org.springframework.data.domain.Page;
  8 +import org.springframework.data.domain.PageImpl;
  9 +import org.springframework.data.domain.PageRequest;
5 import org.springframework.web.bind.annotation.RequestMapping; 10 import org.springframework.web.bind.annotation.RequestMapping;
  11 +import org.springframework.web.bind.annotation.RequestParam;
6 import org.springframework.web.bind.annotation.RestController; 12 import org.springframework.web.bind.annotation.RestController;
  13 +
  14 +import java.util.Map;
  15 +
7 /** 16 /**
8 * 17 *
9 * @author BSTH 18 * @author BSTH
@@ -12,4 +21,26 @@ import org.springframework.web.bind.annotation.RestController; @@ -12,4 +21,26 @@ import org.springframework.web.bind.annotation.RestController;
12 @RestController 21 @RestController
13 @RequestMapping("vehicle_stop") 22 @RequestMapping("vehicle_stop")
14 public class VehicleInoutStopController extends BaseController<VehicleInoutStop,Integer> { 23 public class VehicleInoutStopController extends BaseController<VehicleInoutStop,Integer> {
  24 +
  25 + @Autowired
  26 + VehicleInoutStopService vehicleInoutStopService;
  27 +
  28 + /**
  29 + * 给定条件查车载上报停靠站
  30 + * @param map
  31 + * @param page
  32 + * @param size
  33 + * @return
  34 + */
  35 + @RequestMapping(value = "getVehicleInoutStopByParam")
  36 + public Page<Map<String, Object>> getVehicleInoutStopByParam(@RequestParam Map<String, Object> map,
  37 + @RequestParam(defaultValue = "0") int page,
  38 + @RequestParam(defaultValue = "10") int size) {
  39 + map.put("page",page);
  40 + map.put("size",size);
  41 + long total = vehicleInoutStopService.getVehicleInoutStopCountByParam(map);
  42 + Page<Map<String, Object>> result = new PageImpl<>(vehicleInoutStopService.getVehicleInoutStopByParam(map),
  43 + new PageRequest(page, size, null),total);
  44 + return result;
  45 + }
15 } 46 }
src/main/java/com/bsth/data/gpsdata/arrival/precondition/InPreconditionHandler.java
1 -package com.bsth.data.gpsdata.arrival.precondition;  
2 -  
3 -import com.bsth.data.gpsdata.GpsEntity;  
4 -import org.springframework.stereotype.Component;  
5 -  
6 -/**  
7 - * 进站(前置电子围栏)  
8 - * Created by panzhao on 2017/9/23.  
9 - */  
10 -@Component  
11 -public class InPreconditionHandler {  
12 -  
13 - /**  
14 - * 进站动作是否有通过前置围栏  
15 - * @param gps  
16 - * @param prev  
17 - * @return  
18 - */  
19 - public boolean isPass(GpsEntity gps, GpsEntity prev){  
20 - return false;  
21 - }  
22 -} 1 +package com.bsth.data.gpsdata.arrival.precondition;
  2 +
  3 +import com.bsth.data.gpsdata.GpsEntity;
  4 +import org.springframework.stereotype.Component;
  5 +
  6 +/**
  7 + * 进站(前置电子围栏)
  8 + * Created by panzhao on 2017/9/23.
  9 + */
  10 +@Component
  11 +public class InPreconditionHandler {
  12 +
  13 + /**
  14 + * 进站动作是否有通过前置围栏
  15 + * @param gps
  16 + * @param prev
  17 + * @return
  18 + */
  19 + public boolean isPass(GpsEntity gps, GpsEntity prev){
  20 + return false;
  21 + }
  22 +}
src/main/java/com/bsth/data/gpsdata/arrival/precondition/entity/PreconditionGeo.java
1 -package com.bsth.data.gpsdata.arrival.precondition.entity;  
2 -  
3 -import com.bsth.util.Geo.Polygon;  
4 -  
5 -/**  
6 - * 前置围栏 -地理坐标  
7 - * Created by panzhao on 2017/9/23.  
8 - */  
9 -public class PreconditionGeo {  
10 -  
11 - private String name;  
12 -  
13 - /**  
14 - * 前置约束的站点编码  
15 - */  
16 - private String stationCode;  
17 -  
18 - /**  
19 - * 线路编码  
20 - */  
21 - private String lineCode;  
22 -  
23 - /**  
24 - * 上下行  
25 - */  
26 - private int upDown;  
27 -  
28 - /**  
29 - * 多边形坐标  
30 - */  
31 - private String coords;  
32 -  
33 - private com.bsth.util.Geo.Polygon polygon;  
34 -  
35 - private Integer order;  
36 -  
37 - public String getName() {  
38 - return name;  
39 - }  
40 -  
41 - public void setName(String name) {  
42 - this.name = name;  
43 - }  
44 -  
45 - public String getStationCode() {  
46 - return stationCode;  
47 - }  
48 -  
49 - public void setStationCode(String stationCode) {  
50 - this.stationCode = stationCode;  
51 - }  
52 -  
53 - public String getLineCode() {  
54 - return lineCode;  
55 - }  
56 -  
57 - public void setLineCode(String lineCode) {  
58 - this.lineCode = lineCode;  
59 - }  
60 -  
61 - public int getUpDown() {  
62 - return upDown;  
63 - }  
64 -  
65 - public void setUpDown(int upDown) {  
66 - this.upDown = upDown;  
67 - }  
68 -  
69 - public String getCoords() {  
70 - return coords;  
71 - }  
72 -  
73 - public void setCoords(String coords) {  
74 - this.coords = coords;  
75 - }  
76 -  
77 - public Integer getOrder() {  
78 - return order;  
79 - }  
80 -  
81 - public void setOrder(Integer order) {  
82 - this.order = order;  
83 - }  
84 -  
85 - public Polygon getPolygon() {  
86 - return polygon;  
87 - }  
88 -  
89 - public void setPolygon(Polygon polygon) {  
90 - this.polygon = polygon;  
91 - }  
92 -} 1 +package com.bsth.data.gpsdata.arrival.precondition.entity;
  2 +
  3 +import com.bsth.util.Geo.Polygon;
  4 +
  5 +/**
  6 + * 前置围栏 -地理坐标
  7 + * Created by panzhao on 2017/9/23.
  8 + */
  9 +public class PreconditionGeo {
  10 +
  11 + private String name;
  12 +
  13 + /**
  14 + * 前置约束的站点编码
  15 + */
  16 + private String stationCode;
  17 +
  18 + /**
  19 + * 线路编码
  20 + */
  21 + private String lineCode;
  22 +
  23 + /**
  24 + * 上下行
  25 + */
  26 + private int upDown;
  27 +
  28 + /**
  29 + * 多边形坐标
  30 + */
  31 + private String coords;
  32 +
  33 + private com.bsth.util.Geo.Polygon polygon;
  34 +
  35 + private Integer order;
  36 +
  37 + public String getName() {
  38 + return name;
  39 + }
  40 +
  41 + public void setName(String name) {
  42 + this.name = name;
  43 + }
  44 +
  45 + public String getStationCode() {
  46 + return stationCode;
  47 + }
  48 +
  49 + public void setStationCode(String stationCode) {
  50 + this.stationCode = stationCode;
  51 + }
  52 +
  53 + public String getLineCode() {
  54 + return lineCode;
  55 + }
  56 +
  57 + public void setLineCode(String lineCode) {
  58 + this.lineCode = lineCode;
  59 + }
  60 +
  61 + public int getUpDown() {
  62 + return upDown;
  63 + }
  64 +
  65 + public void setUpDown(int upDown) {
  66 + this.upDown = upDown;
  67 + }
  68 +
  69 + public String getCoords() {
  70 + return coords;
  71 + }
  72 +
  73 + public void setCoords(String coords) {
  74 + this.coords = coords;
  75 + }
  76 +
  77 + public Integer getOrder() {
  78 + return order;
  79 + }
  80 +
  81 + public void setOrder(Integer order) {
  82 + this.order = order;
  83 + }
  84 +
  85 + public Polygon getPolygon() {
  86 + return polygon;
  87 + }
  88 +
  89 + public void setPolygon(Polygon polygon) {
  90 + this.polygon = polygon;
  91 + }
  92 +}
src/main/java/com/bsth/data/pilot80/PilotReport.java
@@ -156,7 +156,7 @@ public class PilotReport { @@ -156,7 +156,7 @@ public class PilotReport {
156 if (d80.getConfirmRs() == 0) { 156 if (d80.getConfirmRs() == 0) {
157 String nbbm = BasicData.deviceId2NbbmMap.get(d80.getDeviceId()); 157 String nbbm = BasicData.deviceId2NbbmMap.get(d80.getDeviceId());
158 158
159 - ScheduleRealInfo sch = dayOfSchedule.nextByBcType(nbbm, "out"); 159 + ScheduleRealInfo sch = dayOfSchedule.searchNearByBcType(nbbm, "out");
160 if (null == sch) 160 if (null == sch)
161 return; 161 return;
162 162
src/main/java/com/bsth/entity/traffic/VehicleInoutStop.java
1 package com.bsth.entity.traffic; 1 package com.bsth.entity.traffic;
2 2
3 -import com.bsth.entity.Cars;  
4 -import com.bsth.entity.Line;  
5 -  
6 import javax.persistence.*; 3 import javax.persistence.*;
7 import java.util.Date; 4 import java.util.Date;
8 5
@@ -27,11 +24,9 @@ public class VehicleInoutStop { @@ -27,11 +24,9 @@ public class VehicleInoutStop {
27 @GeneratedValue(strategy = GenerationType.IDENTITY) 24 @GeneratedValue(strategy = GenerationType.IDENTITY)
28 private Integer id; 25 private Integer id;
29 26
30 - @ManyToOne  
31 - private Line line; 27 + private int line;
32 28
33 - @ManyToOne  
34 - private Cars cars; 29 + private int cars;
35 30
36 // 站点序号 31 // 站点序号
37 private Integer stop; 32 private Integer stop;
@@ -46,7 +41,7 @@ public class VehicleInoutStop { @@ -46,7 +41,7 @@ public class VehicleInoutStop {
46 private Integer inOutStop; 41 private Integer inOutStop;
47 42
48 // 上报时间 43 // 上报时间
49 - private long reportDate; 44 + private Date reportDate;
50 45
51 public Integer getId() { 46 public Integer getId() {
52 return id; 47 return id;
@@ -56,19 +51,19 @@ public class VehicleInoutStop { @@ -56,19 +51,19 @@ public class VehicleInoutStop {
56 this.id = id; 51 this.id = id;
57 } 52 }
58 53
59 - public Line getLine() { 54 + public int getLine() {
60 return line; 55 return line;
61 } 56 }
62 57
63 - public void setLine(Line line) { 58 + public void setLine(int line) {
64 this.line = line; 59 this.line = line;
65 } 60 }
66 61
67 - public Cars getCars() { 62 + public int getCars() {
68 return cars; 63 return cars;
69 } 64 }
70 65
71 - public void setCars(Cars cars) { 66 + public void setCars(int cars) {
72 this.cars = cars; 67 this.cars = cars;
73 } 68 }
74 69
@@ -104,7 +99,11 @@ public class VehicleInoutStop { @@ -104,7 +99,11 @@ public class VehicleInoutStop {
104 this.inOutStop = inOutStop; 99 this.inOutStop = inOutStop;
105 } 100 }
106 101
107 - public long getReportDate() { return reportDate; } 102 + public Date getReportDate() {
  103 + return reportDate;
  104 + }
108 105
109 - public void setReportDate(long reportDate) { this.reportDate = reportDate; } 106 + public void setReportDate(Date reportDate) {
  107 + this.reportDate = reportDate;
  108 + }
110 } 109 }
src/main/java/com/bsth/service/excep/impl/NowSpeedingServiceImpl.java
@@ -129,20 +129,19 @@ public class NowSpeedingServiceImpl implements NowSpeedingService { @@ -129,20 +129,19 @@ public class NowSpeedingServiceImpl implements NowSpeedingService {
129 @Override 129 @Override
130 public PageObject<Speeding> Pagequery(Map<String, Object> map) { 130 public PageObject<Speeding> Pagequery(Map<String, Object> map) {
131 String sql="select count(*) record from bsth_c_speeding_handle where 1=1 "; 131 String sql="select count(*) record from bsth_c_speeding_handle where 1=1 ";
132 - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); 132 + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
133 Object line=map.get("line"); 133 Object line=map.get("line");
134 Object updown=map.get("updown"); 134 Object updown=map.get("updown");
135 Object startDate=map.get("startDate"); 135 Object startDate=map.get("startDate");
136 Object endDate=map.get("endDate"); 136 Object endDate=map.get("endDate");
137 Object times=map.get("times"); 137 Object times=map.get("times");
138 -  
139 - if(line!=null){ 138 + if(line!=null && line != ""){
140 sql +=" and line like'%"+line.toString().trim()+"%'"; 139 sql +=" and line like'%"+line.toString().trim()+"%'";
141 } 140 }
142 - if(updown!=null){ 141 + if(updown!=null && updown != ""){
143 sql +="and up_down like '%"+updown.toString()+"%'"; 142 sql +="and up_down like '%"+updown.toString()+"%'";
144 } 143 }
145 - if(startDate!=null){ 144 + if(startDate!=null && startDate != ""){
146 if (startDate.toString().length()>0) { 145 if (startDate.toString().length()>0) {
147 try { 146 try {
148 Long t1 = sdf.parse(startDate.toString()+" 00:00:00").getTime(); 147 Long t1 = sdf.parse(startDate.toString()+" 00:00:00").getTime();
@@ -152,7 +151,7 @@ public class NowSpeedingServiceImpl implements NowSpeedingService { @@ -152,7 +151,7 @@ public class NowSpeedingServiceImpl implements NowSpeedingService {
152 } 151 }
153 } 152 }
154 } 153 }
155 - if(endDate!=null){ 154 + if(endDate!=null && endDate != ""){
156 if (endDate.toString().length()>0) { 155 if (endDate.toString().length()>0) {
157 try { 156 try {
158 Long t2=sdf.parse(endDate.toString()+" 23:59:59").getTime(); 157 Long t2=sdf.parse(endDate.toString()+" 23:59:59").getTime();
@@ -163,7 +162,7 @@ public class NowSpeedingServiceImpl implements NowSpeedingService { @@ -163,7 +162,7 @@ public class NowSpeedingServiceImpl implements NowSpeedingService {
163 } 162 }
164 } 163 }
165 164
166 - if(times!=null && times.toString().length()>0){ 165 + if(times!=null && times.toString().length()>0 && times != ""){
167 sql +=" and (endTimestamp-startTimestamp) >="+Integer.valueOf(times.toString())*1000; 166 sql +=" and (endTimestamp-startTimestamp) >="+Integer.valueOf(times.toString())*1000;
168 } 167 }
169 168
src/main/java/com/bsth/service/forms/impl/FormsServiceImpl.java
@@ -33,6 +33,7 @@ import com.bsth.entity.mcy_forms.Vehicleloading; @@ -33,6 +33,7 @@ import com.bsth.entity.mcy_forms.Vehicleloading;
33 import com.bsth.entity.mcy_forms.Waybillday; 33 import com.bsth.entity.mcy_forms.Waybillday;
34 import com.bsth.entity.oil.Dlb; 34 import com.bsth.entity.oil.Dlb;
35 import com.bsth.entity.oil.Ylb; 35 import com.bsth.entity.oil.Ylb;
  36 +import com.bsth.entity.realcontrol.ChildTaskPlan;
36 import com.bsth.entity.realcontrol.ScheduleRealInfo; 37 import com.bsth.entity.realcontrol.ScheduleRealInfo;
37 import com.bsth.entity.schedule.SchedulePlanInfo; 38 import com.bsth.entity.schedule.SchedulePlanInfo;
38 import com.bsth.repository.LineRepository; 39 import com.bsth.repository.LineRepository;
@@ -1031,9 +1032,16 @@ public class FormsServiceImpl implements FormsService { @@ -1031,9 +1032,16 @@ public class FormsServiceImpl implements FormsService {
1031 1032
1032 List<ScheduleRealInfo> newList=new ArrayList<ScheduleRealInfo>(); 1033 List<ScheduleRealInfo> newList=new ArrayList<ScheduleRealInfo>();
1033 for (int j = 0; j < listReal.size(); j++) { 1034 for (int j = 0; j < listReal.size(); j++) {
1034 - ScheduleRealInfo s=listReal.get(j);  
1035 - if(s.getXlBm().equals(line) && !lineSet.contains(s.getXlName())){  
1036 - newList.add(s); 1035 + ScheduleRealInfo s = listReal.get(j);
  1036 + if (s.getXlBm().equals(line) && !lineSet.contains(s.getXlName())) {
  1037 + Set<ChildTaskPlan> cts = s.getcTasks();
  1038 + if (cts != null && cts.size() > 0) {
  1039 + newList.add(s);
  1040 + } else {
  1041 + if (s.getZdsjActual() != null) {
  1042 + newList.add(s);
  1043 + }
  1044 + }
1037 } 1045 }
1038 } 1046 }
1039 1047
@@ -1041,12 +1049,12 @@ public class FormsServiceImpl implements FormsService { @@ -1041,12 +1049,12 @@ public class FormsServiceImpl implements FormsService {
1041 int ljbc=culateMileageService.culateLjbc(newList,""); 1049 int ljbc=culateMileageService.culateLjbc(newList,"");
1042 double ksgl=culateMileageService.culateKsgl(newList); 1050 double ksgl=culateMileageService.culateKsgl(newList);
1043 double jccgl=culateMileageService.culateJccgl(newList); 1051 double jccgl=culateMileageService.culateJccgl(newList);
1044 - 1052 + double zksgl=Arith.add(ksgl, jccgl);
1045 double sjgl=culateMileageService.culateSjgl(newList); 1053 double sjgl=culateMileageService.culateSjgl(newList);
1046 double ljgl=culateMileageService.culateLjgl(newList); 1054 double ljgl=culateMileageService.culateLjgl(newList);
1047 - 1055 + double zyygl=Arith.add(sjgl, ljgl);
1048 o.setEmptMileage(String.valueOf(Arith.add(ksgl, jccgl))); 1056 o.setEmptMileage(String.valueOf(Arith.add(ksgl, jccgl)));
1049 - o.setXsgl(String.valueOf(Arith.add(sjgl, ljgl))); 1057 + o.setXsgl(String.valueOf(Arith.add(zyygl, zksgl)));
1050 o.setSjbc(String.valueOf(sjbc+ljbc)); 1058 o.setSjbc(String.valueOf(sjbc+ljbc));
1051 1059
1052 double jzl=0.0; 1060 double jzl=0.0;
@@ -1103,24 +1111,33 @@ public class FormsServiceImpl implements FormsService { @@ -1103,24 +1111,33 @@ public class FormsServiceImpl implements FormsService {
1103 List<ScheduleRealInfo> listReal=scheduleRealInfoRepository.scheduleByDateAndLineTjrb(line, date); 1111 List<ScheduleRealInfo> listReal=scheduleRealInfoRepository.scheduleByDateAndLineTjrb(line, date);
1104 for (int i = 0; i < list.size(); i++) { 1112 for (int i = 0; i < list.size(); i++) {
1105 List<ScheduleRealInfo> newList=new ArrayList<ScheduleRealInfo>(); 1113 List<ScheduleRealInfo> newList=new ArrayList<ScheduleRealInfo>();
  1114 + List<ScheduleRealInfo> newList_=new ArrayList<ScheduleRealInfo>();
1106 Vehicleloading sin=list.get(i); 1115 Vehicleloading sin=list.get(i);
1107 sin.setrQ(date); 1116 sin.setrQ(date);
1108 String jsy=sin.getJgh(); 1117 String jsy=sin.getJgh();
1109 String clzbh=sin.getClzbh(); 1118 String clzbh=sin.getClzbh();
1110 for (int j = 0; j < listReal.size(); j++) { 1119 for (int j = 0; j < listReal.size(); j++) {
1111 - ScheduleRealInfo s=listReal.get(j);  
1112 - if(s.getjGh().equals(jsy) && s.getClZbh().equals(clzbh)){ 1120 + ScheduleRealInfo s = listReal.get(j);
  1121 + if (s.getjGh().equals(jsy) && s.getClZbh().equals(clzbh)) {
  1122 + Set<ChildTaskPlan> cts = s.getcTasks();
  1123 + if (cts != null && cts.size() > 0) {
  1124 + newList_.add(s);
  1125 + } else {
  1126 + if (s.getZdsjActual() != null) {
  1127 + newList_.add(s);
  1128 + }
  1129 + }
1113 newList.add(s); 1130 newList.add(s);
1114 } 1131 }
1115 } 1132 }
1116 1133
1117 int jhbc=culateMileageService.culateJhbc(newList, ""); 1134 int jhbc=culateMileageService.culateJhbc(newList, "");
1118 - int sjbc=culateMileageService.culateSjbc(newList, "");  
1119 - int ljbc=culateMileageService.culateLjbc(newList, "");  
1120 - double yygl=culateMileageService.culateSjgl(newList);  
1121 - double ljgl=culateMileageService.culateLjgl(newList);  
1122 - double ksgl=culateMileageService.culateKsgl(newList);  
1123 - double jcgl=culateMileageService.culateJccgl(newList); 1135 + int sjbc=culateMileageService.culateSjbc(newList_, "");
  1136 + int ljbc=culateMileageService.culateLjbc(newList_, "");
  1137 + double yygl=culateMileageService.culateSjgl(newList_);
  1138 + double ljgl=culateMileageService.culateLjgl(newList_);
  1139 + double ksgl=culateMileageService.culateKsgl(newList_);
  1140 + double jcgl=culateMileageService.culateJccgl(newList_);
1124 double zyygl=Arith.add(yygl, ljgl); 1141 double zyygl=Arith.add(yygl, ljgl);
1125 double zksgl=Arith.add(ksgl, jcgl); 1142 double zksgl=Arith.add(ksgl, jcgl);
1126 sin.setJhlc(String.valueOf(Arith.add(zyygl,zksgl))); 1143 sin.setJhlc(String.valueOf(Arith.add(zyygl,zksgl)));
src/main/java/com/bsth/service/report/impl/ReportServiceImpl.java
@@ -2058,7 +2058,7 @@ public class ReportServiceImpl implements ReportService{ @@ -2058,7 +2058,7 @@ public class ReportServiceImpl implements ReportService{
2058 int weeks_year2 = cal.get(Calendar.WEEK_OF_YEAR); 2058 int weeks_year2 = cal.get(Calendar.WEEK_OF_YEAR);
2059 Date dates2=cal.getTime(); 2059 Date dates2=cal.getTime();
2060 String d2=simpleDateFormat.format(dates2); 2060 String d2=simpleDateFormat.format(dates2);
2061 - String sql="select *,UNIX_TIMESTAMP(times) as ts from bsth_c_arrival_info where times >= '"+d1 +"'and " 2061 + /*String sql="select *,UNIX_TIMESTAMP(times) as ts from bsth_c_arrival_info where times >= '"+d1 +"'and "
2062 + " times <='"+d2+"' and line_id = '"+line+"' and up_down = '"+zd+"'" 2062 + " times <='"+d2+"' and line_id = '"+line+"' and up_down = '"+zd+"'"
2063 + " order by device_id,times"; 2063 + " order by device_id,times";
2064 2064
@@ -2073,7 +2073,30 @@ public class ReportServiceImpl implements ReportService{ @@ -2073,7 +2073,30 @@ public class ReportServiceImpl implements ReportService{
2073 ai.setTs(arg0.getLong("ts")*1000); 2073 ai.setTs(arg0.getLong("ts")*1000);
2074 return ai; 2074 return ai;
2075 } 2075 }
2076 - }); 2076 + });*/
  2077 +
  2078 + Connection conn = null;
  2079 + PreparedStatement ps = null;
  2080 + ResultSet rs = null;
  2081 +
  2082 + String sql = "select * from bsth_c_arrival_info where line_id=? AND weeks_year=? "
  2083 + + " AND ts >= ? AND ts <=? AND up_down=? order by device_id,ts";
  2084 + try{
  2085 + conn = DBUtils_MS.getConnection();
  2086 + ps = conn.prepareStatement(sql);
  2087 + ps.setString(1, line);
  2088 + ps.setInt(2, weeks_year1);
  2089 + ps.setLong(3, date1);
  2090 + ps.setLong(4, date2);
  2091 + ps.setInt(5, zd);
  2092 + rs = ps.executeQuery();
  2093 +
  2094 + list = resultSet2Set(rs);
  2095 + }catch(Exception e){
  2096 + logger.error("", e);
  2097 + }finally {
  2098 + DBUtils_MS.close(rs, ps, conn);
  2099 + }
2077 2100
2078 } catch (ParseException e1) { 2101 } catch (ParseException e1) {
2079 // TODO Auto-generated catch block 2102 // TODO Auto-generated catch block
@@ -2223,23 +2246,6 @@ public class ReportServiceImpl implements ReportService{ @@ -2223,23 +2246,6 @@ public class ReportServiceImpl implements ReportService{
2223 , (i+1)); 2246 , (i+1));
2224 } 2247 }
2225 inoutList.add(map1); 2248 inoutList.add(map1);
2226 -  
2227 - /*for (int j = 0; j < listStation.size(); j++) {  
2228 - map2=new HashMap<String,Object>();  
2229 - StationRoute s=listStation.get(j);  
2230 - List<ArrivalInfo> arrivalList=new ArrayList<ArrivalInfo>();  
2231 - for (int j2 = 0; j2 < arrInfoList.size(); j2++) {  
2232 - ArrivalInfo a=arrivalList.get(j2);  
2233 - if(s.getStationCode().equals(a.getStopNo())){  
2234 - arrivalList.add(a);  
2235 - }  
2236 - }  
2237 - Map<String, String> m=this.strInOut(arrivalList,lzsj);  
2238 -  
2239 - map2.put(s.getStationCode()+"in", m.get("in"));  
2240 - map2.put(s.getStationCode()+"out", m.get("out"));  
2241 - map2.put(s.getStationCode(), m.get("type"));  
2242 - }*/  
2243 List<String> list_nbbm=new ArrayList<String>(); 2249 List<String> list_nbbm=new ArrayList<String>();
2244 Map<String, Object> m=new HashMap<String,Object>(); 2250 Map<String, Object> m=new HashMap<String,Object>();
2245 for (int i = 0; i < arrInfoList.size(); i++) { 2251 for (int i = 0; i < arrInfoList.size(); i++) {
src/main/java/com/bsth/service/traffic/VehicleInoutStopService.java
@@ -3,10 +3,26 @@ package com.bsth.service.traffic; @@ -3,10 +3,26 @@ package com.bsth.service.traffic;
3 import com.bsth.entity.traffic.VehicleInoutStop; 3 import com.bsth.entity.traffic.VehicleInoutStop;
4 import com.bsth.service.BaseService; 4 import com.bsth.service.BaseService;
5 5
  6 +import java.util.List;
  7 +import java.util.Map;
  8 +
6 9
7 /** 10 /**
8 * 时刻模板上传日志 11 * 时刻模板上传日志
9 */ 12 */
10 public interface VehicleInoutStopService extends BaseService<VehicleInoutStop,Integer> { 13 public interface VehicleInoutStopService extends BaseService<VehicleInoutStop,Integer> {
11 14
  15 + /**
  16 + * 给定条件查车载上报停靠站
  17 + * @param map
  18 + * @return
  19 + */
  20 + List<Map<String, Object>> getVehicleInoutStopByParam(Map<String,Object> map);
  21 +
  22 + /**
  23 + * 给定条件查车载上报停靠站的记录数
  24 + * @param map
  25 + * @return
  26 + */
  27 + long getVehicleInoutStopCountByParam(Map<String,Object> map);
12 } 28 }
src/main/java/com/bsth/service/traffic/impl/VehicleInoutStopServiceImpl.java
@@ -3,10 +3,14 @@ package com.bsth.service.traffic.impl; @@ -3,10 +3,14 @@ package com.bsth.service.traffic.impl;
3 import com.bsth.entity.traffic.VehicleInoutStop; 3 import com.bsth.entity.traffic.VehicleInoutStop;
4 import com.bsth.service.impl.BaseServiceImpl; 4 import com.bsth.service.impl.BaseServiceImpl;
5 import com.bsth.service.traffic.VehicleInoutStopService; 5 import com.bsth.service.traffic.VehicleInoutStopService;
6 -import org.slf4j.Logger;  
7 -import org.slf4j.LoggerFactory; 6 +import com.bsth.util.DateUtils;
  7 +import org.springframework.beans.factory.annotation.Autowired;
  8 +import org.springframework.jdbc.core.JdbcTemplate;
8 import org.springframework.stereotype.Service; 9 import org.springframework.stereotype.Service;
9 10
  11 +import java.util.List;
  12 +import java.util.Map;
  13 +
10 /** 14 /**
11 * 15 *
12 * @ClassName: TrafficManageServiceImpl(运管处接口service业务层实现类) 16 * @ClassName: TrafficManageServiceImpl(运管处接口service业务层实现类)
@@ -26,6 +30,70 @@ import org.springframework.stereotype.Service; @@ -26,6 +30,70 @@ import org.springframework.stereotype.Service;
26 @Service 30 @Service
27 public class VehicleInoutStopServiceImpl extends BaseServiceImpl<VehicleInoutStop,Integer> implements VehicleInoutStopService { 31 public class VehicleInoutStopServiceImpl extends BaseServiceImpl<VehicleInoutStop,Integer> implements VehicleInoutStopService {
28 32
29 - Logger logger = LoggerFactory.getLogger(this.getClass()); 33 + @Autowired
  34 + JdbcTemplate jdbcTemplate;
  35 +
  36 + /**
  37 + * 拼装sql
  38 + * @param map
  39 + * @param flag
  40 + * @return
  41 + */
  42 + private String packageParam(Map<String,Object> map,String flag){
  43 + StringBuffer sql = new StringBuffer(" where 1 = 1 ");
  44 + String lineId = map.get("lineId")+"";
  45 + String insideCode = map.get("insideCode")+"";
  46 + String carPlate = map.get("carPlate")+"";
  47 + String reportDate_start = map.get("reportDate_start")+"";
  48 + String reportDate_end = map.get("reportDate_end")+"";
  49 + int page = Integer.valueOf(map.get("page")+"");
  50 + int size = Integer.valueOf(map.get("size")+"");
  51 + String order = " order by report_date asc"+ " LIMIT "+page*size+","+size;
  52 + int dayNum = DateUtils.calcDaynumberInYear(reportDate_start.substring(0,8)) -1;
  53 + if(!lineId.equals("")){
  54 + sql.append(" and l.id = ").append(lineId);
  55 + }
  56 + if(!insideCode.equals("")){
  57 + sql.append(" and c.inside_code = ").append("'").append(insideCode.toUpperCase()).append("'");
  58 + }
  59 + if(!carPlate.equals("")){
  60 + sql.append(" and c.car_plate = ").append("'").append("沪").append(carPlate.substring(0,1)).append("-")
  61 + .append(carPlate.substring(1)).append("'");
  62 + }
  63 + sql.append(" and FROM_UNIXTIME(REPORT_DATE/1000,'%Y%m%d%H') between '").append(reportDate_start).
  64 + append("' and '").append(reportDate_end).append("'").append(" and r.day_year = ").append(dayNum);
  65 + if(flag.equals("count")){
  66 + return sql.toString();
  67 + }else{
  68 + return sql + order;
  69 + }
  70 + }
  71 +
  72 + /**
  73 + * 给定条件查车载上报停靠站
  74 + * @param map
  75 + * @return
  76 + */
  77 + public List<Map<String, Object>> getVehicleInoutStopByParam(Map<String,Object> map){
  78 + String sql = "SELECT c.branche_company,c.company,l.name,l.shanghai_linecode,inside_code,equipment_code,car_plate," +
  79 + "if( r.service_state= 0,'营运','停运') as service_state ," +
  80 + "if( r.up_down= 0,'上行','下行') as up_down ," +
  81 + "if( r.in_out_stop= 0,'站内','站外') as in_out_stop , " +
  82 + "r.stop,r.report_date FROM bsth_c_shreal r LEFT JOIN bsth_c_cars c on r.cars = c.id " +
  83 + "LEFT JOIN bsth_c_line l on r.line = l.id" + packageParam(map,"") ;
  84 + List<Map<String, Object>> result = jdbcTemplate.queryForList(sql);
  85 + return result;
  86 + }
30 87
  88 + /**
  89 + * 给定条件查车载上报停靠站的记录数
  90 + * @param map
  91 + * @return
  92 + */
  93 + public long getVehicleInoutStopCountByParam(Map<String,Object> map){
  94 + String sql = "SELECT count(1) COUNT FROM bsth_c_shreal r LEFT JOIN bsth_c_cars c on r.cars = c.id " +
  95 + "LEFT JOIN bsth_c_line l on r.line = l.id" + packageParam(map,"count");
  96 + long result = Long.valueOf(jdbcTemplate.queryForMap(sql).get("COUNT")+"");
  97 + return result;
  98 + }
31 } 99 }
src/main/java/com/bsth/util/DateUtils.java
@@ -133,4 +133,23 @@ public class DateUtils { @@ -133,4 +133,23 @@ public class DateUtils {
133 public static int calcHHmmDiff(String fcsj, String zdsj) throws ParseException { 133 public static int calcHHmmDiff(String fcsj, String zdsj) throws ParseException {
134 return (int) (sdfHHmm.parse(zdsj).getTime() - sdfHHmm.parse(fcsj).getTime()); 134 return (int) (sdfHHmm.parse(zdsj).getTime() - sdfHHmm.parse(fcsj).getTime());
135 } 135 }
  136 +
  137 + /**
  138 + * 计算某天是这一年的第几天
  139 + * @param str
  140 + * @return
  141 + */
  142 + public static int calcDaynumberInYear(String str){
  143 + int num = 0;
  144 + SimpleDateFormat sdf= new SimpleDateFormat("yyyyMMdd");
  145 + try {
  146 + Date date =sdf.parse(str);
  147 + Calendar calendar = Calendar.getInstance();
  148 + calendar.setTime(date);
  149 + num = calendar.get(Calendar.DAY_OF_YEAR);
  150 + } catch (Exception e) {
  151 + e.printStackTrace();
  152 + }
  153 + return num;
  154 + }
136 } 155 }
src/main/resources/static/pages/base/station/js/station-list-table.js
@@ -262,7 +262,6 @@ @@ -262,7 +262,6 @@
262 var i = layer.load(2); 262 var i = layer.load(2);
263 // 异步请求获取表格数据 263 // 异步请求获取表格数据
264 $.get('/stationroute',params,function(result){ 264 $.get('/stationroute',params,function(result){
265 - console.log(result);  
266 // 添加序号 265 // 添加序号
267 result.content.page = page; 266 result.content.page = page;
268 // 把数据填充到模版中 267 // 把数据填充到模版中
src/main/resources/static/pages/control/lineallot_v2/iframe_wrap.html
1 -<!-- 线路选择 --> 1 +<!-- 线路选择 -->
2 <iframe src="/pages/control/lineallot_v2/main.html?origin=real_control_iframe" frameborder="0" style="height: 100%;width: 100%;"></iframe> 2 <iframe src="/pages/control/lineallot_v2/main.html?origin=real_control_iframe" frameborder="0" style="height: 100%;width: 100%;"></iframe>
3 \ No newline at end of file 3 \ No newline at end of file
src/main/resources/static/pages/control/lineallot_v2/main.html
1 -<!DOCTYPE html>  
2 -<html lang="zh-cn">  
3 -  
4 -<head>  
5 - <meta charset="UTF-8">  
6 - <link rel="stylesheet" href="/assets/plugins/uk3.0/uikit.min.css"/>  
7 - <link rel="stylesheet" href="/real_control_v2/assets/plugins/perfect-scrollbar/perfect-scrollbar.css"/>  
8 - <!-- flatpickr -->  
9 - <link rel="stylesheet" href="/real_control_v2/assets/plugins/flatpickr/flatpickr.min.css">  
10 - <style>  
11 - html, body {  
12 - height: 100%;  
13 - }  
14 -  
15 - .ct_page {  
16 - padding: 25px 15px;  
17 - height: 100%;  
18 - height: calc(100% - 65px);  
19 - }  
20 -  
21 - .ct_cont {  
22 - height: calc(100% - 41px);  
23 - }  
24 -  
25 - .ct_cont > div > div.uk-card {  
26 - height: 99%;  
27 - }  
28 -  
29 - .loading {  
30 - height: 100%;  
31 - text-align: center;  
32 - }  
33 -  
34 - .loading .uk-spinner {  
35 - margin-top: 200px;  
36 - }  
37 -  
38 - .loading circle {  
39 - stroke: red;  
40 - }  
41 -  
42 - .ps-container > .ps-scrollbar-x-rail, .ps-container > .ps-scrollbar-y-rail {  
43 - opacity: 0.6 !important;  
44 - padding: 0 !important;  
45 - }  
46 -  
47 - .line_list_all_wrap {  
48 - height: 200px;  
49 - overflow: auto;  
50 - position: relative;  
51 - -webkit-user-select:none;  
52 - -moz-user-select:none;  
53 - -ms-user-select:none;  
54 - user-select:none;  
55 - }  
56 -  
57 - .line_list_all_wrap > .item {  
58 - background: #fff;  
59 - color: #666;  
60 - box-shadow: 0px 3px 12px rgba(0, 0, 0, 0.08);  
61 - padding: 7px 12px;  
62 - border: 1px solid #ececec;  
63 - display: inline-block;  
64 - margin: 5px;  
65 - min-width: 70px;  
66 - text-align: center;  
67 - cursor: default;  
68 - }  
69 -  
70 - .line_list_all_wrap > .item.active{  
71 - background: #ffe9a5;  
72 - }  
73 -  
74 - .checked_list {  
75 - padding-left: 4px;  
76 - -webkit-user-select:none;  
77 - -moz-user-select:none;  
78 - -ms-user-select:none;  
79 - user-select:none;  
80 - }  
81 -  
82 - .checked_list > .item {  
83 - color: #fbfbfb;  
84 - box-shadow: 0px 3px 12px rgba(50, 197, 210, 0.3);  
85 - padding: 7px 12px;  
86 - border: 1px solid #ececec;  
87 - display: inline-block;  
88 - margin: 5px 2px;  
89 - min-width: 70px;  
90 - text-align: center;  
91 - background: #32C5D2;  
92 - cursor: move;  
93 - }  
94 -  
95 - .company_search_wrap {  
96 - width: 610px;  
97 - margin-left: 6px;  
98 - }  
99 -  
100 - .company_search_wrap select {  
101 - display: inline-block;  
102 - width: 128px;  
103 - margin-right: 12px;  
104 - }  
105 -  
106 - .uk-card {  
107 - border: 1px solid #eeeeee;  
108 - }  
109 -  
110 - .footer_tools_card {  
111 - margin-top: 20px;  
112 - padding: 20px 40px;  
113 - }  
114 -  
115 - .footer_tools_card label {  
116 - vertical-align: bottom;  
117 - display: inline-block;  
118 - font-size: 13px;  
119 - margin-left: 13px;  
120 - margin-bottom: 3px !important;  
121 - }  
122 -  
123 - .uk-button-default{  
124 - background: #e0e0e0 !important;  
125 - }  
126 - </style>  
127 -</head>  
128 -  
129 -<body>  
130 -<div class="loading">  
131 - <div uk-spinner></div>  
132 -</div>  
133 -<div class="ct_page" style="display: none;">  
134 - <h2 class="uk-heading-line uk-heading-bullet"><span>线调 <h5 style="display: inline-block;">-选择线路</h5></span></h2>  
135 - <div class="ct_cont">  
136 - <div class="allot_wrap uk-flex-center" uk-grid>  
137 - <div class="uk-card uk-card-hover uk-card-body uk-width-2-3@m"  
138 - style="padding-top: 20px;padding-bottom: 20px;">  
139 - <div class="company_search_wrap">  
140 - <select class="uk-select company_search_select"></select>  
141 - <select class="uk-select fgs_search_select" disabled>  
142 - <option value="">分公司搜索</option>  
143 - </select>  
144 - <div class="uk-inline">  
145 - <span class="uk-form-icon uk-form-icon-flip" uk-icon="icon: search"></span>  
146 - <input class="uk-input line_search_input" style="width: 310px;" placeholder="搜索线路">  
147 - </div>  
148 - </div>  
149 - <hr>  
150 - <div class="line_list_all_wrap"></div>  
151 - <hr>  
152 - <div class="checked_list" uk-sortable> </div>  
153 - </div>  
154 -  
155 - <div class="uk-card uk-card-hover uk-card-body uk-width-2-3@m footer_tools_card">  
156 - <button class="uk-button uk-button-default uk-button-large" style="font-size: 16px" id="go_to_real_system_btn"><i  
157 - uk-icon=" icon: sign-in" style="margin-right: 5px;" ></i>进入线路调度  
158 - </button>  
159 - <label class="pattern_type_label"><input class="uk-checkbox" type="checkbox" > 主调模式登录</label>  
160 - <label class="new_window_open_label" title="可能会被浏览器阻止新建窗口" uk-tooltip><input class="uk-checkbox" type="checkbox"> 新窗口打开</label>  
161 - </div>  
162 -  
163 - <div class="uk-alert-warning uk-width-2-3@m " uk-alert>  
164 - <p>注意!!! 相关“设备调试人员”和“测试人员”不要以主调模式进入线调。</p>  
165 - </div>  
166 - </div>  
167 - </div>  
168 -</div>  
169 -  
170 -<script id="line_list_items_temp" type="text/html">  
171 - {{each list as obj i}}  
172 - <span class="item" data-id="{{obj.lineCode}}" data-gsbm="{{obj.company}}_{{obj.brancheCompany}}">{{obj.name}}</span>  
173 - {{/each}}  
174 -</script>  
175 -  
176 -<script src="/metronic_v4.5.4/plugins/jquery.min.js"></script>  
177 -<script src="/assets/plugins/uk3.0/uikit.min.js"></script>  
178 -<script src="/assets/plugins/uk3.0/uikit-icons.min.js"></script>  
179 -<script src="/real_control_v2/assets/plugins/perfect-scrollbar/perfect-scrollbar.jquery.js"></script>  
180 -<!-- EventProxy -->  
181 -<script src="/assets/js/eventproxy.js"></script>  
182 -<!-- art-template 模版引擎 -->  
183 -<script src="/assets/plugins/template.js"></script>  
184 -<script src="/real_control_v2/assets/plugins/moment/moment.min.js"></script>  
185 -<script src="/assets/plugins/pinyin.js"></script>  
186 -<script>  
187 - var allMapps = {};//线路搜索映射  
188 - var companyData = {};  
189 - var codeMapps={}; //线路编码映射  
190 - //滚动条  
191 - $('.line_list_all_wrap').perfectScrollbar();  
192 -  
193 - var ep = EventProxy.create('all_lines', 'user_author', 'company_data', function (allLines, userAuthor, company_data) {  
194 - //按用户权限过滤线路  
195 - var authArray = userAuthor.lineCodeStr.split(','),  
196 - newArray = [];  
197 - $.each(allLines, function () {  
198 - if (this.lineCode && authArray.indexOf(this.lineCode) != -1) {  
199 - newArray.push(this);  
200 - codeMapps[this.lineCode] = this;  
201 - }  
202 - });  
203 - //排序  
204 - newArray.sort(function (a, b) {  
205 - return a.name.localeCompare(b.name);  
206 - });  
207 - //创建线路搜索映射  
208 - createLineSearchMapps(newArray);  
209 -  
210 - var htmlStr = template('line_list_items_temp', {list: newArray});  
211 - $('.line_list_all_wrap').html(htmlStr);  
212 -  
213 - //过滤公司编码数据  
214 - filter_company_data.filter(newArray, convert_buss_data(company_data));  
215 - initCompanySelect();  
216 - //更新滚动条高度  
217 - setTimeout(function () {  
218 - $('.line_list_all_wrap').perfectScrollbar('update');  
219 - }, 1000);  
220 -  
221 - //登录模式  
222 - changePattern(userAuthor.pattern);  
223 - if(!userAuthor.pattern)  
224 - $('.pattern_type_label').hide().find('input')[0].checked=false;  
225 - else  
226 - $('input','.pattern_type_label')[0].checked=true;  
227 -  
228 - $('.loading').remove();  
229 - $('.ct_page').show();  
230 -  
231 - //默认选中上次记录  
232 - var lineControlItems = window.localStorage.getItem('lineControlItems');  
233 - if (lineControlItems) {  
234 - var array = JSON.parse(lineControlItems);  
235 - $.each(array, function (i, line) {  
236 - $('.item[data-id='+line.lineCode+']','.line_list_all_wrap').trigger('click');  
237 - });  
238 - }  
239 - });  
240 -  
241 - $('.pattern_type_label').on('click', function () {  
242 - var checked = $('input',this)[0].checked;  
243 - changePattern(checked);  
244 - });  
245 -  
246 - function changePattern(status) {  
247 - var btn = $('#go_to_real_system_btn'),  
248 - def='uk-button-default',  
249 - prim='uk-button-primary';  
250 - if(status){  
251 - btn.removeClass(def).addClass(prim);  
252 - }  
253 - else{  
254 - btn.removeClass(prim).addClass(def);  
255 - }  
256 - }  
257 -  
258 - /**  
259 - * 查询所有线路  
260 - */  
261 - $.get('/line/all', {destroy_eq: 0}, function (list) {  
262 - ep.emit('all_lines', list);  
263 - });  
264 -  
265 - /**用户分配的线路*/  
266 - $.get('/realControAuthority/findByCurrentUser', function (t) {  
267 - ep.emit('user_author', t);  
268 - });  
269 -  
270 - /** 查询公司编码 */  
271 - $.get('/business/all', function (rs) {  
272 - ep.emit('company_data', rs);  
273 - });  
274 -  
275 - //点击选择线路  
276 - $('.line_list_all_wrap').on('click', 'span.item', function () {  
277 - var lineCode = $(this).data('id'),  
278 - name = $(this).text();  
279 - if ($(this).hasClass('active')) {  
280 - $(this).removeClass('active');  
281 -  
282 - $('.item[data-id='+lineCode+']','.checked_list').remove();  
283 - }  
284 - else {  
285 - $(this).addClass('active');  
286 - var span = $('<span data-id="'+lineCode+'" class="item uk-card uk-card-default uk-animation-slide-bottom">'+name+'</span>')  
287 - .one('webkitAnimationEnd', function () {  
288 - $(this).removeClass('uk-animation-slide-bottom');  
289 - });  
290 - $('.checked_list').append(span);  
291 - }  
292 - });  
293 -  
294 - $('.checked_list').on('click', '.item', function () {  
295 - var lineCode = $(this).data('id');  
296 - $('.item[data-id='+lineCode+']','.line_list_all_wrap').removeClass('active');  
297 - $(this).remove();  
298 - });  
299 -  
300 - /**  
301 - * 搜索线路  
302 - */  
303 - function search_line_list() {  
304 - var comp = $('select.company_search_select').val(),  
305 - fgs = $('select.fgs_search_select').val(),  
306 - gsbm = comp + '_' + fgs;  
307 -  
308 - if(gsbm=='_')  
309 - gsbm=null;  
310 - var allDoms = $('.line_list_all_wrap span.item');  
311 - //线路  
312 - var lineCodeArray = [];  
313 - var t = $('.line_search_input').val();  
314 - if(t){  
315 - t = t.toUpperCase();  
316 - for(var m in allMapps){  
317 - if(m.indexOf(t)!=-1)  
318 - lineCodeArray.push(allMapps[m]);  
319 - }  
320 - }  
321 -  
322 - //搜索  
323 - var show_elems = [];  
324 - for (var i=0, dom; dom = allDoms[i++];) {  
325 - if(gsbm && $(dom).data('gsbm').indexOf(gsbm)==-1)  
326 - continue;  
327 -  
328 - if(t && lineCodeArray.indexOf($(dom).data('id')+'') == -1)  
329 - continue;  
330 -  
331 - show_elems.push($(dom));  
332 - }  
333 -  
334 - //show  
335 - allDoms.hide();  
336 - for(var j=0,$dom;$dom=show_elems[j++];)  
337 - $dom.show();  
338 - }  
339 -  
340 - function createLineSearchMapps(list) {  
341 - allMapps = {};  
342 - var name, code;  
343 - for (var i = 0, line; line = list[i++];) {  
344 - name = line.name;  
345 - code = line.lineCode;  
346 - //拼音映射  
347 - allMapps[pinyin.getCamelChars(name)] = code;  
348 - allMapps[pinyin.getFullChars(name).toUpperCase()] = code;  
349 - //中文映射  
350 - allMapps[name] = code;  
351 - }  
352 - }  
353 -  
354 -  
355 - //构建公司级联下拉框  
356 - function initCompanySelect() {  
357 - var opts = '<option value="">公司搜索</option>';  
358 - for (var k in companyData) {  
359 - opts += '<option value="' + k + '">' + companyData[k].name + '</option>';  
360 - }  
361 - $('select.company_search_select').html(opts);  
362 - }  
363 -  
364 - //公司切换  
365 - $('select.company_search_select').on('change', function () {  
366 - var opts = '<option value="">分公司搜索</option>',  
367 - t = $(this).val(),  
368 - fgsSelect = $('select.fgs_search_select');  
369 - if (!t) {  
370 - fgsSelect.html(opts).attr('disabled', 'disabled');  
371 - }  
372 - else{  
373 - var array = companyData[t].childs;  
374 - for (var i = 0, fgs; fgs = array[i++];) {  
375 - opts += '<option value="' + fgs.businessCode + '">' + fgs.businessName + '</option>';  
376 - }  
377 -  
378 - fgsSelect.html(opts).removeAttr('disabled');  
379 - }  
380 - search_line_list();  
381 - });  
382 -  
383 - //分公司切换  
384 - $('select.fgs_search_select').on('change', search_line_list);  
385 -  
386 - //线路文本框输入  
387 - var flag;  
388 - $('.line_search_input').on('input', function () {  
389 - if(flag)  
390 - return;  
391 - flag = true;  
392 - setTimeout(function () {  
393 - //延迟  
394 - search_line_list();  
395 - flag = false;  
396 - }, 200);  
397 - });  
398 -  
399 - function convert_buss_data(rs) {  
400 - var baseCode;  
401 - //找到跟节点  
402 - $.each(rs, function () {  
403 - if (this.upCode == 0) {  
404 - baseCode = this.businessCode;  
405 - return false;  
406 - }  
407 - });  
408 - if (!baseCode)return;  
409 - //提取二级节点  
410 - var secondMap = {};  
411 - $.each(rs, function () {  
412 - if (this.upCode == baseCode)  
413 - secondMap[this.businessCode] = {name: this.businessName, childs: []};  
414 - });  
415 - //分公司节点  
416 - $.each(rs, function () {  
417 - if (secondMap[this.upCode])  
418 - secondMap[this.upCode].childs.push(this);  
419 - });  
420 - //排序  
421 - for (var sid in secondMap)  
422 - secondMap[sid].childs.sort(naturalSort);  
423 - return secondMap;  
424 - }  
425 -  
426 - var naturalSort = function (a, b) {  
427 - return a.businessName.localeCompare(b.businessName);  
428 - };  
429 -  
430 - /**  
431 - * 根据用户线路权限过滤公司编码数据  
432 - */  
433 - var filter_company_data = (function () {  
434 - var filter = function (lineArray, data) {  
435 - companyData = {};  
436 - var com, fCom;  
437 - $.each(lineArray, function () {  
438 - com = this.company;  
439 - fCom = this.brancheCompany;  
440 - if (!companyData[com]) {  
441 - companyData[com] = {name: data[com].name, childs: []};  
442 - }  
443 -  
444 - if (!get(fCom, companyData[com].childs)) {  
445 - companyData[com].childs.push(get(fCom, data[com].childs));  
446 - }  
447 - });  
448 - };  
449 -  
450 - function get(fgsCode, fgsArray) {  
451 - for (var i = 0, fgs; fgs = fgsArray[i++];) {  
452 - if (fgs.businessCode == fgsCode)  
453 - return fgs;  
454 - }  
455 - return null;  
456 - }  
457 -  
458 - return {  
459 - filter: filter  
460 - }  
461 - })();  
462 - var storage = window.localStorage;  
463 - $('#go_to_real_system_btn').on('click', go_to_xd_sys);  
464 - /**  
465 - * 进入线调  
466 - */  
467 - function go_to_xd_sys() {  
468 - var items = $('.checked_list .item');  
469 - if(items.length==0)  
470 - return UIkit.notification({message: '你还没有选择线路!', pos: 'bottom-center', status: 'danger'});  
471 - $(this).attr('disabled', 'disabled');  
472 -  
473 - show_btn_load(this, '更新缓存数据...');  
474 - (function () {  
475 - var ls_line_data = [];  
476 - $.each(items, function () {  
477 - ls_line_data.push(codeMapps[$(this).data('id')]);  
478 - });  
479 - //将线路基础信息写入localStorage  
480 - storage.setItem('lineControlItems', JSON.stringify(ls_line_data));  
481 - //监控模式还是主调模式  
482 - storage.setItem('operationMode', $('.pattern_type_label>input')[0].checked?1:0);  
483 -  
484 - //进入线调  
485 - var eq = EventProxy.create('cache_route', 'check_line_config', function () {  
486 - var newWinOpen = $('input','.new_window_open_label')[0].checked;  
487 - if(!newWinOpen)  
488 - top.window.location.href = "/real_control/v2";  
489 - else{  
490 - window.open("/real_control/v2");  
491 - $('#go_to_real_system_btn').html('已经尝试打开新窗口,如看不到,可能被浏览器阻止了');  
492 - }  
493 - });  
494 -  
495 - //拼接线路编码  
496 - var idx='';  
497 - $.each(ls_line_data, function () {  
498 - idx+=(this.lineCode + ',');  
499 - });  
500 - //缓存路由  
501 - idx=idx.substr(0, idx.length - 1);  
502 - $.get('/realMap/findRouteByLine', {idx: idx}, function (rs) {  
503 - if (rs) {  
504 - for(var lineCode in rs)  
505 - storage.setItem(lineCode + '_route', JSON.stringify(rs[lineCode]));  
506 -  
507 - eq.emit('cache_route');  
508 - }  
509 - });  
510 -  
511 - //检查线路配置  
512 - checkLineConfig(ls_line_data, function (rs) {  
513 - if (rs.status == 0)  
514 - eq.emit('check_line_config');  
515 - else if (rs.status == 1){  
516 - initLineConfig(rs.not, function () {  
517 - eq.emit('check_line_config');  
518 - });  
519 - }  
520 - })  
521 - })();  
522 - }  
523 -  
524 - function checkLineConfig(lsData, cb) {  
525 - var lineCodeArray = [];  
526 - $.each(lsData, function () {  
527 - lineCodeArray.push(this.lineCode);  
528 - });  
529 -  
530 - $.ajax({  
531 - url: '/lineConfig/check',  
532 - traditional: true,  
533 - data: {codeArray: lineCodeArray},  
534 - method: 'POST',  
535 - success: cb  
536 - });  
537 - }  
538 -  
539 - function initLineConfig(arr, cb) {  
540 - var i = 0;  
541 - (function () {  
542 - if (i >= arr.length) {  
543 - cb && cb();  
544 - return;  
545 - }  
546 - var f = arguments.callee  
547 - , lineCode = arr[i];  
548 -  
549 - //showLoad('初始化' + lineIds[lineCode] + '配置信息...');  
550 - $.post('/lineConfig/init/' + lineCode, function (rs) {  
551 - if (rs == 1) {  
552 - i++;  
553 - f();  
554 - }  
555 - });  
556 - })();  
557 - }  
558 -  
559 - /**  
560 - * 按钮转菊花  
561 - */  
562 - function show_btn_load(btn, msg) {  
563 - $(btn).html('<div uk-spinner></div> ' + msg);  
564 - }  
565 -</script>  
566 -</body> 1 +<!DOCTYPE html>
  2 +<html lang="zh-cn">
  3 +
  4 +<head>
  5 + <meta charset="UTF-8">
  6 + <link rel="stylesheet" href="/assets/plugins/uk3.0/uikit.min.css"/>
  7 + <link rel="stylesheet" href="/real_control_v2/assets/plugins/perfect-scrollbar/perfect-scrollbar.css"/>
  8 + <!-- flatpickr -->
  9 + <link rel="stylesheet" href="/real_control_v2/assets/plugins/flatpickr/flatpickr.min.css">
  10 + <style>
  11 + html, body {
  12 + height: 100%;
  13 + }
  14 +
  15 + .ct_page {
  16 + padding: 25px 15px;
  17 + height: 100%;
  18 + height: calc(100% - 65px);
  19 + }
  20 +
  21 + .ct_cont {
  22 + height: calc(100% - 41px);
  23 + }
  24 +
  25 + .ct_cont > div > div.uk-card {
  26 + height: 99%;
  27 + }
  28 +
  29 + .loading {
  30 + height: 100%;
  31 + text-align: center;
  32 + }
  33 +
  34 + .loading .uk-spinner {
  35 + margin-top: 200px;
  36 + }
  37 +
  38 + .loading circle {
  39 + stroke: red;
  40 + }
  41 +
  42 + .ps-container > .ps-scrollbar-x-rail, .ps-container > .ps-scrollbar-y-rail {
  43 + opacity: 0.6 !important;
  44 + padding: 0 !important;
  45 + }
  46 +
  47 + .line_list_all_wrap {
  48 + height: 200px;
  49 + overflow: auto;
  50 + position: relative;
  51 + -webkit-user-select:none;
  52 + -moz-user-select:none;
  53 + -ms-user-select:none;
  54 + user-select:none;
  55 + }
  56 +
  57 + .line_list_all_wrap > .item {
  58 + background: #fff;
  59 + color: #666;
  60 + box-shadow: 0px 3px 12px rgba(0, 0, 0, 0.08);
  61 + padding: 7px 12px;
  62 + border: 1px solid #ececec;
  63 + display: inline-block;
  64 + margin: 5px;
  65 + min-width: 70px;
  66 + text-align: center;
  67 + cursor: default;
  68 + }
  69 +
  70 + .line_list_all_wrap > .item.active{
  71 + background: #ffe9a5;
  72 + }
  73 +
  74 + .checked_list {
  75 + padding-left: 4px;
  76 + -webkit-user-select:none;
  77 + -moz-user-select:none;
  78 + -ms-user-select:none;
  79 + user-select:none;
  80 + }
  81 +
  82 + .checked_list > .item {
  83 + color: #fbfbfb;
  84 + box-shadow: 0px 3px 12px rgba(50, 197, 210, 0.3);
  85 + padding: 7px 12px;
  86 + border: 1px solid #ececec;
  87 + display: inline-block;
  88 + margin: 5px 2px;
  89 + min-width: 70px;
  90 + text-align: center;
  91 + background: #32C5D2;
  92 + cursor: move;
  93 + }
  94 +
  95 + .company_search_wrap {
  96 + width: 610px;
  97 + margin-left: 6px;
  98 + }
  99 +
  100 + .company_search_wrap select {
  101 + display: inline-block;
  102 + width: 128px;
  103 + margin-right: 12px;
  104 + }
  105 +
  106 + .uk-card {
  107 + border: 1px solid #eeeeee;
  108 + }
  109 +
  110 + .footer_tools_card {
  111 + margin-top: 20px;
  112 + padding: 20px 40px;
  113 + }
  114 +
  115 + .footer_tools_card label {
  116 + vertical-align: bottom;
  117 + display: inline-block;
  118 + font-size: 13px;
  119 + margin-left: 13px;
  120 + margin-bottom: 3px !important;
  121 + }
  122 +
  123 + .uk-button-default{
  124 + background: #e0e0e0 !important;
  125 + }
  126 + </style>
  127 +</head>
  128 +
  129 +<body>
  130 +<div class="loading">
  131 + <div uk-spinner></div>
  132 +</div>
  133 +<div class="ct_page" style="display: none;">
  134 + <h2 class="uk-heading-line uk-heading-bullet"><span>线调 <h5 style="display: inline-block;">-选择线路</h5></span></h2>
  135 + <div class="ct_cont">
  136 + <div class="allot_wrap uk-flex-center" uk-grid>
  137 + <div class="uk-card uk-card-hover uk-card-body uk-width-2-3@m"
  138 + style="padding-top: 20px;padding-bottom: 20px;">
  139 + <div class="company_search_wrap">
  140 + <select class="uk-select company_search_select"></select>
  141 + <select class="uk-select fgs_search_select" disabled>
  142 + <option value="">分公司搜索</option>
  143 + </select>
  144 + <div class="uk-inline">
  145 + <span class="uk-form-icon uk-form-icon-flip" uk-icon="icon: search"></span>
  146 + <input class="uk-input line_search_input" style="width: 310px;" placeholder="搜索线路">
  147 + </div>
  148 + </div>
  149 + <hr>
  150 + <div class="line_list_all_wrap"></div>
  151 + <hr>
  152 + <div class="checked_list" uk-sortable> </div>
  153 + </div>
  154 +
  155 + <div class="uk-card uk-card-hover uk-card-body uk-width-2-3@m footer_tools_card">
  156 + <button class="uk-button uk-button-default uk-button-large" style="font-size: 16px" id="go_to_real_system_btn"><i
  157 + uk-icon=" icon: sign-in" style="margin-right: 5px;" ></i>进入线路调度
  158 + </button>
  159 + <label class="pattern_type_label"><input class="uk-checkbox" type="checkbox" > 主调模式登录</label>
  160 + <label class="new_window_open_label" title="可能会被浏览器阻止新建窗口" uk-tooltip><input class="uk-checkbox" type="checkbox"> 新窗口打开</label>
  161 + </div>
  162 +
  163 + <div class="uk-alert-warning uk-width-2-3@m " uk-alert>
  164 + <p>注意!!! 相关“设备调试人员”和“测试人员”不要以主调模式进入线调。</p>
  165 + </div>
  166 + </div>
  167 + </div>
  168 +</div>
  169 +
  170 +<script id="line_list_items_temp" type="text/html">
  171 + {{each list as obj i}}
  172 + <span class="item" data-id="{{obj.lineCode}}" data-gsbm="{{obj.company}}_{{obj.brancheCompany}}">{{obj.name}}</span>
  173 + {{/each}}
  174 +</script>
  175 +
  176 +<script src="/metronic_v4.5.4/plugins/jquery.min.js"></script>
  177 +<script src="/assets/plugins/uk3.0/uikit.min.js"></script>
  178 +<script src="/assets/plugins/uk3.0/uikit-icons.min.js"></script>
  179 +<script src="/real_control_v2/assets/plugins/perfect-scrollbar/perfect-scrollbar.jquery.js"></script>
  180 +<!-- EventProxy -->
  181 +<script src="/assets/js/eventproxy.js"></script>
  182 +<!-- art-template 模版引擎 -->
  183 +<script src="/assets/plugins/template.js"></script>
  184 +<script src="/real_control_v2/assets/plugins/moment/moment.min.js"></script>
  185 +<script src="/assets/plugins/pinyin.js"></script>
  186 +<script>
  187 + var allMapps = {};//线路搜索映射
  188 + var companyData = {};
  189 + var codeMapps={}; //线路编码映射
  190 + //滚动条
  191 + $('.line_list_all_wrap').perfectScrollbar();
  192 +
  193 + var ep = EventProxy.create('all_lines', 'user_author', 'company_data', function (allLines, userAuthor, company_data) {
  194 + //按用户权限过滤线路
  195 + var authArray = userAuthor.lineCodeStr.split(','),
  196 + newArray = [];
  197 + $.each(allLines, function () {
  198 + if (this.lineCode && authArray.indexOf(this.lineCode) != -1) {
  199 + newArray.push(this);
  200 + codeMapps[this.lineCode] = this;
  201 + }
  202 + });
  203 + //排序
  204 + newArray.sort(function (a, b) {
  205 + return a.name.localeCompare(b.name);
  206 + });
  207 + //创建线路搜索映射
  208 + createLineSearchMapps(newArray);
  209 +
  210 + var htmlStr = template('line_list_items_temp', {list: newArray});
  211 + $('.line_list_all_wrap').html(htmlStr);
  212 +
  213 + //过滤公司编码数据
  214 + filter_company_data.filter(newArray, convert_buss_data(company_data));
  215 + initCompanySelect();
  216 + //更新滚动条高度
  217 + setTimeout(function () {
  218 + $('.line_list_all_wrap').perfectScrollbar('update');
  219 + }, 1000);
  220 +
  221 + //登录模式
  222 + changePattern(userAuthor.pattern);
  223 + if(!userAuthor.pattern)
  224 + $('.pattern_type_label').hide().find('input')[0].checked=false;
  225 + else
  226 + $('input','.pattern_type_label')[0].checked=true;
  227 +
  228 + $('.loading').remove();
  229 + $('.ct_page').show();
  230 +
  231 + //默认选中上次记录
  232 + var lineControlItems = window.localStorage.getItem('lineControlItems');
  233 + if (lineControlItems) {
  234 + var array = JSON.parse(lineControlItems);
  235 + $.each(array, function (i, line) {
  236 + $('.item[data-id='+line.lineCode+']','.line_list_all_wrap').trigger('click');
  237 + });
  238 + }
  239 + });
  240 +
  241 + $('.pattern_type_label').on('click', function () {
  242 + var checked = $('input',this)[0].checked;
  243 + changePattern(checked);
  244 + });
  245 +
  246 + function changePattern(status) {
  247 + var btn = $('#go_to_real_system_btn'),
  248 + def='uk-button-default',
  249 + prim='uk-button-primary';
  250 + if(status){
  251 + btn.removeClass(def).addClass(prim);
  252 + }
  253 + else{
  254 + btn.removeClass(prim).addClass(def);
  255 + }
  256 + }
  257 +
  258 + /**
  259 + * 查询所有线路
  260 + */
  261 + $.get('/line/all', {destroy_eq: 0}, function (list) {
  262 + ep.emit('all_lines', list);
  263 + });
  264 +
  265 + /**用户分配的线路*/
  266 + $.get('/realControAuthority/findByCurrentUser', function (t) {
  267 + ep.emit('user_author', t);
  268 + });
  269 +
  270 + /** 查询公司编码 */
  271 + $.get('/business/all', function (rs) {
  272 + ep.emit('company_data', rs);
  273 + });
  274 +
  275 + //点击选择线路
  276 + $('.line_list_all_wrap').on('click', 'span.item', function () {
  277 + var lineCode = $(this).data('id'),
  278 + name = $(this).text();
  279 + if ($(this).hasClass('active')) {
  280 + $(this).removeClass('active');
  281 +
  282 + $('.item[data-id='+lineCode+']','.checked_list').remove();
  283 + }
  284 + else {
  285 + $(this).addClass('active');
  286 + var span = $('<span data-id="'+lineCode+'" class="item uk-card uk-card-default uk-animation-slide-bottom">'+name+'</span>')
  287 + .one('webkitAnimationEnd', function () {
  288 + $(this).removeClass('uk-animation-slide-bottom');
  289 + });
  290 + $('.checked_list').append(span);
  291 + }
  292 + });
  293 +
  294 + $('.checked_list').on('click', '.item', function () {
  295 + var lineCode = $(this).data('id');
  296 + $('.item[data-id='+lineCode+']','.line_list_all_wrap').removeClass('active');
  297 + $(this).remove();
  298 + });
  299 +
  300 + /**
  301 + * 搜索线路
  302 + */
  303 + function search_line_list() {
  304 + var comp = $('select.company_search_select').val(),
  305 + fgs = $('select.fgs_search_select').val(),
  306 + gsbm = comp + '_' + fgs;
  307 +
  308 + if(gsbm=='_')
  309 + gsbm=null;
  310 + var allDoms = $('.line_list_all_wrap span.item');
  311 + //线路
  312 + var lineCodeArray = [];
  313 + var t = $('.line_search_input').val();
  314 + if(t){
  315 + t = t.toUpperCase();
  316 + for(var m in allMapps){
  317 + if(m.indexOf(t)!=-1)
  318 + lineCodeArray.push(allMapps[m]);
  319 + }
  320 + }
  321 +
  322 + //搜索
  323 + var show_elems = [];
  324 + for (var i=0, dom; dom = allDoms[i++];) {
  325 + if(gsbm && $(dom).data('gsbm').indexOf(gsbm)==-1)
  326 + continue;
  327 +
  328 + if(t && lineCodeArray.indexOf($(dom).data('id')+'') == -1)
  329 + continue;
  330 +
  331 + show_elems.push($(dom));
  332 + }
  333 +
  334 + //show
  335 + allDoms.hide();
  336 + for(var j=0,$dom;$dom=show_elems[j++];)
  337 + $dom.show();
  338 + }
  339 +
  340 + function createLineSearchMapps(list) {
  341 + allMapps = {};
  342 + var name, code;
  343 + for (var i = 0, line; line = list[i++];) {
  344 + name = line.name;
  345 + code = line.lineCode;
  346 + //拼音映射
  347 + allMapps[pinyin.getCamelChars(name)] = code;
  348 + allMapps[pinyin.getFullChars(name).toUpperCase()] = code;
  349 + //中文映射
  350 + allMapps[name] = code;
  351 + }
  352 + }
  353 +
  354 +
  355 + //构建公司级联下拉框
  356 + function initCompanySelect() {
  357 + var opts = '<option value="">公司搜索</option>';
  358 + for (var k in companyData) {
  359 + opts += '<option value="' + k + '">' + companyData[k].name + '</option>';
  360 + }
  361 + $('select.company_search_select').html(opts);
  362 + }
  363 +
  364 + //公司切换
  365 + $('select.company_search_select').on('change', function () {
  366 + var opts = '<option value="">分公司搜索</option>',
  367 + t = $(this).val(),
  368 + fgsSelect = $('select.fgs_search_select');
  369 + if (!t) {
  370 + fgsSelect.html(opts).attr('disabled', 'disabled');
  371 + }
  372 + else{
  373 + var array = companyData[t].childs;
  374 + for (var i = 0, fgs; fgs = array[i++];) {
  375 + opts += '<option value="' + fgs.businessCode + '">' + fgs.businessName + '</option>';
  376 + }
  377 +
  378 + fgsSelect.html(opts).removeAttr('disabled');
  379 + }
  380 + search_line_list();
  381 + });
  382 +
  383 + //分公司切换
  384 + $('select.fgs_search_select').on('change', search_line_list);
  385 +
  386 + //线路文本框输入
  387 + var flag;
  388 + $('.line_search_input').on('input', function () {
  389 + if(flag)
  390 + return;
  391 + flag = true;
  392 + setTimeout(function () {
  393 + //延迟
  394 + search_line_list();
  395 + flag = false;
  396 + }, 200);
  397 + });
  398 +
  399 + function convert_buss_data(rs) {
  400 + var baseCode;
  401 + //找到跟节点
  402 + $.each(rs, function () {
  403 + if (this.upCode == 0) {
  404 + baseCode = this.businessCode;
  405 + return false;
  406 + }
  407 + });
  408 + if (!baseCode)return;
  409 + //提取二级节点
  410 + var secondMap = {};
  411 + $.each(rs, function () {
  412 + if (this.upCode == baseCode)
  413 + secondMap[this.businessCode] = {name: this.businessName, childs: []};
  414 + });
  415 + //分公司节点
  416 + $.each(rs, function () {
  417 + if (secondMap[this.upCode])
  418 + secondMap[this.upCode].childs.push(this);
  419 + });
  420 + //排序
  421 + for (var sid in secondMap)
  422 + secondMap[sid].childs.sort(naturalSort);
  423 + return secondMap;
  424 + }
  425 +
  426 + var naturalSort = function (a, b) {
  427 + return a.businessName.localeCompare(b.businessName);
  428 + };
  429 +
  430 + /**
  431 + * 根据用户线路权限过滤公司编码数据
  432 + */
  433 + var filter_company_data = (function () {
  434 + var filter = function (lineArray, data) {
  435 + companyData = {};
  436 + var com, fCom;
  437 + $.each(lineArray, function () {
  438 + com = this.company;
  439 + fCom = this.brancheCompany;
  440 + if (!companyData[com]) {
  441 + companyData[com] = {name: data[com].name, childs: []};
  442 + }
  443 +
  444 + if (!get(fCom, companyData[com].childs)) {
  445 + companyData[com].childs.push(get(fCom, data[com].childs));
  446 + }
  447 + });
  448 + };
  449 +
  450 + function get(fgsCode, fgsArray) {
  451 + for (var i = 0, fgs; fgs = fgsArray[i++];) {
  452 + if (fgs.businessCode == fgsCode)
  453 + return fgs;
  454 + }
  455 + return null;
  456 + }
  457 +
  458 + return {
  459 + filter: filter
  460 + }
  461 + })();
  462 + var storage = window.localStorage;
  463 + $('#go_to_real_system_btn').on('click', go_to_xd_sys);
  464 + /**
  465 + * 进入线调
  466 + */
  467 + function go_to_xd_sys() {
  468 + var items = $('.checked_list .item');
  469 + if(items.length==0)
  470 + return UIkit.notification({message: '你还没有选择线路!', pos: 'bottom-center', status: 'danger'});
  471 + $(this).attr('disabled', 'disabled');
  472 +
  473 + show_btn_load(this, '更新缓存数据...');
  474 + (function () {
  475 + var ls_line_data = [];
  476 + $.each(items, function () {
  477 + ls_line_data.push(codeMapps[$(this).data('id')]);
  478 + });
  479 + //将线路基础信息写入localStorage
  480 + storage.setItem('lineControlItems', JSON.stringify(ls_line_data));
  481 + //监控模式还是主调模式
  482 + storage.setItem('operationMode', $('.pattern_type_label>input')[0].checked?1:0);
  483 +
  484 + //进入线调
  485 + var eq = EventProxy.create('cache_route', 'check_line_config', function () {
  486 + var newWinOpen = $('input','.new_window_open_label')[0].checked;
  487 + if(!newWinOpen)
  488 + top.window.location.href = "/real_control/v2";
  489 + else{
  490 + window.open("/real_control/v2");
  491 + $('#go_to_real_system_btn').html('已经尝试打开新窗口,如看不到,可能被浏览器阻止了');
  492 + }
  493 + });
  494 +
  495 + //拼接线路编码
  496 + var idx='';
  497 + $.each(ls_line_data, function () {
  498 + idx+=(this.lineCode + ',');
  499 + });
  500 + //缓存路由
  501 + idx=idx.substr(0, idx.length - 1);
  502 + $.get('/realMap/findRouteByLine', {idx: idx}, function (rs) {
  503 + if (rs) {
  504 + for(var lineCode in rs)
  505 + storage.setItem(lineCode + '_route', JSON.stringify(rs[lineCode]));
  506 +
  507 + eq.emit('cache_route');
  508 + }
  509 + });
  510 +
  511 + //检查线路配置
  512 + checkLineConfig(ls_line_data, function (rs) {
  513 + if (rs.status == 0)
  514 + eq.emit('check_line_config');
  515 + else if (rs.status == 1){
  516 + initLineConfig(rs.not, function () {
  517 + eq.emit('check_line_config');
  518 + });
  519 + }
  520 + })
  521 + })();
  522 + }
  523 +
  524 + function checkLineConfig(lsData, cb) {
  525 + var lineCodeArray = [];
  526 + $.each(lsData, function () {
  527 + lineCodeArray.push(this.lineCode);
  528 + });
  529 +
  530 + $.ajax({
  531 + url: '/lineConfig/check',
  532 + traditional: true,
  533 + data: {codeArray: lineCodeArray},
  534 + method: 'POST',
  535 + success: cb
  536 + });
  537 + }
  538 +
  539 + function initLineConfig(arr, cb) {
  540 + var i = 0;
  541 + (function () {
  542 + if (i >= arr.length) {
  543 + cb && cb();
  544 + return;
  545 + }
  546 + var f = arguments.callee
  547 + , lineCode = arr[i];
  548 +
  549 + //showLoad('初始化' + lineIds[lineCode] + '配置信息...');
  550 + $.post('/lineConfig/init/' + lineCode, function (rs) {
  551 + if (rs == 1) {
  552 + i++;
  553 + f();
  554 + }
  555 + });
  556 + })();
  557 + }
  558 +
  559 + /**
  560 + * 按钮转菊花
  561 + */
  562 + function show_btn_load(btn, msg) {
  563 + $(btn).html('<div uk-spinner></div> ' + msg);
  564 + }
  565 +</script>
  566 +</body>
567 </html> 567 </html>
568 \ No newline at end of file 568 \ No newline at end of file
src/main/resources/static/pages/excep/mhspeedingList.html
@@ -302,17 +302,17 @@ $(function(){ @@ -302,17 +302,17 @@ $(function(){
302 var cells = $('tr.filter')[0].cells 302 var cells = $('tr.filter')[0].cells
303 ,params = {} 303 ,params = {}
304 ,name; 304 ,name;
305 - $.each(cells, function(i, cell){  
306 - var items = $('input,select', cell);  
307 - for(var j = 0, item; item = items[j++];){  
308 - name = $(item).attr('name');  
309 - if(name){  
310 - params[name] = $(item).val(); 305 + $.each(cells, function(i, cell){
  306 + var items = $('input,select', cell);
  307 + for(var j = 0, item; item = items[j++];){
  308 + name = $(item).attr('name');
  309 + if(name){
  310 + params[name] = $(item).val();
  311 + }
311 } 312 }
312 - }  
313 - });  
314 - page = num - 1;  
315 - jsDoQuery(params, false); 313 + });
  314 + page = num - 1;
  315 + jsDoQuery(params, false);
316 } 316 }
317 }); 317 });
318 } 318 }
src/main/resources/static/pages/report/inoutstation/inoutstation.html
@@ -199,7 +199,7 @@ @@ -199,7 +199,7 @@
199 layer.msg("请选择方向"); 199 layer.msg("请选择方向");
200 }else{ 200 }else{
201 $get('/report/queryStrinon',{line:line,zd:zdlx},function(result){ 201 $get('/report/queryStrinon',{line:line,zd:zdlx},function(result){
202 - $get('/report/queryInOutStrtions',{line:line,date:date,zd:zdlx,lzsj:lzsj},function(result2){ 202 + $get('/report/queryInOutStrtion',{line:line,date:date,zd:zdlx,lzsj:lzsj},function(result2){
203 console.log(result2); 203 console.log(result2);
204 /* getTime(result); */ 204 /* getTime(result); */
205 var ludan_ll_1 = template('ludan_ll_1',{list:result2,lists:result}); 205 var ludan_ll_1 = template('ludan_ll_1',{list:result2,lists:result});
src/main/resources/static/pages/scheduleApp/module/core/schedulePlanManage/info/edit.html
1 -<div ng-controller="SchedulePlanInfoManageEditCtrl as ctrl">  
2 - <div class="page-head">  
3 - <div class="page-title">  
4 - <h1>排班明细管理</h1>  
5 - </div>  
6 - </div>  
7 -  
8 - <ul class="page-breadcrumb breadcrumb">  
9 - <li>  
10 - <a href="/pages/home.html" data-pjax>首页</a>  
11 - <i class="fa fa-circle"></i>  
12 - </li>  
13 - <li>  
14 - <span class="active">运营计划管理</span>  
15 - <i class="fa fa-circle"></i>  
16 - </li>  
17 - <li>  
18 - <a href="javascript:" ng-click="ctrl.toPlanPage()">排班计划管理</a>  
19 - <i class="fa fa-circle"></i>  
20 - </li>  
21 - <li>  
22 - <a href="javascript:" ng-click="ctrl.toPlanInfoListPage()">排班计划管理</a>  
23 - <i class="fa fa-circle"></i>  
24 - </li>  
25 - <li>  
26 - <span class="active">修改计划班次明细</span>  
27 - </li>  
28 - </ul>  
29 -  
30 - <div class="portlet light bordered">  
31 - <div class="portlet-title">  
32 - <div class="caption">  
33 - <i class="icon-equalizer font-red-sunglo"></i>  
34 - <span class="caption-subject font-red-sunglo bold uppercase">  
35 - {{ctrl.schedulePlanInfoForSave.xlName}}  
36 - {{ctrl.schedulePlanInfoForSave.ttInfoName}}  
37 - {{"路牌" + ctrl.schedulePlanInfoForSave.lpName}}  
38 - <span ng-bind="ctrl.schedulePlanInfoForSave.scheduleDate | date: 'yyyy-MM-dd ' "></span>  
39 - <span>计划班次信息</span>  
40 - </span>  
41 - </div>  
42 - </div>  
43 -  
44 - <div class="portlet-body form">  
45 - <form ng-submit="ctrl.submit()" class="form-horizontal" novalidate name="myForm">  
46 - <div class="form-body">  
47 - <div class="form-group has-success has-feedback">  
48 - <label class="col-md-2 control-label">线路*:</label>  
49 - <div class="col-md-3">  
50 - <input type="text" class="form-control"  
51 - ng-value="ctrl.schedulePlanInfoForSave.xlName"  
52 - readonly/>  
53 - </div>  
54 -  
55 - </div>  
56 - <div class="form-group has-success has-feedback">  
57 - <label class="col-md-2 control-label">时刻表名称*:</label>  
58 - <div class="col-md-3">  
59 - <input type="text" class="form-control"  
60 - ng-value="ctrl.schedulePlanInfoForSave.ttInfoName"  
61 - readonly/>  
62 - </div>  
63 - </div>  
64 - <div class="form-group has-success has-feedback">  
65 - <label class="col-md-2 control-label">路牌*:</label>  
66 - <div class="col-md-3">  
67 - <input type="text" class="form-control"  
68 - ng-value="ctrl.schedulePlanInfoForSave.lpName"  
69 - readonly/>  
70 - </div>  
71 -  
72 - </div>  
73 - <div class="form-group has-success has-feedback">  
74 - <label class="col-md-2 control-label">班次类型*:</label>  
75 - <div class="col-md-3">  
76 - <input type="text" class="form-control"  
77 - ng-value="ctrl.schedulePlanInfoForSave.bcType | dict:'ScheduleType':'未知' "  
78 - readonly/>  
79 - </div>  
80 -  
81 - </div>  
82 - <div class="form-group has-success has-feedback">  
83 - <label class="col-md-2 control-label">发车时间*:</label>  
84 - <div class="col-md-3">  
85 - <input type="text" class="form-control"  
86 - ng-value="ctrl.schedulePlanInfoForSave.fcsj"  
87 - readonly/>  
88 - </div>  
89 -  
90 - </div>  
91 -  
92 - <div class="form-group has-success has-feedback">  
93 - <label class="col-md-2 control-label">方向*:</label>  
94 - <div class="col-md-3">  
95 - <sa-Radiogroup model="ctrl.schedulePlanInfoForSave.xlDir" dicgroup="LineTrend" name="xlDir" required disabled="true"></sa-Radiogroup>  
96 - </div>  
97 - <!-- 隐藏块,显示验证信息 -->  
98 - <div class="alert alert-danger well-sm" ng-show="myForm.xlDir.$error.required">  
99 - 请选择线路上下行  
100 - </div>  
101 -  
102 - </div>  
103 -  
104 - <div class="form-group has-success has-feedback">  
105 - <label class="col-md-2 control-label">起点站*:</label>  
106 - <div class="col-md-4">  
107 - <sa-Select5 name="qdz"  
108 - model="ctrl.schedulePlanInfoForSave"  
109 - cmaps="{'qdzCode' : 'zcode', 'qdzName': 'zname'}"  
110 - dcname="qdzCode"  
111 - icname="zcode"  
112 - dsparams="{{ {type: 'ajax', param:{'lineid': ctrl.schedulePlanInfoForSave.xl, 'xldir': ctrl.schedulePlanInfoForSave.xlDir}, atype:'zd_tcc' } | json }}"  
113 - iterobjname="item"  
114 - iterobjexp="item.aname"  
115 - searchph="请输拼音..."  
116 - searchexp="this.aname"  
117 - required >  
118 - </sa-Select5>  
119 - </div>  
120 - <!-- 隐藏块,显示验证信息 -->  
121 - <div class="alert alert-danger well-sm" ng-show="myForm.qdz.$error.required">  
122 - 起点站必须选择  
123 - </div>  
124 - </div>  
125 - <div class="form-group has-success has-feedback">  
126 - <label class="col-md-2 control-label">终点站*:</label>  
127 - <div class="col-md-4">  
128 - <sa-Select5 name="zdz"  
129 - model="ctrl.schedulePlanInfoForSave"  
130 - cmaps="{'zdzCode' : 'zcode', 'zdzName': 'zname'}"  
131 - dcname="zdzCode"  
132 - icname="zcode"  
133 - dsparams="{{ {type: 'ajax', param:{'lineid': ctrl.schedulePlanInfoForSave.xl, 'xldir': ctrl.schedulePlanInfoForSave.xlDir}, atype:'zd_tcc' } | json }}"  
134 - iterobjname="item"  
135 - iterobjexp="item.aname"  
136 - searchph="请输拼音..."  
137 - searchexp="this.aname"  
138 - required >  
139 - </sa-Select5>  
140 - </div>  
141 - <!-- 隐藏块,显示验证信息 -->  
142 - <div class="alert alert-danger well-sm" ng-show="myForm.zdz.$error.required">  
143 - 终点站必须选择  
144 - </div>  
145 - </div>  
146 -  
147 - <div class="form-group has-success has-feedback">  
148 - <label class="col-md-2 control-label">车辆*:</label>  
149 - <div class="col-md-4">  
150 - <sa-Select5 name="cl"  
151 - model="ctrl.schedulePlanInfoForSave"  
152 - cmaps="{'cl': 'id', 'clZbh': 'insideCode'}"  
153 - dcname="cl"  
154 - icname="id"  
155 - dsparams="{{ {type: 'local', param: 'cl' } | json }}"  
156 - iterobjname="item"  
157 - iterobjexp="item.insideCode"  
158 - searchph="请输拼音..."  
159 - searchexp="this.insideCode"  
160 - required  
161 - >  
162 - </sa-Select5>  
163 - </div>  
164 - <!-- 隐藏块,显示验证信息 -->  
165 - <div class="alert alert-danger well-sm" ng-show="myForm.cl.$error.required">  
166 - 车辆必须选择  
167 - </div>  
168 - </div>  
169 -  
170 - <div class="form-group has-success has-feedback">  
171 - <label class="col-md-2 control-label">驾驶员*:</label>  
172 - <div class="col-md-4">  
173 - <sa-Select5 name="j"  
174 - model="ctrl.schedulePlanInfoForSave"  
175 - cmaps="{'j' : 'id', 'jGh': 'workId', 'jName': 'name'}"  
176 - dcname="j"  
177 - icname="id"  
178 - dsparams="{{ {type: 'local', param: 'ry' } | json }}"  
179 - iterobjname="item"  
180 - iterobjexp="item.name + '(' + item.workId + ')'"  
181 - searchph="请输拼音..."  
182 - searchexp="this.name"  
183 - required  
184 - >  
185 - </sa-Select5>  
186 - </div>  
187 - <!-- 隐藏块,显示验证信息 -->  
188 - <div class="alert alert-danger well-sm" ng-show="myForm.j.$error.required">  
189 - 驾驶员必须选择  
190 - </div>  
191 - </div>  
192 -  
193 - <div class="form-group">  
194 - <label class="col-md-2 control-label">售票员:</label>  
195 - <div class="col-md-4">  
196 - <sa-Select5 name="s1"  
197 - model="ctrl.schedulePlanInfoForSave"  
198 - cmaps="{'s' : 'id', 'sGh': 'workId', 'sName': 'name'}"  
199 - dcname="s"  
200 - icname="id"  
201 - dsparams="{{ {type: 'local', param: 'ry' } | json }}"  
202 - iterobjname="item"  
203 - iterobjexp="item.name + '(' + item.workId + ')'"  
204 - searchph="请输拼音..."  
205 - searchexp="this.name"  
206 - >  
207 - </sa-Select5>  
208 - </div>  
209 - </div>  
210 -  
211 -  
212 -  
213 - </div>  
214 -  
215 - <div class="form-actions">  
216 - <div class="row">  
217 - <div class="col-md-offset-3 col-md-4">  
218 - <button type="submit" class="btn green"  
219 - ng-disabled="!myForm.$valid"><i class="fa fa-check"></i> 提交</button>  
220 - <a type="button" class="btn default"  
221 - href="javascript:" ng-click="ctrl.cancel()" ><i class="fa fa-times"></i> 取消</a>  
222 - </div>  
223 - </div>  
224 - </div>  
225 - </form>  
226 -  
227 - </div>  
228 -  
229 - </div>  
230 -  
231 -  
232 -  
233 -  
234 -</div> 1 +<div ng-controller="SchedulePlanInfoManageEditCtrl as ctrl">
  2 + <div class="page-head">
  3 + <div class="page-title">
  4 + <h1>排班明细管理</h1>
  5 + </div>
  6 + </div>
  7 +
  8 + <ul class="page-breadcrumb breadcrumb">
  9 + <li>
  10 + <a href="/pages/home.html" data-pjax>首页</a>
  11 + <i class="fa fa-circle"></i>
  12 + </li>
  13 + <li>
  14 + <span class="active">运营计划管理</span>
  15 + <i class="fa fa-circle"></i>
  16 + </li>
  17 + <li>
  18 + <a href="javascript:" ng-click="ctrl.toPlanPage()">排班计划管理</a>
  19 + <i class="fa fa-circle"></i>
  20 + </li>
  21 + <li>
  22 + <a href="javascript:" ng-click="ctrl.toPlanInfoListPage()">排班计划管理</a>
  23 + <i class="fa fa-circle"></i>
  24 + </li>
  25 + <li>
  26 + <span class="active">修改计划班次明细</span>
  27 + </li>
  28 + </ul>
  29 +
  30 + <div class="portlet light bordered">
  31 + <div class="portlet-title">
  32 + <div class="caption">
  33 + <i class="icon-equalizer font-red-sunglo"></i>
  34 + <span class="caption-subject font-red-sunglo bold uppercase">
  35 + {{ctrl.schedulePlanInfoForSave.xlName}}
  36 + {{ctrl.schedulePlanInfoForSave.ttInfoName}}
  37 + {{"路牌" + ctrl.schedulePlanInfoForSave.lpName}}
  38 + <span ng-bind="ctrl.schedulePlanInfoForSave.scheduleDate | date: 'yyyy-MM-dd ' "></span>
  39 + <span>计划班次信息</span>
  40 + </span>
  41 + </div>
  42 + </div>
  43 +
  44 + <div class="portlet-body form">
  45 + <form ng-submit="ctrl.submit()" class="form-horizontal" novalidate name="myForm">
  46 + <div class="form-body">
  47 + <div class="form-group has-success has-feedback">
  48 + <label class="col-md-2 control-label">线路*:</label>
  49 + <div class="col-md-3">
  50 + <input type="text" class="form-control"
  51 + ng-value="ctrl.schedulePlanInfoForSave.xlName"
  52 + readonly/>
  53 + </div>
  54 +
  55 + </div>
  56 + <div class="form-group has-success has-feedback">
  57 + <label class="col-md-2 control-label">时刻表名称*:</label>
  58 + <div class="col-md-3">
  59 + <input type="text" class="form-control"
  60 + ng-value="ctrl.schedulePlanInfoForSave.ttInfoName"
  61 + readonly/>
  62 + </div>
  63 + </div>
  64 + <div class="form-group has-success has-feedback">
  65 + <label class="col-md-2 control-label">路牌*:</label>
  66 + <div class="col-md-3">
  67 + <input type="text" class="form-control"
  68 + ng-value="ctrl.schedulePlanInfoForSave.lpName"
  69 + readonly/>
  70 + </div>
  71 +
  72 + </div>
  73 + <div class="form-group has-success has-feedback">
  74 + <label class="col-md-2 control-label">班次类型*:</label>
  75 + <div class="col-md-3">
  76 + <input type="text" class="form-control"
  77 + ng-value="ctrl.schedulePlanInfoForSave.bcType | dict:'ScheduleType':'未知' "
  78 + readonly/>
  79 + </div>
  80 +
  81 + </div>
  82 + <div class="form-group has-success has-feedback">
  83 + <label class="col-md-2 control-label">发车时间*:</label>
  84 + <div class="col-md-3">
  85 + <input type="text" class="form-control"
  86 + ng-value="ctrl.schedulePlanInfoForSave.fcsj"
  87 + readonly/>
  88 + </div>
  89 +
  90 + </div>
  91 +
  92 + <div class="form-group has-success has-feedback">
  93 + <label class="col-md-2 control-label">方向*:</label>
  94 + <div class="col-md-3">
  95 + <sa-Radiogroup model="ctrl.schedulePlanInfoForSave.xlDir" dicgroup="LineTrend" name="xlDir" required disabled="true"></sa-Radiogroup>
  96 + </div>
  97 + <!-- 隐藏块,显示验证信息 -->
  98 + <div class="alert alert-danger well-sm" ng-show="myForm.xlDir.$error.required">
  99 + 请选择线路上下行
  100 + </div>
  101 +
  102 + </div>
  103 +
  104 + <div class="form-group has-success has-feedback">
  105 + <label class="col-md-2 control-label">起点站*:</label>
  106 + <div class="col-md-4">
  107 + <sa-Select5 name="qdz"
  108 + model="ctrl.schedulePlanInfoForSave"
  109 + cmaps="{'qdzCode' : 'zcode', 'qdzName': 'zname'}"
  110 + dcname="qdzCode"
  111 + icname="zcode"
  112 + dsparams="{{ {type: 'ajax', param:{'lineid': ctrl.schedulePlanInfoForSave.xl, 'xldir': ctrl.schedulePlanInfoForSave.xlDir}, atype:'zd_tcc' } | json }}"
  113 + iterobjname="item"
  114 + iterobjexp="item.aname"
  115 + searchph="请输拼音..."
  116 + searchexp="this.aname"
  117 + required >
  118 + </sa-Select5>
  119 + </div>
  120 + <!-- 隐藏块,显示验证信息 -->
  121 + <div class="alert alert-danger well-sm" ng-show="myForm.qdz.$error.required">
  122 + 起点站必须选择
  123 + </div>
  124 + </div>
  125 + <div class="form-group has-success has-feedback">
  126 + <label class="col-md-2 control-label">终点站*:</label>
  127 + <div class="col-md-4">
  128 + <sa-Select5 name="zdz"
  129 + model="ctrl.schedulePlanInfoForSave"
  130 + cmaps="{'zdzCode' : 'zcode', 'zdzName': 'zname'}"
  131 + dcname="zdzCode"
  132 + icname="zcode"
  133 + dsparams="{{ {type: 'ajax', param:{'lineid': ctrl.schedulePlanInfoForSave.xl, 'xldir': ctrl.schedulePlanInfoForSave.xlDir}, atype:'zd_tcc' } | json }}"
  134 + iterobjname="item"
  135 + iterobjexp="item.aname"
  136 + searchph="请输拼音..."
  137 + searchexp="this.aname"
  138 + required >
  139 + </sa-Select5>
  140 + </div>
  141 + <!-- 隐藏块,显示验证信息 -->
  142 + <div class="alert alert-danger well-sm" ng-show="myForm.zdz.$error.required">
  143 + 终点站必须选择
  144 + </div>
  145 + </div>
  146 +
  147 + <div class="form-group has-success has-feedback">
  148 + <label class="col-md-2 control-label">车辆*:</label>
  149 + <div class="col-md-4">
  150 + <sa-Select5 name="cl"
  151 + model="ctrl.schedulePlanInfoForSave"
  152 + cmaps="{'cl': 'id', 'clZbh': 'insideCode'}"
  153 + dcname="cl"
  154 + icname="id"
  155 + dsparams="{{ {type: 'local', param: 'cl' } | json }}"
  156 + iterobjname="item"
  157 + iterobjexp="item.insideCode"
  158 + searchph="请输拼音..."
  159 + searchexp="this.insideCode"
  160 + required
  161 + >
  162 + </sa-Select5>
  163 + </div>
  164 + <!-- 隐藏块,显示验证信息 -->
  165 + <div class="alert alert-danger well-sm" ng-show="myForm.cl.$error.required">
  166 + 车辆必须选择
  167 + </div>
  168 + </div>
  169 +
  170 + <div class="form-group has-success has-feedback">
  171 + <label class="col-md-2 control-label">驾驶员*:</label>
  172 + <div class="col-md-4">
  173 + <sa-Select5 name="j"
  174 + model="ctrl.schedulePlanInfoForSave"
  175 + cmaps="{'j' : 'id', 'jGh': 'workId', 'jName': 'name'}"
  176 + dcname="j"
  177 + icname="id"
  178 + dsparams="{{ {type: 'local', param: 'ry' } | json }}"
  179 + iterobjname="item"
  180 + iterobjexp="item.name + '(' + item.workId + ')'"
  181 + searchph="请输拼音..."
  182 + searchexp="this.name"
  183 + required
  184 + >
  185 + </sa-Select5>
  186 + </div>
  187 + <!-- 隐藏块,显示验证信息 -->
  188 + <div class="alert alert-danger well-sm" ng-show="myForm.j.$error.required">
  189 + 驾驶员必须选择
  190 + </div>
  191 + </div>
  192 +
  193 + <div class="form-group">
  194 + <label class="col-md-2 control-label">售票员:</label>
  195 + <div class="col-md-4">
  196 + <sa-Select5 name="s1"
  197 + model="ctrl.schedulePlanInfoForSave"
  198 + cmaps="{'s' : 'id', 'sGh': 'workId', 'sName': 'name'}"
  199 + dcname="s"
  200 + icname="id"
  201 + dsparams="{{ {type: 'local', param: 'ry' } | json }}"
  202 + iterobjname="item"
  203 + iterobjexp="item.name + '(' + item.workId + ')'"
  204 + searchph="请输拼音..."
  205 + searchexp="this.name"
  206 + >
  207 + </sa-Select5>
  208 + </div>
  209 + </div>
  210 +
  211 +
  212 +
  213 + </div>
  214 +
  215 + <div class="form-actions">
  216 + <div class="row">
  217 + <div class="col-md-offset-3 col-md-4">
  218 + <button type="submit" class="btn green"
  219 + ng-disabled="!myForm.$valid"><i class="fa fa-check"></i> 提交</button>
  220 + <a type="button" class="btn default"
  221 + href="javascript:" ng-click="ctrl.cancel()" ><i class="fa fa-times"></i> 取消</a>
  222 + </div>
  223 + </div>
  224 + </div>
  225 + </form>
  226 +
  227 + </div>
  228 +
  229 + </div>
  230 +
  231 +
  232 +
  233 +
  234 +</div>
src/main/resources/static/pages/trafficManage/js/lineStationUploadRecord.js
@@ -114,30 +114,12 @@ @@ -114,30 +114,12 @@
114 $.each(inputs, function(i, element) { 114 $.each(inputs, function(i, element) {
115 params[$(element).attr("name")] = $(element).val(); 115 params[$(element).attr("name")] = $(element).val();
116 }); 116 });
117 -  
118 - var startDate = params['startDate'];  
119 - var endDate = params['endDate']; 117 + var startDate = params['startDate'] == "" ? "0" : params['startDate'];
  118 + var endDate = params['endDate'] == "" ? "23" : params['endDate'];
120 var reportDate = params['reportDate']; 119 var reportDate = params['reportDate'];
121 - if($("#carPlate").val() != ''){  
122 - params['cars.carPlate_eq'] = changeCarPlate($("#carPlate").val());  
123 - }  
124 - if($("#insideCode").val() != ''){  
125 - params['cars.insideCode_eq'] = $("#insideCode").val().toUpperCase();  
126 - }  
127 - // 默认开始时间  
128 - params['reportDate_ge'] = str2datetime(reportDate+" 00:00:00");  
129 - // 默认结束时间  
130 - params['reportDate_le'] = str2datetime(reportDate+" 23:59:59");  
131 -  
132 - // 指定的开始时间  
133 - if(startDate != ''){  
134 - params['reportDate_gt'] = str2datetime(reportDate+" "+ (startDate > 9 ? startDate : "0"+startDate + ":00:00"));  
135 - }  
136 - // 指定的结束时间  
137 - if(endDate != ''){  
138 - params['reportDate_lt'] = str2datetime(reportDate+" "+ (endDate > 9 ? endDate : "0"+endDate + ":59:59"));  
139 - }  
140 - $get('/vehicle_stop', params, function(data) { 120 + params['reportDate_start'] = reportDate.replace(/-/g,'') + (startDate > 9 ? startDate : "0"+startDate);
  121 + params['reportDate_end'] = reportDate.replace(/-/g,'') + (endDate > 9 ? endDate : "0"+endDate);
  122 + $get('/vehicle_stop/getVehicleInoutStopByParam', params, function(data) {
141 var content = data.content; 123 var content = data.content;
142 _dateFormat(content); 124 _dateFormat(content);
143 var bodyHtm = template('lineStationUploadRecord_list_temp', { 125 var bodyHtm = template('lineStationUploadRecord_list_temp', {
@@ -183,7 +165,7 @@ @@ -183,7 +165,7 @@
183 function _dateFormat(list) { 165 function _dateFormat(list) {
184 var fs = 'YYYY-MM-DD HH:mm:ss'; 166 var fs = 'YYYY-MM-DD HH:mm:ss';
185 $.each(list, function(i, obj) { 167 $.each(list, function(i, obj) {
186 - obj.reportDate = moment(obj.reportDate).format(fs); 168 + obj['report_date'] = moment(obj['report_date']).format(fs);
187 }); 169 });
188 } 170 }
189 171
@@ -191,10 +173,4 @@ @@ -191,10 +173,4 @@
191 function str2datetime(stringTime){ 173 function str2datetime(stringTime){
192 return Date.parse(new Date(stringTime)); 174 return Date.parse(new Date(stringTime));
193 } 175 }
194 -  
195 - // 时间字符串转成时间戳  
196 - function changeCarPlate(carPlate){  
197 - var tmp = "沪" + carPlate.substr(0, 1) + "-" + carPlate.substr(1, carPlate.length);  
198 - return tmp.toUpperCase();;  
199 - }  
200 })(); 176 })();
201 \ No newline at end of file 177 \ No newline at end of file
src/main/resources/static/pages/trafficManage/lineStationUploadRecord.html
@@ -20,15 +20,15 @@ @@ -20,15 +20,15 @@
20 </div> 20 </div>
21 <div class="inLine_block" style="display: inline-block;margin-left: 15px;"> 21 <div class="inLine_block" style="display: inline-block;margin-left: 15px;">
22 <span class="item-label" style="width: 80px;">线路名称:</span> 22 <span class="item-label" style="width: 80px;">线路名称:</span>
23 - <select class="form-control" name="line.id_eq" id="line" style="width: 150px;"></select> 23 + <select class="form-control" name="lineId" id="line" style="width: 150px;"></select>
24 </div> 24 </div>
25 <div class="inLine_block" style="display: inline-block;margin-left: 15px;"> 25 <div class="inLine_block" style="display: inline-block;margin-left: 15px;">
26 <span class="item-label" style="width: 80px;">内部编码:</span> 26 <span class="item-label" style="width: 80px;">内部编码:</span>
27 - <input type="text" name="cars.insideCode_eq" id="insideCode" style="width: 120px;" maxlength="40"/> 27 + <input type="text" name="insideCode" id="insideCode" style="width: 120px;" maxlength="40"/>
28 </div> 28 </div>
29 <div class="inLine_block" style="display: inline-block;margin-left: 15px;"> 29 <div class="inLine_block" style="display: inline-block;margin-left: 15px;">
30 <span class="item-label" style="width: 80px;">车牌号:</span> 30 <span class="item-label" style="width: 80px;">车牌号:</span>
31 - <input type="text" name="cars.carPlate_eq" id="carPlate" style="width: 120px;" maxlength="40"/> 31 + <input type="text" name="carPlate" id="carPlate" style="width: 120px;" maxlength="40"/>
32 <span style="color: red;width: 80px;">(沪D-12345 '沪'和'-'去掉)</span> 32 <span style="color: red;width: 80px;">(沪D-12345 '沪'和'-'去掉)</span>
33 </div> 33 </div>
34 <div class="form-group" style="display: inline-block;margin-left: 15px;"> 34 <div class="form-group" style="display: inline-block;margin-left: 15px;">
@@ -76,114 +76,40 @@ @@ -76,114 +76,40 @@
76 {{i+1}} 76 {{i+1}}
77 </td> 77 </td>
78 <td> 78 <td>
79 - {{if obj.line.company == '55'}}  
80 - 上南公司  
81 - {{else if obj.line.company == '22'}}  
82 - 金高公司  
83 - {{else if obj.line.company == '05'}}  
84 - 杨高公司  
85 - {{else if obj.line.company == '26'}}  
86 - 南汇公司  
87 - {{else if obj.line.company == '77'}}  
88 - 闵行公司  
89 - {{/if}} 79 + {{obj['branche_company']}}
90 </td> 80 </td>
91 <td> 81 <td>
92 - {{if obj.line.company == '55'}}  
93 -  
94 - {{if obj.line.brancheCompany == '1'}}  
95 - 上南二分公司  
96 - {{else if obj.line.brancheCompany == '2'}}  
97 - 上南三分公司  
98 - {{else if obj.line.brancheCompany == '3'}}  
99 - 上南六分公司  
100 - {{else if obj.line.brancheCompany == '4'}}  
101 - 上南一分公司  
102 - {{/if}}  
103 -  
104 - {{else if obj.line.company == '22'}}  
105 -  
106 - {{if obj.line.brancheCompany == '1'}}  
107 - 四分公司  
108 - {{else if obj.line.brancheCompany == '2'}}  
109 - 二分公司  
110 - {{else if obj.line.brancheCompany == '3'}}  
111 - 三分公司  
112 - {{else if obj.line.brancheCompany == '5'}}  
113 - 一分公司  
114 - {{/if}}  
115 -  
116 - {{else if obj.line.company == '05'}}  
117 -  
118 - {{if obj.line.brancheCompany == '1'}}  
119 - 川沙分公司  
120 - {{else if obj.line.brancheCompany == '2'}}  
121 - 金桥分公司  
122 - {{else if obj.line.brancheCompany == '3'}}  
123 - 芦潮港分公司  
124 - {{else if obj.line.brancheCompany == '5'}}  
125 - 杨高分公司  
126 - {{else if obj.line.brancheCompany == '6'}}  
127 - 周浦分公司  
128 - {{/if}}  
129 -  
130 - {{else if obj.line.company == '26'}}  
131 -  
132 - {{if obj.line.brancheCompany == '1'}}  
133 - 南汇一分  
134 - {{else if obj.line.brancheCompany == '2'}}  
135 - 南汇二分  
136 - {{else if obj.line.brancheCompany == '3'}}  
137 - 南汇三分  
138 - {{else if obj.line.brancheCompany == '4'}}  
139 - 南汇维修公司  
140 - {{else if obj.line.brancheCompany == '5'}}  
141 - 南汇公司  
142 - {{/if}}  
143 -  
144 - {{/if}} 82 + {{obj['company']}}
145 </td> 83 </td>
146 <td> 84 <td>
147 - {{obj.line.name}} 85 + {{obj['name']}}
148 </td> 86 </td>
149 <td> 87 <td>
150 - {{obj.line.shanghaiLinecode}} 88 + {{obj['shanghai_linecode']}}
151 </td> 89 </td>
152 <td> 90 <td>
153 - {{obj.cars.insideCode}} 91 + {{obj['inside_code']}}
154 </td> 92 </td>
155 <td> 93 <td>
156 - {{obj.cars.equipmentCode}} 94 + {{obj['equipment_code']}}
157 </td> 95 </td>
158 <td> 96 <td>
159 - {{obj.cars.carPlate}} 97 + {{obj['car_plate']}}
160 </td> 98 </td>
161 <td> 99 <td>
162 - {{obj.stop}} 100 + {{obj['stop']}}
163 </td> 101 </td>
164 <td> 102 <td>
165 - {{if obj.serviceState == 0}}  
166 - 营运  
167 - {{else if obj.serviceState == 1}}  
168 - 停运  
169 - {{/if}} 103 + {{obj['service_state']}}
170 </td> 104 </td>
171 <td> 105 <td>
172 - {{if obj.upDown == 0}}  
173 - 上行  
174 - {{else if obj.upDown == 1}}  
175 - 下行  
176 - {{/if}} 106 + {{obj['up_down']}}
177 </td> 107 </td>
178 <td> 108 <td>
179 - {{if obj.inOutStop == 0}}  
180 - 站内  
181 - {{else if obj.inOutStop == 1}}  
182 - 站外  
183 - {{/if}} 109 + {{obj['in_out_stop']}}
184 </td> 110 </td>
185 <td> 111 <td>
186 - {{obj.reportDate}} 112 + {{obj['report_date']}}
187 </td> 113 </td>
188 </tr> 114 </tr>
189 {{/each}} 115 {{/each}}
src/main/resources/static/real_control_v2/fragments/north/nav/user_change/user_change_modal.html
1 -<div class="uk-modal ct-form-modal" id="change_user_options-modal">  
2 - <div class="uk-modal-dialog">  
3 - <a href="" class="uk-modal-close uk-close"></a>  
4 - <h2>切换账号/模式</h2>  
5 -  
6 - <div class="user_info">  
7 - <form class="uk-form uk-form-horizontal">  
8 -  
9 - <div class="uk-form-row">  
10 - <label class="uk-form-label" for="form-h-it">用户名</label>  
11 - <div class="uk-form-controls">  
12 - <input name="userName" type="text" id="form-h-it" value="" autocomplete="off">  
13 - </div>  
14 - </div>  
15 - <div class="uk-form-row">  
16 - <label class="uk-form-label" for="form-h-ip">密码</label>  
17 - <div class="uk-form-controls">  
18 - <input name="password" type="password" id="form-h-ip" value="******" disabled  
19 - autocomplete="off">  
20 - </div>  
21 - </div>  
22 - <div class="uk-form-row">  
23 - <label class="uk-form-label" for="form-h-s">调度模式</label>  
24 - <div class="uk-form-controls">  
25 - <select id="form-h-s" name="operationMode">  
26 - <option value="1">主调模式</option>  
27 - <option value="0">监控模式</option>  
28 - </select>  
29 - </div>  
30 - </div>  
31 - <br>  
32 - <div class="uk-form-row">  
33 - <button disabled class="uk-button uk-button-danger uk-button-large uk-width-1-1 confirm_btn"  
34 - type="button">  
35 - 确认切换  
36 - </button>  
37 - </div>  
38 - </form>  
39 - </div>  
40 - </div>  
41 -  
42 - <script>  
43 - (function () {  
44 - var modal = '#change_user_options-modal',  
45 - user = gb_northToolbar.user(),  
46 - operationMode = window.localStorage.getItem('operationMode'),  
47 - f = $('.user_info>form', modal);  
48 - //用户名  
49 - $('input[name=userName]', f).val(user.userName)  
50 - .on('input', function () {  
51 - //清除密码  
52 - $('input[name=password]', f).val('').removeAttr('disabled');  
53 - changeBtnStatus();  
54 - });  
55 -  
56 - //密码  
57 - $('input[name=password]', f).on('input', changeBtnStatus);  
58 -  
59 - //切换模式  
60 - $('select[name=operationMode]', f).val(operationMode).on('change', changeBtnStatus);  
61 -  
62 - var confirmBtn = $('.confirm_btn', f);  
63 -  
64 - function changeBtnStatus() {  
65 - var data = f.serializeJSON();  
66 - if ((data.userName != user.userName && $.trim(data.password))  
67 - || data.operationMode != operationMode)  
68 - confirmBtn.removeAttr('disabled');  
69 - else {  
70 - confirmBtn.attr('disabled', 'disabled');  
71 - if (data.userName == user.userName)  
72 - $('input[name=password]', f).val('******').attr('disabled', 'disabled');  
73 - }  
74 - }  
75 -  
76 - //确认切换  
77 - $('.confirm_btn', f).on('click', function () {  
78 - $(this).attr('disabled', 'disabled');  
79 -  
80 - var data = f.serializeJSON();  
81 - if (data.userName != user.userName) {  
82 - //切换账号  
83 - if (!$.trim(data.password))  
84 - return notify_err('密码不能为空!');  
85 -  
86 - gb_common.$post('/user/change_user', data, function (rs) {  
87 - notify_succ('切换账号成功!');  
88 - gb_northToolbar.init();  
89 - gb_delay_write_log();//当班调度日志  
90 - });  
91 - }  
92 -  
93 - if(data.operationMode != operationMode){  
94 - window.localStorage.setItem('operationMode', data.operationMode);  
95 - //切换调度模式  
96 - gb_dp_initHttpIntercept();  
97 - }  
98 -  
99 - UIkit.modal(modal).hide();  
100 - });  
101 - })();  
102 - </script>  
103 -</div> 1 +<div class="uk-modal ct-form-modal" id="change_user_options-modal">
  2 + <div class="uk-modal-dialog">
  3 + <a href="" class="uk-modal-close uk-close"></a>
  4 + <h2>切换账号/模式</h2>
  5 +
  6 + <div class="user_info">
  7 + <form class="uk-form uk-form-horizontal">
  8 +
  9 + <div class="uk-form-row">
  10 + <label class="uk-form-label" for="form-h-it">用户名</label>
  11 + <div class="uk-form-controls">
  12 + <input name="userName" type="text" id="form-h-it" value="" autocomplete="off">
  13 + </div>
  14 + </div>
  15 + <div class="uk-form-row">
  16 + <label class="uk-form-label" for="form-h-ip">密码</label>
  17 + <div class="uk-form-controls">
  18 + <input name="password" type="password" id="form-h-ip" value="******" disabled
  19 + autocomplete="off">
  20 + </div>
  21 + </div>
  22 + <div class="uk-form-row">
  23 + <label class="uk-form-label" for="form-h-s">调度模式</label>
  24 + <div class="uk-form-controls">
  25 + <select id="form-h-s" name="operationMode">
  26 + <option value="1">主调模式</option>
  27 + <option value="0">监控模式</option>
  28 + </select>
  29 + </div>
  30 + </div>
  31 + <br>
  32 + <div class="uk-form-row">
  33 + <button disabled class="uk-button uk-button-danger uk-button-large uk-width-1-1 confirm_btn"
  34 + type="button">
  35 + 确认切换
  36 + </button>
  37 + </div>
  38 + </form>
  39 + </div>
  40 + </div>
  41 +
  42 + <script>
  43 + (function () {
  44 + var modal = '#change_user_options-modal',
  45 + user = gb_northToolbar.user(),
  46 + operationMode = window.localStorage.getItem('operationMode'),
  47 + f = $('.user_info>form', modal);
  48 + //用户名
  49 + $('input[name=userName]', f).val(user.userName)
  50 + .on('input', function () {
  51 + //清除密码
  52 + $('input[name=password]', f).val('').removeAttr('disabled');
  53 + changeBtnStatus();
  54 + });
  55 +
  56 + //密码
  57 + $('input[name=password]', f).on('input', changeBtnStatus);
  58 +
  59 + //切换模式
  60 + $('select[name=operationMode]', f).val(operationMode).on('change', changeBtnStatus);
  61 +
  62 + var confirmBtn = $('.confirm_btn', f);
  63 +
  64 + function changeBtnStatus() {
  65 + var data = f.serializeJSON();
  66 + if ((data.userName != user.userName && $.trim(data.password))
  67 + || data.operationMode != operationMode)
  68 + confirmBtn.removeAttr('disabled');
  69 + else {
  70 + confirmBtn.attr('disabled', 'disabled');
  71 + if (data.userName == user.userName)
  72 + $('input[name=password]', f).val('******').attr('disabled', 'disabled');
  73 + }
  74 + }
  75 +
  76 + //确认切换
  77 + $('.confirm_btn', f).on('click', function () {
  78 + $(this).attr('disabled', 'disabled');
  79 +
  80 + var data = f.serializeJSON();
  81 + if (data.userName != user.userName) {
  82 + //切换账号
  83 + if (!$.trim(data.password))
  84 + return notify_err('密码不能为空!');
  85 +
  86 + gb_common.$post('/user/change_user', data, function (rs) {
  87 + notify_succ('切换账号成功!');
  88 + gb_northToolbar.init();
  89 + gb_delay_write_log();//当班调度日志
  90 + });
  91 + }
  92 +
  93 + if(data.operationMode != operationMode){
  94 + window.localStorage.setItem('operationMode', data.operationMode);
  95 + //切换调度模式
  96 + gb_dp_initHttpIntercept();
  97 + }
  98 +
  99 + UIkit.modal(modal).hide();
  100 + });
  101 + })();
  102 + </script>
  103 +</div>
src/main/resources/static/real_control_v2/js/main.js
@@ -47,7 +47,7 @@ var gb_main_ep = new EventProxy(), @@ -47,7 +47,7 @@ var gb_main_ep = new EventProxy(),
47 $('li.map-panel', '#main-tab-content').load('/real_control_v2/mapmonitor/real.html'); 47 $('li.map-panel', '#main-tab-content').load('/real_control_v2/mapmonitor/real.html');
48 }, 1000); 48 }, 1000);
49 //弹出更新说明 49 //弹出更新说明
50 - //showUpdateDescription(); 50 + showUpdateDescription();
51 }); 51 });
52 52
53 function g_emit(id) { 53 function g_emit(id) {
@@ -168,8 +168,8 @@ var disabled_submit_btn = function (form) { @@ -168,8 +168,8 @@ var disabled_submit_btn = function (form) {
168 function showUpdateDescription() { 168 function showUpdateDescription() {
169 //更新说明 169 //更新说明
170 var updateDescription = { 170 var updateDescription = {
171 - date: '2017-09-24',  
172 - text: '<h5>1、尝试解决 “祝桥2路” 和 “机场七线” 进站问题!</h5>' 171 + date: '2017-09-28',
  172 + text: '<h5>1、修复了一个bug,该bug曾导致,出场时间设置为请求出场的线路,有几率早出场时间会误跳至分班班次!</h5>'
173 }; 173 };
174 174
175 var storage = window.localStorage 175 var storage = window.localStorage