Commit 1b1d237b2d8608c0ba81c517702544a087576e1f

Authored by 徐烜
2 parents 7c9a72d4 28d9bc72
Showing 49 changed files with 1234 additions and 268 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/LineController.java
@@ -51,8 +51,11 @@ public class LineController extends BaseController&lt;Line, Integer&gt; { @@ -51,8 +51,11 @@ public class LineController extends BaseController&lt;Line, Integer&gt; {
51 @RequestMapping(method = RequestMethod.POST) 51 @RequestMapping(method = RequestMethod.POST)
52 public Map<String, Object> save(Line t){ 52 public Map<String, Object> save(Line t){
53 53
54 - t.setId(Integer.valueOf(t.getLineCode()));  
55 - 54 + if(t.getId()==null) {
  55 +
  56 + t.setId(Integer.valueOf(t.getLineCode()));
  57 +
  58 + }
56 return service.save(t); 59 return service.save(t);
57 } 60 }
58 } 61 }
src/main/java/com/bsth/controller/StationRouteController.java
@@ -92,11 +92,10 @@ public class StationRouteController extends BaseController&lt;StationRoute, Integer @@ -92,11 +92,10 @@ public class StationRouteController extends BaseController&lt;StationRoute, Integer
92 * 92 *
93 * @param map <id:线路ID> 93 * @param map <id:线路ID>
94 * 94 *
95 - * @return Map<String, Object> <SUCCESS ; ERROR> 95 + * @return Map<String, Object> <SUCCESS ; ERROR ; NOTDATA>
96 */ 96 */
97 @RequestMapping(value = "/usingSingle",method = RequestMethod.POST) 97 @RequestMapping(value = "/usingSingle",method = RequestMethod.POST)
98 public Map<String, Object> usingSingle(@RequestParam Map<String, Object> map) { 98 public Map<String, Object> usingSingle(@RequestParam Map<String, Object> map) {
99 -  
100 return service.usingSingle(map); 99 return service.usingSingle(map);
101 } 100 }
102 101
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/SectionRouteRepository.java
@@ -142,6 +142,13 @@ public interface SectionRouteRepository extends BaseRepository&lt;SectionRoute, Int @@ -142,6 +142,13 @@ public interface SectionRouteRepository extends BaseRepository&lt;SectionRoute, Int
142 @Query(value = " select MAX(r.sectionroute_code) as sectionrouteCode from bsth_c_sectionroute r WHERE r.line=?1 and r.directions =?2 and r.sectionroute_code< ?3", nativeQuery=true) 142 @Query(value = " select MAX(r.sectionroute_code) as sectionrouteCode from bsth_c_sectionroute r WHERE r.line=?1 and r.directions =?2 and r.sectionroute_code< ?3", nativeQuery=true)
143 List<Object[]> findUpSectionRouteCode(Integer lineId,Integer direction,Integer stationRouteCode); 143 List<Object[]> findUpSectionRouteCode(Integer lineId,Integer direction,Integer stationRouteCode);
144 144
  145 + /**
  146 + * @Description :TODO(获取路段路由信息)
  147 + *
  148 + * @param lineId:线路ID;directions:方向
  149 + *
  150 + * @return List<Map<String, Object>> {[0]:directions(方向);[1]:bsection_vector(路段坐标);[2]:speed_limit(限速);[3]:section_name(路段名称)}
  151 + */
145 @Query(value = "SELECT " + 152 @Query(value = "SELECT " +
146 "c.directions," + 153 "c.directions," +
147 "AsText(s.bsection_vector) as bsection_vector," + 154 "AsText(s.bsection_vector) as bsection_vector," +
@@ -149,5 +156,5 @@ public interface SectionRouteRepository extends BaseRepository&lt;SectionRoute, Int @@ -149,5 +156,5 @@ public interface SectionRouteRepository extends BaseRepository&lt;SectionRoute, Int
149 "s.section_name " + 156 "s.section_name " +
150 " FROM bsth_c_sectionroute c " + 157 " FROM bsth_c_sectionroute c " +
151 " LEFT JOIN bsth_c_section s on c.section = s.id where c.line = ?1 and c.directions = ?2", nativeQuery=true) 158 " LEFT JOIN bsth_c_section s on c.section = s.id where c.line = ?1 and c.directions = ?2", nativeQuery=true)
152 -List<Object[]> sectionRouteVector(Integer lineId,Integer directions); 159 + List<Object[]> sectionRouteVector(Integer lineId,Integer directions);
153 } 160 }
src/main/java/com/bsth/repository/StationRouteRepository.java
@@ -7,6 +7,8 @@ import org.springframework.data.jpa.repository.Query; @@ -7,6 +7,8 @@ import org.springframework.data.jpa.repository.Query;
7 import org.springframework.stereotype.Repository; 7 import org.springframework.stereotype.Repository;
8 import org.springframework.transaction.annotation.Transactional; 8 import org.springframework.transaction.annotation.Transactional;
9 9
  10 +import com.bsth.entity.Line;
  11 +import com.bsth.entity.LineInformation;
10 import com.bsth.entity.StationRoute; 12 import com.bsth.entity.StationRoute;
11 13
12 /** 14 /**
@@ -124,7 +126,11 @@ public interface StationRouteRepository extends BaseRepository&lt;StationRoute, Int @@ -124,7 +126,11 @@ public interface StationRouteRepository extends BaseRepository&lt;StationRoute, Int
124 * 126 *
125 * @param lineId:线路ID 127 * @param lineId:线路ID
126 * 128 *
127 - * @return List<Object[]> 129 + * @return List<Object[]>:{[0]:g_lonx(GPS经度);[1]:g_laty(GPS纬度);[2]:b_jwpoints(百度经纬度坐标)
  130 + *
  131 + * [3]:station_mark(站点类型);[4]:station_route_code(站点序号);[5]:station_cod(站点编码);
  132 + *
  133 + * [6]:distances(站点距离);[7]:station_name(站点名称);[8]:directions(方向)}
128 */ 134 */
129 @Query(value = "SELECT * FROM ("+ 135 @Query(value = "SELECT * FROM ("+
130 "SELECT b.g_lonx," + 136 "SELECT b.g_lonx," +
@@ -212,4 +218,6 @@ public interface StationRouteRepository extends BaseRepository&lt;StationRoute, Int @@ -212,4 +218,6 @@ public interface StationRouteRepository extends BaseRepository&lt;StationRoute, Int
212 " s.update_date AS stationRouteUpdateDate FROM bsth_c_stationroute s WHERE s.id = ?1 ) a " + 218 " s.update_date AS stationRouteUpdateDate FROM bsth_c_stationroute s WHERE s.id = ?1 ) a " +
213 " LEFT JOIN bsth_c_station b ON a.stationRouteStation = b.id", nativeQuery=true) 219 " LEFT JOIN bsth_c_station b ON a.stationRouteStation = b.id", nativeQuery=true)
214 List<Object[]> findStationRouteInfo(Integer id); 220 List<Object[]> findStationRouteInfo(Integer id);
  221 +
  222 + List<StationRoute> findByLine(Line line);
215 } 223 }
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/StationRouteService.java
@@ -65,7 +65,7 @@ public interface StationRouteService extends BaseService&lt;StationRoute, Integer&gt; @@ -65,7 +65,7 @@ public interface StationRouteService extends BaseService&lt;StationRoute, Integer&gt;
65 * 65 *
66 * @param map <id:线路ID> 66 * @param map <id:线路ID>
67 * 67 *
68 - * @return Map<String, Object> <SUCCESS ; ERROR> 68 + * @return Map<String, Object> <SUCCESS ; ERROR ; NOTDATA>
69 */ 69 */
70 Map<String, Object> usingSingle(Map<String, Object> map); 70 Map<String, Object> usingSingle(Map<String, Object> map);
71 71
src/main/java/com/bsth/service/impl/StationRouteServiceImpl.java
1 package com.bsth.service.impl; 1 package com.bsth.service.impl;
2 2
3 -import java.awt.Point;  
4 import java.io.ByteArrayInputStream; 3 import java.io.ByteArrayInputStream;
5 import java.io.File; 4 import java.io.File;
6 import java.io.InputStream; 5 import java.io.InputStream;
  6 +import java.text.DecimalFormat;
7 import java.util.ArrayList; 7 import java.util.ArrayList;
8 import java.util.HashMap; 8 import java.util.HashMap;
9 import java.util.List; 9 import java.util.List;
@@ -23,7 +23,7 @@ import com.bsth.repository.StationRepository; @@ -23,7 +23,7 @@ import com.bsth.repository.StationRepository;
23 import com.bsth.repository.StationRouteRepository; 23 import com.bsth.repository.StationRouteRepository;
24 import com.bsth.service.StationRouteService; 24 import com.bsth.service.StationRouteService;
25 import com.bsth.util.FTPClientUtils; 25 import com.bsth.util.FTPClientUtils;
26 -import com.bsth.util.Test; 26 +import com.bsth.util.PackTarGZUtils;
27 import com.bsth.util.db.DBUtils_MS; 27 import com.bsth.util.db.DBUtils_MS;
28 28
29 /** 29 /**
@@ -505,11 +505,12 @@ public class StationRouteServiceImpl extends BaseServiceImpl&lt;StationRoute, Integ @@ -505,11 +505,12 @@ public class StationRouteServiceImpl extends BaseServiceImpl&lt;StationRoute, Integ
505 * 505 *
506 * @param map <lineId:线路ID> 506 * @param map <lineId:线路ID>
507 * 507 *
508 - * @return Map<String, Object> <SUCCESS ; ERROR> 508 + * @return Map<String, Object> <SUCCESS ; ERROR ; NOTDATA>
509 */ 509 */
510 @Override 510 @Override
511 public Map<String, Object> usingSingle(Map<String, Object> map) { 511 public Map<String, Object> usingSingle(Map<String, Object> map) {
512 512
  513 + // 返回值map
513 Map<String, Object> resultMap = new HashMap<String,Object>(); 514 Map<String, Object> resultMap = new HashMap<String,Object>();
514 515
515 try { 516 try {
@@ -517,63 +518,75 @@ public class StationRouteServiceImpl extends BaseServiceImpl&lt;StationRoute, Integ @@ -517,63 +518,75 @@ public class StationRouteServiceImpl extends BaseServiceImpl&lt;StationRoute, Integ
517 // 获取线路ID 518 // 获取线路ID
518 Integer lineId = map.get("lineId").equals("") ? 0 : Integer.parseInt(map.get("lineId").toString()); 519 Integer lineId = map.get("lineId").equals("") ? 0 : Integer.parseInt(map.get("lineId").toString());
519 520
520 - /** 查询线路信息 */ 521 + /** 查询线路信息 @param:<lineId:线路ID> */
521 Line line = lineRepository.findOne(lineId); 522 Line line = lineRepository.findOne(lineId);
522 523
  524 + /** 查询线路信息下的站点路由信息 @param:<lineId:线路ID> */
523 List<Object[]> objects = repository.usingSingle(lineId); 525 List<Object[]> objects = repository.usingSingle(lineId);
524 526
525 if (objects.size()>0) { 527 if (objects.size()>0) {
526 528
527 - /** 获取配置文件里的ftp参数 */ 529 + /** 获取配置文件里的ftp登录参数 */
528 Map<String, Object> FTPParamMap = readPropertiesGetFTPParam(); 530 Map<String, Object> FTPParamMap = readPropertiesGetFTPParam();
529 531
530 // 压缩文件名 532 // 压缩文件名
531 String odlGzFileName = line.getLineCode() + ".txt.gz"; 533 String odlGzFileName = line.getLineCode() + ".txt.gz";
532 534
533 - // text文件名 535 + // txt文件名
534 String textFileName = line.getLineCode() + ".txt"; 536 String textFileName = line.getLineCode() + ".txt";
535 537
  538 + // 创建一个ftp上传实例
536 FTPClientUtils clientUtils = new FTPClientUtils(); 539 FTPClientUtils clientUtils = new FTPClientUtils();
537 540
  541 + // IP
538 String url = FTPParamMap.get("url").toString(); 542 String url = FTPParamMap.get("url").toString();
539 543
  544 + // 端口
540 int port = Integer.valueOf(FTPParamMap.get("port").toString()); 545 int port = Integer.valueOf(FTPParamMap.get("port").toString());
541 546
  547 + // 用户名
542 String username = FTPParamMap.get("username").toString(); 548 String username = FTPParamMap.get("username").toString();
543 549
  550 + // 密码
544 String password = FTPParamMap.get("password").toString(); 551 String password = FTPParamMap.get("password").toString();
545 552
  553 + // 相对路径
546 String remotePath = FTPParamMap.get("remotePath").toString(); 554 String remotePath = FTPParamMap.get("remotePath").toString();
547 555
548 - /** 如果行单文件已存在则删除 */ 556 + /** 如果已存在相同行单文件名则先删除 */
549 clientUtils.deleteFtpFile(url, port, username, password, remotePath, odlGzFileName); 557 clientUtils.deleteFtpFile(url, port, username, password, remotePath, odlGzFileName);
550 558
551 clientUtils.deleteFtpFile(url, port, username, password, remotePath, textFileName); 559 clientUtils.deleteFtpFile(url, port, username, password, remotePath, textFileName);
552 560
  561 + /** 行单文件内容 @param:<objects:站点路由;lineId:线路ID>*/
553 String textStr = newTextFileToFTP(objects,lineId); 562 String textStr = newTextFileToFTP(objects,lineId);
554 563
555 - /*textStr = line.getName() + "\t" + "2" + "\r\n" + textStr;*/ 564 + /*textStr = line.getName() + "\t" + "2" + "\r" + textStr;*/
556 565
557 - textStr = line.getName() + "\t" + "2" + "\r" + textStr; 566 + textStr = line.getName() + " " + "2" + "\r" + textStr;
558 567
559 InputStream input = new ByteArrayInputStream(textStr.getBytes("gbk")); 568 InputStream input = new ByteArrayInputStream(textStr.getBytes("gbk"));
560 569
561 - /** 生成text文件 */ 570 + /** 生成txt文件,上传ftp */
562 clientUtils.uploadFile(url, port, username, password, remotePath, textFileName, input); 571 clientUtils.uploadFile(url, port, username, password, remotePath, textFileName, input);
563 572
564 - Test test= new Test(); 573 + // 创建打包实例
  574 + PackTarGZUtils packTarGZUtils= new PackTarGZUtils();
565 575
  576 + /** 获取txt文件 */
566 File textFile = clientUtils.GetFtpFile(url, port, username, password, remotePath, textFileName); 577 File textFile = clientUtils.GetFtpFile(url, port, username, password, remotePath, textFileName);
567 578
  579 + /*File[] sources = new File[] {textFile};*/
568 File[] sources = new File[] {textFile}; 580 File[] sources = new File[] {textFile};
569 581
570 File target = new File(odlGzFileName); 582 File target = new File(odlGzFileName);
571 -  
572 - File targetFile = test.pack(sources, target); 583 +
  584 + // 将txt文件打包
  585 + File targetFile = packTarGZUtils.pack(sources, target);
573 586
574 /*clientUtils.testUpLoadFromDisk(targetFile,targetFile.getName());*/ 587 /*clientUtils.testUpLoadFromDisk(targetFile,targetFile.getName());*/
575 588
576 - clientUtils.testUpLoadFromDisk(targetFile, targetFile.getName(), url, port, username, password, remotePath); 589 + clientUtils.FTPUpLoadFromDisk(targetFile, targetFile.getName(), url, port, username, password, remotePath);
577 590
578 resultMap.put("status", ResponseCode.SUCCESS); 591 resultMap.put("status", ResponseCode.SUCCESS);
579 592
@@ -593,12 +606,28 @@ public class StationRouteServiceImpl extends BaseServiceImpl&lt;StationRoute, Integ @@ -593,12 +606,28 @@ public class StationRouteServiceImpl extends BaseServiceImpl&lt;StationRoute, Integ
593 return resultMap; 606 return resultMap;
594 } 607 }
595 608
  609 + /**
  610 + * @Description : TODO(形成行单文件内容)
  611 + *
  612 + * @param objects :站点路由信息
  613 + *
  614 + * {[0]:g_lonx(GPS经度);[1]:g_laty(GPS纬度);[2]:b_jwpoints(百度经纬度坐标)
  615 + *
  616 + * [3]:station_mark(站点类型);[4]:station_route_code(站点序号);[5]:station_cod(站点编码);
  617 + *
  618 + * [6]:distances(站点距离);[7]:station_name(站点名称);[8]:directions(方向)}
  619 + *
  620 + * @param lineId :线路ID
  621 + *
  622 + * @return String
  623 + */
596 public String newTextFileToFTP(List<Object[]> objects,Integer lineId) { 624 public String newTextFileToFTP(List<Object[]> objects,Integer lineId) {
597 625
  626 + // 返回值String
598 String stationRStr = ""; 627 String stationRStr = "";
599 628
600 // windows下的文本文件换行符 629 // windows下的文本文件换行符
601 - // String enterStr = "\r\n"; 630 + //String enterStr = "\r\n";
602 631
603 // linux/unix下的文本文件换行符 632 // linux/unix下的文本文件换行符
604 String enterStr = "\r"; 633 String enterStr = "\r";
@@ -616,15 +645,17 @@ public class StationRouteServiceImpl extends BaseServiceImpl&lt;StationRoute, Integ @@ -616,15 +645,17 @@ public class StationRouteServiceImpl extends BaseServiceImpl&lt;StationRoute, Integ
616 lat = "\t" + lat; 645 lat = "\t" + lat;
617 646
618 // 站点类型 647 // 站点类型
619 - String stationMake = objects.get(i)[3].equals("") ? "" : objects.get(i)[3].toString(); 648 + String stationMakeStr = objects.get(i)[3].equals("") ? "" : objects.get(i)[3].toString();
  649 +
  650 + String stationMake = "";
620 651
621 - if(stationMake.equals("E")) { 652 + if(stationMakeStr.equals("E")) {
622 653
623 - stationMake = "\t" + "2"; 654 + stationMake = "\t2";
624 655
625 }else { 656 }else {
626 657
627 - stationMake ="\t" + "1"; 658 + stationMake ="\t1";
628 659
629 } 660 }
630 661
@@ -638,30 +669,35 @@ public class StationRouteServiceImpl extends BaseServiceImpl&lt;StationRoute, Integ @@ -638,30 +669,35 @@ public class StationRouteServiceImpl extends BaseServiceImpl&lt;StationRoute, Integ
638 669
639 stationCode = "\t" +stationCode; 670 stationCode = "\t" +stationCode;
640 671
641 - double dis = objects.get(i)[6]==null ? 0.0 : Double.parseDouble(objects.get(i)[6].toString()); 672 + double dis = objects.get(i)[6]==null ? 0.0 : Double.parseDouble(objects.get(i)[6].toString())*1000;
642 673
643 - double tempd = dis*1000; 674 + String tempDistc = String.valueOf((int) dis);
644 675
645 // 站点距离 676 // 站点距离
646 - String staitondistance = "\t" + String.valueOf((int) tempd); 677 + String staitondistance = "\t" + tempDistc;
647 678
648 // 站点名称 679 // 站点名称
649 String stationName = objects.get(i)[7].equals("") ? "" : objects.get(i)[7].toString(); 680 String stationName = objects.get(i)[7].equals("") ? "" : objects.get(i)[7].toString();
650 681
  682 + stationName = "\t" +stationName;
  683 +
651 // 限速 684 // 限速
652 // String sleepStr = " " + "60"; 685 // String sleepStr = " " + "60";
653 686
  687 + // 限速
654 String sleepStr = ""; 688 String sleepStr = "";
655 689
  690 + // 方向
656 int directions = objects.get(i)[8]==null ? null : Integer.valueOf(objects.get(i)[8].toString()); 691 int directions = objects.get(i)[8]==null ? null : Integer.valueOf(objects.get(i)[8].toString());
657 692
  693 + /** 获取路段路由信息 @pararm:<lineId:线路ID;directions:方向> */
658 List<Object[]> sobje = routeRepository.sectionRouteVector(lineId,directions); 694 List<Object[]> sobje = routeRepository.sectionRouteVector(lineId,directions);
659 695
660 if(sobje.size()==1) { 696 if(sobje.size()==1) {
661 697
662 - sleepStr = sobje.get(0)[2] == null ? "" : sobje.get(0)[2].toString(); 698 + double dsleepStr = sobje.get(0)[2] == null ? 60d : Double.valueOf(sobje.get(0)[2].toString());
663 699
664 - sleepStr = "\t" + sleepStr; 700 + sleepStr = "\t" + new DecimalFormat("0").format(dsleepStr);
665 701
666 }else if(sobje.size()>1){ 702 }else if(sobje.size()>1){
667 703
@@ -674,9 +710,11 @@ public class StationRouteServiceImpl extends BaseServiceImpl&lt;StationRoute, Integ @@ -674,9 +710,11 @@ public class StationRouteServiceImpl extends BaseServiceImpl&lt;StationRoute, Integ
674 710
675 if(stationName.equals(sectionNameA[0])){ 711 if(stationName.equals(sectionNameA[0])){
676 712
677 - sleepStr = sobje.get(j)[2].toString(); 713 + /*sleepStr = sobje.get(j)[2].toString();*/
  714 +
  715 + double dsleepStrt = sobje.get(0)[2] == null ? 60d : Double.valueOf(sobje.get(j)[2].toString());
678 716
679 - sleepStr = "\t" + sleepStr; 717 + sleepStr = "\t" + new DecimalFormat("0").format(dsleepStrt);
680 718
681 } 719 }
682 720
@@ -698,12 +736,6 @@ public class StationRouteServiceImpl extends BaseServiceImpl&lt;StationRoute, Integ @@ -698,12 +736,6 @@ public class StationRouteServiceImpl extends BaseServiceImpl&lt;StationRoute, Integ
698 sleepStr = sleepStr + GetFormPointOnPolylineSeleepLimit(pointsM,sobje);*/ 736 sleepStr = sleepStr + GetFormPointOnPolylineSeleepLimit(pointsM,sobje);*/
699 } 737 }
700 738
701 - if(sleepStr.equals(""))  
702 - sleepStr = "\t" + "60";  
703 -  
704 -  
705 - stationName = "\t" +stationName;  
706 -  
707 stationRStr = stationRStr + lng + lat + stationMake + stationNo + stationCode + staitondistance + sleepStr + stationName + enterStr; 739 stationRStr = stationRStr + lng + lat + stationMake + stationNo + stationCode + staitondistance + sleepStr + stationName + enterStr;
708 740
709 } 741 }
@@ -798,8 +830,14 @@ public class StationRouteServiceImpl extends BaseServiceImpl&lt;StationRoute, Integ @@ -798,8 +830,14 @@ public class StationRouteServiceImpl extends BaseServiceImpl&lt;StationRoute, Integ
798 return success; 830 return success;
799 } 831 }
800 832
  833 + /**
  834 + * @Description:TOOD(获取FTP登录参数) 这里暂时只做一个map值返回,以后可以作为ftp登录类提出来
  835 + *
  836 + * @return : Map<String, Object> <url:IP;port:端口;username:用户名;password:密码;remotePath:相对路径>
  837 + */
801 public Map<String, Object> readPropertiesGetFTPParam(){ 838 public Map<String, Object> readPropertiesGetFTPParam(){
802 839
  840 + // 返回值map
803 Map<String, Object> resultMap = new HashMap<String, Object>(); 841 Map<String, Object> resultMap = new HashMap<String, Object>();
804 842
805 Properties env = new Properties(); 843 Properties env = new Properties();
src/main/java/com/bsth/service/impl/StationServiceImpl.java
@@ -161,6 +161,11 @@ public class StationServiceImpl extends BaseServiceImpl&lt;Station, Integer&gt; implem @@ -161,6 +161,11 @@ public class StationServiceImpl extends BaseServiceImpl&lt;Station, Integer&gt; implem
161 // 更新里程 161 // 更新里程
162 updateLineInfoUpOrDownMileage( resultLine , directions, sumUpOrDownMileage); 162 updateLineInfoUpOrDownMileage( resultLine , directions, sumUpOrDownMileage);
163 163
  164 + if(directions==0) {
  165 +
  166 + lineUpdateStationName(resultLine);
  167 +
  168 + }
164 resultMap.put("status", ResponseCode.SUCCESS); 169 resultMap.put("status", ResponseCode.SUCCESS);
165 170
166 } catch (Exception e) { 171 } catch (Exception e) {
@@ -175,6 +180,53 @@ public class StationServiceImpl extends BaseServiceImpl&lt;Station, Integer&gt; implem @@ -175,6 +180,53 @@ public class StationServiceImpl extends BaseServiceImpl&lt;Station, Integer&gt; implem
175 } 180 }
176 181
177 182
  183 + public void lineUpdateStationName(Line resultLine) {
  184 +
  185 + List<StationRoute> stationRoutes = routeRepository.findByLine(resultLine);
  186 +
  187 + int sizeL = stationRoutes.size();
  188 +
  189 + if(sizeL<0) {
  190 +
  191 + return;
  192 +
  193 + }
  194 +
  195 + if(resultLine.getStartStationName()==null){
  196 +
  197 + for(int k =0;k<sizeL;k++) {
  198 +
  199 + StationRoute tempS = stationRoutes.get(k);
  200 +
  201 + if(tempS.getStationMark().equals("B") && tempS.getDirections()==0) {
  202 +
  203 + resultLine.setStartStationName(tempS.getStationName());
  204 +
  205 + lineRepository.save(resultLine);
  206 +
  207 + }
  208 + }
  209 +
  210 + };
  211 +
  212 + if(resultLine.getEndStationName()==null) {
  213 +
  214 + for(int k =0;k<sizeL;k++) {
  215 +
  216 + StationRoute tempS = stationRoutes.get(k);
  217 +
  218 + if(tempS.getStationMark().equals("E") && tempS.getDirections()==0) {
  219 +
  220 + resultLine.setEndStationName(tempS.getStationName());
  221 +
  222 + lineRepository.save(resultLine);
  223 +
  224 + }
  225 + }
  226 +
  227 + }
  228 + }
  229 +
178 /** 230 /**
179 * @Description :保存站点和站点路由信息(系统规划) 231 * @Description :保存站点和站点路由信息(系统规划)
180 * 232 *
@@ -877,7 +929,7 @@ public class StationServiceImpl extends BaseServiceImpl&lt;Station, Integer&gt; implem @@ -877,7 +929,7 @@ public class StationServiceImpl extends BaseServiceImpl&lt;Station, Integer&gt; implem
877 929
878 String stationRouteCodeArray [] = stationRouteCodeStr.split("_"); 930 String stationRouteCodeArray [] = stationRouteCodeStr.split("_");
879 931
880 - stationRouteCode = Integer.parseInt(stationRouteCodeArray[0]+1); 932 + stationRouteCode = Integer.parseInt(stationRouteCodeArray[0].toString())+1;
881 933
882 934
883 }else { 935 }else {
@@ -1436,6 +1488,12 @@ public class StationServiceImpl extends BaseServiceImpl&lt;Station, Integer&gt; implem @@ -1436,6 +1488,12 @@ public class StationServiceImpl extends BaseServiceImpl&lt;Station, Integer&gt; implem
1436 // 更新里程 1488 // 更新里程
1437 updateLineInfoUpOrDownMileage( resultLine , directions, sumUpOrDownMileage); 1489 updateLineInfoUpOrDownMileage( resultLine , directions, sumUpOrDownMileage);
1438 1490
  1491 + if(directions==0) {
  1492 +
  1493 + lineUpdateStationName(resultLine);
  1494 +
  1495 + }
  1496 +
1439 resultMap.put("status", ResponseCode.SUCCESS); 1497 resultMap.put("status", ResponseCode.SUCCESS);
1440 1498
1441 } catch (Exception e) { 1499 } catch (Exception e) {
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/util/FTPClientUtils.java
@@ -11,6 +11,7 @@ import java.io.OutputStream; @@ -11,6 +11,7 @@ import java.io.OutputStream;
11 import java.io.UnsupportedEncodingException; 11 import java.io.UnsupportedEncodingException;
12 12
13 import org.apache.commons.net.ftp.FTPClient; 13 import org.apache.commons.net.ftp.FTPClient;
  14 +import org.apache.commons.net.ftp.FTPFile;
14 import org.apache.commons.net.ftp.FTPReply; 15 import org.apache.commons.net.ftp.FTPReply;
15 /** 16 /**
16 * @Description: 向FTP服务器上传文件 17 * @Description: 向FTP服务器上传文件
@@ -66,13 +67,16 @@ public class FTPClientUtils { @@ -66,13 +67,16 @@ public class FTPClientUtils {
66 67
67 ftp.changeWorkingDirectory(path); 68 ftp.changeWorkingDirectory(path);
68 69
69 - ftp.storeFile(filename, input); 70 + ftp.enterLocalPassiveMode();
  71 +
  72 + success = ftp.storeFile(new String(filename.getBytes("gbk"),"gbk"), input);
  73 + /*success = ftp.storeFile(filename, input); */
70 74
71 input.close(); 75 input.close();
72 76
73 ftp.logout(); 77 ftp.logout();
74 78
75 - success = true; 79 + // success = true;
76 80
77 } catch (IOException e) { 81 } catch (IOException e) {
78 82
@@ -97,8 +101,25 @@ public class FTPClientUtils { @@ -97,8 +101,25 @@ public class FTPClientUtils {
97 return success; 101 return success;
98 } 102 }
99 103
100 - // 将本地文件上传到FTP服务器上  
101 - public void testUpLoadFromDisk(File file,String name,String url, int port, String username, String password, String remotePath){ 104 + /**
  105 + * @Description : TOOD(将本地文件上传到FTP服务器上)
  106 + *
  107 + * @param file
  108 + *
  109 + * @param name
  110 + *
  111 + * @param url
  112 + *
  113 + * @param port
  114 + *
  115 + * @param username
  116 + *
  117 + * @param password
  118 + *
  119 + * @param remotePath
  120 + *
  121 + */
  122 + public void FTPUpLoadFromDisk(File file,String name,String url, int port, String username, String password, String remotePath){
102 123
103 try { 124 try {
104 FileInputStream in=new FileInputStream(file); 125 FileInputStream in=new FileInputStream(file);
@@ -137,16 +158,21 @@ public class FTPClientUtils { @@ -137,16 +158,21 @@ public class FTPClientUtils {
137 } 158 }
138 159
139 /** 160 /**
140 - * <删除FTP上的文件>  
141 - * <远程删除FTP服务器上的录音文件> 161 + * @Description (删除FTP上的文件)
  162 + *
142 * @param url FTP服务器IP地址 163 * @param url FTP服务器IP地址
  164 + *
143 * @param port FTP服务器端口 165 * @param port FTP服务器端口
  166 + *
144 * @param username FTP服务器登录名 167 * @param username FTP服务器登录名
  168 + *
145 * @param password FTP服务器密码 169 * @param password FTP服务器密码
  170 + *
146 * @param remotePath 远程文件路径 171 * @param remotePath 远程文件路径
  172 + *
147 * @param fileName 待删除的文件名 173 * @param fileName 待删除的文件名
148 - * @return  
149 - * @see [类、类#方法、类#成员] 174 + *
  175 + * @return boolean
150 */ 176 */
151 public static boolean deleteFtpFile(String url, int port, String username, String password, String remotePath, String fileName){ 177 public static boolean deleteFtpFile(String url, int port, String username, String password, String remotePath, String fileName){
152 178
@@ -170,8 +196,6 @@ public class FTPClientUtils { @@ -170,8 +196,6 @@ public class FTPClientUtils {
170 // 登录 196 // 登录
171 ftp.login(username, password); 197 ftp.login(username, password);
172 198
173 -  
174 -  
175 reply = ftp.getReplyCode(); 199 reply = ftp.getReplyCode();
176 200
177 if (!FTPReply.isPositiveCompletion(reply)) { 201 if (!FTPReply.isPositiveCompletion(reply)) {
@@ -185,7 +209,9 @@ public class FTPClientUtils { @@ -185,7 +209,9 @@ public class FTPClientUtils {
185 209
186 ftp.changeWorkingDirectory(remotePath); 210 ftp.changeWorkingDirectory(remotePath);
187 211
188 - success = ftp.deleteFile(fileName); 212 + /*success = ftp.deleteFile(fileName);*/
  213 +
  214 + success = ftp.deleteFile(new String(fileName.getBytes("gbk"),"gbk"));
189 215
190 ftp.logout(); 216 ftp.logout();
191 217
@@ -217,6 +243,8 @@ public class FTPClientUtils { @@ -217,6 +243,8 @@ public class FTPClientUtils {
217 public static File GetFtpFile(String url, int port, String username, String password, String remotePath, String fileName){ 243 public static File GetFtpFile(String url, int port, String username, String password, String remotePath, String fileName){
218 244
219 FTPClient ftp = new FTPClient(); 245 FTPClient ftp = new FTPClient();
  246 +
  247 + /*File destFile = new File(fileName); */
220 248
221 File destFile = new File(fileName); 249 File destFile = new File(fileName);
222 250
@@ -247,16 +275,42 @@ public class FTPClientUtils { @@ -247,16 +275,42 @@ public class FTPClientUtils {
247 ftp.disconnect(); 275 ftp.disconnect();
248 276
249 } 277 }
250 - 278 +
251 // 转移到FTP服务器目录 279 // 转移到FTP服务器目录
252 - 280 +
253 ftp.changeWorkingDirectory(remotePath); 281 ftp.changeWorkingDirectory(remotePath);
254 282
255 - File srcFile = new File(fileName); 283 + ftp.enterLocalPassiveMode();
  284 +
  285 + FTPFile[] fs = ftp.listFiles();
  286 +
  287 + System.out.println(fs.length);
  288 +
  289 + /* for (FTPFile ff : fs) {
  290 + //解决中文乱码问题,两次解码
  291 + byte[] bytes=ff.getName().getBytes("gbk");
  292 + String fn=new String(bytes,"gbk");
  293 + if (fn.equals(fileName)) {
  294 + //6.写操作,将其写入到本地文件中
  295 + File localFile = new File(ff.getName());
  296 +
  297 +
  298 + OutputStream is = new FileOutputStream(localFile);
  299 + ftp.retrieveFile(ff.getName(), is);
  300 + is.close();
  301 + }
  302 + } */
  303 +
  304 + /* File srcFile = new File(fileName); */
  305 +
  306 + /* File srcFile = new File(new String(fileName.getBytes("gbk"),"gbk"));*/
256 307
257 int byteread = 0; // 读取的字节数 308 int byteread = 0; // 读取的字节数
  309 +
  310 + /* in = ftp.retrieveFileStream(remotePath + fileName);*/
258 311
259 - in = ftp.retrieveFileStream(fileName); 312 + in = ftp.retrieveFileStream(new String(fileName.getBytes("gbk"),"gbk"));
  313 +
260 314
261 out = new FileOutputStream(destFile); 315 out = new FileOutputStream(destFile);
262 316
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/ftp.properties
@@ -2,7 +2,7 @@ ftp.url=222.66.0.205 @@ -2,7 +2,7 @@ ftp.url=222.66.0.205
2 ftp.port=21 2 ftp.port=21
3 ftp.username=transport 3 ftp.username=transport
4 ftp.password=transport123 4 ftp.password=transport123
5 -ftp.path= down/ 5 +ftp.path=down/
6 6
7 #ftp.url=192.168.168.101 7 #ftp.url=192.168.168.101
8 #ftp.port=21 8 #ftp.port=21
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/base/line/js/line-add-form.js
@@ -49,6 +49,8 @@ $(function(){ @@ -49,6 +49,8 @@ $(function(){
49 // 填充公司下拉框选择值 49 // 填充公司下拉框选择值
50 $get('/business/all', {upCode_eq: '77'}, function(array){ 50 $get('/business/all', {upCode_eq: '77'}, function(array){
51 51
  52 + console.log(array);
  53 +
52 // 公司下拉options属性值 54 // 公司下拉options属性值
53 var options = '<option value="">-- 请选择公司 --</option>'; 55 var options = '<option value="">-- 请选择公司 --</option>';
54 56
src/main/resources/static/pages/base/line/js/line-edit-form.js
@@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@
12 // 初始化公司下拉框 12 // 初始化公司下拉框
13 selectTemp(function(){ 13 selectTemp(function(){
14 14
15 - // 根据ID查询详细信息 15 + /** 根据ID查询详细信息 */
16 $get('/line/' + lineId ,null, function(result){ 16 $get('/line/' + lineId ,null, function(result){
17 17
18 // 如果不为空 18 // 如果不为空
@@ -24,7 +24,7 @@ @@ -24,7 +24,7 @@
24 // 设置日期 24 // 设置日期
25 result.openDate = moment(result.openDate).format(fs); 25 result.openDate = moment(result.openDate).format(fs);
26 26
27 - // 填充修改线路表单元素值 27 + /** 填充修改线路表单元素值 @param:<result:数据结果集;line_edit_form:表单元素> */
28 putFormData(result, '#line_edit_form'); 28 putFormData(result, '#line_edit_form');
29 29
30 // 设置公司值 30 // 设置公司值
@@ -60,7 +60,7 @@ @@ -60,7 +60,7 @@
60 // 输入线路名称,自动生成英文名称和线路简称 60 // 输入线路名称,自动生成英文名称和线路简称
61 $('#nameInput').on('keyup', setPinYin); 61 $('#nameInput').on('keyup', setPinYin);
62 62
63 - // 根据线路名称值设置英文名称值和线路简称 63 + /** 根据线路名称值设置英文名称值和线路简称 */
64 function setPinYin(){ 64 function setPinYin(){
65 65
66 // 获取线路名称值 66 // 获取线路名称值
@@ -74,7 +74,7 @@ @@ -74,7 +74,7 @@
74 } 74 }
75 75
76 76
77 - // 公司下拉框 77 + /** 公司下拉框 @param:<callback:回调函数> */
78 function selectTemp(callback) { 78 function selectTemp(callback) {
79 79
80 // 填充公司下拉框选择值 80 // 填充公司下拉框选择值
@@ -453,7 +453,7 @@ @@ -453,7 +453,7 @@
453 } 453 }
454 }); 454 });
455 455
456 - // 联系电话(手机/电话皆可)验证 456 + /** 联系电话(手机/电话皆可)验证 */
457 $.validator.addMethod("isPhone", function(value,element) { 457 $.validator.addMethod("isPhone", function(value,element) {
458 458
459 // 长度 459 // 长度
src/main/resources/static/pages/base/line/js/line-list-table.js
1 /** 1 /**
2 * 2 *
3 - * @JSName : list.js(线路信息list.html页面js) 3 + * @JSName : line-list-table.js(线路信息list.html页面js)
4 * 4 *
5 * @Author : bsth@lq 5 * @Author : bsth@lq
6 * 6 *
@@ -27,14 +27,16 @@ @@ -27,14 +27,16 @@
27 27
28 }); 28 });
29 29
30 - // 填充公司下拉框options,并添加公司下拉框值改变事件setbrancheCompanySelectOptions 30 + // 填充公司下拉框options
31 $('#companySelect').html(options) 31 $('#companySelect').html(options)
  32 +
  33 + /** 闵行没下属公司,这里暂时注释公司值改变事件 */
32 //$('#companySelect').html(options).on('change', setbrancheCompanySelectOptions); 34 //$('#companySelect').html(options).on('change', setbrancheCompanySelectOptions);
33 35
34 }); 36 });
35 37
36 - /** 填充分公司下拉框 */  
37 - setbrancheCompanySelectOptions(); 38 + /** 填充分公司下拉框。--- 闵行没下属公司,这里暂时注释*/
  39 + /* setbrancheCompanySelectOptions();*/
38 40
39 /** 填充分公司下拉框选择值 */ 41 /** 填充分公司下拉框选择值 */
40 function setbrancheCompanySelectOptions(){ 42 function setbrancheCompanySelectOptions(){
@@ -53,7 +55,7 @@ @@ -53,7 +55,7 @@
53 55
54 } else { 56 } else {
55 57
56 - // 查询出所属公司下的分公司名称和相应分公司代码 58 + /** 查询出所属公司下的分公司名称和相应分公司代码 @param:<upCode_eq:公司代码> */
57 $get('/business/all', {upCode_eq: businessCode}, function(array){ 59 $get('/business/all', {upCode_eq: businessCode}, function(array){
58 60
59 // 遍历array 61 // 遍历array
@@ -75,7 +77,7 @@ @@ -75,7 +77,7 @@
75 // 选择框 77 // 选择框
76 var icheckOptions = {checkboxClass: 'icheckbox_flat-blue',increaseArea: '20%'}; 78 var icheckOptions = {checkboxClass: 'icheckbox_flat-blue',increaseArea: '20%'};
77 79
78 - // 表格数据分页加载 80 + /** 表格数据分页加载 @param:<null:搜索参数;true:是否重新分页> */
79 loadTableDate(null,true); 81 loadTableDate(null,true);
80 82
81 /** 重置按钮事件 */ 83 /** 重置按钮事件 */
@@ -84,7 +86,7 @@ @@ -84,7 +86,7 @@
84 // 清空搜索框值 86 // 清空搜索框值
85 $('tr.filter input,select').val('').change(); 87 $('tr.filter input,select').val('').change();
86 88
87 - // 重新加载表格数据 89 + /** 表格数据分页加载 @param:<null:搜索参数;true:是否重新分页> */
88 loadTableDate(null,true); 90 loadTableDate(null,true);
89 }); 91 });
90 92
@@ -120,8 +122,10 @@ @@ -120,8 +122,10 @@
120 } 122 }
121 } 123 }
122 }); 124 });
  125 +
123 page = 0; 126 page = 0;
124 127
  128 + /** 表格数据分页加载 @param:<params:搜索参数;true:是否重新分页> */
125 loadTableDate(params,true); 129 loadTableDate(params,true);
126 }); 130 });
127 131
@@ -149,8 +153,6 @@ @@ -149,8 +153,6 @@
149 // 异步请求获取表格数据 153 // 异步请求获取表格数据
150 $.get('/line',params,function(result){ 154 $.get('/line',params,function(result){
151 155
152 - console.log(result);  
153 -  
154 // 添加序号 156 // 添加序号
155 result.content.page = page; 157 result.content.page = page;
156 158
@@ -244,7 +246,7 @@ @@ -244,7 +246,7 @@
244 }); 246 });
245 } 247 }
246 248
247 - // 生成行单 249 + /** 生成行单,这里暂时只做了单选生成。 */
248 $('#datatable_ajax_tools #createUsingSingle').on('click', function() { 250 $('#datatable_ajax_tools #createUsingSingle').on('click', function() {
249 251
250 // 获取选中行 252 // 获取选中行
@@ -275,11 +277,13 @@ @@ -275,11 +277,13 @@
275 277
276 lineName = arrChk.val(); 278 lineName = arrChk.val();
277 279
  280 + // 请求参数
278 var params = {lineId:id}; 281 var params = {lineId:id};
279 282
280 // 弹出正在加载层 283 // 弹出正在加载层
281 var index = layer.load(0); 284 var index = layer.load(0);
282 285
  286 + /** 生成线路行单 @pararm:<params:请求参数> */
283 $post('/stationroute/usingSingle',params,function(data) { 287 $post('/stationroute/usingSingle',params,function(data) {
284 288
285 // 关闭弹出框 289 // 关闭弹出框
src/main/resources/static/pages/base/line/list.html
@@ -53,6 +53,7 @@ @@ -53,6 +53,7 @@
53 <th width="7%">线路编码</th> 53 <th width="7%">线路编码</th>
54 <th width="8%">线路名称</th> 54 <th width="8%">线路名称</th>
55 <th width="7%">所属公司</th> 55 <th width="7%">所属公司</th>
  56 + <!-- 闵行没有下属公司,这里暂时注释掉 -->
56 <!-- <th width="8%">所属分公司</th> --> 57 <!-- <th width="8%">所属分公司</th> -->
57 <th width="6%">线路性质</th> 58 <th width="6%">线路性质</th>
58 <th width="6%">线路等级</th> 59 <th width="6%">线路等级</th>
@@ -72,12 +73,15 @@ @@ -72,12 +73,15 @@
72 <input type="text" class="form-control form-filter input-sm" name="name_like"> 73 <input type="text" class="form-control form-filter input-sm" name="name_like">
73 </td> 74 </td>
74 <td> 75 <td>
  76 + <!-- 公司这里没使用字典表,暂时查的公司表 -->
75 <select name="company_eq" class="form-control" id="companySelect"></select> 77 <select name="company_eq" class="form-control" id="companySelect"></select>
76 </td> 78 </td>
  79 + <!-- 闵行没有下属公司,这里暂时注释掉 -->
77 <!-- <td> 80 <!-- <td>
78 <select name="brancheCompany_eq" class="form-control" id="brancheCompanySelect"></select> 81 <select name="brancheCompany_eq" class="form-control" id="brancheCompanySelect"></select>
79 </td> --> 82 </td> -->
80 <td> 83 <td>
  84 + <!-- 这里没使用字典表,暂时写在页面上 -->
81 <select name="nature_like" class="form-control" id="natureSelect"> 85 <select name="nature_like" class="form-control" id="natureSelect">
82 <option value="">请选择...</option> 86 <option value="">请选择...</option>
83 <option value="lj">路救</option> 87 <option value="lj">路救</option>
@@ -93,6 +97,7 @@ @@ -93,6 +97,7 @@
93 </select> 97 </select>
94 </td> 98 </td>
95 <td> 99 <td>
  100 + <!-- 这里没使用字典表,暂时写在页面上 -->
96 <select name="level_eq" class="form-control" id="levelSelect"> 101 <select name="level_eq" class="form-control" id="levelSelect">
97 <option value="">请选择...</option> 102 <option value="">请选择...</option>
98 <option value="1">一级线路</option> 103 <option value="1">一级线路</option>
@@ -104,6 +109,7 @@ @@ -104,6 +109,7 @@
104 <input type="text" class="form-control form-filter input-sm" name="shanghaiLinecode_eq"> 109 <input type="text" class="form-control form-filter input-sm" name="shanghaiLinecode_eq">
105 </td> 110 </td>
106 <td> 111 <td>
  112 + <!-- 这里没使用字典表,暂时写在页面上 -->
107 <select class="form-control form-filter " name="destroy_eq"> 113 <select class="form-control form-filter " name="destroy_eq">
108 <option value="">请选择...</option> 114 <option value="">请选择...</option>
109 <option value="0">运营</option> 115 <option value="0">运营</option>
@@ -225,7 +231,6 @@ @@ -225,7 +231,6 @@
225 闵行公司 231 闵行公司
226 {{/if}} 232 {{/if}}
227 </td> 233 </td>
228 -  
229 <td> 234 <td>
230 {{if obj.nature == 'lj'}} 235 {{if obj.nature == 'lj'}}
231 路救 236 路救
src/main/resources/static/pages/base/stationroute/editsection.html
@@ -399,9 +399,7 @@ $(&#39;#edit_section_mobal&#39;).on(&#39;editSectionMobal_show&#39;, function(e, map_,ajaxd,sect @@ -399,9 +399,7 @@ $(&#39;#edit_section_mobal&#39;).on(&#39;editSectionMobal_show&#39;, function(e, map_,ajaxd,sect
399 399
400 console.log(params); 400 console.log(params);
401 401
402 - return;  
403 -  
404 - ajaxd.sectionUpdata(params,function(resuntDate) { 402 + ajaxd.sectionUpdate(params,function(resuntDate) {
405 403
406 if(resuntDate.status=='SUCCESS') { 404 if(resuntDate.status=='SUCCESS') {
407 405
src/main/resources/static/pages/base/stationroute/js/stationroute-list-function.js
@@ -431,6 +431,9 @@ var PublicFunctions = function () { @@ -431,6 +431,9 @@ var PublicFunctions = function () {
431 431
432 var Line = LineObj.getLineObj(); 432 var Line = LineObj.getLineObj();
433 433
  434 + // 刷行左边树
  435 + PublicFunctions.resjtreeDate(Line.id,stationRouteDirections);
  436 +
434 /** 查询上行路段信息 @param:<Line.id:线路Id;0:上行> @return:data:上行路段数据 */ 437 /** 查询上行路段信息 @param:<Line.id:线路Id;0:上行> @return:data:上行路段数据 */
435 GetAjaxData.getSectionRouteInfo(Line.id,stationRouteDirections,function(data) { 438 GetAjaxData.getSectionRouteInfo(Line.id,stationRouteDirections,function(data) {
436 439
src/main/resources/static/pages/base/stationroute/list.html
@@ -85,7 +85,7 @@ @@ -85,7 +85,7 @@
85 </div> 85 </div>
86 <!-- 树 --> 86 <!-- 树 -->
87 <div class="portlet-body"> 87 <div class="portlet-body">
88 - <div id="station_Up_tree" style="height: 550px;overflow-y: auto;"></div> 88 + <div id="station_Up_tree" style="height: auto;max-height: 500px;overflow-y: auto;"></div>
89 </div> 89 </div>
90 </div> 90 </div>
91 91
@@ -167,7 +167,7 @@ @@ -167,7 +167,7 @@
167 </div> 167 </div>
168 <!-- 树 --> 168 <!-- 树 -->
169 <div class="portlet-body"> 169 <div class="portlet-body">
170 - <div id="station_Down_tree" style="height: 550px;overflow-y: auto;"></div> 170 + <div id="station_Down_tree" style="height: auto;max-height: 500px;overflow-y: auto;"></div>
171 </div> 171 </div>
172 </div> 172 </div>
173 173
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>