Commit 43c95db674e588a60dd33503ebccaae2b8b54819

Authored by 李强
2 parents 98b3ce7d b22c2083

Merge branch 'master' of git@192.168.168.201:panzhaov5/bsth_control.git

Showing 33 changed files with 978 additions and 191 deletions
@@ -5,7 +5,7 @@ @@ -5,7 +5,7 @@
5 <groupId>com.bsth</groupId> 5 <groupId>com.bsth</groupId>
6 <artifactId>bsth_control</artifactId> 6 <artifactId>bsth_control</artifactId>
7 <version>0.0.1-SNAPSHOT</version> 7 <version>0.0.1-SNAPSHOT</version>
8 - <packaging>jar</packaging> 8 + <packaging>war</packaging>
9 9
10 <parent> 10 <parent>
11 <groupId>org.springframework.boot</groupId> 11 <groupId>org.springframework.boot</groupId>
@@ -19,11 +19,11 @@ @@ -19,11 +19,11 @@
19 <artifactId>spring-boot-starter-web</artifactId> 19 <artifactId>spring-boot-starter-web</artifactId>
20 </dependency> 20 </dependency>
21 21
22 - <!-- <dependency> 22 + <dependency>
23 <groupId>org.springframework.boot</groupId> 23 <groupId>org.springframework.boot</groupId>
24 <artifactId>spring-boot-starter-tomcat</artifactId> 24 <artifactId>spring-boot-starter-tomcat</artifactId>
25 <scope>provided</scope> 25 <scope>provided</scope>
26 - </dependency> --> 26 + </dependency>
27 27
28 <dependency> 28 <dependency>
29 <groupId>org.springframework.boot</groupId> 29 <groupId>org.springframework.boot</groupId>
src/main/java/com/bsth/Application.java
@@ -4,21 +4,28 @@ import com.fasterxml.jackson.databind.ObjectMapper; @@ -4,21 +4,28 @@ import com.fasterxml.jackson.databind.ObjectMapper;
4 import com.fasterxml.jackson.databind.SerializationFeature; 4 import com.fasterxml.jackson.databind.SerializationFeature;
5 import org.springframework.boot.SpringApplication; 5 import org.springframework.boot.SpringApplication;
6 import org.springframework.boot.autoconfigure.SpringBootApplication; 6 import org.springframework.boot.autoconfigure.SpringBootApplication;
  7 +import org.springframework.boot.builder.SpringApplicationBuilder;
  8 +import org.springframework.boot.context.web.SpringBootServletInitializer;
7 import org.springframework.context.annotation.Bean; 9 import org.springframework.context.annotation.Bean;
8 import org.springframework.context.annotation.Primary; 10 import org.springframework.context.annotation.Primary;
9 11
10 @SpringBootApplication 12 @SpringBootApplication
11 -public class Application{ 13 +public class Application extends SpringBootServletInitializer {
12 14
13 - @Bean  
14 - @Primary  
15 - public ObjectMapper objectMapper() {  
16 - ObjectMapper objectMapper = new ObjectMapper();  
17 - objectMapper.disable(SerializationFeature.FAIL_ON_EMPTY_BEANS); 15 + @Override
  16 + protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
  17 + return application.sources(Application.class);
  18 + }
  19 +
  20 + @Bean
  21 + @Primary
  22 + public ObjectMapper objectMapper() {
  23 + ObjectMapper objectMapper = new ObjectMapper();
  24 + objectMapper.disable(SerializationFeature.FAIL_ON_EMPTY_BEANS);
  25 +
  26 + return objectMapper;
  27 + }
18 28
19 - return objectMapper;  
20 - }  
21 -  
22 public static void main(String[] args) throws Exception { 29 public static void main(String[] args) throws Exception {
23 SpringApplication.run(Application.class, args); 30 SpringApplication.run(Application.class, args);
24 } 31 }
src/main/java/com/bsth/StartCommand.java
@@ -93,7 +93,7 @@ public class StartCommand implements CommandLineRunner{ @@ -93,7 +93,7 @@ public class StartCommand implements CommandLineRunner{
93 * 每15秒从数据库抓取到离站信息和班次匹配 93 * 每15秒从数据库抓取到离站信息和班次匹配
94 * (网关生成的到离站数据也是延迟批量入库,所以缩短该线程执行周期并不会提高 “实际到离站” 的实时性) 94 * (网关生成的到离站数据也是延迟批量入库,所以缩短该线程执行周期并不会提高 “实际到离站” 的实时性)
95 */ 95 */
96 - scheduler.scheduleWithFixedDelay(gpsArrivalStationThread, 35, 1200, TimeUnit.SECONDS); 96 + //scheduler.scheduleWithFixedDelay(gpsArrivalStationThread, 35, 1200, TimeUnit.SECONDS);
97 97
98 /** 98 /**
99 * 首个调度指令下发(2分钟运行一次) 99 * 首个调度指令下发(2分钟运行一次)
src/main/java/com/bsth/controller/realcontrol/ScheduleRealInfoController.java
@@ -5,6 +5,7 @@ import java.util.List; @@ -5,6 +5,7 @@ import java.util.List;
5 import java.util.Map; 5 import java.util.Map;
6 6
7 import org.springframework.beans.factory.annotation.Autowired; 7 import org.springframework.beans.factory.annotation.Autowired;
  8 +import org.springframework.web.bind.annotation.PathVariable;
8 import org.springframework.web.bind.annotation.RequestMapping; 9 import org.springframework.web.bind.annotation.RequestMapping;
9 import org.springframework.web.bind.annotation.RequestMethod; 10 import org.springframework.web.bind.annotation.RequestMethod;
10 import org.springframework.web.bind.annotation.RequestParam; 11 import org.springframework.web.bind.annotation.RequestParam;
@@ -205,6 +206,18 @@ public class ScheduleRealInfoController extends BaseController&lt;ScheduleRealInfo, @@ -205,6 +206,18 @@ public class ScheduleRealInfoController extends BaseController&lt;ScheduleRealInfo,
205 public Map<Integer, Integer> trustStatus(@RequestParam String lineCodes) { 206 public Map<Integer, Integer> trustStatus(@RequestParam String lineCodes) {
206 return scheduleRealInfoService.trustStatus(lineCodes); 207 return scheduleRealInfoService.trustStatus(lineCodes);
207 } 208 }
  209 +
  210 + /**
  211 + *
  212 + * @Title: outgoAdjustAll
  213 + * @Description: TODO(批量待发调整)
  214 + * @param @param list
  215 + * @throws
  216 + */
  217 + @RequestMapping(value = "/outgoAdjustAll", method = RequestMethod.POST)
  218 + public Map<String, Object> outgoAdjustAll(@RequestParam String params){
  219 + return scheduleRealInfoService.outgoAdjustAll(params);
  220 + }
208 221
209 /** 222 /**
210 * 223 *
@@ -216,6 +229,29 @@ public class ScheduleRealInfoController extends BaseController&lt;ScheduleRealInfo, @@ -216,6 +229,29 @@ public class ScheduleRealInfoController extends BaseController&lt;ScheduleRealInfo,
216 ScheduleBuffer.trustMap.put(lineCode, status); 229 ScheduleBuffer.trustMap.put(lineCode, status);
217 return 200; 230 return 200;
218 } 231 }
  232 +
  233 + /**
  234 + *
  235 + * @Title: findByLineAndUpDown
  236 + * @Description: TODO(根据线路和走向获取班次)
  237 + * @param @param line
  238 + * @param @param upDown
  239 + */
  240 + @RequestMapping(value = "/findByLineAndUpDown")
  241 + public List<ScheduleRealInfo> findByLineAndUpDown(@RequestParam Integer line,@RequestParam Integer upDown){
  242 + return ScheduleBuffer.findByLineAndUpDown(line, upDown);
  243 + }
  244 +
  245 + /**
  246 + *
  247 + * @Title: findByLineCode
  248 + * @Description: TODO(根据线路获取班次信息)
  249 + * @param @param lineCode
  250 + */
  251 + @RequestMapping(value = "/lineCode/{lineCode}")
  252 + public List<ScheduleRealInfo> findByLineCode(@PathVariable("lineCode") String lineCode){
  253 + return ScheduleBuffer.schedulListMap.get(lineCode);
  254 + }
219 255
220 @RequestMapping(value = "/queryUserInfo") 256 @RequestMapping(value = "/queryUserInfo")
221 public List<ScheduleRealInfo> queryUserInfo(@RequestParam String line, @RequestParam String date) { 257 public List<ScheduleRealInfo> queryUserInfo(@RequestParam String line, @RequestParam String date) {
src/main/java/com/bsth/entity/realcontrol/ChildTaskPlan.java
@@ -95,7 +95,7 @@ public class ChildTaskPlan { @@ -95,7 +95,7 @@ public class ChildTaskPlan {
95 /** 95 /**
96 * 主排班计划 96 * 主排班计划
97 */ 97 */
98 - @ManyToOne(fetch = FetchType.LAZY) 98 + @ManyToOne
99 private ScheduleRealInfo schedule; 99 private ScheduleRealInfo schedule;
100 100
101 private String remarks; 101 private String remarks;
src/main/java/com/bsth/entity/realcontrol/ScheduleRealInfo.java
@@ -482,6 +482,17 @@ public class ScheduleRealInfo { @@ -482,6 +482,17 @@ public class ScheduleRealInfo {
482 this.dfsj = sdfHHmm.format(new Date(this.dfsjT)); 482 this.dfsj = sdfHHmm.format(new Date(this.dfsjT));
483 } 483 }
484 484
  485 + public void setDfsjAll(String dfsj) {
  486 +
  487 + try {
  488 + String dfsjFull = sdfyyyyMMdd.format(this.scheduleDate) + " " + dfsj;
  489 + this.dfsjT = sdfyyyyMMddHHmm.parse(dfsjFull).getTime();
  490 + this.dfsj = dfsj;
  491 + } catch (ParseException e) {
  492 + e.printStackTrace();
  493 + }
  494 + }
  495 +
485 @Transient 496 @Transient
486 static SimpleDateFormat sdfyyyyMMdd = new SimpleDateFormat("yyyy-MM-dd"); 497 static SimpleDateFormat sdfyyyyMMdd = new SimpleDateFormat("yyyy-MM-dd");
487 @Transient 498 @Transient
src/main/java/com/bsth/repository/realcontrol/ScheduleRealInfoRepository.java
@@ -4,10 +4,6 @@ import java.util.Date; @@ -4,10 +4,6 @@ import java.util.Date;
4 import java.util.List; 4 import java.util.List;
5 import java.util.Map; 5 import java.util.Map;
6 6
7 -import org.springframework.data.domain.Page;  
8 -import org.springframework.data.domain.Pageable;  
9 -import org.springframework.data.jpa.domain.Specification;  
10 -import org.springframework.data.jpa.repository.EntityGraph;  
11 import org.springframework.data.jpa.repository.Query; 7 import org.springframework.data.jpa.repository.Query;
12 import org.springframework.stereotype.Repository; 8 import org.springframework.stereotype.Repository;
13 9
@@ -20,9 +16,6 @@ public interface ScheduleRealInfoRepository extends BaseRepository&lt;ScheduleRealI @@ -20,9 +16,6 @@ public interface ScheduleRealInfoRepository extends BaseRepository&lt;ScheduleRealI
20 @Query("select s from ScheduleRealInfo s where s.xlBm in ?1") 16 @Query("select s from ScheduleRealInfo s where s.xlBm in ?1")
21 List<ScheduleRealInfo> findByLines(List<String> lines); 17 List<ScheduleRealInfo> findByLines(List<String> lines);
22 18
23 - @EntityGraph(value = "scheduleRealInfo_childTasks", type = EntityGraph.EntityGraphType.FETCH)  
24 - @Override  
25 - Page<ScheduleRealInfo> findAll(Specification<ScheduleRealInfo> spec, Pageable pageable);  
26 19
27 @Query(value="select s from ScheduleRealInfo s where s.xlName = ?1 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 group by jName,clZbh,lpName") 20 @Query(value="select s from ScheduleRealInfo s where s.xlName = ?1 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 group by jName,clZbh,lpName")
28 List<ScheduleRealInfo> queryUserInfo(String line,String date); 21 List<ScheduleRealInfo> queryUserInfo(String line,String date);
src/main/java/com/bsth/service/realcontrol/ScheduleRealInfoService.java
@@ -78,4 +78,6 @@ public interface ScheduleRealInfoService extends BaseService&lt;ScheduleRealInfo, L @@ -78,4 +78,6 @@ public interface ScheduleRealInfoService extends BaseService&lt;ScheduleRealInfo, L
78 78
79 Map<String, Object> schInfoFineTune(Map<String, String> map); 79 Map<String, Object> schInfoFineTune(Map<String, String> map);
80 80
  81 + Map<String, Object> outgoAdjustAll(String params);
  82 +
81 } 83 }
src/main/java/com/bsth/service/realcontrol/buffer/GetSchedulePlanThread.java
1 package com.bsth.service.realcontrol.buffer; 1 package com.bsth.service.realcontrol.buffer;
2 2
  3 +import java.text.ParseException;
3 import java.text.SimpleDateFormat; 4 import java.text.SimpleDateFormat;
4 import java.util.Date; 5 import java.util.Date;
5 import java.util.List; 6 import java.util.List;
@@ -16,7 +17,7 @@ import com.bsth.entity.schedule.SchedulePlanInfo; @@ -16,7 +17,7 @@ import com.bsth.entity.schedule.SchedulePlanInfo;
16 import com.bsth.repository.realcontrol.ScheduleRealInfoRepository; 17 import com.bsth.repository.realcontrol.ScheduleRealInfoRepository;
17 import com.bsth.repository.schedule.SchedulePlanInfoRepository; 18 import com.bsth.repository.schedule.SchedulePlanInfoRepository;
18 import com.bsth.util.BatchSaveUtils; 19 import com.bsth.util.BatchSaveUtils;
19 -import com.fasterxml.jackson.databind.ObjectMapper; 20 +import com.bsth.vehicle.directive.buffer.DirectiveBuffer;
20 21
21 /** 22 /**
22 * 23 *
@@ -37,56 +38,65 @@ public class GetSchedulePlanThread extends Thread{ @@ -37,56 +38,65 @@ public class GetSchedulePlanThread extends Thread{
37 @Autowired 38 @Autowired
38 ScheduleRealInfoRepository scheduleRealInfoRepository; 39 ScheduleRealInfoRepository scheduleRealInfoRepository;
39 40
40 - @Autowired  
41 - ObjectMapper objectMapper;  
42 -  
43 SimpleDateFormat sdfyyyyMMdd = new SimpleDateFormat("yyyy-MM-dd"); 41 SimpleDateFormat sdfyyyyMMdd = new SimpleDateFormat("yyyy-MM-dd");
44 42
  43 + @Autowired
  44 + DirectiveBuffer directiveBuffer;
  45 +
45 @Override 46 @Override
46 public void run() { 47 public void run() {
47 try{ 48 try{
  49 + //清除缓存
48 ScheduleBuffer.clear(); 50 ScheduleBuffer.clear();
  51 + //所有指令入库
  52 + directiveBuffer.saveAll();
  53 + DirectiveBuffer.clear();
49 54
50 - List<ScheduleRealInfo> realList = null;  
51 - String dateStr = sdfyyyyMMdd.format(new Date());  
52 - Date cDate = sdfyyyyMMdd.parse(dateStr);  
53 - //查询数据库是否有今日排班  
54 - int size = scheduleRealInfoRepository.countByDate(cDate);  
55 - if(size > 0){  
56 - //从数据库恢复当日排班  
57 - realList = scheduleRealInfoRepository.findByDate(cDate);  
58 - logger.info("从数据库恢复当日排班 " + realList.size());  
59 - //写入缓存  
60 - ScheduleBuffer.init(realList);  
61 - }  
62 - else{  
63 - List<SchedulePlanInfo> list = schedulePlanInfoRepository.findByDate(cDate);  
64 -  
65 - for(SchedulePlanInfo sp : list){  
66 - sp.setSchedulePlan(null);  
67 - }  
68 -  
69 - //实际排班计划  
70 - realList = JSONArray.parseArray(JSON.toJSONString(list), ScheduleRealInfo.class);  
71 - //查询数据库最大ID  
72 - Long id = scheduleRealInfoRepository.getMaxId();  
73 - if(null == id)  
74 - id = 0L;  
75 - id ++;  
76 -  
77 - for(ScheduleRealInfo item : realList){  
78 - item.setSpId(item.getId());  
79 - item.setId(id ++);//设置ID  
80 - }  
81 -  
82 - //写入缓存  
83 - ScheduleBuffer.init(realList);  
84 - //入库  
85 - new BatchSaveUtils<ScheduleRealInfo>().saveList(realList, ScheduleRealInfo.class);  
86 - }  
87 - logger.info("获取当天实际排班计划数量:" + realList.size()); 55 + //加载新的排班
  56 + loaSchedule();
88 }catch(Exception e){ 57 }catch(Exception e){
89 logger.error("",e); 58 logger.error("",e);
90 } 59 }
91 } 60 }
  61 +
  62 + public void loaSchedule() throws ParseException{
  63 + List<ScheduleRealInfo> realList = null;
  64 + String dateStr = sdfyyyyMMdd.format(new Date());
  65 + Date cDate = sdfyyyyMMdd.parse(dateStr);
  66 + //查询数据库是否有今日排班
  67 + int size = scheduleRealInfoRepository.countByDate(cDate);
  68 + if(size > 0){
  69 + //从数据库恢复当日排班
  70 + realList = scheduleRealInfoRepository.findByDate(cDate);
  71 + logger.info("从数据库恢复当日排班 " + realList.size());
  72 + //写入缓存
  73 + ScheduleBuffer.init(realList);
  74 + }
  75 + else{
  76 + List<SchedulePlanInfo> list = schedulePlanInfoRepository.findByDate(cDate);
  77 +
  78 + for(SchedulePlanInfo sp : list){
  79 + sp.setSchedulePlan(null);
  80 + }
  81 +
  82 + //实际排班计划
  83 + realList = JSONArray.parseArray(JSON.toJSONString(list), ScheduleRealInfo.class);
  84 + //查询数据库最大ID
  85 + Long id = scheduleRealInfoRepository.getMaxId();
  86 + if(null == id)
  87 + id = 0L;
  88 + id ++;
  89 +
  90 + for(ScheduleRealInfo item : realList){
  91 + item.setSpId(item.getId());
  92 + item.setId(id ++);//设置ID
  93 + }
  94 +
  95 + //写入缓存
  96 + ScheduleBuffer.init(realList);
  97 + //入库
  98 + new BatchSaveUtils<ScheduleRealInfo>().saveList(realList, ScheduleRealInfo.class);
  99 + }
  100 + logger.info("获取当天实际排班计划数量:" + realList.size());
  101 + }
92 } 102 }
src/main/java/com/bsth/service/realcontrol/buffer/ScheduleBuffer.java
@@ -36,13 +36,19 @@ public class ScheduleBuffer { @@ -36,13 +36,19 @@ public class ScheduleBuffer {
36 /** 36 /**
37 * K: 车辆自编号 V: 未完成班次链表 37 * K: 车辆自编号 V: 未完成班次链表
38 */ 38 */
39 - public static Map<String, LinkedList<ScheduleRealInfo>> vehLinkedMap; 39 + /*public static Map<String, LinkedList<ScheduleRealInfo>> vehLinkedMap;*/
  40 +
  41 + /**
  42 + * K: 车辆自编号 V: 班次链表
  43 + */
  44 + public static ArrayListMultimap<String, ScheduleRealInfo> vehSchListMap;
  45 + /*public static Map<String, LinkedList<ScheduleRealInfo>> vehSchLinkedMap;*/
40 46
41 47
42 /** 48 /**
43 * K: 车辆自编号 V: 已执行班次链表 49 * K: 车辆自编号 V: 已执行班次链表
44 */ 50 */
45 - public static LinkedListMultimap<String, ScheduleRealInfo> finishLinkedMap; 51 + /*public static LinkedListMultimap<String, ScheduleRealInfo> finishLinkedMap;*/
46 52
47 53
48 /** 54 /**
@@ -73,8 +79,9 @@ public class ScheduleBuffer { @@ -73,8 +79,9 @@ public class ScheduleBuffer {
73 schedulListMap = ArrayListMultimap.create(); 79 schedulListMap = ArrayListMultimap.create();
74 pkSchedulMap = new HashMap<>(); 80 pkSchedulMap = new HashMap<>();
75 persistentList = new LinkedList<>(); 81 persistentList = new LinkedList<>();
76 - vehLinkedMap = new HashMap<>();  
77 - finishLinkedMap = LinkedListMultimap.create(); 82 + /*vehLinkedMap = new HashMap<>();
  83 + finishLinkedMap = LinkedListMultimap.create();*/
  84 + vehSchListMap = ArrayListMultimap.create();
78 trustMap = new HashMap<>(); 85 trustMap = new HashMap<>();
79 } 86 }
80 87
@@ -96,10 +103,11 @@ public class ScheduleBuffer { @@ -96,10 +103,11 @@ public class ScheduleBuffer {
96 103
97 //初始化车辆和班次列表对照 104 //初始化车辆和班次列表对照
98 zbh = schedul.getClZbh(); 105 zbh = schedul.getClZbh();
99 - if(!vehLinkedMap.containsKey(zbh)) 106 + vehSchListMap.put(zbh, schedul);
  107 + /*if(!vehLinkedMap.containsKey(zbh))
100 vehLinkedMap.put(zbh, new LinkedList<ScheduleRealInfo>()); 108 vehLinkedMap.put(zbh, new LinkedList<ScheduleRealInfo>());
101 109
102 - vehLinkedMap.get(zbh).add(schedul); 110 + vehLinkedMap.get(zbh).add(schedul);*/
103 } 111 }
104 112
105 //计算起点应到时间 113 //计算起点应到时间
@@ -152,18 +160,23 @@ public class ScheduleBuffer { @@ -152,18 +160,23 @@ public class ScheduleBuffer {
152 160
153 public static int put(ScheduleRealInfo sch){ 161 public static int put(ScheduleRealInfo sch){
154 schedulListMap.put(sch.getXlBm(), sch); 162 schedulListMap.put(sch.getXlBm(), sch);
155 - pkSchedulMap.put(sch.getId(), sch);  
156 163
  164 + pkSchedulMap.put(sch.getId(), sch);
157 String zbh = sch.getClZbh(); 165 String zbh = sch.getClZbh();
158 - if(!vehLinkedMap.containsKey(zbh)) 166 + vehSchListMap.put(zbh, sch);
  167 +
  168 + //List<ScheduleRealInfo> list = vehSchListMap.get(sch.getClZbh());
  169 +
  170 + /*if(!vehLinkedMap.containsKey(zbh))
159 vehLinkedMap.put(zbh, new LinkedList<ScheduleRealInfo>()); 171 vehLinkedMap.put(zbh, new LinkedList<ScheduleRealInfo>());
160 - vehLinkedMap.get(zbh).add(sch); 172 + vehLinkedMap.get(zbh).add(sch);*/
161 173
162 //重新排序 174 //重新排序
163 - //Collections.sort(vehLinkedMap.get(zbh), scheduleComparator); 175 + Collections.sort(schedulListMap.get(sch.getXlBm()), scheduleComparator);
164 176
165 //重新计算应到时间 177 //重新计算应到时间
166 - calcArrDateQd(vehLinkedMap.get(zbh)); 178 + //calcArrDateQd(vehLinkedMap.get(zbh));
  179 + calcArrDateQd(vehSchListMap.get(zbh));
167 return 0; 180 return 0;
168 } 181 }
169 182
@@ -184,12 +197,15 @@ public class ScheduleBuffer { @@ -184,12 +197,15 @@ public class ScheduleBuffer {
184 * @throws 197 * @throws
185 */ 198 */
186 public static ScheduleRealInfo finishSch(ScheduleRealInfo sch){ 199 public static ScheduleRealInfo finishSch(ScheduleRealInfo sch){
187 - LinkedList<ScheduleRealInfo> list = vehLinkedMap.get(sch.getClZbh()); 200 + //LinkedList<ScheduleRealInfo> list = vehLinkedMap.get(sch.getClZbh());
188 //状态修改为已执行 201 //状态修改为已执行
189 sch.setStatus(2); 202 sch.setStatus(2);
190 persistentList.add(sch); 203 persistentList.add(sch);
191 204
192 - ScheduleRealInfo temp; 205 + //下一个班次
  206 + ScheduleRealInfo next = getNext(sch);
  207 + next.setQdzArrDateSJ(sch.getZdsjActual());
  208 + /*ScheduleRealInfo temp;
193 int len = list.size(); 209 int len = list.size();
194 for(int i = 0; i < len; i ++){ 210 for(int i = 0; i < len; i ++){
195 temp = list.poll(); 211 temp = list.poll();
@@ -199,8 +215,41 @@ public class ScheduleBuffer { @@ -199,8 +215,41 @@ public class ScheduleBuffer {
199 break; 215 break;
200 } 216 }
201 } 217 }
202 - ScheduleRealInfo next = list.getFirst();  
203 - next.setQdzArrDateSJ(sch.getZdsjActual()); 218 + ScheduleRealInfo next = list.getFirst();*/
  219 + //next.setQdzArrDateSJ(sch.getZdsjActual());
  220 + return next;
  221 + }
  222 +
  223 + public static ScheduleRealInfo getNext(ScheduleRealInfo sch){
  224 + List<ScheduleRealInfo> list = vehSchListMap.get(sch.getClZbh());
  225 +
  226 + boolean flag = false;
  227 + ScheduleRealInfo next = null;
  228 + for(ScheduleRealInfo temp : list){
  229 + if(temp.getId() == sch.getId()){
  230 + flag = true;
  231 + continue;
  232 + }
  233 + //忽略烂班
  234 + if(temp.getStatus() == -1)
  235 + continue;
  236 +
  237 + if(flag){
  238 + next = temp;
  239 + break;
  240 + }
  241 + }
  242 +
  243 +
  244 + /*int size = list.size();
  245 + for(int i = 0; i < size; i ++){
  246 + current = list.get(i);
  247 + if(current.getId() == sch.getId()
  248 + && i < (size - 1)){
  249 + next = list.get(i + 1);
  250 + break;
  251 + }
  252 + }*/
204 return next; 253 return next;
205 } 254 }
206 255
@@ -212,7 +261,56 @@ public class ScheduleBuffer { @@ -212,7 +261,56 @@ public class ScheduleBuffer {
212 * @throws 261 * @throws
213 */ 262 */
214 public static int getFinishSchNo(String nbbm){ 263 public static int getFinishSchNo(String nbbm){
215 - return finishLinkedMap.get(nbbm) == null ? 0 : finishLinkedMap.get(nbbm).size(); 264 + List<ScheduleRealInfo> list = vehSchListMap.get(nbbm);
  265 + int no = 0;
  266 + for(ScheduleRealInfo sch : list){
  267 + if(sch.getStatus() == 2)
  268 + no ++;
  269 + }
  270 + return no;
  271 + //return finishLinkedMap.get(nbbm) == null ? 0 : finishLinkedMap.get(nbbm).size();
  272 + }
  273 +
  274 + /**
  275 + *
  276 + * @Title: findCurrent
  277 + * @Description: TODO(获取车辆当前正在执行的班次)
  278 + * @param @param nbbm
  279 + * @throws
  280 + */
  281 + public static ScheduleRealInfo findCurrent(String nbbm){
  282 + List<ScheduleRealInfo> list = ScheduleBuffer.vehSchListMap.get(nbbm);
  283 +
  284 + int size = list.size();
  285 + ScheduleRealInfo sch;
  286 + //最后一个状态为 正在执行的班次
  287 + for(int i = size - 1; i > 0; i --){
  288 + sch = list.get(i);
  289 + if(sch.getStatus() == 1)
  290 + return sch;
  291 + }
  292 + return null;
  293 + }
  294 +
  295 + /**
  296 + *
  297 + * @Title: findNextList
  298 + * @Description: TODO(获取后续班次)
  299 + * @param @param sch
  300 + * @throws
  301 + */
  302 + public static List<ScheduleRealInfo> findNextList(ScheduleRealInfo sch){
  303 + List<ScheduleRealInfo> list = vehSchListMap.get(sch.getClZbh()),
  304 + rs = null;
  305 +
  306 + for(ScheduleRealInfo temp : list){
  307 + if(temp.getId() == sch.getId())
  308 + rs = new ArrayList<>();
  309 +
  310 + if(rs != null)
  311 + rs.add(temp);
  312 + }
  313 + return rs == null?new ArrayList<ScheduleRealInfo>():rs;
216 } 314 }
217 315
218 public static void calcArrDateQd(List<ScheduleRealInfo> list){ 316 public static void calcArrDateQd(List<ScheduleRealInfo> list){
@@ -256,4 +354,16 @@ public class ScheduleBuffer { @@ -256,4 +354,16 @@ public class ScheduleBuffer {
256 public static ScheduleRealInfo findOne(Long id){ 354 public static ScheduleRealInfo findOne(Long id){
257 return pkSchedulMap.get(id); 355 return pkSchedulMap.get(id);
258 } 356 }
  357 +
  358 + public static List<ScheduleRealInfo> findByLineAndUpDown(Integer lineCode, Integer upDown){
  359 + List<ScheduleRealInfo> list = schedulListMap.get(String.valueOf(lineCode))
  360 + ,subList = new ArrayList<>();
  361 + //按走向过滤
  362 + for(ScheduleRealInfo sch : list){
  363 + if(Integer.parseInt(sch.getXlDir()) == upDown){
  364 + subList.add(sch);
  365 + }
  366 + }
  367 + return subList;
  368 + }
259 } 369 }
src/main/java/com/bsth/service/realcontrol/impl/ChildTaskPlanServiceImpl.java
@@ -12,6 +12,7 @@ import com.bsth.vehicle.common.CommonMapped; @@ -12,6 +12,7 @@ import com.bsth.vehicle.common.CommonMapped;
12 @Service 12 @Service
13 public class ChildTaskPlanServiceImpl extends BaseServiceImpl<ChildTaskPlan, Long> implements ChildTaskPlanService{ 13 public class ChildTaskPlanServiceImpl extends BaseServiceImpl<ChildTaskPlan, Long> implements ChildTaskPlanService{
14 14
  15 +
15 @Override 16 @Override
16 public Map<String, Object> save(ChildTaskPlan t) { 17 public Map<String, Object> save(ChildTaskPlan t) {
17 //保存起终点名称 18 //保存起终点名称
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
@@ -19,6 +19,8 @@ import org.slf4j.LoggerFactory; @@ -19,6 +19,8 @@ import org.slf4j.LoggerFactory;
19 import org.springframework.beans.factory.annotation.Autowired; 19 import org.springframework.beans.factory.annotation.Autowired;
20 import org.springframework.stereotype.Service; 20 import org.springframework.stereotype.Service;
21 21
  22 +import com.alibaba.fastjson.JSONArray;
  23 +import com.alibaba.fastjson.JSONObject;
22 import com.bsth.common.ResponseCode; 24 import com.bsth.common.ResponseCode;
23 import com.bsth.entity.Cars; 25 import com.bsth.entity.Cars;
24 import com.bsth.entity.Line; 26 import com.bsth.entity.Line;
@@ -121,6 +123,10 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -121,6 +123,10 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
121 ScheduleRealInfo schedule = null; 123 ScheduleRealInfo schedule = null;
122 for (String id : idList) { 124 for (String id : idList) {
123 schedule = ScheduleBuffer.pkSchedulMap.get(Long.parseLong(id)); 125 schedule = ScheduleBuffer.pkSchedulMap.get(Long.parseLong(id));
  126 + /*if(schedule.getStatus() == -1){
  127 + map.put("status", ResponseCode.ERROR);
  128 + map.put("msg", value)
  129 + }*/
124 if (null != schedule) { 130 if (null != schedule) {
125 schedule.setStatus(-1); 131 schedule.setStatus(-1);
126 schedule.addRemarks(remarks); 132 schedule.addRemarks(remarks);
@@ -264,7 +270,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -264,7 +270,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
264 // 加入缓存 270 // 加入缓存
265 ScheduleBuffer.put(t); 271 ScheduleBuffer.put(t);
266 //将该临加之后的班次作为更新返回页面 272 //将该临加之后的班次作为更新返回页面
267 - List<ScheduleRealInfo> list = ScheduleBuffer.vehLinkedMap.get(t.getClZbh()) 273 + List<ScheduleRealInfo> list = ScheduleBuffer.findNextList(t)
268 ,rsList = null; 274 ,rsList = null;
269 275
270 for(ScheduleRealInfo sch : list){ 276 for(ScheduleRealInfo sch : list){
@@ -492,8 +498,8 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -492,8 +498,8 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
492 rs.put("msg", "无实发时间,无法撤销!"); 498 rs.put("msg", "无实发时间,无法撤销!");
493 } else { 499 } else {
494 sch.setStatus(0); 500 sch.setStatus(0);
495 - sch.setFcsjActual("");  
496 - sch.setFcsjActualTime(0L); 501 + sch.setFcsjActual(null);
  502 + sch.setFcsjActualTime(null);
497 rs.put("status", ResponseCode.SUCCESS); 503 rs.put("status", ResponseCode.SUCCESS);
498 rs.put("t", sch); 504 rs.put("t", sch);
499 505
@@ -564,10 +570,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -564,10 +570,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
564 String fcsj = map.get("fcsj"); 570 String fcsj = map.get("fcsj");
565 //实际发车时间 571 //实际发车时间
566 String fcsjActual = map.get("fcsjActual"); 572 String fcsjActual = map.get("fcsjActual");
567 - //驾驶员  
568 - String[] jsy = map.get("jsy").split("/");  
569 - //售票员  
570 - String[] spy = map.get("spy").split("/"); 573 +
571 //实际终点时间 574 //实际终点时间
572 String zdsjActual = map.get("zdsjActual"); 575 String zdsjActual = map.get("zdsjActual");
573 //备注 576 //备注
@@ -575,27 +578,47 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -575,27 +578,47 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
575 578
576 ScheduleRealInfo sch = ScheduleBuffer.findOne(id); 579 ScheduleRealInfo sch = ScheduleBuffer.findOne(id);
577 if(null != sch){ 580 if(null != sch){
  581 + //驾驶员
  582 + if(StringUtils.isNotBlank(map.get("jsy"))){
  583 + String[] jsy = map.get("jsy").split("/");
  584 + sch.setjGh(jsy[0]);
  585 + sch.setjName(jsy[1]);
  586 + }
  587 +
  588 + //售票员
  589 + if(StringUtils.isNotBlank(map.get("spy"))){
  590 + String[] spy = map.get("spy").split("/");
  591 + sch.setsGh(spy[0]);
  592 + sch.setsName(spy[1]);
  593 + }
  594 +
578 sch.setBcType(bcType); 595 sch.setBcType(bcType);
579 sch.setClZbh(clZbh); 596 sch.setClZbh(clZbh);
580 sch.setFcsjAll(fcsj); 597 sch.setFcsjAll(fcsj);
581 - if(null == fcsjActual){ 598 + if(StringUtils.isNotBlank(fcsjActual)){
  599 + //调整实发
  600 + sch.setFcsjActualAll(fcsjActual);
  601 + sch.setStatus(1);
  602 + }
  603 + else{
582 sch.setFcsjActual(null); 604 sch.setFcsjActual(null);
583 sch.setFcsjActualTime(null); 605 sch.setFcsjActualTime(null);
584 } 606 }
585 - else  
586 - sch.setFcsjActualAll(fcsjActual);  
587 607
588 - if(null == zdsjActual){ 608 + if(StringUtils.isNotBlank(zdsjActual)){
  609 + //调整实达
  610 + sch.setZdsjActualAll(zdsjActual);
  611 + sch.setStatus(2);
  612 + //下一班次起点到达
  613 + ScheduleRealInfo next = ScheduleBuffer.getNext(sch);
  614 + next.setQdzArrDateSJ(zdsjActual);
  615 + rs.put("nextSch", next);
  616 + }
  617 + else{
589 sch.setZdsjActual(null); 618 sch.setZdsjActual(null);
590 sch.setZdsjActualTime(null); 619 sch.setZdsjActualTime(null);
591 } 620 }
592 - else  
593 - sch.setZdsjActualAll(zdsjActual);  
594 621
595 - sch.setjGh(jsy[0]);  
596 - sch.setjName(jsy[1]);  
597 - sch.setsGh(spy[0]);  
598 - sch.setsName(spy[1]);  
599 sch.setRemarks(remarks); 622 sch.setRemarks(remarks);
600 } 623 }
601 624
@@ -609,4 +632,32 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -609,4 +632,32 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
609 } 632 }
610 return rs; 633 return rs;
611 } 634 }
  635 +
  636 + @Override
  637 + public Map<String, Object> outgoAdjustAll(String params) {
  638 + Map<String, Object> rs = new HashMap<>();
  639 + try{
  640 + JSONArray jsonArray = JSONArray.parseArray(params);
  641 +
  642 + ScheduleRealInfo schedule = null;
  643 + JSONObject jsonObj;
  644 + String dfsj;
  645 + for(int i = 0; i < jsonArray.size(); i ++){
  646 + jsonObj = jsonArray.getJSONObject(i);
  647 + dfsj = jsonObj.getString("t");
  648 + schedule = ScheduleBuffer.findOne(jsonObj.getLong("id"));
  649 + //设置待发时间
  650 + schedule.setDfsjAll(dfsj);
  651 + ScheduleBuffer.persistentList.add(schedule);
  652 + }
  653 +
  654 + rs.put("status", ResponseCode.SUCCESS);
  655 + //将更新的最后一个班次返回
  656 + rs.put("t", schedule);
  657 + }catch(Exception e){
  658 + logger.error("", e);
  659 + rs.put("status", ResponseCode.ERROR);
  660 + }
  661 + return rs;
  662 + }
612 } 663 }
src/main/java/com/bsth/vehicle/directive/buffer/DirectiveBuffer.java
1 package com.bsth.vehicle.directive.buffer; 1 package com.bsth.vehicle.directive.buffer;
2 2
  3 +import java.util.ArrayList;
3 import java.util.HashMap; 4 import java.util.HashMap;
  5 +import java.util.Iterator;
4 import java.util.LinkedList; 6 import java.util.LinkedList;
  7 +import java.util.List;
5 import java.util.Map; 8 import java.util.Map;
6 9
7 import org.slf4j.Logger; 10 import org.slf4j.Logger;
@@ -19,6 +22,7 @@ import com.bsth.vehicle.directive.entity.Directive80; @@ -19,6 +22,7 @@ import com.bsth.vehicle.directive.entity.Directive80;
19 import com.bsth.vehicle.directive.entity.DirectiveC0; 22 import com.bsth.vehicle.directive.entity.DirectiveC0;
20 import com.bsth.vehicle.directive.entity.DirectiveC0.DirectiveC0Data; 23 import com.bsth.vehicle.directive.entity.DirectiveC0.DirectiveC0Data;
21 import com.bsth.vehicle.directive.entity.LineChange; 24 import com.bsth.vehicle.directive.entity.LineChange;
  25 +import com.bsth.vehicle.directive.repository.Directive60Repository;
22 import com.bsth.vehicle.directive.repository.Directive80Repository; 26 import com.bsth.vehicle.directive.repository.Directive80Repository;
23 import com.bsth.vehicle.directive.repository.LineChangeRepository; 27 import com.bsth.vehicle.directive.repository.LineChangeRepository;
24 import com.bsth.vehicle.directive.util.HttpUtils; 28 import com.bsth.vehicle.directive.util.HttpUtils;
@@ -61,6 +65,9 @@ public class DirectiveBuffer { @@ -61,6 +65,9 @@ public class DirectiveBuffer {
61 */ 65 */
62 private static Map<Integer, Directive60> directiveMap; 66 private static Map<Integer, Directive60> directiveMap;
63 67
  68 + @Autowired
  69 + Directive60Repository d60Repository;
  70 +
64 /** 71 /**
65 * 驾驶员上报数据 72 * 驾驶员上报数据
66 * {K: 线路编码} 73 * {K: 线路编码}
@@ -71,10 +78,7 @@ public class DirectiveBuffer { @@ -71,10 +78,7 @@ public class DirectiveBuffer {
71 RealControlSocketHandler socketHandler; 78 RealControlSocketHandler socketHandler;
72 79
73 static{ 80 static{
74 - transientList = new LinkedList<>();  
75 - directiveMap = new HashMap<>();  
76 - reportMultiMap = ArrayListMultimap.create();  
77 - changeMap = new HashMap<>(); 81 + clear();
78 } 82 }
79 83
80 public static void put(Directive60 directive){ 84 public static void put(Directive60 directive){
@@ -205,4 +209,34 @@ public class DirectiveBuffer { @@ -205,4 +209,34 @@ public class DirectiveBuffer {
205 c0.setData(data); 209 c0.setData(data);
206 return c0; 210 return c0;
207 } 211 }
  212 +
  213 + /**
  214 + *
  215 + * @Title: saveAll
  216 + * @Description: TODO(所有缓存里的指令全部入库)
  217 + */
  218 + public void saveAll(){
  219 + Iterator<Directive60> iterator = directiveMap.values().iterator();
  220 + List<Directive60> pList = new ArrayList<>();
  221 + Directive60 d60;
  222 + while(iterator.hasNext()){
  223 + d60 = iterator.next();
  224 + if(!d60.isPersistent())
  225 + pList.add(d60);
  226 + }
  227 + d60Repository.save(pList);
  228 + }
  229 +
  230 + /**
  231 + *
  232 + * @Title: clear
  233 + * @Description: TODO(清理缓存)
  234 + * @throws
  235 + */
  236 + public static void clear(){
  237 + transientList = new LinkedList<>();
  238 + directiveMap = new HashMap<>();
  239 + reportMultiMap = ArrayListMultimap.create();
  240 + changeMap = new HashMap<>();
  241 + }
208 } 242 }
src/main/java/com/bsth/vehicle/directive/entity/Directive60.java
@@ -84,6 +84,9 @@ public class Directive60 { @@ -84,6 +84,9 @@ public class Directive60 {
84 @ManyToOne 84 @ManyToOne
85 private SysUser sender; 85 private SysUser sender;
86 86
  87 + @Transient
  88 + private boolean persistent;
  89 +
87 @Embeddable 90 @Embeddable
88 public static class DirectiveData { 91 public static class DirectiveData {
89 // 公司代码 92 // 公司代码
@@ -280,4 +283,12 @@ public class Directive60 { @@ -280,4 +283,12 @@ public class Directive60 {
280 public void setSender(SysUser sender) { 283 public void setSender(SysUser sender) {
281 this.sender = sender; 284 this.sender = sender;
282 } 285 }
  286 +
  287 + public boolean isPersistent() {
  288 + return persistent;
  289 + }
  290 +
  291 + public void setPersistent(boolean persistent) {
  292 + this.persistent = persistent;
  293 + }
283 } 294 }
src/main/java/com/bsth/vehicle/directive/thread/DirectivePersistenceThread.java
@@ -38,6 +38,7 @@ public class DirectivePersistenceThread extends Thread{ @@ -38,6 +38,7 @@ public class DirectivePersistenceThread extends Thread{
38 if(null == directive) 38 if(null == directive)
39 break; 39 break;
40 40
  41 + directive.setPersistent(true);
41 directiveRepository.save(directive); 42 directiveRepository.save(directive);
42 } 43 }
43 } 44 }
src/main/java/com/bsth/vehicle/directive/thread/FirstScheduleIssuedThread.java
1 package com.bsth.vehicle.directive.thread; 1 package com.bsth.vehicle.directive.thread;
2 2
3 import java.util.LinkedList; 3 import java.util.LinkedList;
  4 +import java.util.List;
4 import java.util.Set; 5 import java.util.Set;
5 6
6 import org.springframework.beans.factory.annotation.Autowired; 7 import org.springframework.beans.factory.annotation.Autowired;
@@ -27,7 +28,25 @@ public class FirstScheduleIssuedThread extends Thread{ @@ -27,7 +28,25 @@ public class FirstScheduleIssuedThread extends Thread{
27 @Override 28 @Override
28 public void run() { 29 public void run() {
29 30
30 - Set<String> keys = ScheduleBuffer.vehLinkedMap.keySet(); 31 + Set<String> keys = ScheduleBuffer.vehSchListMap.keySet();
  32 + List<ScheduleRealInfo> list;
  33 +
  34 + Long t = System.currentTimeMillis();
  35 + ScheduleRealInfo sch;
  36 + for(String nbbm : keys){
  37 + list = ScheduleBuffer.vehSchListMap.get(nbbm);
  38 +
  39 + if(list.size() == 0)
  40 + continue;
  41 +
  42 + sch = list.get(0);
  43 +
  44 + if(sch.getStatus() == 0 && sch.getFcsjT() > t){
  45 + directiveService.send60Dispatch(sch, 0);
  46 + }
  47 + }
  48 +
  49 + /*Set<String> keys = ScheduleBuffer.vehLinkedMap.keySet();
31 LinkedList<ScheduleRealInfo> linkedList; 50 LinkedList<ScheduleRealInfo> linkedList;
32 ScheduleRealInfo sch; 51 ScheduleRealInfo sch;
33 for(String nbbm : keys){ 52 for(String nbbm : keys){
@@ -39,6 +58,6 @@ public class FirstScheduleIssuedThread extends Thread{ @@ -39,6 +58,6 @@ public class FirstScheduleIssuedThread extends Thread{
39 if(!ScheduleBuffer.finishLinkedMap.containsKey(nbbm) 58 if(!ScheduleBuffer.finishLinkedMap.containsKey(nbbm)
40 && sch.getFcsjActual() == null) 59 && sch.getFcsjActual() == null)
41 directiveService.send60Dispatch(sch, 0); 60 directiveService.send60Dispatch(sch, 0);
42 - } 61 + }*/
43 } 62 }
44 } 63 }
src/main/java/com/bsth/vehicle/gpsdata/GpsArrivalStationThread.java
@@ -9,7 +9,6 @@ import java.util.ArrayList; @@ -9,7 +9,6 @@ import java.util.ArrayList;
9 import java.util.Calendar; 9 import java.util.Calendar;
10 import java.util.Date; 10 import java.util.Date;
11 import java.util.HashSet; 11 import java.util.HashSet;
12 -import java.util.LinkedList;  
13 import java.util.List; 12 import java.util.List;
14 import java.util.Set; 13 import java.util.Set;
15 14
@@ -68,18 +67,18 @@ public class GpsArrivalStationThread extends Thread{ @@ -68,18 +67,18 @@ public class GpsArrivalStationThread extends Thread{
68 set.add(CommonMapped.vehicDeviceBiMap.get(arr.getDeviceId())); 67 set.add(CommonMapped.vehicDeviceBiMap.get(arr.getDeviceId()));
69 68
70 List<ArrivalInfo> rsList = null; 69 List<ArrivalInfo> rsList = null;
71 - LinkedList<ScheduleRealInfo> linked = null; 70 + List<ScheduleRealInfo> subList = null;
72 ArrivalInfo[] status; 71 ArrivalInfo[] status;
73 for(String nbbm : set){ 72 for(String nbbm : set){
74 rsList = GpsArrivalDataBuffer.pops(nbbm); 73 rsList = GpsArrivalDataBuffer.pops(nbbm);
75 - //和该车辆未执行班次进行匹配  
76 - linked = ScheduleBuffer.vehLinkedMap.get(nbbm); 74 + //和该车辆班次进行匹配
  75 + subList = ScheduleBuffer.vehSchListMap.get(nbbm);
77 76
78 - if(null == linked || linked.size() == 0) 77 + if(null == subList || subList.size() == 0)
79 continue; 78 continue;
80 79
81 try{ 80 try{
82 - for(ScheduleRealInfo schedule : linked){ 81 + for(ScheduleRealInfo schedule : subList){
83 //匹配结果 82 //匹配结果
84 status = match(rsList, schedule); 83 status = match(rsList, schedule);
85 84
src/main/java/com/bsth/vehicle/gpsdata/GpsArrivalStationThread_old.java
@@ -64,7 +64,7 @@ public class GpsArrivalStationThread_old extends Thread{ @@ -64,7 +64,7 @@ public class GpsArrivalStationThread_old extends Thread{
64 System.out.println("开始..."); 64 System.out.println("开始...");
65 List<ScheduleRealInfo> schList; 65 List<ScheduleRealInfo> schList;
66 for(String key : keySet){ 66 for(String key : keySet){
67 - schList = extractSched(ScheduleBuffer.vehLinkedMap.get(key)); 67 + schList = extractSched(ScheduleBuffer.vehSchListMap.get(key));
68 if(null != schList) 68 if(null != schList)
69 match(GpsArrivalDataBuffer.allMap.get(key), schList); 69 match(GpsArrivalDataBuffer.allMap.get(key), schList);
70 } 70 }
@@ -221,8 +221,8 @@ public class GpsArrivalStationThread_old extends Thread{ @@ -221,8 +221,8 @@ public class GpsArrivalStationThread_old extends Thread{
221 try { 221 try {
222 conn = DBUtils_MS.getConnection(); 222 conn = DBUtils_MS.getConnection();
223 ps = conn.prepareStatement(sql); 223 ps = conn.prepareStatement(sql);
224 - ps.setInt(1, /*weeks_year*/28);  
225 - ps.setLong(2, /*GpsArrivalDataBuffer.markTime*/1467853749000L); 224 + ps.setInt(1, weeks_year);
  225 + ps.setLong(2, GpsArrivalDataBuffer.markTime);
226 226
227 Long t = System.currentTimeMillis(); 227 Long t = System.currentTimeMillis();
228 rs = ps.executeQuery(); 228 rs = ps.executeQuery();
src/main/java/com/bsth/vehicle/gpsdata/buffer/GpsRealDataBuffer.java
@@ -3,7 +3,6 @@ package com.bsth.vehicle.gpsdata.buffer; @@ -3,7 +3,6 @@ package com.bsth.vehicle.gpsdata.buffer;
3 import java.util.ArrayList; 3 import java.util.ArrayList;
4 import java.util.HashMap; 4 import java.util.HashMap;
5 import java.util.Iterator; 5 import java.util.Iterator;
6 -import java.util.LinkedList;  
7 import java.util.List; 6 import java.util.List;
8 import java.util.Map; 7 import java.util.Map;
9 import java.util.Set; 8 import java.util.Set;
@@ -136,15 +135,27 @@ public class GpsRealDataBuffer { @@ -136,15 +135,27 @@ public class GpsRealDataBuffer {
136 135
137 //写入车辆自编号 136 //写入车辆自编号
138 String nbbm; 137 String nbbm;
139 - LinkedList<ScheduleRealInfo> linkedList;  
140 - int size; 138 + ScheduleRealInfo current, next;
141 for(GpsRealData gpsData : list){ 139 for(GpsRealData gpsData : list){
142 nbbm = CommonMapped.vehicDeviceBiMap.get(gpsData.getDeviceId()); 140 nbbm = CommonMapped.vehicDeviceBiMap.get(gpsData.getDeviceId());
143 if(null != nbbm){ 141 if(null != nbbm){
144 gpsData.setNbbm(nbbm); 142 gpsData.setNbbm(nbbm);
145 gpsData.setStationName(CommonMapped.stationCodeMap.get(gpsData.getStopNo())); 143 gpsData.setStationName(CommonMapped.stationCodeMap.get(gpsData.getStopNo()));
146 144
147 - linkedList = ScheduleBuffer.vehLinkedMap.get(nbbm); 145 + current = ScheduleBuffer.findCurrent(nbbm);
  146 + next = ScheduleBuffer.getNext(current);
  147 +
  148 + if(current != null)
  149 + gpsData.setCurrSchId(current.getId());
  150 + if(next != null)
  151 + gpsData.setNextSchId(next.getId());
  152 + //gpsData.setCurrSchId(ScheduleBuffer.findCurrent(nbbm));
  153 + /*subList = ScheduleBuffer.vehSchListMap.get(nbbm);
  154 + if(subList.size() == 0)
  155 + continue;*/
  156 +
  157 +
  158 + /*linkedList = ScheduleBuffer.vehLinkedMap.get(nbbm);
148 if(null != linkedList){ 159 if(null != linkedList){
149 //为GPS点附加班次信息 160 //为GPS点附加班次信息
150 size = linkedList.size(); 161 size = linkedList.size();
@@ -152,7 +163,7 @@ public class GpsRealDataBuffer { @@ -152,7 +163,7 @@ public class GpsRealDataBuffer {
152 gpsData.setCurrSchId(linkedList.peekFirst().getId()); 163 gpsData.setCurrSchId(linkedList.peekFirst().getId());
153 if(size > 1) 164 if(size > 1)
154 gpsData.setNextSchId(linkedList.get(1).getId()); 165 gpsData.setNextSchId(linkedList.get(1).getId());
155 - } 166 + }*/
156 resList.add(gpsData); 167 resList.add(gpsData);
157 } 168 }
158 } 169 }
src/main/resources/application-dev.properties
@@ -26,6 +26,6 @@ spring.datasource.validation-query=select 1 @@ -26,6 +26,6 @@ spring.datasource.validation-query=select 1
26 ## 26 ##
27 #222.66.0.204:5555 27 #222.66.0.204:5555
28 ##\u5B9E\u65F6gps 28 ##\u5B9E\u65F6gps
29 -http.gps.real.url= http://192.168.168.192:8080/transport_server/rtgps/ 29 +http.gps.real.url= http://192.168.168.171:8080/transport_server/rtgps/
30 ##\u6D88\u606F\u4E0B\u53D1 30 ##\u6D88\u606F\u4E0B\u53D1
31 -http.send.directive = http://192.168.168.192:8080/transport_server/message/ 31 +http.send.directive = http://192.168.168.171:8080/transport_server/message/
src/main/resources/application.properties
1 spring.profiles: dev,prod 1 spring.profiles: dev,prod
2 -spring.profiles.active: prod 2 +spring.profiles.active: dev
3 3
4 spring.view.suffix=.html 4 spring.view.suffix=.html
5 server.session-timeout=-1 5 server.session-timeout=-1
src/main/resources/fatso/start.js
@@ -37,8 +37,9 @@ fs.mkdir(dest, function(e){ @@ -37,8 +37,9 @@ fs.mkdir(dest, function(e){
37 var cProcess; 37 var cProcess;
38 38
39 ep.tail('mvn-clean',function(){ 39 ep.tail('mvn-clean',function(){
  40 + ep.emit('copy-project');
40 //清理target 41 //清理target
41 - logInfo('mvn clean...'); 42 + /*logInfo('mvn clean...');
42 cProcess = child_process.exec("mvn clean",{cwd: workspace + '\\' + pName},function(error){ 43 cProcess = child_process.exec("mvn clean",{cwd: workspace + '\\' + pName},function(error){
43 if(error) 44 if(error)
44 logError(error); 45 logError(error);
@@ -46,7 +47,7 @@ ep.tail(&#39;mvn-clean&#39;,function(){ @@ -46,7 +47,7 @@ ep.tail(&#39;mvn-clean&#39;,function(){
46 logSuccess('mvn clean success'); 47 logSuccess('mvn clean success');
47 48
48 ep.emit('copy-project'); 49 ep.emit('copy-project');
49 - }); 50 + });*/
50 output(cProcess); 51 output(cProcess);
51 }); 52 });
52 53
src/main/resources/ms-jdbc.properties
1 ms.mysql.driver= com.mysql.jdbc.Driver 1 ms.mysql.driver= com.mysql.jdbc.Driver
2 -ms.mysql.url= jdbc:mysql://192.168.168.192:3306/ms?useUnicode=true&characterEncoding=utf-8 2 +ms.mysql.url= jdbc:mysql://192.168.168.171:3306/ms?useUnicode=true&characterEncoding=utf-8
3 ms.mysql.username= root 3 ms.mysql.username= root
4 ms.mysql.password= root2jsp 4 ms.mysql.password= root2jsp
5 \ No newline at end of file 5 \ No newline at end of file
src/main/resources/static/pages/control/line/child_pages/child_task.html
@@ -189,7 +189,7 @@ $(function(){ @@ -189,7 +189,7 @@ $(function(){
189 189
190 //显示班次详细 190 //显示班次详细
191 $.each(this.cells, function(i,cell){ 191 $.each(this.cells, function(i,cell){
192 - $('#mainDetailPabel input[data-cell='+i+']').val($(cell).text()); 192 + $('#mainDetailPabel input[data-cell='+i+']').val($.trim($(cell).text()));
193 }); 193 });
194 if(!changeHandlerPanel(this)) 194 if(!changeHandlerPanel(this))
195 return; 195 return;
@@ -284,7 +284,7 @@ $(function(){ @@ -284,7 +284,7 @@ $(function(){
284 var cont = $('.custom-table-panel'); 284 var cont = $('.custom-table-panel');
285 cont.animate({ 285 cont.animate({
286 scrollTop: $tr.offset().top - cont.offset().top + $tr.scrollTop() - 36 * 4 286 scrollTop: $tr.offset().top - cont.offset().top + $tr.scrollTop() - 36 * 4
287 - }, 500); 287 + }, 500);
288 288
289 }, 100); 289 }, 100);
290 }); 290 });
@@ -381,6 +381,18 @@ $(function(){ @@ -381,6 +381,18 @@ $(function(){
381 $(this).show(); 381 $(this).show();
382 $('input.no', schAddPanel).val($(tr.cells[0]).text()); 382 $('input.no', schAddPanel).val($(tr.cells[0]).text());
383 $('select[name=xlDir]', schAddPanel).trigger('change'); 383 $('select[name=xlDir]', schAddPanel).trigger('change');
  384 + //当前表格第一条数据 data-type="empty"
  385 + var $tr = $('.mainTable tr[data-id]', '#childTaskDiv').eq(0);
  386 + if($tr.length > 0){
  387 + var sch = _data.getSchedulById($tr.data('id'));
  388 + console.log(sch);
  389 + //默认车辆
  390 + $('select[name=clZbh]', schAddPanel).val(sch.clZbh).trigger('change');
  391 + //默认驾驶员
  392 + $('select[name=jGh]', schAddPanel).val(sch.jGh + '/' + sch.jName).trigger('change');
  393 + //默认售票员
  394 + $('select[name=sGh]', schAddPanel).val(sch.sGh + '/' + sch.sName).trigger('change');
  395 + }
384 }); 396 });
385 //切换上下行 397 //切换上下行
386 $(schAddPanel).on('change', 'select[name=xlDir]', function(){ 398 $(schAddPanel).on('change', 'select[name=xlDir]', function(){
@@ -433,9 +445,12 @@ $(function(){ @@ -433,9 +445,12 @@ $(function(){
433 //拆分驾驶员工号和姓名 445 //拆分驾驶员工号和姓名
434 param.jName = param.jGh.split('/')[1]; 446 param.jName = param.jGh.split('/')[1];
435 param.jGh = param.jGh.split('/')[0]; 447 param.jGh = param.jGh.split('/')[0];
436 - //拆分售票员工号和姓名  
437 - param.sName = param.sGh.split('/')[1];  
438 - param.sGh = param.sGh.split('/')[0]; 448 +
  449 + if(param.sGh != null){
  450 + //拆分售票员工号和姓名
  451 + param.sName = param.sGh.split('/')[1];
  452 + param.sGh = param.sGh.split('/')[0];
  453 + }
439 //附加起终点名称 454 //附加起终点名称
440 var route = stationRoute[param.xlDir]; 455 var route = stationRoute[param.xlDir];
441 param.qdzName = searchStationName(route, param.qdzCode); 456 param.qdzName = searchStationName(route, param.qdzCode);
@@ -445,10 +460,14 @@ $(function(){ @@ -445,10 +460,14 @@ $(function(){
445 $post('/realSchedule', param, function(rs){ 460 $post('/realSchedule', param, function(rs){
446 var sch = rs.t; 461 var sch = rs.t;
447 //前端缓存更新 462 //前端缓存更新
448 - scheduleLineMap[param.xlBm][param.lpName].push(sch); 463 + //scheduleLineMap[param.xlBm][param.lpName].push(sch);
  464 + /* var ups = rs.ups;
  465 + for(var i in ups){
  466 + _data.updateSchedule(ups[i]);
  467 + } */
449 //刷新表格 468 //刷新表格
450 - _alone.addScheduleToTable(sch);  
451 - _alone.refreshScheduleArray(rs.ups); 469 + //_alone.updateTableBySch(sch);
  470 + _alone.update2Table(sch.xlBm, sch);
452 471
453 //关闭弹出层 472 //关闭弹出层
454 layer.closeAll(); 473 layer.closeAll();
src/main/resources/static/pages/control/line/child_pages/outgo_adjust_all.html 0 → 100644
  1 +<!-- 待发调整 -->
  2 +<div id="outgoAdjustAllPanel">
  3 + <form action="#" class="form-horizontal form-custom">
  4 + <div class="form-body">
  5 + <div class="form-custom-row">
  6 + <div class="item" style="margin-top: 0">
  7 + <div class="input-icon right">
  8 + <span class="item-label" style="width: 40px;">线路: </span>
  9 + <select name="line" class="form-control lineSelect">
  10 + </select>
  11 + </div>
  12 + </div>
  13 + &nbsp;&nbsp;
  14 + <div class="item" style="margin-top: 0">
  15 + <span class="item-label" style="width: 40px;">车辆: </span>
  16 + <select name="nbbm" class="form-control vehicSelect">
  17 + </select>
  18 + </div>
  19 + </div>
  20 +
  21 + <div class="form-custom-row">
  22 + <div class="item" style="min-width: calc(100% - 10px);">
  23 + <div class="custom-table-panel" style="display: inline-block;height: 420px;">
  24 + <div style="height: 36px; position: relative;">
  25 + <div class="custom-table-header">
  26 + <table class="table table-bordered table-advance sch-table">
  27 + <thead>
  28 + <tr>
  29 + <th width="12%">车辆</th>
  30 + <th width="7%">路牌</th>
  31 + <th width="10%">驾驶员</th>
  32 + <th width="18%">起点</th>
  33 + <th width="18%">终点</th>
  34 + <th width="13%">计发</th>
  35 + <th width="22%">待发</th>
  36 + </tr>
  37 + </thead>
  38 + </table>
  39 + </div>
  40 + </div>
  41 +
  42 + <div class="custom-table-body" >
  43 + <table class="table table-bordered table-hover table-advance sch-table" >
  44 + <tbody></tbody>
  45 + </table>
  46 + </div>
  47 + </div>
  48 + </div>
  49 + </div>
  50 +
  51 + <hr>
  52 + <div class="form-custom-footer" style="margin-top: 15px;">
  53 + <button type="button" class="btn blue-madison confirm">
  54 + <i class="fa fa-check"></i> &nbsp;&nbsp;确&nbsp;&nbsp;定
  55 + </button>
  56 + <button type="button" class="btn layui-layer-close">取消</button>
  57 + </div>
  58 + <br>
  59 + </div>
  60 + </form>
  61 +
  62 +<script id="outgo_adjust_all_item_temp" type="text/html">
  63 +{{each list as item i}}
  64 +<tr data-id={{item.id}}>
  65 + <td width="12%">
  66 + {{item.clZbh}}
  67 + {{if item.bcType == "out"}}
  68 + <span class="out-badge short"></span>
  69 + {{else if item.bcType == "in"}}
  70 + <span class="in-badge short"></span>
  71 + {{/if}}
  72 + </td>
  73 + <td width="7%">{{item.lpName}}</td>
  74 + <td width="10%">{{item.jName}}</td>
  75 + <td width="18%" title="{{item.qdzName}}">{{item.qdzName}}</td>
  76 + <td width="18%" title="{{item.zdzName}}">{{item.zdzName}}</td>
  77 + <td width="13%">{{item.fcsj}}</td>
  78 + <td width="22%"><input value="{{item.dfsj}}" data-old="{{item.dfsj}}" type="time" class="form-control df-input" style="width: 100%;"></td>
  79 +</tr>
  80 +{{/each}}
  81 +
  82 +{{if list.length == 0 }}
  83 +<tr>
  84 + <td style="font-size: 12px;text-align: center;" colspan=7>该车辆今日无班次信息</td>
  85 +</tr>
  86 +{{/if}}
  87 +</script>
  88 +
  89 +<script id="outgo_adjust_change_text_temp" type="text/html">
  90 +<h5>B-89524(闵行11路)</h5>
  91 +<hr>
  92 +<div class="change-confirm-text">
  93 +{{each list as item i}}
  94 +<div>
  95 + <span>{{item.old}}</span><i class="fa fa-long-arrow-right"></i><span>{{item.t}}</span>
  96 +</div>
  97 +{{/each}}
  98 +</div>
  99 +</script>
  100 +
  101 +<script type="text/javascript">
  102 +!function(){
  103 + //滚动时固定表头
  104 + $('.custom-table-panel').on('scroll', function(){
  105 + var top = $(this).scrollTop()
  106 + ,$header = $(this).find('.custom-table-header');
  107 + $header.css('top', top);
  108 + });
  109 +
  110 + var _data, _alone, lineCodeMaps;
  111 +
  112 + var lineSelect = $('#outgoAdjustAllPanel .lineSelect');
  113 + var vehicSelect = $('#outgoAdjustAllPanel .vehicSelect');
  114 +
  115 + var initStatus, schedul;
  116 + $('#outgoAdjustAllPanel').on('init', function(e, ops){
  117 + initStatus = true;
  118 + _data = ops._data;
  119 + _alone = ops._alone;
  120 + schedul = ops.selected;
  121 +
  122 + //线路下拉框
  123 + var data = [];
  124 + lineCodeMaps = _data.getLineIds();
  125 + for(var line in lineCodeMaps){
  126 + data.push({id: line, text: lineCodeMaps[line]});
  127 + }
  128 +
  129 + initPinYinSelect2(lineSelect, data, function(){
  130 + //默认选中线路
  131 + lineSelect.val(schedul.xlBm).trigger("change");
  132 +
  133 +
  134 + }).on('change', lineSelectChange);
  135 +
  136 +
  137 + //线路切换事件
  138 + function lineSelectChange(){
  139 + var lineCode = $(this).val();
  140 +
  141 + var index = layer.msg('加载中', {icon: 16});
  142 + //查询线路配车
  143 + $get('/cci/all', {'xl.lineCode_eq': lineCode}, function(rs){
  144 + var data = [];
  145 + $.each(rs, function(){
  146 + data.push({id: this.cl.carCode, text: this.cl.carCode})
  147 + });
  148 + vehicSelect.html('').select2({data: data});
  149 +
  150 + layer.close(index);
  151 +
  152 + //初始选中车辆
  153 + if(initStatus)
  154 + vehicSelect.val(schedul.clZbh);
  155 + //触发change
  156 + vehicSelect.trigger("change")
  157 + });
  158 + }
  159 +
  160 + //车辆切换事件
  161 + vehicSelect.on('change', function(){
  162 + //根据车辆获取班次信息
  163 + var schArray = _data.getSchedulByVeh($(this).val());
  164 +
  165 + var htmlStr = template('outgo_adjust_all_item_temp', {list: schArray});
  166 +
  167 + var table = '#outgoAdjustAllPanel .sch-table ';
  168 + $('tbody', table).html(htmlStr);
  169 +
  170 + //初始选中班次
  171 + if(initStatus){
  172 + var $tr = $('tr[data-id='+schedul.id+']', table);
  173 + $tr.addClass('anim-delay animated flash');
  174 + //滚动条
  175 + var cont = $('#outgoAdjustAllPanel .custom-table-panel');
  176 + cont.animate({
  177 + scrollTop: $tr.offset().top - cont.offset().top + $tr.scrollTop() - 36 * 4
  178 + }, 500);
  179 +
  180 + initStatus = false;
  181 + }
  182 + });
  183 +
  184 + //确定
  185 + $('.confirm', '#outgoAdjustAllPanel').on('click', function(){
  186 + var es = $('#outgoAdjustAllPanel .df-input'),old, t;
  187 + var changes = [];
  188 + for(var i = 0, e;e = es[i++];){
  189 + t = $(e).val(), old = $(e).data('old');
  190 + if(t == ''){
  191 + layer.alert('待发时间不能为空!', {icon: 2, title: '提交失败'});
  192 + $(e).addClass('custom-val-error');
  193 + return false;
  194 + }
  195 + $(e).removeClass('custom-val-error');
  196 +
  197 + if(old != t)
  198 + changes.push({old: old, t: t, id: $(e).parents('tr').data('id')});
  199 + }
  200 +
  201 + var text = template('outgo_adjust_change_text_temp', {list: changes});
  202 + layer.confirm(text, {
  203 + btn: ['确认调整','取消'],title:'待发调整确认'
  204 + }, function(){
  205 + $.ajax({
  206 + url: '/realSchedule/outgoAdjustAll',
  207 + type: 'post',
  208 + data: {params: JSON.stringify(changes)},
  209 + success:function(rs){
  210 + if(rs.status == 'SUCCESS' && rs.t){
  211 + layer.closeAll();
  212 + layer.msg('调整成功!', {icon: 1});
  213 + //刷新表格
  214 + _alone.update2Table(rs.t.xlBm);
  215 + }
  216 + },
  217 + error: errorHandle
  218 + });
  219 + });
  220 + });
  221 + });
  222 +
  223 +
  224 + function errorHandle(){
  225 + layer.alert('服务器出现异常!', {icon: 2, title: '操作失败'});
  226 + }
  227 +}();
  228 +</script>
  229 +</div>
0 \ No newline at end of file 230 \ No newline at end of file
src/main/resources/static/pages/control/line/css/lineControl.css
@@ -2009,7 +2009,8 @@ span.log-item-handle a { @@ -2009,7 +2009,8 @@ span.log-item-handle a {
2009 .log-item.fache { 2009 .log-item.fache {
2010 } 2010 }
2011 2011
2012 -.in-badge, .out-badge { 2012 +.in-badge, .out-badge,
  2013 +span.blue-badge {
2013 font-size: 13px; 2014 font-size: 13px;
2014 margin-left: 2px; 2015 margin-left: 2px;
2015 padding: 2px 4px; 2016 padding: 2px 4px;
@@ -2017,6 +2018,16 @@ span.log-item-handle a { @@ -2017,6 +2018,16 @@ span.log-item-handle a {
2017 display: inline-block; 2018 display: inline-block;
2018 } 2019 }
2019 2020
  2021 +span.blue-badge{
  2022 + background: #7cccaa;
  2023 + color: white;
  2024 +}
  2025 +
  2026 +tr._active .blue-badge{
  2027 + background: #ffffff;
  2028 + color: #3c973c;
  2029 +}
  2030 +
2020 .out-badge{ 2031 .out-badge{
2021 background: #59d8e3; 2032 background: #59d8e3;
2022 color: white; 2033 color: white;
@@ -2032,16 +2043,24 @@ span.log-item-handle a { @@ -2032,16 +2043,24 @@ span.log-item-handle a {
2032 } 2043 }
2033 2044
2034 .out-badge:BEFORE{ 2045 .out-badge:BEFORE{
2035 - content: '出场' 2046 + content: '出场';
  2047 +}
  2048 +
  2049 +.out-badge.short:BEFORE{
  2050 + content: '出';
  2051 +}
  2052 +
  2053 +.in-badge.short:BEFORE{
  2054 + content: '进';
2036 } 2055 }
2037 2056
2038 @media ( max-width : 1780px) { 2057 @media ( max-width : 1780px) {
2039 .in-badge:BEFORE{ 2058 .in-badge:BEFORE{
2040 - content: '进' 2059 + content: '进';
2041 } 2060 }
2042 2061
2043 .out-badge:BEFORE{ 2062 .out-badge:BEFORE{
2044 - content: '出' 2063 + content: '出';
2045 } 2064 }
2046 } 2065 }
2047 2066
@@ -2117,37 +2136,51 @@ span.log-item-handle a { @@ -2117,37 +2136,51 @@ span.log-item-handle a {
2117 color: white; 2136 color: white;
2118 } 2137 }
2119 2138
2120 -.tab_line .panel-wrap ._panel ._body .pb-table tr._tr_active.active-line-no a{  
2121 - color: #afafaf; 2139 +.tab_line .panel-wrap ._panel ._body .pb-table tr._tr_active.active-line-no a,
  2140 +.pb-table tr.selected.dir_0 a,
  2141 +.pb-table tr.selected.dir_1 a{
  2142 + color: #afafaf !important;
2122 } 2143 }
2123 2144
2124 .tab_line .pb-table tr._tr_active.active-line-no a.remarks-popover{ 2145 .tab_line .pb-table tr._tr_active.active-line-no a.remarks-popover{
2125 color: #bebebe; 2146 color: #bebebe;
2126 } 2147 }
2127 2148
2128 -.tab_line .pb-table tr._tr_active.active-line-no td.tl-qrlb{ 2149 +.tab_line .pb-table tr._tr_active.active-line-no td.tl-qrlb,
  2150 +.pb-table tr.selected.dir_0 td.tl-qrlb,
  2151 +.pb-table tr.selected.dir_1 td.tl-qrlb{
2129 background: none; 2152 background: none;
2130 color: #ff796a; 2153 color: #ff796a;
2131 } 2154 }
2132 -.tab_line .pb-table tr._tr_active.active-line-no td.tl-zzzx{ 2155 +.tab_line .pb-table tr._tr_active.active-line-no td.tl-zzzx,
  2156 +.pb-table tr.selected.dir_0 td.tl-zzzx,
  2157 +.pb-table tr.selected.dir_1 td.tl-zzzx{
2133 background: none; 2158 background: none;
2134 color: #5ae35a; 2159 color: #5ae35a;
2135 } 2160 }
2136 -.tab_line .pb-table tr._tr_active.active-line-no td.tl-yzx{ 2161 +.tab_line .pb-table tr._tr_active.active-line-no td.tl-yzx,
  2162 +.pb-table tr.selected.dir_0 td.tl-yzx,
  2163 +.pb-table tr.selected.dir_1 td.tl-yzx{
2137 background: none; 2164 background: none;
2138 color: #80c8fa; 2165 color: #80c8fa;
2139 } 2166 }
2140 -.tab_line .pb-table tr._tr_active.active-line-no td.tl-xxfc{ 2167 +.tab_line .pb-table tr._tr_active.active-line-no td.tl-xxfc,
  2168 +.pb-table tr.selected.dir_0 td.tl-xxfc,
  2169 +.pb-table tr.selected.dir_1 td.tl-xxfc{
2141 background: none; 2170 background: none;
2142 color: #a16dff; 2171 color: #a16dff;
2143 } 2172 }
2144 2173
2145 -.tab_line .pb-table tr._tr_active.active-line-no td.tl-xxsd{ 2174 +.tab_line .pb-table tr._tr_active.active-line-no td.tl-xxsd,
  2175 +.pb-table tr.selected.dir_0 td.tl-xxsd,
  2176 +.pb-table tr.selected.dir_1 td.tl-xxsd{
2146 background: none; 2177 background: none;
2147 color: #ffb193; 2178 color: #ffb193;
2148 } 2179 }
2149 2180
2150 -.tab_line .pb-table tr._tr_active.active-line-no td.tl-xxrd{ 2181 +.tab_line .pb-table tr._tr_active.active-line-no td.tl-xxrd,
  2182 +.pb-table tr.selected.dir_0 td.tl-xxrd,
  2183 +.pb-table tr.selected.dir_1 td.tl-xxrd{
2151 background: none; 2184 background: none;
2152 color: #5cb0e9; 2185 color: #5cb0e9;
2153 } 2186 }
@@ -2187,4 +2220,66 @@ tr._tr_active.active-line-no .out-badge{ @@ -2187,4 +2220,66 @@ tr._tr_active.active-line-no .out-badge{
2187 color: black; 2220 color: black;
2188 } 2221 }
2189 2222
  2223 +.pb-table tr .anim-delay{
  2224 + animation-delay:.5s;
  2225 + -webkit-animation-delay:.5s;
  2226 +}
  2227 +
  2228 +.sch-table tr td:nth-of-type(1),
  2229 +.sch-table tr td:nth-of-type(2),
  2230 +.sch-table tr td:nth-of-type(3),
  2231 +.sch-table tr td:nth-of-type(4),
  2232 +.sch-table tr td:nth-of-type(5){
  2233 + color: #646363;
  2234 +}
  2235 +
  2236 +.sch-table tr td:nth-of-type(6),
  2237 +.sch-table tr td:nth-of-type(7){
  2238 + color: black;
  2239 +}
  2240 +
  2241 +
  2242 +.sch-table tr th:nth-of-type(1),
  2243 +.sch-table tr th:nth-of-type(2),
  2244 +.sch-table tr th:nth-of-type(3),
  2245 +.sch-table tr th:nth-of-type(4),
  2246 +.sch-table tr th:nth-of-type(5){
  2247 + color: #646363;
  2248 +}
  2249 +
  2250 +.sch-table tr th:nth-of-type(6),
  2251 +.sch-table tr th:nth-of-type(7){
  2252 + color: black;
  2253 +}
  2254 +
  2255 +.sch-table input{
  2256 + color: black;
  2257 +}
  2258 +
  2259 +.sch-table td{
  2260 + text-overflow: ellipsis;
  2261 + overflow: hidden;
  2262 + white-space: nowrap;
  2263 + vertical-align: middle !important;
  2264 +}
  2265 +
  2266 +.change-confirm-text span{
  2267 + margin: 3px 8px 0 3px;
  2268 + font-family: arial;
  2269 +}
  2270 +
  2271 +.change-confirm-text div span:nth-of-type(1){
  2272 + color: gray;
  2273 +}
  2274 +
  2275 +.change-confirm-text i{
  2276 + color: #46c146;
  2277 +}
  2278 +
  2279 +.pb-table tr.selected.dir_0{
  2280 + background-color: #5d5da9 !important;
  2281 +}
2190 2282
  2283 +.pb-table tr.selected.dir_1{
  2284 + background-color: #dc5a5a !important;
  2285 +}
2191 \ No newline at end of file 2286 \ No newline at end of file
src/main/resources/static/pages/control/line/index.html
@@ -90,13 +90,28 @@ @@ -90,13 +90,28 @@
90 </div> 90 </div>
91 <div id="tooltipShade" class="animated fadeIn"></div> 91 <div id="tooltipShade" class="animated fadeIn"></div>
92 92
  93 +<div id="menuWrap"></div>
93 <!-- 线路调度右键菜单 --> 94 <!-- 线路调度右键菜单 -->
94 -<menu class="menu" id="rightMenu">  
95 - <li class="menu-item" > 95 +<menu class="menu" id="rightMenu" style="display: none;">
  96 + <li class="menu-item submenu">
96 <button type="button" class="menu-btn" data-method="outgoAdjust"> 97 <button type="button" class="menu-btn" data-method="outgoAdjust">
97 <span class="menu-text">待发调整</span> 98 <span class="menu-text">待发调整</span>
98 </button> 99 </button>
  100 + <menu class="menu">
  101 + <li class="menu-item">
  102 + <button type="button" class="menu-btn" data-method="outgoAdjust">
  103 + <span class="menu-text">基于班次</span>
  104 + </button>
  105 + </li>
  106 + <li class="menu-item">
  107 + <button type="button" class="menu-btn" data-method="outgoAdjustAll">
  108 + <span class="menu-text">基于车辆</span>
  109 + </button>
  110 + </li>
  111 + </menu>
99 </li> 112 </li>
  113 +
  114 +
100 <li class="menu-separator"></li> 115 <li class="menu-separator"></li>
101 <li class="menu-item" > 116 <li class="menu-item" >
102 <button type="button" class="menu-btn" data-method="planDestroy"> 117 <button type="button" class="menu-btn" data-method="planDestroy">
@@ -164,7 +179,7 @@ @@ -164,7 +179,7 @@
164 </li> 179 </li>
165 </menu> 180 </menu>
166 <!-- 主页右键菜单 --> 181 <!-- 主页右键菜单 -->
167 -<menu class="menu" id="homeMenu"> 182 +<menu class="menu" id="homeMenu" style="display: none;">
168 <li class="menu-item disabled" id="menu-linename"> 183 <li class="menu-item disabled" id="menu-linename">
169 <button type="button" class="menu-btn"> 184 <button type="button" class="menu-btn">
170 <span class="menu-text">--- W2B-102 ---</span> 185 <span class="menu-text">--- W2B-102 ---</span>
src/main/resources/static/pages/control/line/js/alone.js
@@ -73,26 +73,64 @@ var _alone = (function(){ @@ -73,26 +73,64 @@ var _alone = (function(){
73 var table = $('tr[data-id='+array[0].id+']').parents('table')[0]; 73 var table = $('tr[data-id='+array[0].id+']').parents('table')[0];
74 calculateLineNo(table); 74 calculateLineNo(table);
75 }, 75 },
76 - //添加一个班次到表格  
77 - addScheduleToTable: function(schedule){  
78 - _data.pushSchedule(schedule);  
79 -  
80 - var upDown = schedule.xlDir==0?'up':'down';  
81 - var tab = $('#tab_line_' + schedule.xlBm);  
82 - //重新渲染表格  
83 - var table = tab.find('.pb-table[data-type='+upDown+']');  
84 - //获取班次信息  
85 - var schArray = _data.findSchByLine(schedule.xlBm, schedule.xlDir);  
86 - calculateLineNo(  
87 - table.find('tbody').html(template('alone_plan_table_temp', {list: schArray}))[0]  
88 - );  
89 -  
90 - //定位到新添加的班次  
91 - var currTr = table.find('tr[data-id='+schedule.id+']')  
92 - ,top = parseInt(currTr.find('td[name=lineNo]').text()) * 37; 76 + //将班次所在的表格做全量更新
  77 + updateTableBySch: function(schedule){
  78 + //将该线路走向班次 全部从服务器同步一次
  79 + var xlDir = schedule.xlDir, xlBm = schedule.xlBm;
  80 + $.get('/realSchedule/findByLineAndUpDown', {line: xlBm, upDown: xlDir}
  81 + ,function(list){
  82 + $.each(list, function(){
  83 + _data.pushSchedule(this);
  84 + });
  85 +
  86 + var upDown = xlDir==0?'up':'down';
  87 + var tab = $('#tab_line_' + xlBm);
  88 + //重新渲染表格
  89 + var table = tab.find('.pb-table[data-type='+upDown+']');
  90 + var schArray = _data.findSchByLine(xlBm, xlDir);
  91 + calculateLineNo(
  92 + table.find('tbody').html(template('alone_plan_table_temp', {list: schArray}))[0]
  93 + );
  94 +
  95 + var half = tab.find('._body').height() / 2;
  96 +
  97 + //定位到新添加的班次
  98 + var currTr = table.find('tr[data-id='+schedule.id+']')
  99 + ,top = parseInt(currTr.find('td[name=lineNo]').text()) * 37 - half;
  100 +
  101 + top = top>0?top:0;
  102 + currTr.addClass('anim-delay animated flash');
  103 + currTr.parents('._body').slimScroll({ scrollTo: top + 'px' });
  104 + });
  105 + },
  106 + update2Table: function(xlBm, schedule){
  107 + //上行
  108 + $.get('/realSchedule/lineCode/' + xlBm, function(array){
  109 + //加入_data缓存
  110 + $.each(array, function(){
  111 + _data.pushSchedule(this);
  112 + });
  113 +
  114 + var rs = splitDir(array)
  115 + ,tab = $('#tab_line_' + xlBm)
  116 + ,half = tab.find('._body').height() / 2;
  117 + //填充表格数据
  118 + calculateLineNo(
  119 + //上行
  120 + tab.find('table[data-type=up] tbody').html(template('alone_plan_table_temp', {list: rs.up}))[0]
  121 + );
  122 + calculateLineNo(
  123 + //下行
  124 + tab.find('table[data-type=down] tbody').html(template('alone_plan_table_temp', {list: rs.down}))[0]
  125 + );
  126 + //定位到指定的班次
  127 + var currTr = tab.find('tr[data-id='+schedule.id+']')
  128 + ,top = parseInt(currTr.find('td[name=lineNo]').text()) * 37 - half;
93 129
94 - currTr.addClass('animated flash');  
95 - currTr.parents('._body').slimScroll({ scrollTo: top + 'px' }); 130 + top = top>0?top:0;
  131 + currTr.addClass('anim-delay animated flash');
  132 + currTr.parents('._body').slimScroll({ scrollTo: top + 'px' });
  133 + });
96 }, 134 },
97 //重新计算行号 135 //重新计算行号
98 calculateLineNo: calculateLineNo 136 calculateLineNo: calculateLineNo
src/main/resources/static/pages/control/line/js/data.js
@@ -13,8 +13,7 @@ var _data = (function(){ @@ -13,8 +13,7 @@ var _data = (function(){
13 13
14 var dateStr = moment().format('YYYY-MM-DD'); 14 var dateStr = moment().format('YYYY-MM-DD');
15 //实际排班 15 //实际排班
16 - var schedules = {}  
17 - ,scheduleList = []; 16 + var schedules = {};
18 17
19 //站点路由缓存 18 //站点路由缓存
20 var stationRoute = {}; 19 var stationRoute = {};
@@ -24,38 +23,69 @@ var _data = (function(){ @@ -24,38 +23,69 @@ var _data = (function(){
24 //线路标准信息 23 //线路标准信息
25 var lineInformations = {}; 24 var lineInformations = {};
26 //车辆和班次数组映射 25 //车辆和班次数组映射
27 - var clSchMap = {}; 26 + //var clSchMap = {};
28 27
29 //车辆自编号和设备号对照 28 //车辆自编号和设备号对照
30 var carDeviceIdMapp = {}; 29 var carDeviceIdMapp = {};
31 30
  31 + var fcsjSort = function(a, b){
  32 + return a.fcsjT - b.fcsjT;
  33 + }
  34 +
32 var dataObject = { 35 var dataObject = {
33 /*//班次发车 36 /*//班次发车
34 setFcsj: function(schId, fcsj, fcsjT){ 37 setFcsj: function(schId, fcsj, fcsjT){
35 schedules[schId].fcsjActual = fcsj; 38 schedules[schId].fcsjActual = fcsj;
36 schedules[schId].fcsjActualTime = fcsjT; 39 schedules[schId].fcsjActualTime = fcsjT;
37 },*/ 40 },*/
  41 + //根据线路编码获取上行和下行班次
  42 + /*findByLineAll: function(xlbm){
  43 + var array = [],sch;
  44 + for(var id in schedules){
  45 + sch = schedules[id];
  46 + if(sch.xlBm == xlbm)
  47 + array.push(e);
  48 + }
  49 + //排序
  50 + array.sort(function(a, b){
  51 + return a.fcsjT - b.fcsjT;
  52 + });
  53 +
  54 + return array;
  55 + },*/
38 //根据线路和上下行获取计划排班 56 //根据线路和上下行获取计划排班
39 findSchByLine: function(xlbm, upDown){ 57 findSchByLine: function(xlbm, upDown){
40 var array = []; 58 var array = [];
41 - $.each(scheduleList, function(){  
42 - if(this.xlBm == xlbm  
43 - && this.xlDir == upDown)  
44 - array.push(this);  
45 - }); 59 + var sch;
  60 + for(var id in schedules){
  61 + sch = schedules[id];
  62 + if(sch.xlBm == xlbm
  63 + && sch.xlDir == upDown){
  64 + array.push(sch);
  65 + }
  66 + }
  67 + //排序
  68 + array.sort(fcsjSort);
46 69
47 return array; 70 return array;
48 }, 71 },
49 //根据车辆获取班次数组 72 //根据车辆获取班次数组
50 findByCl: function(nbbm){ 73 findByCl: function(nbbm){
51 - return clSchMap[nbbm]; 74 + var array = [];
  75 + for(var id in schedules){
  76 + sch = schedules[id];
  77 + if(sch.clZbh == nbbm)
  78 + array.push(sch);
  79 + }
  80 +
  81 + //排序
  82 + array.sort(fcsjSort);
  83 + return array;
52 }, 84 },
53 //添加一个班次 85 //添加一个班次
54 pushSchedule: function(sch){ 86 pushSchedule: function(sch){
55 //附加信息 87 //附加信息
56 attachInfo(sch); 88 attachInfo(sch);
57 - //加入缓存  
58 - scheduleList.push(sch);  
59 schedules[sch.id] = sch; 89 schedules[sch.id] = sch;
60 lineLpMap[sch.xlBm][sch.lpName].push(sch); 90 lineLpMap[sch.xlBm][sch.lpName].push(sch);
61 }, 91 },
@@ -124,15 +154,14 @@ var _data = (function(){ @@ -124,15 +154,14 @@ var _data = (function(){
124 attachInfo(this); 154 attachInfo(this);
125 //缓存排班计划 155 //缓存排班计划
126 schedules[this.id] = this; 156 schedules[this.id] = this;
127 - scheduleList.push(this);  
128 //构造 线路 ——> 路牌 ——> 班次 3层映射 157 //构造 线路 ——> 路牌 ——> 班次 3层映射
129 if(!lineLpMap[lineCode][this.lpName]) 158 if(!lineLpMap[lineCode][this.lpName])
130 lineLpMap[lineCode][this.lpName] = []; 159 lineLpMap[lineCode][this.lpName] = [];
131 lineLpMap[lineCode][this.lpName].push(this); 160 lineLpMap[lineCode][this.lpName].push(this);
132 //车辆 ——> 班次数组 161 //车辆 ——> 班次数组
133 - if(!clSchMap[this.clZbh]) 162 + /*if(!clSchMap[this.clZbh])
134 clSchMap[this.clZbh] = []; 163 clSchMap[this.clZbh] = [];
135 - clSchMap[this.clZbh].push(this); 164 + clSchMap[this.clZbh].push(this);*/
136 }); 165 });
137 166
138 //按发车时间排序 167 //按发车时间排序
@@ -150,10 +179,15 @@ var _data = (function(){ @@ -150,10 +179,15 @@ var _data = (function(){
150 //根据车辆内部编码获取排班数组 179 //根据车辆内部编码获取排班数组
151 getSchedulByVeh: function(nbbm){ 180 getSchedulByVeh: function(nbbm){
152 var array = []; 181 var array = [];
153 - $.each(scheduleList, function(){  
154 - if(this.clZbh == nbbm)  
155 - array.push(this);  
156 - }); 182 + var sch;
  183 + for(var id in schedules){
  184 + sch = schedules[id];
  185 + if(sch.clZbh == nbbm)
  186 + array.push(sch);
  187 + }
  188 +
  189 + //排序
  190 + array.sort(fcsjSort);
157 return array; 191 return array;
158 }, 192 },
159 //根据设备号获取GPS 193 //根据设备号获取GPS
src/main/resources/static/pages/control/line/js/main.js
@@ -83,6 +83,7 @@ @@ -83,6 +83,7 @@
83 setTimeout(function(){ 83 setTimeout(function(){
84 //去掉loading 84 //去掉loading
85 $('.load-anim').fadeOut(); 85 $('.load-anim').fadeOut();
  86 + $('menu.menu').show();
86 }, 500); 87 }, 500);
87 }, 400); 88 }, 400);
88 89
src/main/resources/static/pages/control/line/js/rightMenu.js
@@ -31,7 +31,7 @@ var _menu = (function() { @@ -31,7 +31,7 @@ var _menu = (function() {
31 31
32 // 表格右键呼出菜单 32 // 表格右键呼出菜单
33 var ac = 'active-menu' 33 var ac = 'active-menu'
34 - ,items = '.pb-table.data tr td[name!=lineNo]'; 34 + ,items = '.pb-table.data tr td[name!=lineNo][data-name!=lpName]';
35 $('.portlet-fullscreen').on('contextmenu', items, 35 $('.portlet-fullscreen').on('contextmenu', items,
36 function(e) { 36 function(e) {
37 e.preventDefault(); 37 e.preventDefault();
@@ -83,6 +83,20 @@ var _menu = (function() { @@ -83,6 +83,20 @@ var _menu = (function() {
83 83
84 }); 84 });
85 85
  86 + //点击路牌
  87 + var lps = '.pb-table.data tr td[data-name=lpName]';
  88 + $('.portlet-fullscreen').on('click', lps, function(e){
  89 + var lp = $(this).text();
  90 + layer.msg('高亮路牌:' + lp + '',{offset: 'ct', shift : 5});
  91 + var lineCode = $(this).parents('.tab-pane').data('id');
  92 + var schArray = _data.getLineLpMap()[lineCode][lp];
  93 +
  94 + resetAllState();
  95 + $.each(schArray, function(){
  96 + $('.pb-table tr[data-id='+this.id+']').addClass('selected dir_' + this.xlDir);
  97 + });
  98 + });
  99 +
86 function selectOneRow(firstCell){ 100 function selectOneRow(firstCell){
87 return $(firstCell).addClass('selected').parent().addClass('_tr_active active-line-no'); 101 return $(firstCell).addClass('selected').parent().addClass('_tr_active active-line-no');
88 } 102 }
@@ -97,11 +111,11 @@ var _menu = (function() { @@ -97,11 +111,11 @@ var _menu = (function() {
97 tips: [2, '#709d94'],shift:5, time: 5000 111 tips: [2, '#709d94'],shift:5, time: 5000
98 }); 112 });
99 }); 113 });
100 - 114 +/*
101 $('.portlet-fullscreen').on('dbclick', 'table.pb-table .sfsj-item', function(){ 115 $('.portlet-fullscreen').on('dbclick', 'table.pb-table .sfsj-item', function(){
102 alert(11); 116 alert(11);
103 }); 117 });
104 - 118 +*/
105 //选中关联班次 119 //选中关联班次
106 function selCognateSch($ctr){ 120 function selCognateSch($ctr){
107 //选中关联班次 121 //选中关联班次
@@ -110,6 +124,7 @@ var _menu = (function() { @@ -110,6 +124,7 @@ var _menu = (function() {
110 ,sch = _data.getSchedulById(schId); 124 ,sch = _data.getSchedulById(schId);
111 125
112 var scroll = false; 126 var scroll = false;
  127 + console.log(_data.findByCl(clnbbm));
113 $.each(_data.findByCl(clnbbm), function(){ 128 $.each(_data.findByCl(clnbbm), function(){
114 if(scroll){ 129 if(scroll){
115 var nextTr = $('tr[data-id='+this.id+']'); 130 var nextTr = $('tr[data-id='+this.id+']');
@@ -122,8 +137,11 @@ var _menu = (function() { @@ -122,8 +137,11 @@ var _menu = (function() {
122 } 137 }
123 scroll = false; 138 scroll = false;
124 nextTr.addClass('next-sch'); 139 nextTr.addClass('next-sch');
  140 +
  141 + $('.pb-table tr[data-id='+this.id+']').addClass('selected');
  142 + return false;
125 } 143 }
126 - $('.pb-table tr[data-id='+this.id+']').addClass('selected'); 144 + //$('.pb-table tr[data-id='+this.id+']').addClass('selected');
127 if(this.id == schId) 145 if(this.id == schId)
128 scroll = true; 146 scroll = true;
129 }); 147 });
@@ -134,6 +152,8 @@ var _menu = (function() { @@ -134,6 +152,8 @@ var _menu = (function() {
134 $('.pb-table tr td.' + ac).removeClass(ac); 152 $('.pb-table tr td.' + ac).removeClass(ac);
135 $('.pb-table tr.selected').removeClass('selected'); 153 $('.pb-table tr.selected').removeClass('selected');
136 $('.pb-table tr.next-sch').removeClass('next-sch'); 154 $('.pb-table tr.next-sch').removeClass('next-sch');
  155 + $('.pb-table tr.dir_0').removeClass('dir_0');
  156 + $('.pb-table tr.dir_1').removeClass('dir_1');
137 if(layerTip){ 157 if(layerTip){
138 layer.close(layerTip); 158 layer.close(layerTip);
139 layerTip = null; 159 layerTip = null;
@@ -142,6 +162,8 @@ var _menu = (function() { @@ -142,6 +162,8 @@ var _menu = (function() {
142 function resetAllState(){ 162 function resetAllState(){
143 $('.pb-table tr td.' + ac).removeClass(ac); 163 $('.pb-table tr td.' + ac).removeClass(ac);
144 $('.pb-table tr.selected').removeClass('selected'); 164 $('.pb-table tr.selected').removeClass('selected');
  165 + $('.pb-table tr.dir_0').removeClass('dir_0');
  166 + $('.pb-table tr.dir_1').removeClass('dir_1');
145 $('.pb-table tr._tr_active').removeClass('_tr_active active-line-no'); 167 $('.pb-table tr._tr_active').removeClass('_tr_active active-line-no');
146 $('.pb-table tr.next-sch').removeClass('next-sch'); 168 $('.pb-table tr.next-sch').removeClass('next-sch');
147 $('.pb-table.data tr td.selected[name=lineNo]').removeClass('selected'); 169 $('.pb-table.data tr td.selected[name=lineNo]').removeClass('selected');
@@ -223,7 +245,18 @@ var _menu = (function() { @@ -223,7 +245,18 @@ var _menu = (function() {
223 }, 245 },
224 //计划烂班 246 //计划烂班
225 planDestroy: function(schedul){ 247 planDestroy: function(schedul){
226 - var data = {item: schedul, array : _data.getSchedulByVeh(schedul.clZbh)} 248 + /*if(schedul.status == -1){
  249 + layer.alert('不能重复烂班!', {icon: 2, title: '提示', shift: 5});
  250 + return;
  251 + }*/
  252 + var array = [];
  253 + //获取未烂班的班次
  254 + $.each(_data.getSchedulByVeh(schedul.clZbh),function(){
  255 + if(this.status != -1)
  256 + array.push(this);
  257 + });
  258 +
  259 + var data = {item: schedul, array : array}
227 var index = layer.open({ 260 var index = layer.open({
228 type: 1, 261 type: 1,
229 area: ['370px', '645px'], 262 area: ['370px', '645px'],
@@ -507,10 +540,33 @@ var _menu = (function() { @@ -507,10 +540,33 @@ var _menu = (function() {
507 layer.close(index); 540 layer.close(index);
508 if(rs.t) 541 if(rs.t)
509 _alone.refreshSchedule(rs.t); 542 _alone.refreshSchedule(rs.t);
  543 +
  544 + if(rs.nextSch)
  545 + _alone.refreshSchedule(rs.nextSch);
510 }); 546 });
511 }); 547 });
512 } 548 }
513 }); 549 });
  550 + },
  551 + //基于车辆的待发调整
  552 + outgoAdjustAll: function(schedul){
  553 + $.get('/pages/control/line/child_pages/outgo_adjust_all.html', function(content){
  554 + layer.open({
  555 + type: 1,
  556 + area: '830px',
  557 + maxmin: true,
  558 + content: content,
  559 + shift: 5,
  560 + title: '待发调整(车辆)',
  561 + success: function(){
  562 + $('#outgoAdjustAllPanel').trigger('init', {
  563 + selected: schedul,
  564 + _data: _data,
  565 + _alone: _alone
  566 + });
  567 + }
  568 + });
  569 + });
514 } 570 }
515 } 571 }
516 572
src/main/resources/static/pages/control/line/temps/alone_tp.html
@@ -293,7 +293,7 @@ @@ -293,7 +293,7 @@
293 {{each array as obj i}} 293 {{each array as obj i}}
294 <label> 294 <label>
295 <div class="checker"> 295 <div class="checker">
296 - <span><input type="checkbox" value={{obj.id}} name="ids[]" class="icheck" {{if obj.dfsj==item.dfsj}}checked{{/if}}></span></div> {{obj.dfsj}} 296 + <span><input type="checkbox" value={{obj.id}} name="ids[]" class="icheck" {{if obj.id==item.id}}checked{{/if}}></span></div> {{obj.dfsj}}
297 </label> 297 </label>
298 {{/each}} 298 {{/each}}
299 </div> 299 </div>
@@ -486,7 +486,7 @@ @@ -486,7 +486,7 @@
486 <div class="form-custom-row"> 486 <div class="form-custom-row">
487 <div class="item full" > 487 <div class="item full" >
488 <p style="margin: 10px 0;">调整说明: <span class="font-red">(不超过20个字符)</span></p> 488 <p style="margin: 10px 0;">调整说明: <span class="font-red">(不超过20个字符)</span></p>
489 - <textarea class="form-control" name="remarks" rows="4" placeholder="说明,必填"></textarea> 489 + <textarea class="form-control" name="remarks" rows="4" placeholder="调整说明"></textarea>
490 </div> 490 </div>
491 </div> 491 </div>
492 <hr> 492 <hr>
src/main/resources/static/pages/control/line/temps/child_task_case_tp.html
@@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
3 <script id="child_task_main_table_temp" type="text/html"> 3 <script id="child_task_main_table_temp" type="text/html">
4 {{each list as item i}} 4 {{each list as item i}}
5 {{if item == null}} 5 {{if item == null}}
6 - <tr class="empty"> 6 + <tr class="empty" data-type="empty">
7 <td width="5%" >{{i + 1}}</td> 7 <td width="5%" >{{i + 1}}</td>
8 <td width="9%" ></td> 8 <td width="9%" ></td>
9 <td width="9%" ></td> 9 <td width="9%" ></td>
@@ -17,7 +17,10 @@ @@ -17,7 +17,10 @@
17 {{else}} 17 {{else}}
18 <tr data-id="{{item.id}}" > 18 <tr data-id="{{item.id}}" >
19 <td width="5%" >{{i + 1}}</td> 19 <td width="5%" >{{i + 1}}</td>
20 - <td width="9%" >{{item.fcsj}}</td> 20 + <td width="9%" >
  21 + {{if item.fcsjActual != null}}{{item.fcsjActual}}<span class="blue-badge">实</span>{{else}}{{item.dfsj}}
  22 + {{/if}}
  23 + </td>
21 <td width="9%" >{{item.zdsj}}</td> 24 <td width="9%" >{{item.zdsj}}</td>
22 <td width="14%" >{{item.qdzName}}</td> 25 <td width="14%" >{{item.qdzName}}</td>
23 <td width="14%" >{{item.zdzName}}</td> 26 <td width="14%" >{{item.zdzName}}</td>