Commit a9adf14cf304ad50105d3d3c3bb52fd672479662

Authored by 潘钊
2 parents 4f544f09 1de463e6

Merge branch 'minhang' into pudong

# Conflicts:
#	src/main/resources/application-dev.properties
Showing 52 changed files with 1275 additions and 273 deletions
src/main/java/com/bsth/data/ThreadMonotor.java 0 → 100644
  1 +package com.bsth.data;
  2 +
  3 +import com.bsth.data.gpsdata.arrival.GpsRealAnalyse;
  4 +import com.bsth.data.msg_queue.DirectivePushQueue;
  5 +import com.bsth.data.msg_queue.WebSocketPushQueue;
  6 +import org.slf4j.Logger;
  7 +import org.slf4j.LoggerFactory;
  8 +import org.springframework.stereotype.Component;
  9 +
  10 +/**
  11 + * Created by panzhao on 2017/5/11.
  12 + */
  13 +@Component
  14 +public class ThreadMonotor extends Thread{
  15 +
  16 + Logger log = LoggerFactory.getLogger(this.getClass());
  17 +
  18 + @Override
  19 + public void run() {
  20 +
  21 + //线调GPS分析线程
  22 + if(GpsRealAnalyse.isBlock()){
  23 + log.warn("GpsRealAnalyse isBlock true !!!!");
  24 + GpsRealAnalyse.shutdown();
  25 + }
  26 +
  27 + //webSocket 消息推送队列
  28 + if(WebSocketPushQueue.isIdle()){
  29 + log.warn("WebSocketPushQueue isIdle true !!!!");
  30 + WebSocketPushQueue.start();
  31 + }
  32 +
  33 + //系统自动发送的网关指令 推送队列
  34 + if(DirectivePushQueue.isIdle()){
  35 + log.warn("DirectivePushQueue isIdle true !!!!");
  36 + DirectivePushQueue.start();
  37 + }
  38 + }
  39 +}
src/main/java/com/bsth/data/directive/DayOfDirectives.java
@@ -57,10 +57,11 @@ public class DayOfDirectives { @@ -57,10 +57,11 @@ public class DayOfDirectives {
57 pstDirectives = new LinkedList<>(); 57 pstDirectives = new LinkedList<>();
58 } 58 }
59 59
60 - public void put60(D60 d60) { 60 + public void put60(D60 d60, boolean pst) {
61 d60Map.put(d60.getMsgId(), d60); 61 d60Map.put(d60.getMsgId(), d60);
62 //等待持久化 62 //等待持久化
63 - pstDirectives.add(d60); 63 + if(pst)
  64 + pstDirectives.add(d60);
64 } 65 }
65 66
66 public void put64(D64 d64) { 67 public void put64(D64 d64) {
src/main/java/com/bsth/data/directive/GatewayHttpUtils.java
@@ -41,8 +41,8 @@ public class GatewayHttpUtils { @@ -41,8 +41,8 @@ public class GatewayHttpUtils {
41 41
42 //超时时间 42 //超时时间
43 RequestConfig requestConfig = RequestConfig.custom() 43 RequestConfig requestConfig = RequestConfig.custom()
44 - .setConnectTimeout(3000).setConnectionRequestTimeout(1000)  
45 - .setSocketTimeout(3000).build(); 44 + .setConnectTimeout(1500).setConnectionRequestTimeout(1000)
  45 + .setSocketTimeout(1500).build();
46 46
47 HttpPost post = new HttpPost(url); 47 HttpPost post = new HttpPost(url);
48 48
src/main/java/com/bsth/data/gpsdata/GpsRealData.java
@@ -4,7 +4,6 @@ import com.bsth.data.BasicData; @@ -4,7 +4,6 @@ import com.bsth.data.BasicData;
4 import com.bsth.data.forecast.ForecastRealServer; 4 import com.bsth.data.forecast.ForecastRealServer;
5 import com.bsth.data.gpsdata.thread.GpsDataLoaderThread; 5 import com.bsth.data.gpsdata.thread.GpsDataLoaderThread;
6 import com.bsth.data.gpsdata.thread.OfflineMonitorThread; 6 import com.bsth.data.gpsdata.thread.OfflineMonitorThread;
7 -import com.bsth.data.gpsdata.thread.ThreadPollMonitor;  
8 import com.bsth.data.schedule.DayOfSchedule; 7 import com.bsth.data.schedule.DayOfSchedule;
9 import com.bsth.entity.realcontrol.ScheduleRealInfo; 8 import com.bsth.entity.realcontrol.ScheduleRealInfo;
10 import com.google.common.collect.TreeMultimap; 9 import com.google.common.collect.TreeMultimap;
@@ -47,9 +46,6 @@ public class GpsRealData implements CommandLineRunner { @@ -47,9 +46,6 @@ public class GpsRealData implements CommandLineRunner {
47 @Autowired 46 @Autowired
48 ForecastRealServer forecastRealServer; 47 ForecastRealServer forecastRealServer;
49 48
50 - @Autowired  
51 - ThreadPollMonitor threadPollMonitor;  
52 -  
53 /** 49 /**
54 * 构造函数 50 * 构造函数
55 */ 51 */
@@ -60,15 +56,11 @@ public class GpsRealData implements CommandLineRunner { @@ -60,15 +56,11 @@ public class GpsRealData implements CommandLineRunner {
60 56
61 @Override 57 @Override
62 public void run(String... arg0) throws Exception { 58 public void run(String... arg0) throws Exception {
63 - logger.info("gpsDataLoader,20,3"); 59 + logger.info("gpsDataLoader,30,2");
64 //http形式获取GPS数据 60 //http形式获取GPS数据
65 - //Application.mainServices.scheduleWithFixedDelay(gpsDataLoader, 20, 2, TimeUnit.SECONDS); 61 + //Application.mainServices.scheduleWithFixedDelay(gpsDataLoader, 30, 2, TimeUnit.SECONDS);
66 //定时扫描掉离线 62 //定时扫描掉离线
67 //Application.mainServices.scheduleWithFixedDelay(offlineMonitorThread, 120, 60, TimeUnit.SECONDS); 63 //Application.mainServices.scheduleWithFixedDelay(offlineMonitorThread, 120, 60, TimeUnit.SECONDS);
68 -  
69 - //扫描GPS线程池状态  
70 - //Application.mainServices.scheduleWithFixedDelay(threadPollMonitor, 60, 20, TimeUnit.SECONDS);  
71 -  
72 } 64 }
73 65
74 66
@@ -89,19 +81,29 @@ public class GpsRealData implements CommandLineRunner { @@ -89,19 +81,29 @@ public class GpsRealData implements CommandLineRunner {
89 gps.setExpectStopTime(forecastRealServer.expectStopTime(gps.getNbbm())); 81 gps.setExpectStopTime(forecastRealServer.expectStopTime(gps.getNbbm()));
90 } 82 }
91 } 83 }
92 - } catch (Exception e) {  
93 - logger.error("", e);  
94 - }  
95 84
96 - //刷新对照  
97 - gpsMap.put(device, gps);  
98 - if (StringUtils.isNotBlank(gps.getLineId())) {  
99 - //站点名称  
100 - gps.setStationName(getStationName(gps));  
101 - lineCode2Devices.put(gps.getLineId(), device); 85 + //刷新对照
  86 + gpsMap.put(device, gps);
  87 + if (StringUtils.isNotBlank(gps.getLineId())) {
  88 + //站点名称
  89 + gps.setStationName(getStationName(gps));
  90 + lineCode2Devices.put(gps.getLineId(), device);
  91 +
  92 + if(old != null && !gps.getLineId().equals(old.getLineId()))
  93 + lineCode2Devices.remove(old.getLineId(), device);
  94 + }
102 95
103 - if(old != null && !gps.getLineId().equals(old.getLineId()))  
104 - lineCode2Devices.remove(old.getLineId(), device); 96 + //车辆换设备了
  97 + String nbbm = gps.getNbbm();
  98 + if(old != null && StringUtils.isNotEmpty(nbbm) && !nbbm.equals(old.getNbbm())){
  99 + List<GpsEntity> list = findByNbbm(nbbm);
  100 + for(GpsEntity g : list){
  101 + if(!g.getDeviceId().equals(device))
  102 + gpsMap.remove(g.getDeviceId());
  103 + }
  104 + }
  105 + } catch (Exception e) {
  106 + logger.error("", e);
105 } 107 }
106 } 108 }
107 109
@@ -116,6 +118,16 @@ public class GpsRealData implements CommandLineRunner { @@ -116,6 +118,16 @@ public class GpsRealData implements CommandLineRunner {
116 return gpsMap.get(deviceId); 118 return gpsMap.get(deviceId);
117 } 119 }
118 120
  121 + public List<GpsEntity> findByNbbm(String nbbm){
  122 + Collection<GpsEntity> arr = gpsMap.values();
  123 + List<GpsEntity> rs = new ArrayList<>();
  124 + for(GpsEntity g : arr){
  125 + if(nbbm.equals(g.getNbbm()))
  126 + rs.add(g);
  127 + }
  128 + return rs;
  129 + }
  130 +
119 /** 131 /**
120 * @Title: get @Description: TODO(线路编码获取GPS集合) @throws 132 * @Title: get @Description: TODO(线路编码获取GPS集合) @throws
121 */ 133 */
src/main/java/com/bsth/data/gpsdata/arrival/GpsRealAnalyse.java
@@ -11,10 +11,7 @@ import org.slf4j.LoggerFactory; @@ -11,10 +11,7 @@ import org.slf4j.LoggerFactory;
11 import org.springframework.beans.factory.annotation.Autowired; 11 import org.springframework.beans.factory.annotation.Autowired;
12 import org.springframework.stereotype.Component; 12 import org.springframework.stereotype.Component;
13 13
14 -import java.util.Collections;  
15 -import java.util.Comparator;  
16 -import java.util.List;  
17 -import java.util.Set; 14 +import java.util.*;
18 import java.util.concurrent.CountDownLatch; 15 import java.util.concurrent.CountDownLatch;
19 import java.util.concurrent.ExecutorService; 16 import java.util.concurrent.ExecutorService;
20 import java.util.concurrent.Executors; 17 import java.util.concurrent.Executors;
@@ -44,15 +41,18 @@ public class GpsRealAnalyse { @@ -44,15 +41,18 @@ public class GpsRealAnalyse {
44 @Autowired 41 @Autowired
45 GpsRealData gpsRealData; 42 GpsRealData gpsRealData;
46 43
47 - static ExecutorService threadPool = Executors.newFixedThreadPool(100); 44 + static ExecutorService threadPool = Executors.newFixedThreadPool(20);
48 45
49 public static long st; 46 public static long st;
50 public static CountDownLatch count; 47 public static CountDownLatch count;
51 48
  49 + public static boolean isBlock() {
  50 + return System.currentTimeMillis() - st > 1000 * 20;
  51 + }
  52 +
52 public void analyse(List<GpsEntity> list) { 53 public void analyse(List<GpsEntity> list) {
53 try { 54 try {
54 st = System.currentTimeMillis(); 55 st = System.currentTimeMillis();
55 - //如果正在恢复数据  
56 if (GpsDataRecovery.run) 56 if (GpsDataRecovery.run)
57 return; 57 return;
58 58
@@ -63,6 +63,7 @@ public class GpsRealAnalyse { @@ -63,6 +63,7 @@ public class GpsRealAnalyse {
63 } 63 }
64 64
65 Set<String> ks = multimap.keySet(); 65 Set<String> ks = multimap.keySet();
  66 +
66 logger.info("analyse gps size: " + list.size() + ", ks: " + ks.size()); 67 logger.info("analyse gps size: " + list.size() + ", ks: " + ks.size());
67 count = new CountDownLatch(ks.size()); 68 count = new CountDownLatch(ks.size());
68 69
@@ -125,7 +126,7 @@ public class GpsRealAnalyse { @@ -125,7 +126,7 @@ public class GpsRealAnalyse {
125 abnormalStateHandle.handle(gps, prevs); 126 abnormalStateHandle.handle(gps, prevs);
126 127
127 if (!task) 128 if (!task)
128 - return; //无任务的,到这里就结束 129 + continue; //无任务的,到这里就结束
129 130
130 //反向处理 131 //反向处理
131 reverseSignalHandle.handle(gps, prevs); 132 reverseSignalHandle.handle(gps, prevs);
src/main/java/com/bsth/data/gpsdata/arrival/handlers/InOutStationSignalHandle.java
@@ -6,12 +6,12 @@ import com.bsth.data.gpsdata.arrival.SignalHandle; @@ -6,12 +6,12 @@ import com.bsth.data.gpsdata.arrival.SignalHandle;
6 import com.bsth.data.gpsdata.arrival.utils.CircleQueue; 6 import com.bsth.data.gpsdata.arrival.utils.CircleQueue;
7 import com.bsth.data.gpsdata.arrival.utils.ScheduleSignalState; 7 import com.bsth.data.gpsdata.arrival.utils.ScheduleSignalState;
8 import com.bsth.data.gpsdata.arrival.utils.SignalSchPlanMatcher; 8 import com.bsth.data.gpsdata.arrival.utils.SignalSchPlanMatcher;
  9 +import com.bsth.data.msg_queue.DirectivePushQueue;
9 import com.bsth.data.schedule.DayOfSchedule; 10 import com.bsth.data.schedule.DayOfSchedule;
10 import com.bsth.data.schedule.ScheduleComparator; 11 import com.bsth.data.schedule.ScheduleComparator;
11 import com.bsth.data.schedule.late_adjust.LateAdjustHandle; 12 import com.bsth.data.schedule.late_adjust.LateAdjustHandle;
12 import com.bsth.entity.realcontrol.LineConfig; 13 import com.bsth.entity.realcontrol.LineConfig;
13 import com.bsth.entity.realcontrol.ScheduleRealInfo; 14 import com.bsth.entity.realcontrol.ScheduleRealInfo;
14 -import com.bsth.service.directive.DirectiveService;  
15 import com.bsth.websocket.handler.SendUtils; 15 import com.bsth.websocket.handler.SendUtils;
16 import org.apache.commons.lang3.StringUtils; 16 import org.apache.commons.lang3.StringUtils;
17 import org.slf4j.Logger; 17 import org.slf4j.Logger;
@@ -41,9 +41,6 @@ public class InOutStationSignalHandle extends SignalHandle{ @@ -41,9 +41,6 @@ public class InOutStationSignalHandle extends SignalHandle{
41 SendUtils sendUtils; 41 SendUtils sendUtils;
42 42
43 @Autowired 43 @Autowired
44 - DirectiveService directiveService;  
45 -  
46 - @Autowired  
47 ScheduleSignalState scheduleSignalState; 44 ScheduleSignalState scheduleSignalState;
48 45
49 @Autowired 46 @Autowired
@@ -151,7 +148,8 @@ public class InOutStationSignalHandle extends SignalHandle{ @@ -151,7 +148,8 @@ public class InOutStationSignalHandle extends SignalHandle{
151 148
152 if(sch.getBcType().equals("out")){ 149 if(sch.getBcType().equals("out")){
153 //出场时,切换成营运状态 150 //出场时,切换成营运状态
154 - directiveService.send60Operation(sch.getClZbh(), 0, Integer.parseInt(sch.getXlDir()), null, "出场@系统"); 151 + DirectivePushQueue.put6003(sch.getClZbh(), 0, Integer.parseInt(sch.getXlDir()), null, "出场@系统");
  152 + //directiveService.send60Operation(sch.getClZbh(), 0, Integer.parseInt(sch.getXlDir()), null, "出场@系统");
155 } 153 }
156 //出站既出场 154 //出站既出场
157 outStationAndOutPark(sch); 155 outStationAndOutPark(sch);
@@ -208,7 +206,8 @@ public class InOutStationSignalHandle extends SignalHandle{ @@ -208,7 +206,8 @@ public class InOutStationSignalHandle extends SignalHandle{
208 206
209 if(schPrev.getBcType().equals("out")){ 207 if(schPrev.getBcType().equals("out")){
210 //出场时,切换成营运状态 208 //出场时,切换成营运状态
211 - directiveService.send60Operation(schPrev.getClZbh(), 0, Integer.parseInt(schPrev.getXlDir()), null, "出场@系统"); 209 + DirectivePushQueue.put6003(schPrev.getClZbh(), 0, Integer.parseInt(schPrev.getXlDir()), null, "出场@系统");
  210 + //directiveService.send60Operation(schPrev.getClZbh(), 0, Integer.parseInt(schPrev.getXlDir()), null, "出场@系统");
212 } 211 }
213 } 212 }
214 } 213 }
@@ -276,15 +275,19 @@ public class InOutStationSignalHandle extends SignalHandle{ @@ -276,15 +275,19 @@ public class InOutStationSignalHandle extends SignalHandle{
276 //将gps转换为下一个班次走向的站内信号 275 //将gps转换为下一个班次走向的站内信号
277 transformUpdown(gps, next); 276 transformUpdown(gps, next);
278 //下发调度指令 277 //下发调度指令
279 - directiveService.send60Dispatch(next, doneSum, "到站@系统"); 278 + DirectivePushQueue.put6002(next, doneSum, "到站@系统");
  279 + //directiveService.send60Dispatch(next, doneSum, "到站@系统");
280 280
281 //套跑 -下发线路切换指令 281 //套跑 -下发线路切换指令
282 - if(!next.getXlBm().equals(sch.getXlBm()))  
283 - directiveService.lineChange(next.getClZbh(), next.getXlBm(), "套跑@系统"); 282 + if(!next.getXlBm().equals(sch.getXlBm())){
  283 + DirectivePushQueue.put64(next.getClZbh(), next.getXlBm(), "套跑@系统");
  284 + //directiveService.lineChange(next.getClZbh(), next.getXlBm(), "套跑@系统");
  285 + }
284 } 286 }
285 else if(sch.getBcType().equals("in")){ 287 else if(sch.getBcType().equals("in")){
286 //终班进场,切换成非营运状态 288 //终班进场,切换成非营运状态
287 - directiveService.send60Operation(sch.getClZbh(), 1, Integer.parseInt(sch.getXlDir()), null, "进场@系统"); 289 + DirectivePushQueue.put6003(sch.getClZbh(), 1, Integer.parseInt(sch.getXlDir()), null, "进场@系统");
  290 + //directiveService.send60Operation(sch.getClZbh(), 1, Integer.parseInt(sch.getXlDir()), null, "进场@系统");
288 } 291 }
289 } 292 }
290 else { 293 else {
src/main/java/com/bsth/data/gpsdata/recovery/GpsDataRecovery.java
@@ -164,7 +164,7 @@ public class GpsDataRecovery implements ApplicationContextAware { @@ -164,7 +164,7 @@ public class GpsDataRecovery implements ApplicationContextAware {
164 //abnormalStateHandle.handle(gps, prevs); 164 //abnormalStateHandle.handle(gps, prevs);
165 165
166 if(!task) 166 if(!task)
167 - return; //无任务的,到这里就结束 167 + continue; //无任务的,到这里就结束
168 168
169 //反向处理 169 //反向处理
170 reverseSignalHandle.handle(gps, prevs); 170 reverseSignalHandle.handle(gps, prevs);
src/main/java/com/bsth/data/gpsdata/thread/ThreadPollMonitor.java deleted 100644 → 0
1 -package com.bsth.data.gpsdata.thread;  
2 -  
3 -import com.bsth.data.gpsdata.arrival.GpsRealAnalyse;  
4 -import org.springframework.stereotype.Component;  
5 -  
6 -/**  
7 - * 线程池监听  
8 - * Created by panzhao on 2017/5/10.  
9 - */  
10 -@Component  
11 -public class ThreadPollMonitor extends Thread{  
12 -  
13 - @Override  
14 - public void run() {  
15 - long t = System.currentTimeMillis();  
16 -  
17 - if(t - GpsRealAnalyse.st > 3000 * 10){  
18 - GpsRealAnalyse.shutdown();  
19 - }  
20 - }  
21 -}  
src/main/java/com/bsth/data/msg_queue/DirectivePushQueue.java 0 → 100644
  1 +package com.bsth.data.msg_queue;
  2 +
  3 +import com.bsth.entity.realcontrol.ScheduleRealInfo;
  4 +import com.bsth.service.directive.DirectiveService;
  5 +import org.slf4j.Logger;
  6 +import org.slf4j.LoggerFactory;
  7 +import org.springframework.beans.BeansException;
  8 +import org.springframework.boot.CommandLineRunner;
  9 +import org.springframework.context.ApplicationContext;
  10 +import org.springframework.context.ApplicationContextAware;
  11 +import org.springframework.stereotype.Component;
  12 +
  13 +import java.util.LinkedList;
  14 +
  15 +/**
  16 + * 到网关的指令推送队列 (系统发送的队列, 用户手动发送的不走这里)
  17 + * Created by panzhao on 2017/5/11.
  18 + */
  19 +@Component
  20 +public class DirectivePushQueue implements CommandLineRunner, ApplicationContextAware {
  21 +
  22 + static LinkedList<QueueData_Directive> linkedList;
  23 + static DataPushThread thread;
  24 + static DirectiveService directiveService;
  25 + static long t;
  26 + static final int IDLE_TIME = 1000 * 30;
  27 +
  28 + static {
  29 + linkedList = new LinkedList<>();
  30 + }
  31 +
  32 + public static void put6002(ScheduleRealInfo sch, int finish, String sender){
  33 + QueueData_Directive qd6002 = new QueueData_Directive();
  34 + qd6002.setSch(sch);
  35 + qd6002.setFinish(finish);
  36 + qd6002.setSender(sender);
  37 + qd6002.setCode("60_02");
  38 +
  39 + linkedList.add(qd6002);
  40 + }
  41 +
  42 + public static void put6003(String nbbm, int state, int upDown, ScheduleRealInfo sch, String sender){
  43 + QueueData_Directive qd6003 = new QueueData_Directive();
  44 + qd6003.setNbbm(nbbm);
  45 + qd6003.setState(state);
  46 + qd6003.setUpDown(upDown);
  47 + qd6003.setSch(sch);
  48 + qd6003.setSender(sender);
  49 +
  50 + qd6003.setCode("60_03");
  51 +
  52 + linkedList.add(qd6003);
  53 + }
  54 +
  55 + public static void put64(String nbbm, String lineCode, String sender){
  56 + QueueData_Directive qd64 = new QueueData_Directive();
  57 + qd64.setNbbm(nbbm);
  58 + qd64.setLineCode(lineCode);
  59 + qd64.setSender(sender);
  60 +
  61 + qd64.setCode("64");
  62 +
  63 + linkedList.add(qd64);
  64 + }
  65 +
  66 + public static boolean isIdle(){
  67 + return System.currentTimeMillis() - t > IDLE_TIME;
  68 + }
  69 +
  70 + public static void start(){
  71 + if(thread != null){
  72 + thread.interrupt();
  73 + }
  74 + thread = new DataPushThread();
  75 + thread.start();
  76 + }
  77 +
  78 + @Override
  79 + public void run(String... strings) throws Exception {
  80 + start();
  81 + }
  82 +
  83 + @Override
  84 + public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
  85 + directiveService = applicationContext.getBean(DirectiveService.class);
  86 + }
  87 +
  88 + public static class DataPushThread extends Thread {
  89 +
  90 + Logger log = LoggerFactory.getLogger(this.getClass());
  91 +
  92 + @Override
  93 + public void run() {
  94 + boolean sleepFlag = false;
  95 + QueueData_Directive qd;
  96 + String code;
  97 + while (true) {
  98 + try {
  99 + qd = linkedList.pollFirst();
  100 + if (qd != null) {
  101 + sleepFlag = false;
  102 + code = qd.getCode();
  103 +
  104 + if(code.equals("60_02")){
  105 + directiveService.send60Dispatch(qd.getSch(), qd.getFinish(), qd.getSender());
  106 + log.info("directive 60_02 sch id: " + qd.getSch().getId());
  107 + }
  108 + else if(code.equals("60_03")){
  109 + directiveService.send60Operation(qd.getNbbm(), qd.getState(), qd.getUpDown(), null, qd.getSender());
  110 + log.info("directive 60_03 nbbm: " + qd.getNbbm());
  111 + }
  112 + else if(code.equals("64")){
  113 + directiveService.lineChange(qd.getNbbm(), qd.getLineCode(), qd.getSender());
  114 + log.info("directive 64 nbbm: " + qd.getNbbm() + " lineCode: " + qd.getLineCode());
  115 + }
  116 +
  117 + } else{
  118 + Thread.sleep(500);
  119 + if(!sleepFlag){
  120 + log.info("sleep...");
  121 + sleepFlag = true;
  122 + }
  123 + }
  124 + t = System.currentTimeMillis();
  125 + }
  126 + catch(InterruptedException e){
  127 + break;
  128 + }
  129 + catch (Exception e) {
  130 + log.error("", e);
  131 + }
  132 +
  133 + }
  134 + }
  135 + }
  136 +}
src/main/java/com/bsth/data/msg_queue/QueueData.java 0 → 100644
  1 +package com.bsth.data.msg_queue;
  2 +
  3 +import org.springframework.web.socket.TextMessage;
  4 +import org.springframework.web.socket.WebSocketSession;
  5 +
  6 +/**
  7 + * Created by panzhao on 2017/5/11.
  8 + */
  9 +public class QueueData {
  10 +
  11 + private TextMessage message;
  12 +
  13 + private WebSocketSession session;
  14 +
  15 +
  16 + public WebSocketSession getSession() {
  17 + return session;
  18 + }
  19 +
  20 + public void setSession(WebSocketSession session) {
  21 + this.session = session;
  22 + }
  23 +
  24 + public TextMessage getMessage() {
  25 + return message;
  26 + }
  27 +
  28 + public void setMessage(TextMessage message) {
  29 + this.message = message;
  30 + }
  31 +}
src/main/java/com/bsth/data/msg_queue/QueueData_Directive.java 0 → 100644
  1 +package com.bsth.data.msg_queue;
  2 +
  3 +import com.bsth.entity.realcontrol.ScheduleRealInfo;
  4 +
  5 +/**
  6 + * Created by panzhao on 2017/5/11.
  7 + */
  8 +public class QueueData_Directive {
  9 +
  10 + /**
  11 + * 指令类型
  12 + * 60_02
  13 + * 60_03
  14 + * 64
  15 + */
  16 + private String code;
  17 +
  18 + /** 60调度指令内容 60_02*/
  19 + private ScheduleRealInfo sch;
  20 + private int finish;
  21 +
  22 + /** 60 营运指令 60_03*/
  23 + private String nbbm;
  24 + private int state;
  25 + private int upDown;
  26 +
  27 + /** 64指令内容 */
  28 + private String lineCode;
  29 +
  30 + private String sender;
  31 +
  32 +
  33 + public ScheduleRealInfo getSch() {
  34 + return sch;
  35 + }
  36 +
  37 + public void setSch(ScheduleRealInfo sch) {
  38 + this.sch = sch;
  39 + }
  40 +
  41 + public int getFinish() {
  42 + return finish;
  43 + }
  44 +
  45 + public void setFinish(int finish) {
  46 + this.finish = finish;
  47 + }
  48 +
  49 + public String getSender() {
  50 + return sender;
  51 + }
  52 +
  53 + public void setSender(String sender) {
  54 + this.sender = sender;
  55 + }
  56 +
  57 + public String getNbbm() {
  58 + return nbbm;
  59 + }
  60 +
  61 + public void setNbbm(String nbbm) {
  62 + this.nbbm = nbbm;
  63 + }
  64 +
  65 + public int getState() {
  66 + return state;
  67 + }
  68 +
  69 + public void setState(int state) {
  70 + this.state = state;
  71 + }
  72 +
  73 + public int getUpDown() {
  74 + return upDown;
  75 + }
  76 +
  77 + public void setUpDown(int upDown) {
  78 + this.upDown = upDown;
  79 + }
  80 +
  81 + public String getCode() {
  82 + return code;
  83 + }
  84 +
  85 + public void setCode(String code) {
  86 + this.code = code;
  87 + }
  88 +
  89 + public String getLineCode() {
  90 + return lineCode;
  91 + }
  92 +
  93 + public void setLineCode(String lineCode) {
  94 + this.lineCode = lineCode;
  95 + }
  96 +}
src/main/java/com/bsth/data/msg_queue/WebSocketPushQueue.java 0 → 100644
  1 +package com.bsth.data.msg_queue;
  2 +
  3 +import com.bsth.common.Constants;
  4 +import org.slf4j.Logger;
  5 +import org.slf4j.LoggerFactory;
  6 +import org.springframework.boot.CommandLineRunner;
  7 +import org.springframework.stereotype.Component;
  8 +import org.springframework.web.socket.TextMessage;
  9 +import org.springframework.web.socket.WebSocketSession;
  10 +
  11 +import java.util.LinkedList;
  12 +
  13 +/**
  14 + * 线调web socket 推送队列
  15 + * Created by panzhao on 2017/5/11.
  16 + */
  17 +@Component
  18 +public class WebSocketPushQueue implements CommandLineRunner {
  19 +
  20 + static LinkedList<QueueData> linkedList;
  21 + static DataPushThread thread;
  22 + static Logger log = LoggerFactory.getLogger(WebSocketPushQueue.class);
  23 + static long t;
  24 + static final int IDLE_TIME = 1000 * 30;
  25 +
  26 + static {
  27 + linkedList = new LinkedList();
  28 + }
  29 +
  30 + public static boolean isIdle() {
  31 + return System.currentTimeMillis() - t > IDLE_TIME;
  32 + }
  33 +
  34 + public static void put(WebSocketSession session, TextMessage msg) {
  35 + QueueData qd = new QueueData();
  36 + qd.setMessage(msg);
  37 + qd.setSession(session);
  38 +
  39 + log.info("put、[" + session.getAttributes().get(Constants.SESSION_USERNAME) + "] 、" + msg.getPayload());
  40 + linkedList.add(qd);
  41 + }
  42 +
  43 + public static void start() {
  44 + if (thread != null) {
  45 + thread.interrupt();
  46 + }
  47 + thread = new DataPushThread();
  48 + thread.start();
  49 + }
  50 +
  51 + @Override
  52 + public void run(String... strings) throws Exception {
  53 + start();
  54 + }
  55 +
  56 + public static class DataPushThread extends Thread {
  57 +
  58 + Logger log = LoggerFactory.getLogger(this.getClass());
  59 +
  60 + @Override
  61 + public void run() {
  62 + QueueData qd;
  63 + WebSocketSession session;
  64 +
  65 + boolean sleepFlag = false;
  66 + while (true) {
  67 + try {
  68 + qd = linkedList.pollFirst();
  69 + if (qd != null) {
  70 + sleepFlag = false;
  71 + session = qd.getSession();
  72 + if (session.isOpen()) {
  73 + log.info("push start、[" + session.getAttributes().get(Constants.SESSION_USERNAME) + "] 、" + qd.getMessage().getPayload());
  74 + session.sendMessage(qd.getMessage());
  75 + log.info("push end..");
  76 + }
  77 + } else {
  78 + Thread.sleep(500);
  79 + if (!sleepFlag) {
  80 + log.info("sleep...");
  81 + sleepFlag = true;
  82 + }
  83 + }
  84 + t = System.currentTimeMillis();
  85 + } catch (InterruptedException e) {
  86 + break;
  87 + } catch (Exception e) {
  88 + log.error("", e);
  89 + }
  90 + }
  91 + }
  92 + }
  93 +}
src/main/java/com/bsth/data/pilot80/PilotReport.java
@@ -4,6 +4,7 @@ import com.bsth.data.BasicData; @@ -4,6 +4,7 @@ import com.bsth.data.BasicData;
4 import com.bsth.data.LineConfigData; 4 import com.bsth.data.LineConfigData;
5 import com.bsth.data.gpsdata.GpsEntity; 5 import com.bsth.data.gpsdata.GpsEntity;
6 import com.bsth.data.gpsdata.GpsRealData; 6 import com.bsth.data.gpsdata.GpsRealData;
  7 +import com.bsth.data.msg_queue.DirectivePushQueue;
7 import com.bsth.data.schedule.DayOfSchedule; 8 import com.bsth.data.schedule.DayOfSchedule;
8 import com.bsth.entity.Line; 9 import com.bsth.entity.Line;
9 import com.bsth.entity.directive.D80; 10 import com.bsth.entity.directive.D80;
@@ -82,9 +83,11 @@ public class PilotReport { @@ -82,9 +83,11 @@ public class PilotReport {
82 outSch = dayOfSchedule.next(outSch); 83 outSch = dayOfSchedule.next(outSch);
83 84
84 //下发调度指令 85 //下发调度指令
85 - directiveService.send60Dispatch(outSch, dayOfSchedule.doneSum(nbbm), "请出@系统"); 86 + DirectivePushQueue.put6002(outSch, dayOfSchedule.doneSum(nbbm), "请出@系统");
  87 + //directiveService.send60Dispatch(outSch, dayOfSchedule.doneSum(nbbm), "请出@系统");
86 //下发线路切换指令 88 //下发线路切换指令
87 - directiveService.lineChange(outSch.getClZbh(), outSch.getXlBm(), "请出@系统"); 89 + DirectivePushQueue.put64(outSch.getClZbh(), outSch.getXlBm(), "请出@系统");
  90 + //directiveService.lineChange(outSch.getClZbh(), outSch.getXlBm(), "请出@系统");
88 }else 91 }else
89 d80.setRemarks("没有出场计划"); 92 d80.setRemarks("没有出场计划");
90 93
src/main/java/com/bsth/data/schedule/DayOfSchedule.java
@@ -7,6 +7,7 @@ import com.bsth.common.Constants; @@ -7,6 +7,7 @@ import com.bsth.common.Constants;
7 import com.bsth.common.ResponseCode; 7 import com.bsth.common.ResponseCode;
8 import com.bsth.data.BasicData; 8 import com.bsth.data.BasicData;
9 import com.bsth.data.LineConfigData; 9 import com.bsth.data.LineConfigData;
  10 +import com.bsth.data.ThreadMonotor;
10 import com.bsth.data.directive.DirectivesPstThread; 11 import com.bsth.data.directive.DirectivesPstThread;
11 import com.bsth.data.gpsdata.GpsRealData; 12 import com.bsth.data.gpsdata.GpsRealData;
12 import com.bsth.data.gpsdata.recovery.GpsDataRecovery; 13 import com.bsth.data.gpsdata.recovery.GpsDataRecovery;
@@ -139,6 +140,9 @@ public class DayOfSchedule implements CommandLineRunner { @@ -139,6 +140,9 @@ public class DayOfSchedule implements CommandLineRunner {
139 @Autowired 140 @Autowired
140 CalcOilThread calcOilThread; 141 CalcOilThread calcOilThread;
141 142
  143 + @Autowired
  144 + ThreadMonotor threadMonotor;
  145 +
142 private static DateTimeFormatter fmtyyyyMMdd = DateTimeFormat.forPattern("yyyy-MM-dd"), fmtHHmm = DateTimeFormat.forPattern("HH:mm"); 146 private static DateTimeFormatter fmtyyyyMMdd = DateTimeFormat.forPattern("yyyy-MM-dd"), fmtHHmm = DateTimeFormat.forPattern("HH:mm");
143 147
144 @Override 148 @Override
@@ -165,6 +169,9 @@ public class DayOfSchedule implements CommandLineRunner { @@ -165,6 +169,9 @@ public class DayOfSchedule implements CommandLineRunner {
165 169
166 //指令持久化线程 170 //指令持久化线程
167 Application.mainServices.scheduleWithFixedDelay(directivesPstThread, 180, 180, TimeUnit.SECONDS); 171 Application.mainServices.scheduleWithFixedDelay(directivesPstThread, 180, 180, TimeUnit.SECONDS);
  172 +
  173 + //监听
  174 + Application.mainServices.scheduleWithFixedDelay(threadMonotor, 120, 60, TimeUnit.SECONDS);
168 } 175 }
169 176
170 //数据恢复 177 //数据恢复
src/main/java/com/bsth/entity/oil/Ylb.java
@@ -49,7 +49,9 @@ public class Ylb { @@ -49,7 +49,9 @@ public class Ylb {
49 private int sjbc; 49 private int sjbc;
50 private String edituser; 50 private String edituser;
51 private Date edittime; 51 private Date edittime;
  52 + private Date updatetime;
52 private Date createtime; 53 private Date createtime;
  54 +
53 private int nylx; 55 private int nylx;
54 //进场顺序(根据最先出场和最后进场来关联车辆的存油量) 56 //进场顺序(根据最先出场和最后进场来关联车辆的存油量)
55 private int jcsx; 57 private int jcsx;
@@ -321,6 +323,12 @@ public class Ylb { @@ -321,6 +323,12 @@ public class Ylb {
321 } 323 }
322 324
323 325
324 - 326 + public Date getUpdatetime() {
  327 + return updatetime;
  328 + }
  329 +
  330 + public void setUpdatetime(Date updatetime) {
  331 + this.updatetime = updatetime;
  332 + }
325 333
326 } 334 }
src/main/java/com/bsth/repository/StationRouteRepository.java
@@ -113,8 +113,8 @@ public interface StationRouteRepository extends BaseRepository&lt;StationRoute, Int @@ -113,8 +113,8 @@ public interface StationRouteRepository extends BaseRepository&lt;StationRoute, Int
113 /*@Query(value = "SELECT s.b_jwpoints,s.station_name FROM (" + 113 /*@Query(value = "SELECT s.b_jwpoints,s.station_name FROM (" +
114 "SELECT b.station FROM bsth_c_stationroute b where b.line =?1 and b.directions = ?2 and b.destroy=0) r " + 114 "SELECT b.station FROM bsth_c_stationroute b where b.line =?1 and b.directions = ?2 and b.destroy=0) r " +
115 "LEFT JOIN bsth_c_station s on r.station = s.id", nativeQuery=true)*/ 115 "LEFT JOIN bsth_c_station s on r.station = s.id", nativeQuery=true)*/
116 - @Query(value = "SELECT s.b_jwpoints,s.station_name,r.station_route_code FROM (" +  
117 - "SELECT b.station,b.station_route_code FROM bsth_c_stationroute b where b.line =?1 and b.directions = ?2 and b.destroy=0) r " + 116 + @Query(value = "SELECT s.b_jwpoints,r.station_name,r.station_route_code FROM (" +
  117 + "SELECT b.station,b.station_route_code,b.station_name FROM bsth_c_stationroute b where b.line =?1 and b.directions = ?2 and b.destroy=0) r " +
118 "LEFT JOIN bsth_c_station s on r.station = s.id order by r.station_route_code asc", nativeQuery=true) 118 "LEFT JOIN bsth_c_station s on r.station = s.id order by r.station_route_code asc", nativeQuery=true)
119 List<Object[]> getSelectStationRouteCenterPoints(Integer lineId,Integer direction); 119 List<Object[]> getSelectStationRouteCenterPoints(Integer lineId,Integer direction);
120 120
src/main/java/com/bsth/service/directive/DirectiveServiceImpl.java
@@ -85,12 +85,15 @@ public class DirectiveServiceImpl extends BaseServiceImpl&lt;D60, Integer&gt; implemen @@ -85,12 +85,15 @@ public class DirectiveServiceImpl extends BaseServiceImpl&lt;D60, Integer&gt; implemen
85 if(null != sender) 85 if(null != sender)
86 d60.setSender(sender); 86 d60.setSender(sender);
87 d60.setHttpCode(code); 87 d60.setHttpCode(code);
88 - // 添加到缓存  
89 - dayOfDirectives.put60(d60);  
90 88
91 - if (code != 0) { 89 + if (code == 0) {
  90 + // 添加到缓存
  91 + dayOfDirectives.put60(d60, true);
  92 + }
  93 + else{
92 d60.setErrorText("网关通讯失败, code: " + code); 94 d60.setErrorText("网关通讯失败, code: " + code);
93 d60Repository.save(d60); 95 d60Repository.save(d60);
  96 + dayOfDirectives.put60(d60, false);
94 } 97 }
95 return code; 98 return code;
96 } 99 }
@@ -139,12 +142,13 @@ public class DirectiveServiceImpl extends BaseServiceImpl&lt;D60, Integer&gt; implemen @@ -139,12 +142,13 @@ public class DirectiveServiceImpl extends BaseServiceImpl&lt;D60, Integer&gt; implemen
139 if (code == 0) { 142 if (code == 0) {
140 sch.setDirectiveState(60); 143 sch.setDirectiveState(60);
141 // 添加到缓存,延迟入库 144 // 添加到缓存,延迟入库
142 - dayOfDirectives.put60(d60); 145 + dayOfDirectives.put60(d60, true);
143 // 通知页面 146 // 通知页面
144 sendD60ToPage(sch); 147 sendD60ToPage(sch);
145 } 148 }
146 else{ 149 else{
147 d60.setErrorText("网关通讯失败, code: " + code); 150 d60.setErrorText("网关通讯失败, code: " + code);
  151 + dayOfDirectives.put60(d60, false);
148 d60Repository.save(d60); 152 d60Repository.save(d60);
149 } 153 }
150 return code; 154 return code;
@@ -196,11 +200,15 @@ public class DirectiveServiceImpl extends BaseServiceImpl&lt;D60, Integer&gt; implemen @@ -196,11 +200,15 @@ public class DirectiveServiceImpl extends BaseServiceImpl&lt;D60, Integer&gt; implemen
196 d60.setHttpCode(code); 200 d60.setHttpCode(code);
197 if (null != sch) 201 if (null != sch)
198 d60.setSch(sch); 202 d60.setSch(sch);
199 - dayOfDirectives.put60(d60);  
200 203
201 - if (code != 0) { 204 +
  205 + if (code == 0) {
  206 + dayOfDirectives.put60(d60, true);
  207 + }
  208 + else{
202 d60.setErrorText("网关通讯失败, code: " + code); 209 d60.setErrorText("网关通讯失败, code: " + code);
203 d60Repository.save(d60); 210 d60Repository.save(d60);
  211 + dayOfDirectives.put60(d60, false);
204 } 212 }
205 return code; 213 return code;
206 } 214 }
src/main/java/com/bsth/service/impl/StationServiceImpl.java
@@ -248,13 +248,13 @@ public class StationServiceImpl extends BaseServiceImpl&lt;Station, Integer&gt; implem @@ -248,13 +248,13 @@ public class StationServiceImpl extends BaseServiceImpl&lt;Station, Integer&gt; implem
248 for(int i = 0;i <stationsArray.size();i++) { 248 for(int i = 0;i <stationsArray.size();i++) {
249 // 站点名称 249 // 站点名称
250 String stationName = stationsArray.getJSONObject(i).equals("") ? "" : stationsArray.getJSONObject(i).get("name").toString(); 250 String stationName = stationsArray.getJSONObject(i).equals("") ? "" : stationsArray.getJSONObject(i).get("name").toString();
251 - Double distance = stationsArray.getJSONObject(i).get("distance").equals("") ? 0 : Double.parseDouble(stationsArray.getJSONObject(i).get("distance").toString()); 251 + Double distance = stationsArray.getJSONObject(i).get("distance").equals("") ? 0.0d : Double.parseDouble(stationsArray.getJSONObject(i).get("distance").toString());
252 // 转成公里 252 // 转成公里
253 distance = distance/1000; 253 distance = distance/1000;
254 BigDecimal d = new BigDecimal(distance); 254 BigDecimal d = new BigDecimal(distance);
255 distance = d.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); 255 distance = d.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
256 sectionDistance= distance + sectionDistance; 256 sectionDistance= distance + sectionDistance;
257 - Double duration = stationsArray.getJSONObject(i).get("duration").equals("") ? 0 : Double.parseDouble(stationsArray.getJSONObject(i).get("duration").toString()); 257 + Double duration = stationsArray.getJSONObject(i).get("duration").equals("") ? 0.0d : Double.parseDouble(stationsArray.getJSONObject(i).get("duration").toString());
258 // 转成分钟 258 // 转成分钟
259 duration = duration/60; 259 duration = duration/60;
260 BigDecimal t = new BigDecimal(duration); 260 BigDecimal t = new BigDecimal(duration);
@@ -792,9 +792,9 @@ public class StationServiceImpl extends BaseServiceImpl&lt;Station, Integer&gt; implem @@ -792,9 +792,9 @@ public class StationServiceImpl extends BaseServiceImpl&lt;Station, Integer&gt; implem
792 Station station = repository.findOne(stationId); 792 Station station = repository.findOne(stationId);
793 StationRoute arg0 = new StationRoute(); 793 StationRoute arg0 = new StationRoute();
794 // 距离 794 // 距离
795 - Double distances = map.get("distances").equals("") ? null : Double.parseDouble(map.get("distances").toString()); 795 + Double distances = map.get("distances").equals("") ? 0.0d : Double.parseDouble(map.get("distances").toString());
796 // 时间 796 // 时间
797 - Double toTime = map.get("toTime").equals("") ? null : Double.parseDouble(map.get("toTime").toString()); 797 + Double toTime = map.get("toTime").equals("") ? 0.0d : Double.parseDouble(map.get("toTime").toString());
798 // 站点路由名称 798 // 站点路由名称
799 String stationName = map.get("stationName").equals("") ? "" : map.get("stationName").toString(); 799 String stationName = map.get("stationName").equals("") ? "" : map.get("stationName").toString();
800 // 线路ID 800 // 线路ID
@@ -952,8 +952,8 @@ public class StationServiceImpl extends BaseServiceImpl&lt;Station, Integer&gt; implem @@ -952,8 +952,8 @@ public class StationServiceImpl extends BaseServiceImpl&lt;Station, Integer&gt; implem
952 stationRouteCode = stationRouteCode == null ? 100 : stationRouteCode; 952 stationRouteCode = stationRouteCode == null ? 100 : stationRouteCode;
953 Integer LineId = map.get("stationRouteLine").equals("") ? null : Integer.parseInt(map.get("stationRouteLine").toString()); 953 Integer LineId = map.get("stationRouteLine").equals("") ? null : Integer.parseInt(map.get("stationRouteLine").toString());
954 String stationMark = map.get("stationMark").equals("") ? null : map.get("stationMark").toString(); 954 String stationMark = map.get("stationMark").equals("") ? null : map.get("stationMark").toString();
955 - Double distances = map.get("distances").equals("") ? null : Double.parseDouble(map.get("distances").toString());  
956 - Double toTime = map.get("toTime").equals("") ? null : Double.parseDouble(map.get("toTime").toString()); 955 + Double distances = map.get("distances").equals("") ? 0.0d : Double.parseDouble(map.get("distances").toString());
  956 + Double toTime = map.get("toTime").equals("") ? 0.0d : Double.parseDouble(map.get("toTime").toString());
957 Integer directions = map.get("directions").equals("") ? null : Integer.parseInt(map.get("directions").toString()); 957 Integer directions = map.get("directions").equals("") ? null : Integer.parseInt(map.get("directions").toString());
958 Station station = repository.findOne(stationId); 958 Station station = repository.findOne(stationId);
959 Line line = lineRepository.findOne(LineId); 959 Line line = lineRepository.findOne(LineId);
src/main/java/com/bsth/service/oil/impl/YlbServiceImpl.java
@@ -79,6 +79,8 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS @@ -79,6 +79,8 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
79 public String obtainDsq() throws Exception{ 79 public String obtainDsq() throws Exception{
80 String result = "failure"; 80 String result = "failure";
81 try { 81 try {
  82 + List<Ylb> addList = new ArrayList<Ylb>();
  83 + String type = "";
82 List<Cars> carsList=carsRepository.findCars(); 84 List<Cars> carsList=carsRepository.findCars();
83 Map<String, Boolean> carsMap=new HashMap<String, Boolean>(); 85 Map<String, Boolean> carsMap=new HashMap<String, Boolean>();
84 for (int i = 0; i < carsList.size(); i++) { 86 for (int i = 0; i < carsList.size(); i++) {
@@ -126,6 +128,7 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS @@ -126,6 +128,7 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
126 &&t1.getXlbm().equals(map.get("xlBm").toString())) 128 &&t1.getXlbm().equals(map.get("xlBm").toString()))
127 { 129 {
128 t=t1; 130 t=t1;
  131 + type="update";
129 } 132 }
130 } 133 }
131 134
@@ -182,13 +185,22 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS @@ -182,13 +185,22 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
182 t.setRq(sdf.parse(rq)); 185 t.setRq(sdf.parse(rq));
183 t.setCreatetime(dNow); 186 t.setCreatetime(dNow);
184 if(!(t.getSsgsdm().equals("") || t.getFgsdm().equals(""))){ 187 if(!(t.getSsgsdm().equals("") || t.getFgsdm().equals(""))){
185 - repository.save(t); 188 + if(type.equals("update")){
  189 + repository.save(t);
  190 + }else{
  191 + addList.add(t);
  192 + }
  193 +
186 } 194 }
187 195
188 196
189 } 197 }
190 - result = "success"; 198 +
191 } 199 }
  200 + if(addList.size()>0){
  201 + new BatchSaveUtils<Ylb>().saveList(addList, Ylb.class);
  202 + }
  203 + result = "success";
192 }catch (Exception e) { 204 }catch (Exception e) {
193 // TODO Auto-generated catch block 205 // TODO Auto-generated catch block
194 throw e; 206 throw e;
@@ -334,11 +346,13 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS @@ -334,11 +346,13 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
334 t.setFgsdm(map.get("bCompany") == null ? "" : map.get("bCompany").toString()); 346 t.setFgsdm(map.get("bCompany") == null ? "" : map.get("bCompany").toString());
335 t.setJhsj(map.get("fcsj")==null?"":map.get("fcsj").toString()); 347 t.setJhsj(map.get("fcsj")==null?"":map.get("fcsj").toString());
336 t.setRq(sdf.parse(rq)); 348 t.setRq(sdf.parse(rq));
337 - t.setCreatetime(date); 349 +
338 if(!(t.getSsgsdm().equals("") || t.getFgsdm().equals(""))){ 350 if(!(t.getSsgsdm().equals("") || t.getFgsdm().equals(""))){
339 if(type.equals("add")){ 351 if(type.equals("add")){
  352 + t.setCreatetime(date);
340 addList.add(t); 353 addList.add(t);
341 }else{ 354 }else{
  355 + t.setUpdatetime(date);
342 updateList.add(t); 356 updateList.add(t);
343 ins += t.getId().toString()+","; 357 ins += t.getId().toString()+",";
344 } 358 }
@@ -438,6 +452,7 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS @@ -438,6 +452,7 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
438 map.put("xlbm_like", ylb.getXlbm()); 452 map.put("xlbm_like", ylb.getXlbm());
439 // Iterator<Ylb> iterator2 = repository 453 // Iterator<Ylb> iterator2 = repository
440 // .findAll(new CustomerSpecs<Ylb>(map), new Sort(Direction.ASC, "jcsx")).iterator(); 454 // .findAll(new CustomerSpecs<Ylb>(map), new Sort(Direction.ASC, "jcsx")).iterator();
  455 + double czyl=0.0;
441 for (int j = 0; j < iterator2.size(); j++) { 456 for (int j = 0; j < iterator2.size(); j++) {
442 Ylb t = iterator2.get(j); 457 Ylb t = iterator2.get(j);
443 if(t.getNbbm().equals(ylb.getNbbm())){ 458 if(t.getNbbm().equals(ylb.getNbbm())){
@@ -445,6 +460,7 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS @@ -445,6 +460,7 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
445 // 进场等于出场的操作 既 最后进场存油量等于第一次的出场存油量 460 // 进场等于出场的操作 既 最后进场存油量等于第一次的出场存油量
446 // Double yl = t.getCzyl(); 461 // Double yl = t.getCzyl();
447 // Double jcyl = t.getCzyl(); 462 // Double jcyl = t.getCzyl();
  463 + czyl = t.getCzyl();
448 zyl =jzl; 464 zyl =jzl;
449 Double yh=0.0; 465 Double yh=0.0;
450 if(zlc>0){ 466 if(zlc>0){
@@ -476,10 +492,18 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS @@ -476,10 +492,18 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
476 } 492 }
477 nextJzyl =Arith.sub( Arith.add(Arith.sub(t.getJzl(),t.getSh()),nextJzyl),yh); 493 nextJzyl =Arith.sub( Arith.add(Arith.sub(t.getJzl(),t.getSh()),nextJzyl),yh);
478 if(zlc>0){ 494 if(zlc>0){
479 - long l=Math.round(nextJzyl);  
480 - double ylxs=l*100/100;  
481 -// nextJzyl = Arith.add(nextJzyl,Arith.sub(nextJzyl,ylxs)); 495 + long l=0l;
  496 + double ylxs=0.0;
  497 + if(j==iterator2.size()-1){
  498 + ylxs=czyl;
  499 + }else{
  500 + l=Math.round(nextJzyl);
  501 + ylxs=l*100/100;
  502 +
  503 + }
482 yh=Arith.add(yh, Arith.sub(ylxs,nextJzyl)); 504 yh=Arith.add(yh, Arith.sub(ylxs,nextJzyl));
  505 +// nextJzyl = Arith.add(nextJzyl,Arith.sub(nextJzyl,ylxs));
  506 +
483 t.setYh(yh); 507 t.setYh(yh);
484 t.setJzyl(ylxs); 508 t.setJzyl(ylxs);
485 nextJzyl=ylxs; 509 nextJzyl=ylxs;
@@ -704,7 +728,6 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS @@ -704,7 +728,6 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
704 } 728 }
705 // List<Ylb> ylListBe=repository.obtainYlbefore(rq, gsbm, "", xlbm, nbbm); 729 // List<Ylb> ylListBe=repository.obtainYlbefore(rq, gsbm, "", xlbm, nbbm);
706 List<Ylb> ylListBe=repository.listMaxRqJcsx(rq, gsbm, fgsbm, xlbm, nbbm); 730 List<Ylb> ylListBe=repository.listMaxRqJcsx(rq, gsbm, fgsbm, xlbm, nbbm);
707 - List<Cyl> cylList=cylRepository.obtainCyl(nbbm, gsbm);  
708 List<Ylb> ylbList=repository.obtainYl(rq,gsbm,fgsbm,xlbm,nbbm,"nbbm"); 731 List<Ylb> ylbList=repository.obtainYl(rq,gsbm,fgsbm,xlbm,nbbm,"nbbm");
709 List<Ylxxb> ylxxbList=ylxxbRepository.obtainYlxx(rq,0,gsbm); 732 List<Ylxxb> ylxxbList=ylxxbRepository.obtainYlxx(rq,0,gsbm);
710 for (int i = 0; i < ylxxbList.size(); i++) { 733 for (int i = 0; i < ylxxbList.size(); i++) {
@@ -719,7 +742,6 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS @@ -719,7 +742,6 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
719 } 742 }
720 743
721 if(fage){ 744 if(fage){
722 - Cyl cyl=null;  
723 Ylb t=new Ylb(); 745 Ylb t=new Ylb();
724 t.setNbbm(y1.getNbbm()); 746 t.setNbbm(y1.getNbbm());
725 t.setRq(y1.getYyrq()); 747 t.setRq(y1.getYyrq());
@@ -749,23 +771,13 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS @@ -749,23 +771,13 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
749 } 771 }
750 } 772 }
751 if(status){ 773 if(status){
752 - for (int j = 0; j < cylList.size(); j++) {  
753 - Cyl c=cylList.get(j);  
754 - if(c.getNbbm().equals(y1.getNbbm())){  
755 - t.setCzyl(c.getCyl());  
756 - cyl=c;  
757 - status=false;  
758 - break;  
759 - }  
760 - }  
761 - }  
762 - if(status){  
763 t.setCzyl(0.0); 774 t.setCzyl(0.0);
764 } 775 }
765 // double jzyl=Arith.add(t.getJzl(), t.getCzyl()); 776 // double jzyl=Arith.add(t.getJzl(), t.getCzyl());
766 t.setJzyl(Arith.add(t.getJzl(), t.getCzyl())); 777 t.setJzyl(Arith.add(t.getJzl(), t.getCzyl()));
767 t.setYh(0.0); 778 t.setYh(0.0);
768 if(!(t.getSsgsdm().equals("") || t.getFgsdm().equals(""))){ 779 if(!(t.getSsgsdm().equals("") || t.getFgsdm().equals(""))){
  780 + t.setCreatetime(new Date());
769 repository.save(t); 781 repository.save(t);
770 /*if(null!=cyl){ 782 /*if(null!=cyl){
771 cyl.setCyl(Arith.add(t.getJzl(), t.getCzyl())); 783 cyl.setCyl(Arith.add(t.getJzl(), t.getCzyl()));
@@ -1141,6 +1153,7 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS @@ -1141,6 +1153,7 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
1141 Double zyl = 0.0; 1153 Double zyl = 0.0;
1142 Double nextJzyl = 0.0; 1154 Double nextJzyl = 0.0;
1143 // 车的,进,出油量及耗油 1155 // 车的,进,出油量及耗油
  1156 + double czyl=0.0;
1144 for (int i = 0; i < iterator2.size(); i++) { 1157 for (int i = 0; i < iterator2.size(); i++) {
1145 Ylb t = iterator2.get(i); 1158 Ylb t = iterator2.get(i);
1146 if (t.getJcsx() == 1) { 1159 if (t.getJcsx() == 1) {
@@ -1148,6 +1161,7 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS @@ -1148,6 +1161,7 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
1148 t.setSh(sh); 1161 t.setSh(sh);
1149 t.setShyy(shyy); 1162 t.setShyy(shyy);
1150 } 1163 }
  1164 + czyl=t.getCzyl();
1151 // Double jcyl = t.getCzyl(); 1165 // Double jcyl = t.getCzyl();
1152 zyl = jzl; 1166 zyl = jzl;
1153 Double yh = 0.0; 1167 Double yh = 0.0;
@@ -1179,8 +1193,14 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS @@ -1179,8 +1193,14 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
1179 } 1193 }
1180 nextJzyl = Arith.sub(Arith.add(t.getJzl(), nextJzyl), Arith.add(yh, t.getSh())); 1194 nextJzyl = Arith.sub(Arith.add(t.getJzl(), nextJzyl), Arith.add(yh, t.getSh()));
1181 if(zlc>0){ 1195 if(zlc>0){
1182 - long l=Math.round(nextJzyl);  
1183 - double ylxs=l*100/100; 1196 + long l=0l;
  1197 + double ylxs=0.0;
  1198 + if(i==iterator2.size()){
  1199 + ylxs=czyl;
  1200 + }else{
  1201 + l=Math.round(nextJzyl);
  1202 + ylxs=l*100/100;
  1203 + }
1184 // nextJzyl = Arith.add(nextJzyl,Arith.sub(nextJzyl,ylxs)); 1204 // nextJzyl = Arith.add(nextJzyl,Arith.sub(nextJzyl,ylxs));
1185 yh=Arith.add(yh, Arith.sub(ylxs,nextJzyl)); 1205 yh=Arith.add(yh, Arith.sub(ylxs,nextJzyl));
1186 t.setYh(yh); 1206 t.setYh(yh);
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
@@ -10,6 +10,7 @@ import com.bsth.controller.realcontrol.dto.DfsjChange; @@ -10,6 +10,7 @@ import com.bsth.controller.realcontrol.dto.DfsjChange;
10 import com.bsth.controller.realcontrol.dto.LpData; 10 import com.bsth.controller.realcontrol.dto.LpData;
11 import com.bsth.data.BasicData; 11 import com.bsth.data.BasicData;
12 import com.bsth.data.LineConfigData; 12 import com.bsth.data.LineConfigData;
  13 +import com.bsth.data.msg_queue.DirectivePushQueue;
13 import com.bsth.data.schedule.DayOfSchedule; 14 import com.bsth.data.schedule.DayOfSchedule;
14 import com.bsth.data.schedule.SchAttrCalculator; 15 import com.bsth.data.schedule.SchAttrCalculator;
15 import com.bsth.data.schedule.SchModifyLog; 16 import com.bsth.data.schedule.SchModifyLog;
@@ -1280,9 +1281,14 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -1280,9 +1281,14 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1280 ts.add(next); 1281 ts.add(next);
1281 } 1282 }
1282 1283
1283 - if(!next.getXlBm().equals(sch.getXlBm())){  
1284 - directiveService.lineChange(next.getClZbh(), next.getXlBm(), "套跑@系统");  
1285 - } 1284 + try{
  1285 + //车辆下一个要执行的班次
  1286 + ScheduleRealInfo carNext = dayOfSchedule.next(sch);
  1287 + if(carNext != null && !carNext.getXlBm().equals(sch.getXlBm())){
  1288 + DirectivePushQueue.put64(carNext.getClZbh(), carNext.getXlBm(), "套跑@系统");
  1289 + //directiveService.lineChange(carNext.getClZbh(), carNext.getXlBm(), "套跑@系统");
  1290 + }
  1291 + }catch (Exception e){logger.error("", e);}
1286 1292
1287 //重新计算车辆执行班次 1293 //重新计算车辆执行班次
1288 dayOfSchedule.reCalcExecPlan(sch.getClZbh()); 1294 dayOfSchedule.reCalcExecPlan(sch.getClZbh());
@@ -1806,11 +1812,14 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -1806,11 +1812,14 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1806 List<ScheduleRealInfo> list = null; 1812 List<ScheduleRealInfo> list = null;
1807 list = scheduleRealInfoRepository.queryListWaybill(jName, clZbh, lpName, date, line); 1813 list = scheduleRealInfoRepository.queryListWaybill(jName, clZbh, lpName, date, line);
1808 SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm"); 1814 SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm");
1809 - String sqlMinYysj="select start_opt from bsth_c_line_config where line = '"+BasicData.lineId2CodeMap.inverse().get(line) +"'"; 1815 + String sqlMinYysj="select start_opt from bsth_c_line_config where "
  1816 + + " id = ("
  1817 + + "select max(id) from bsth_c_line_config where line ='"+BasicData.lineId2CodeMap.inverse().get(line) +"'"
  1818 + + ")";
1810 String minfcsj=jdbcTemplate.queryForObject(sqlMinYysj, String.class); 1819 String minfcsj=jdbcTemplate.queryForObject(sqlMinYysj, String.class);
1811 - String[] minSjs = minfcsj.split(":");  
1812 - Long minSj=Long.parseLong(minSjs[0])*60+Long.parseLong(minSjs[1]);  
1813 - 1820 + String[] minSjs = minfcsj.split(":");
  1821 + Long minSj=Long.parseLong(minSjs[0])*60+Long.parseLong(minSjs[1]);
  1822 +
1814 for (int i = 0; i < list.size(); i++) { 1823 for (int i = 0; i < list.size(); i++) {
1815 ScheduleRealInfo s=list.get(i); 1824 ScheduleRealInfo s=list.get(i);
1816 String[] fcsj= s.getFcsj().split(":"); 1825 String[] fcsj= s.getFcsj().split(":");
src/main/java/com/bsth/service/report/impl/CulateMileageServiceImpl.java
@@ -151,8 +151,7 @@ public class CulateMileageServiceImpl implements CulateMileageService{ @@ -151,8 +151,7 @@ public class CulateMileageServiceImpl implements CulateMileageService{
151 int lbbc=0; 151 int lbbc=0;
152 for (int i = 0; i < lists.size(); i++) { 152 for (int i = 0; i < lists.size(); i++) {
153 ScheduleRealInfo scheduleRealInfo=lists.get(i); 153 ScheduleRealInfo scheduleRealInfo=lists.get(i);
154 - if (!(scheduleRealInfo.getBcType().equals("in")  
155 - || scheduleRealInfo.getBcType().equals("out"))) { 154 + if (!isInOut(scheduleRealInfo)) {
156 Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks(); 155 Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks();
157 if(childTaskPlans.isEmpty()){ 156 if(childTaskPlans.isEmpty()){
158 if(scheduleRealInfo.getStatus() == -1){ 157 if(scheduleRealInfo.getStatus() == -1){
@@ -187,8 +186,7 @@ public class CulateMileageServiceImpl implements CulateMileageService{ @@ -187,8 +186,7 @@ public class CulateMileageServiceImpl implements CulateMileageService{
187 List<Map<String, Object>> list=new ArrayList<Map<String,Object>>(); 186 List<Map<String, Object>> list=new ArrayList<Map<String,Object>>();
188 for (int i = 0; i < lists.size(); i++) { 187 for (int i = 0; i < lists.size(); i++) {
189 ScheduleRealInfo scheduleRealInfo=lists.get(i); 188 ScheduleRealInfo scheduleRealInfo=lists.get(i);
190 - if (!(scheduleRealInfo.getBcType().equals("in")  
191 - || scheduleRealInfo.getBcType().equals("out"))) { 189 + if (!isInOut(scheduleRealInfo)) {
192 // Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks(); 190 // Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks();
193 // if(childTaskPlans.isEmpty()){ 191 // if(childTaskPlans.isEmpty()){
194 if(scheduleRealInfo.isSflj()){ 192 if(scheduleRealInfo.isSflj()){
@@ -221,8 +219,7 @@ public class CulateMileageServiceImpl implements CulateMileageService{ @@ -221,8 +219,7 @@ public class CulateMileageServiceImpl implements CulateMileageService{
221 double ljgl=0; 219 double ljgl=0;
222 for (int i = 0; i < lists.size(); i++) { 220 for (int i = 0; i < lists.size(); i++) {
223 ScheduleRealInfo scheduleRealInfo=lists.get(i); 221 ScheduleRealInfo scheduleRealInfo=lists.get(i);
224 - if (!(scheduleRealInfo.getBcType().equals("in")  
225 - || scheduleRealInfo.getBcType().equals("out"))) { 222 + if (!isInOut(scheduleRealInfo)) {
226 if(!scheduleRealInfo.isDestroy()){ 223 if(!scheduleRealInfo.isDestroy()){
227 if(scheduleRealInfo.isSflj()){ 224 if(scheduleRealInfo.isSflj()){
228 ljgl=Arith.add(ljgl,scheduleRealInfo.getJhlc()==null?0:scheduleRealInfo.getJhlc()); 225 ljgl=Arith.add(ljgl,scheduleRealInfo.getJhlc()==null?0:scheduleRealInfo.getJhlc());
@@ -250,8 +247,7 @@ public class CulateMileageServiceImpl implements CulateMileageService{ @@ -250,8 +247,7 @@ public class CulateMileageServiceImpl implements CulateMileageService{
250 int ljbc=0; 247 int ljbc=0;
251 for (int i = 0; i < lists.size(); i++) { 248 for (int i = 0; i < lists.size(); i++) {
252 ScheduleRealInfo scheduleRealInfo=lists.get(i); 249 ScheduleRealInfo scheduleRealInfo=lists.get(i);
253 - if (!(scheduleRealInfo.getBcType().equals("in")  
254 - || scheduleRealInfo.getBcType().equals("out"))) { 250 + if (!isInOut(scheduleRealInfo)) {
255 if(scheduleRealInfo.isSflj()){ 251 if(scheduleRealInfo.isSflj()){
256 if(item.equals("zgf") || item.equals("wgf")){ 252 if(item.equals("zgf") || item.equals("wgf")){
257 String time=""; 253 String time="";
@@ -292,8 +288,7 @@ public class CulateMileageServiceImpl implements CulateMileageService{ @@ -292,8 +288,7 @@ public class CulateMileageServiceImpl implements CulateMileageService{
292 double jhgl=0; 288 double jhgl=0;
293 for (int i = 0; i < lists.size(); i++) { 289 for (int i = 0; i < lists.size(); i++) {
294 ScheduleRealInfo scheduleRealInfo=lists.get(i); 290 ScheduleRealInfo scheduleRealInfo=lists.get(i);
295 - if (!(scheduleRealInfo.getBcType().equals("in")  
296 - || scheduleRealInfo.getBcType().equals("out"))) { 291 + if (!isInOut(scheduleRealInfo)) {
297 if(!scheduleRealInfo.isSflj()){ 292 if(!scheduleRealInfo.isSflj()){
298 jhgl=Arith.add(jhgl,scheduleRealInfo.getJhlcOrig()==null?0:scheduleRealInfo.getJhlcOrig()); 293 jhgl=Arith.add(jhgl,scheduleRealInfo.getJhlcOrig()==null?0:scheduleRealInfo.getJhlcOrig());
299 } 294 }
@@ -308,8 +303,7 @@ public class CulateMileageServiceImpl implements CulateMileageService{ @@ -308,8 +303,7 @@ public class CulateMileageServiceImpl implements CulateMileageService{
308 int jhbc=0; 303 int jhbc=0;
309 for (int i = 0; i < lists.size(); i++) { 304 for (int i = 0; i < lists.size(); i++) {
310 ScheduleRealInfo scheduleRealInfo=lists.get(i); 305 ScheduleRealInfo scheduleRealInfo=lists.get(i);
311 - if (!(scheduleRealInfo.getBcType().equals("in")  
312 - || scheduleRealInfo.getBcType().equals("out"))) { 306 + if (!isInOut(scheduleRealInfo)) {
313 if(!scheduleRealInfo.isSflj()){ 307 if(!scheduleRealInfo.isSflj()){
314 String[] fcsjStr = scheduleRealInfo.getFcsj().split(":"); 308 String[] fcsjStr = scheduleRealInfo.getFcsj().split(":");
315 long fcsj= Long.parseLong(fcsjStr[0])*60+Long.parseLong(fcsjStr[1]); 309 long fcsj= Long.parseLong(fcsjStr[0])*60+Long.parseLong(fcsjStr[1]);
@@ -375,8 +369,7 @@ public class CulateMileageServiceImpl implements CulateMileageService{ @@ -375,8 +369,7 @@ public class CulateMileageServiceImpl implements CulateMileageService{
375 int sjbc=0; 369 int sjbc=0;
376 for (int i = 0; i < lists.size(); i++) { 370 for (int i = 0; i < lists.size(); i++) {
377 ScheduleRealInfo scheduleRealInfo=lists.get(i); 371 ScheduleRealInfo scheduleRealInfo=lists.get(i);
378 - if (!(scheduleRealInfo.getBcType().equals("in")  
379 - || scheduleRealInfo.getBcType().equals("out"))) { 372 + if (!isInOut(scheduleRealInfo)) {
380 Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks(); 373 Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks();
381 if(!scheduleRealInfo.isSflj()){ 374 if(!scheduleRealInfo.isSflj()){
382 String time=""; 375 String time="";
@@ -491,7 +484,7 @@ public class CulateMileageServiceImpl implements CulateMileageService{ @@ -491,7 +484,7 @@ public class CulateMileageServiceImpl implements CulateMileageService{
491 for (int i = 0; i < lists.size(); i++) { 484 for (int i = 0; i < lists.size(); i++) {
492 ScheduleRealInfo scheduleRealInfo=lists.get(i); 485 ScheduleRealInfo scheduleRealInfo=lists.get(i);
493 if (scheduleRealInfo.getBcType().equals("in") 486 if (scheduleRealInfo.getBcType().equals("in")
494 - || scheduleRealInfo.getBcType().equals("out")) { 487 + || scheduleRealInfo.getBcType().equals("out")||scheduleRealInfo.getBcType().equals("ldks")) {
495 Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks(); 488 Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks();
496 if(childTaskPlans.isEmpty()){ 489 if(childTaskPlans.isEmpty()){
497 if(!scheduleRealInfo.isDestroy()) 490 if(!scheduleRealInfo.isDestroy())
@@ -521,7 +514,7 @@ public class CulateMileageServiceImpl implements CulateMileageService{ @@ -521,7 +514,7 @@ public class CulateMileageServiceImpl implements CulateMileageService{
521 ScheduleRealInfo scheduleRealInfo=lists.get(i); 514 ScheduleRealInfo scheduleRealInfo=lists.get(i);
522 if(!scheduleRealInfo.isSflj()){ 515 if(!scheduleRealInfo.isSflj()){
523 if (scheduleRealInfo.getBcType().equals("in") 516 if (scheduleRealInfo.getBcType().equals("in")
524 - || scheduleRealInfo.getBcType().equals("out")) { 517 + || scheduleRealInfo.getBcType().equals("out")|| scheduleRealInfo.getBcType().equals("ldks")) {
525 double jhlcOrig=scheduleRealInfo.getJhlcOrig()==null?0:scheduleRealInfo.getJhlcOrig(); 518 double jhlcOrig=scheduleRealInfo.getJhlcOrig()==null?0:scheduleRealInfo.getJhlcOrig();
526 if(jhlcOrig-scheduleRealInfo.getJhlc()>0){ 519 if(jhlcOrig-scheduleRealInfo.getJhlc()>0){
527 jcclc =Arith.add(jcclc, scheduleRealInfo.getJhlcOrig()==null?0:scheduleRealInfo.getJhlcOrig()); 520 jcclc =Arith.add(jcclc, scheduleRealInfo.getJhlcOrig()==null?0:scheduleRealInfo.getJhlcOrig());
@@ -542,6 +535,9 @@ public class CulateMileageServiceImpl implements CulateMileageService{ @@ -542,6 +535,9 @@ public class CulateMileageServiceImpl implements CulateMileageService{
542 if(s.getBcType().equals("out")){ 535 if(s.getBcType().equals("out")){
543 fage=true; 536 fage=true;
544 } 537 }
  538 + if(s.getBcType().equals("ldks")){
  539 + fage=true;
  540 + }
545 541
546 return fage; 542 return fage;
547 } 543 }
src/main/java/com/bsth/service/report/impl/ReportServiceImpl.java
@@ -369,8 +369,11 @@ public class ReportServiceImpl implements ReportService{ @@ -369,8 +369,11 @@ public class ReportServiceImpl implements ReportService{
369 DecimalFormat df = new DecimalFormat("#0.00"); 369 DecimalFormat df = new DecimalFormat("#0.00");
370 // TODO Auto-generated method stub 370 // TODO Auto-generated method stub
371 //最早营运时间 区分夜宵线 371 //最早营运时间 区分夜宵线
372 - String sqlMinYysj="select start_opt from bsth_c_line_config where line = '"+BasicData.lineId2CodeMap.inverse().get(line) +"'";  
373 - String minfcsj=jdbcTemplate.queryForObject(sqlMinYysj, String.class); 372 + String sqlMinYysj="select start_opt from bsth_c_line_config where "
  373 + + " id = ("
  374 + + "select max(id) from bsth_c_line_config where line ='"+BasicData.lineId2CodeMap.inverse().get(line) +"'"
  375 + + ")";
  376 + String minfcsj=jdbcTemplate.queryForObject(sqlMinYysj, String.class);
374 String[] minSjs = minfcsj.split(":"); 377 String[] minSjs = minfcsj.split(":");
375 int minSj=Integer.parseInt(minSjs[0])*60+Integer.parseInt(minSjs[1]); 378 int minSj=Integer.parseInt(minSjs[0])*60+Integer.parseInt(minSjs[1]);
376 //查询时间里程 379 //查询时间里程
@@ -564,8 +567,11 @@ public class ReportServiceImpl implements ReportService{ @@ -564,8 +567,11 @@ public class ReportServiceImpl implements ReportService{
564 List<Map<String, Object>> list =new ArrayList<>(); 567 List<Map<String, Object>> list =new ArrayList<>();
565 // TODO Auto-generated method stub 568 // TODO Auto-generated method stub
566 //最早营运时间 区分夜宵线 569 //最早营运时间 区分夜宵线
567 - String sqlMinYysj="select start_opt from bsth_c_line_config where line = '"+BasicData.lineId2CodeMap.inverse().get(line) +"'";  
568 - String minfcsj=jdbcTemplate.queryForObject(sqlMinYysj, String.class); 570 + String sqlMinYysj="select start_opt from bsth_c_line_config where "
  571 + + " id = ("
  572 + + "select max(id) from bsth_c_line_config where line ='"+BasicData.lineId2CodeMap.inverse().get(line) +"'"
  573 + + ")";
  574 + String minfcsj=jdbcTemplate.queryForObject(sqlMinYysj, String.class);
569 575
570 //查询全程 576 //查询全程
571 String sqlqc="select t.*,x.station_name as qdz_name from ( " 577 String sqlqc="select t.*,x.station_name as qdz_name from ( "
src/main/java/com/bsth/service/schedule/impl/SchedulePlanServiceImpl.java
@@ -21,6 +21,9 @@ import com.bsth.service.schedule.rules.shiftloop.ScheduleRule_input; @@ -21,6 +21,9 @@ import com.bsth.service.schedule.rules.shiftloop.ScheduleRule_input;
21 import com.bsth.service.schedule.rules.ttinfo.*; 21 import com.bsth.service.schedule.rules.ttinfo.*;
22 import com.bsth.service.schedule.rules.ttinfo2.CalcuParam; 22 import com.bsth.service.schedule.rules.ttinfo2.CalcuParam;
23 import com.bsth.service.schedule.rules.ttinfo2.Result; 23 import com.bsth.service.schedule.rules.ttinfo2.Result;
  24 +import com.bsth.service.schedule.rules.validate.ValidateParam;
  25 +import com.bsth.service.schedule.rules.validate.ValidateResults_output;
  26 +import org.apache.commons.lang3.StringUtils;
24 import org.joda.time.DateTime; 27 import org.joda.time.DateTime;
25 import org.kie.api.KieBase; 28 import org.kie.api.KieBase;
26 import org.kie.api.runtime.KieSession; 29 import org.kie.api.runtime.KieSession;
@@ -321,6 +324,59 @@ public class SchedulePlanServiceImpl extends BServiceImpl&lt;SchedulePlan, Long&gt; im @@ -321,6 +324,59 @@ public class SchedulePlanServiceImpl extends BServiceImpl&lt;SchedulePlan, Long&gt; im
321 324
322 } 325 }
323 326
  327 + /**
  328 + * 验证排班结果。
  329 + * @param planResult
  330 + * @param schedulePlan
  331 + */
  332 + public void validPlanResult(PlanResult planResult, SchedulePlan schedulePlan) {
  333 + // 1-1、构造drools规则输入数据,输出数据
  334 + ValidateParam validateParam = new ValidateParam(
  335 + new DateTime(schedulePlan.getScheduleFromTime()),
  336 + new DateTime(schedulePlan.getScheduleToTime())
  337 + );
  338 + // 规则输出数据
  339 + ValidateResults_output result = new ValidateResults_output();
  340 +
  341 + // 1-2、构造drools session->载入数据->启动规则->计算->销毁session
  342 + // 创建session,内部配置的是stateful
  343 + KieSession session = kieBase.newKieSession();
  344 +
  345 + // 设置gloable对象,在drl中通过别名使用
  346 + session.setGlobal("validResult", result);
  347 + session.setGlobal("log", logger); // 设置日志
  348 +
  349 + // 载入数据
  350 + session.insert(validateParam);
  351 + for (SchedulePlanInfo schedulePlanInfo: planResult.getSchedulePlanInfos()) {
  352 + session.insert(schedulePlanInfo);
  353 + }
  354 +
  355 + // 执行rule
  356 + session.fireAllRules();
  357 +
  358 + // 执行完毕销毁,有日志的也要关闭
  359 + session.dispose();
  360 +
  361 +// for (ValidateResults_output.ValidInfo validInfo: result.getInfos()) {
  362 +// logger.info(validInfo.getDesc());
  363 +// }
  364 +
  365 + // 取10条错误
  366 + int size = result.getInfos().size() > 10 ? 10: result.getInfos().size();
  367 + List<String> desclist = new ArrayList<>();
  368 + for (int i = 0; i < size; i++) {
  369 + desclist.add(result.getInfos().get(i).getDesc());
  370 + }
  371 + if (desclist.size() > 0) {
  372 + schedulePlan.setPlanResult(StringUtils.join(desclist, "</br>"));
  373 + } else {
  374 + schedulePlan.setPlanResult("ok");
  375 + }
  376 +
  377 + // TODO:设定错误信息
  378 + }
  379 +
324 @Transactional(propagation = Propagation.REQUIRED, isolation = Isolation.READ_COMMITTED) 380 @Transactional(propagation = Propagation.REQUIRED, isolation = Isolation.READ_COMMITTED)
325 public SchedulePlan save(SchedulePlan schedulePlan) { 381 public SchedulePlan save(SchedulePlan schedulePlan) {
326 // pre、如果排班的数据之前已经有了,删除之前的数据 382 // pre、如果排班的数据之前已经有了,删除之前的数据
@@ -341,6 +397,9 @@ public class SchedulePlanServiceImpl extends BServiceImpl&lt;SchedulePlan, Long&gt; im @@ -341,6 +397,9 @@ public class SchedulePlanServiceImpl extends BServiceImpl&lt;SchedulePlan, Long&gt; im
341 // 3、确定套跑规则 397 // 3、确定套跑规则
342 rerunPlanResult(planResult, schedulePlan); 398 rerunPlanResult(planResult, schedulePlan);
343 399
  400 + // TODO:3-1、验证排班结果
  401 + validPlanResult(planResult, schedulePlan);
  402 +
344 // 4、保存数据(jdbcTemplate 批量插入) 403 // 4、保存数据(jdbcTemplate 批量插入)
345 Date start4 = new Date(); 404 Date start4 = new Date();
346 scheduleRuleService.generateSchedulePlan(schedulePlan, planResult.getSchedulePlanInfos()); 405 scheduleRuleService.generateSchedulePlan(schedulePlan, planResult.getSchedulePlanInfos());
src/main/java/com/bsth/service/schedule/rules/MyDroolsConfiguration.java
@@ -74,6 +74,9 @@ public class MyDroolsConfiguration { @@ -74,6 +74,9 @@ public class MyDroolsConfiguration {
74 kfs.write("src/main/resources/rerun.drl", kieServices.getResources() 74 kfs.write("src/main/resources/rerun.drl", kieServices.getResources()
75 .newInputStreamResource(this.getClass().getResourceAsStream( 75 .newInputStreamResource(this.getClass().getResourceAsStream(
76 "/rules/rerun.drl"), "UTF-8")); 76 "/rules/rerun.drl"), "UTF-8"));
  77 + kfs.write("src/main/resources/validplan.drl", kieServices.getResources()
  78 + .newInputStreamResource(this.getClass().getResourceAsStream(
  79 + "/rules/validplan.drl"), "UTF-8"));
77 // TODO:还有其他drl.... 80 // TODO:还有其他drl....
78 81
79 // 4、创建KieBuilder,使用KieFileSystem构建 82 // 4、创建KieBuilder,使用KieFileSystem构建
src/main/java/com/bsth/service/schedule/rules/shiftloop/ScheduleRule_input.java
1 package com.bsth.service.schedule.rules.shiftloop; 1 package com.bsth.service.schedule.rules.shiftloop;
2 2
3 import com.bsth.entity.schedule.rule.ScheduleRule1Flat; 3 import com.bsth.entity.schedule.rule.ScheduleRule1Flat;
4 -import com.bsth.service.schedule.utils.Md5Util;  
5 import com.google.common.base.Splitter; 4 import com.google.common.base.Splitter;
6 import org.apache.commons.lang3.StringUtils; 5 import org.apache.commons.lang3.StringUtils;
7 import org.joda.time.DateTime; 6 import org.joda.time.DateTime;
@@ -18,11 +17,6 @@ public class ScheduleRule_input { @@ -18,11 +17,6 @@ public class ScheduleRule_input {
18 17
19 /** 规则Id */ 18 /** 规则Id */
20 private String ruleId; 19 private String ruleId;
21 - /**  
22 - * 规则md5值(不使用id判定,使用md5判定)  
23 - * 使用,启用日期,路牌范围,人员范围 结合生成md5编码  
24 - */  
25 - private String ruleMd5;  
26 20
27 /** 规则启用日期 */ 21 /** 规则启用日期 */
28 private DateTime qyrq; 22 private DateTime qyrq;
@@ -85,15 +79,6 @@ public class ScheduleRule_input { @@ -85,15 +79,6 @@ public class ScheduleRule_input {
85 } 79 }
86 } 80 }
87 81
88 - /** 生成规则md5编码 */  
89 - ruleMd5 = Md5Util.getMd5(  
90 - String.valueOf(qyrq.getMillis()) + "_" +  
91 - scheduleRule1Flat.getLpIds() + "_" +  
92 - scheduleRule1Flat.getRyConfigIds()  
93 - );  
94 -  
95 -// System.out.println("rule的md5:" + ruleMd5 + " 车辆:" + scheduleRule1Flat.getCarConfigInfo().getCl().getInsideCode());  
96 -  
97 this.self = scheduleRule1Flat; 82 this.self = scheduleRule1Flat;
98 } 83 }
99 84
@@ -179,11 +164,4 @@ public class ScheduleRule_input { @@ -179,11 +164,4 @@ public class ScheduleRule_input {
179 this.self = self; 164 this.self = self;
180 } 165 }
181 166
182 - public String getRuleMd5() {  
183 - return ruleMd5;  
184 - }  
185 -  
186 - public void setRuleMd5(String ruleMd5) {  
187 - this.ruleMd5 = ruleMd5;  
188 - }  
189 } 167 }
src/main/java/com/bsth/service/schedule/rules/validate/ValidRepeatBcFunction.java 0 → 100644
  1 +package com.bsth.service.schedule.rules.validate;
  2 +
  3 +import com.bsth.entity.schedule.SchedulePlanInfo;
  4 +import org.kie.api.runtime.rule.AccumulateFunction;
  5 +
  6 +import java.io.*;
  7 +import java.text.SimpleDateFormat;
  8 +import java.util.ArrayList;
  9 +import java.util.HashMap;
  10 +import java.util.List;
  11 +import java.util.Map;
  12 +
  13 +/**
  14 + * 计算班次重复错误。
  15 + * 同一个路牌下,相同发车时间的班次数。
  16 + * 注意:使用这个函数时,要一天计算一次,多天计算无意义。
  17 + */
  18 +public class ValidRepeatBcFunction implements AccumulateFunction {
  19 + @Override
  20 + public void writeExternal(ObjectOutput out) throws IOException {
  21 + }
  22 +
  23 + @Override
  24 + public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
  25 +
  26 + }
  27 +
  28 + protected static class RepeatBcInfo implements Externalizable {
  29 + /** 错误描述 */
  30 + public List<ValidateResults_output.ValidInfo> validInfoList = new ArrayList<>();
  31 + /** 内部计数Map,key:{路牌Id}_{发车时间},value:个数 */
  32 + public Map<String, Integer> lpBcFcsjCount = new HashMap<>();
  33 +
  34 + public RepeatBcInfo() {
  35 + }
  36 +
  37 + @Override
  38 + public void writeExternal(ObjectOutput out) throws IOException {
  39 + out.writeObject(validInfoList);
  40 + }
  41 +
  42 + @Override
  43 + public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
  44 + validInfoList = (List<ValidateResults_output.ValidInfo>) in.readObject();
  45 + }
  46 + }
  47 +
  48 + @Override
  49 + public Serializable createContext() {
  50 + return new RepeatBcInfo();
  51 + }
  52 +
  53 + @Override
  54 + public void init(Serializable serializable) throws Exception {
  55 + // TODO:
  56 + }
  57 +
  58 + @Override
  59 + public void accumulate(Serializable context, Object o) {
  60 + RepeatBcInfo repeatBcInfo = (RepeatBcInfo) context;
  61 + SchedulePlanInfo schedulePlanInfo = (SchedulePlanInfo) o;
  62 +
  63 + String key = schedulePlanInfo.getLp() + "_" + schedulePlanInfo.getFcsj();
  64 + SimpleDateFormat sf = new SimpleDateFormat("yyyy年MM月dd日");
  65 + String infoformat = "日期(%s),路牌(%s),班次(%s),重复(%d)次";
  66 + if (repeatBcInfo.lpBcFcsjCount.get(key) == null) {
  67 + repeatBcInfo.lpBcFcsjCount.put(key, 1);
  68 + } else {
  69 + int count = repeatBcInfo.lpBcFcsjCount.get(key) + 1;
  70 + ValidateResults_output.ValidInfo validInfo = new ValidateResults_output.ValidInfo();
  71 + validInfo.setSd(schedulePlanInfo.getScheduleDate());
  72 + validInfo.setDesc(String.format(
  73 + infoformat,
  74 + sf.format(schedulePlanInfo.getScheduleDate()),
  75 + schedulePlanInfo.getLpName(),
  76 + schedulePlanInfo.getFcsj(),
  77 + count));
  78 + repeatBcInfo.validInfoList.add(validInfo);
  79 + repeatBcInfo.lpBcFcsjCount.put(key, count);
  80 + }
  81 + }
  82 +
  83 + @Override
  84 + public boolean supportsReverse() {
  85 + return false;
  86 + }
  87 +
  88 + @Override
  89 + public void reverse(Serializable serializable, Object o) throws Exception {
  90 +
  91 + }
  92 +
  93 + @Override
  94 + public Class<?> getResultType() {
  95 + return List.class;
  96 + }
  97 +
  98 + @Override
  99 + public Object getResult(Serializable context) throws Exception {
  100 + RepeatBcInfo repeatBcInfo = (RepeatBcInfo) context;
  101 + return repeatBcInfo.validInfoList;
  102 + }
  103 +}
src/main/java/com/bsth/service/schedule/rules/validate/ValidateParam.java 0 → 100644
  1 +package com.bsth.service.schedule.rules.validate;
  2 +
  3 +import org.joda.time.DateTime;
  4 +import org.joda.time.Period;
  5 +import org.joda.time.PeriodType;
  6 +
  7 +/**
  8 + * Created by xu on 17/5/11.
  9 + */
  10 +public class ValidateParam {
  11 + /** 开始计算日期 */
  12 + private DateTime fromDate;
  13 + /** 结束计算日期 */
  14 + private DateTime toDate;
  15 +
  16 + /** 间隔天数 */
  17 + private Integer days;
  18 +
  19 + public ValidateParam(DateTime f, DateTime t) {
  20 + this.fromDate = f;
  21 + this.toDate = t;
  22 + Period period = new Period(fromDate, toDate, PeriodType.days());
  23 + days = period.getDays() + 1;
  24 + }
  25 +
  26 + public DateTime getFromDate() {
  27 + return fromDate;
  28 + }
  29 +
  30 + public void setFromDate(DateTime fromDate) {
  31 + this.fromDate = fromDate;
  32 + }
  33 +
  34 + public DateTime getToDate() {
  35 + return toDate;
  36 + }
  37 +
  38 + public void setToDate(DateTime toDate) {
  39 + this.toDate = toDate;
  40 + }
  41 +
  42 + public Integer getDays() {
  43 + return days;
  44 + }
  45 +
  46 + public void setDays(Integer days) {
  47 + this.days = days;
  48 + }
  49 +}
src/main/java/com/bsth/service/schedule/rules/validate/ValidateResults_output.java 0 → 100644
  1 +package com.bsth.service.schedule.rules.validate;
  2 +
  3 +import java.util.ArrayList;
  4 +import java.util.Date;
  5 +import java.util.List;
  6 +
  7 +/**
  8 + * 验证输出。
  9 + */
  10 +public class ValidateResults_output {
  11 + private List<ValidInfo> infos = new ArrayList<>();
  12 +
  13 + public static class ValidInfo {
  14 + /** 日期 */
  15 + private Date sd;
  16 + /** 描述 */
  17 + private String desc;
  18 +
  19 + public Date getSd() {
  20 + return sd;
  21 + }
  22 +
  23 + public void setSd(Date sd) {
  24 + this.sd = sd;
  25 + }
  26 +
  27 + public String getDesc() {
  28 + return desc;
  29 + }
  30 +
  31 + public void setDesc(String desc) {
  32 + this.desc = desc;
  33 + }
  34 + }
  35 +
  36 + public List<ValidInfo> getInfos() {
  37 + return infos;
  38 + }
  39 +
  40 + public void setInfos(List<ValidInfo> infos) {
  41 + this.infos = infos;
  42 + }
  43 +}
src/main/java/com/bsth/websocket/handler/RealControlSocketHandler.java
1 package com.bsth.websocket.handler; 1 package com.bsth.websocket.handler;
2 2
3 import com.alibaba.fastjson.JSONObject; 3 import com.alibaba.fastjson.JSONObject;
4 -import com.bsth.common.Constants;  
5 import com.bsth.data.BasicData; 4 import com.bsth.data.BasicData;
  5 +import com.bsth.data.msg_queue.WebSocketPushQueue;
6 import com.google.common.base.Splitter; 6 import com.google.common.base.Splitter;
7 import org.slf4j.Logger; 7 import org.slf4j.Logger;
8 import org.slf4j.LoggerFactory; 8 import org.slf4j.LoggerFactory;
@@ -103,7 +103,8 @@ public class RealControlSocketHandler implements WebSocketHandler { @@ -103,7 +103,8 @@ public class RealControlSocketHandler implements WebSocketHandler {
103 return; 103 return;
104 104
105 for(WebSocketSession user : list){ 105 for(WebSocketSession user : list){
106 - try { 106 + WebSocketPushQueue.put(user, message);
  107 + /*try {
107 if (user.isOpen()) { 108 if (user.isOpen()) {
108 user.sendMessage(message); 109 user.sendMessage(message);
109 } 110 }
@@ -114,7 +115,7 @@ public class RealControlSocketHandler implements WebSocketHandler { @@ -114,7 +115,7 @@ public class RealControlSocketHandler implements WebSocketHandler {
114 catch(Exception e2){} 115 catch(Exception e2){}
115 logger.error("sendMessageToLine error ...."+msg); 116 logger.error("sendMessageToLine error ...."+msg);
116 logger.error("sendMessageToLine error ....", e); 117 logger.error("sendMessageToLine error ....", e);
117 - } 118 + }*/
118 } 119 }
119 } 120 }
120 121
src/main/resources/application-dev.properties
@@ -29,7 +29,7 @@ spring.datasource.validation-query=select 1 @@ -29,7 +29,7 @@ spring.datasource.validation-query=select 1
29 ## 29 ##
30 #222.66.0.204:5555 30 #222.66.0.204:5555
31 ##\u5B9E\u65F6gps 31 ##\u5B9E\u65F6gps
32 -http.gps.real.url= http://114.80.178.12:18080/transport_server/rtgps/ 32 +#http.gps.real.url= http://114.80.178.12:18080/transport_server/rtgps/
33 #http.gps.real.url= http://27.115.69.123:8800/transport_server/rtgps/ 33 #http.gps.real.url= http://27.115.69.123:8800/transport_server/rtgps/
34 ##\u6D88\u606F\u4E0B\u53D1 34 ##\u6D88\u606F\u4E0B\u53D1
35 http.send.directive = http://192.168.168.201:9090/transport_server/message/ 35 http.send.directive = http://192.168.168.201:9090/transport_server/message/
src/main/resources/datatools/ktrs/scheduleRuleDataInput.ktr
@@ -429,7 +429,7 @@ @@ -429,7 +429,7 @@
429 <name>cid</name> 429 <name>cid</name>
430 </field> 430 </field>
431 <field> 431 <field>
432 - <name>&#x8def;&#x724c;&#x8303;&#x56f4;</name> 432 + <name>lpnames</name>
433 </field> 433 </field>
434 <field> 434 <field>
435 <name>lpids</name> 435 <name>lpids</name>
@@ -460,6 +460,12 @@ @@ -460,6 +460,12 @@
460 <type>CONCAT_STRING</type> 460 <type>CONCAT_STRING</type>
461 <valuefield>,</valuefield> 461 <valuefield>,</valuefield>
462 </field> 462 </field>
  463 + <field>
  464 + <aggregate>rybms</aggregate>
  465 + <subject>rybm</subject>
  466 + <type>CONCAT_STRING</type>
  467 + <valuefield>,</valuefield>
  468 + </field>
463 </fields> 469 </fields>
464 <cluster_schema/> 470 <cluster_schema/>
465 <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI> 471 <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
@@ -496,9 +502,6 @@ @@ -496,9 +502,6 @@
496 <name>cid</name> 502 <name>cid</name>
497 </field> 503 </field>
498 <field> 504 <field>
499 - <name>&#x8def;&#x724c;&#x8303;&#x56f4;</name>  
500 - </field>  
501 - <field>  
502 <name>&#x8d77;&#x59cb;&#x8def;&#x724c;</name> 505 <name>&#x8d77;&#x59cb;&#x8def;&#x724c;</name>
503 </field> 506 </field>
504 <field> 507 <field>
@@ -524,6 +527,12 @@ @@ -524,6 +527,12 @@
524 <type>CONCAT_STRING</type> 527 <type>CONCAT_STRING</type>
525 <valuefield>,</valuefield> 528 <valuefield>,</valuefield>
526 </field> 529 </field>
  530 + <field>
  531 + <aggregate>lpnames</aggregate>
  532 + <subject>lpname</subject>
  533 + <type>CONCAT_STRING</type>
  534 + <valuefield>,</valuefield>
  535 + </field>
527 </fields> 536 </fields>
528 <cluster_schema/> 537 <cluster_schema/>
529 <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI> 538 <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
@@ -712,13 +721,19 @@ @@ -712,13 +721,19 @@
712 <optimizationLevel>9</optimizationLevel> 721 <optimizationLevel>9</optimizationLevel>
713 <jsScripts> <jsScript> <jsScript_type>0</jsScript_type> 722 <jsScripts> <jsScript> <jsScript_type>0</jsScript_type>
714 <jsScript_name>Script 1</jsScript_name> 723 <jsScript_name>Script 1</jsScript_name>
715 - <jsScript_script>&#x2f;&#x2f;Script here&#xa;&#xa;var rycid&#x3b;&#xa;&#xa;if &#x28;rycid2 &#x3d;&#x3d; null&#x29; &#x7b;&#xa; rycid &#x3d; rycid1&#x3b;&#xa;&#x7d; else &#x7b;&#xa; rycid &#x3d; rycid1 &#x2b; &#x22;-&#x22; &#x2b; rycid2&#x3b;&#xa;&#x7d;</jsScript_script> 724 + <jsScript_script>&#x2f;&#x2f;Script here&#xa;&#xa;var rycid&#x3b;&#xa;var rybm&#x3b;&#xa;&#xa;if &#x28;rycid2 &#x3d;&#x3d; null&#x29; &#x7b;&#xa; rycid &#x3d; rycid1&#x3b;&#xa; rybm &#x3d; dbbm1&#x3b;&#xa;&#x7d; else &#x7b;&#xa; rycid &#x3d; rycid1 &#x2b; &#x22;-&#x22; &#x2b; rycid2&#x3b;&#xa; rybm &#x3d; dbbm1 &#x2b; &#x22;-&#x22; &#x2b; dbbm2&#x3b;&#xa;&#x7d;</jsScript_script>
716 </jsScript> </jsScripts> <fields> <field> <name>rycid</name> 725 </jsScript> </jsScripts> <fields> <field> <name>rycid</name>
717 <rename>rycid</rename> 726 <rename>rycid</rename>
718 <type>String</type> 727 <type>String</type>
719 <length>-1</length> 728 <length>-1</length>
720 <precision>-1</precision> 729 <precision>-1</precision>
721 <replace>N</replace> 730 <replace>N</replace>
  731 + </field> <field> <name>rybm</name>
  732 + <rename>rybm</rename>
  733 + <type>String</type>
  734 + <length>-1</length>
  735 + <precision>-1</precision>
  736 + <replace>N</replace>
722 </field> </fields> <cluster_schema/> 737 </field> </fields> <cluster_schema/>
723 <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI> 738 <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
724 <xloc>917</xloc> 739 <xloc>917</xloc>
@@ -927,12 +942,6 @@ @@ -927,12 +942,6 @@
927 <presorted>N</presorted> 942 <presorted>N</presorted>
928 </field> 943 </field>
929 <field> 944 <field>
930 - <name>&#x8def;&#x724c;&#x8303;&#x56f4;</name>  
931 - <ascending>Y</ascending>  
932 - <case_sensitive>N</case_sensitive>  
933 - <presorted>N</presorted>  
934 - </field>  
935 - <field>  
936 <name>&#x8d77;&#x59cb;&#x8def;&#x724c;</name> 945 <name>&#x8d77;&#x59cb;&#x8def;&#x724c;</name>
937 <ascending>Y</ascending> 946 <ascending>Y</ascending>
938 <case_sensitive>N</case_sensitive> 947 <case_sensitive>N</case_sensitive>
@@ -1009,7 +1018,7 @@ @@ -1009,7 +1018,7 @@
1009 <presorted>N</presorted> 1018 <presorted>N</presorted>
1010 </field> 1019 </field>
1011 <field> 1020 <field>
1012 - <name>&#x8def;&#x724c;&#x8303;&#x56f4;</name> 1021 + <name>lpnames</name>
1013 <ascending>Y</ascending> 1022 <ascending>Y</ascending>
1014 <case_sensitive>N</case_sensitive> 1023 <case_sensitive>N</case_sensitive>
1015 <presorted>N</presorted> 1024 <presorted>N</presorted>
@@ -1106,7 +1115,7 @@ @@ -1106,7 +1115,7 @@
1106 </value> 1115 </value>
1107 <value> 1116 <value>
1108 <name>lp_names</name> 1117 <name>lp_names</name>
1109 - <rename>&#x8def;&#x724c;&#x8303;&#x56f4;</rename> 1118 + <rename>lpnames</rename>
1110 <update>Y</update> 1119 <update>Y</update>
1111 </value> 1120 </value>
1112 <value> 1121 <value>
@@ -1126,7 +1135,7 @@ @@ -1126,7 +1135,7 @@
1126 </value> 1135 </value>
1127 <value> 1136 <value>
1128 <name>ry_dbbms</name> 1137 <name>ry_dbbms</name>
1129 - <rename>&#x4eba;&#x5458;&#x8303;&#x56f4;</rename> 1138 + <rename>rybms</rename>
1130 <update>Y</update> 1139 <update>Y</update>
1131 </value> 1140 </value>
1132 <value> 1141 <value>
src/main/resources/logback.xml
@@ -182,6 +182,48 @@ @@ -182,6 +182,48 @@
182 <appender-ref ref="GPS_COUNT" /> 182 <appender-ref ref="GPS_COUNT" />
183 </logger> 183 </logger>
184 184
  185 + <!-- 消息队列纪录 -->
  186 + <appender name="QUEUE_WEB_SOCKET"
  187 + class="ch.qos.logback.core.rolling.RollingFileAppender">
  188 + <file>${LOG_BASE}/msg_queue/websocket.log</file>
  189 + <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
  190 + <fileNamePattern>${LOG_BASE}/msg_queue/websocket-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
  191 + <timeBasedFileNamingAndTriggeringPolicy
  192 + class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
  193 + <maxFileSize>100MB</maxFileSize>
  194 + </timeBasedFileNamingAndTriggeringPolicy>
  195 + </rollingPolicy>
  196 +
  197 + <layout class="ch.qos.logback.classic.PatternLayout">
  198 + <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%file:%line] %-5level -%msg%n
  199 + </pattern>
  200 + </layout>
  201 + </appender>
  202 + <logger name="com.bsth.data.msg_queue.WebSocketPushQueue"
  203 + level="INFO" additivity="false">
  204 + <appender-ref ref="QUEUE_WEB_SOCKET" />
  205 + </logger>
  206 + <appender name="QUEUE_DIRECTIVE"
  207 + class="ch.qos.logback.core.rolling.RollingFileAppender">
  208 + <file>${LOG_BASE}/msg_queue/directive.log</file>
  209 + <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
  210 + <fileNamePattern>${LOG_BASE}/msg_queue/directive-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
  211 + <timeBasedFileNamingAndTriggeringPolicy
  212 + class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
  213 + <maxFileSize>100MB</maxFileSize>
  214 + </timeBasedFileNamingAndTriggeringPolicy>
  215 + </rollingPolicy>
  216 +
  217 + <layout class="ch.qos.logback.classic.PatternLayout">
  218 + <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%file:%line] %-5level -%msg%n
  219 + </pattern>
  220 + </layout>
  221 + </appender>
  222 + <logger name="com.bsth.data.msg_queue.DirectivePushQueue"
  223 + level="INFO" additivity="false">
  224 + <appender-ref ref="QUEUE_DIRECTIVE" />
  225 + </logger>
  226 +
185 <!--<logger name="org.hibernate.SQL" level="TRACE">--> 227 <!--<logger name="org.hibernate.SQL" level="TRACE">-->
186 <!--<appender-ref ref="STDOUT" />--> 228 <!--<appender-ref ref="STDOUT" />-->
187 <!--</logger>--> 229 <!--</logger>-->
src/main/resources/rules/functions.drl
@@ -4,4 +4,5 @@ import accumulate com.bsth.service.schedule.rules.ttinfo2.ErrorBcCountFunction e @@ -4,4 +4,5 @@ import accumulate com.bsth.service.schedule.rules.ttinfo2.ErrorBcCountFunction e
4 import accumulate com.bsth.service.schedule.rules.shiftloop.GidsCountFunction gidscount; 4 import accumulate com.bsth.service.schedule.rules.shiftloop.GidsCountFunction gidscount;
5 import accumulate com.bsth.service.schedule.rules.shiftloop.GidFbTimeFunction gidfbtime; 5 import accumulate com.bsth.service.schedule.rules.shiftloop.GidFbTimeFunction gidfbtime;
6 import accumulate com.bsth.service.schedule.rules.ttinfo.LpInfoResultsFunction lpinforesult; 6 import accumulate com.bsth.service.schedule.rules.ttinfo.LpInfoResultsFunction lpinforesult;
7 -import accumulate com.bsth.service.schedule.rules.ttinfo.MinRuleQyrqFunction minruleqyrq  
8 \ No newline at end of file 7 \ No newline at end of file
  8 +import accumulate com.bsth.service.schedule.rules.ttinfo.MinRuleQyrqFunction minruleqyrq;
  9 +import accumulate com.bsth.service.schedule.rules.validate.ValidRepeatBcFunction vrb;
9 \ No newline at end of file 10 \ No newline at end of file
src/main/resources/rules/shiftloop_fb_2.drl
@@ -31,6 +31,7 @@ global ScheduleRuleService scheduleRuleService; @@ -31,6 +31,7 @@ global ScheduleRuleService scheduleRuleService;
31 declare Calcu_days_result_pre 31 declare Calcu_days_result_pre
32 ruleId: String // 规则Id 32 ruleId: String // 规则Id
33 ruleMd5: String // 规则md5 33 ruleMd5: String // 规则md5
  34 + ruleEcCount: Integer // 人员范围个数
34 35
35 calcu_index_lp : Integer // 计算之后路牌的起始索引 36 calcu_index_lp : Integer // 计算之后路牌的起始索引
36 calcu_index_ry : Integer // 计算之后人员的起始索引 37 calcu_index_ry : Integer // 计算之后人员的起始索引
@@ -61,8 +62,8 @@ rule &quot;calcu_days_1_&quot; @@ -61,8 +62,8 @@ rule &quot;calcu_days_1_&quot;
61 $toDate : toDate, 62 $toDate : toDate,
62 $xlId: xlId 63 $xlId: xlId
63 ) 64 )
64 - ScheduleRule_input(  
65 - $ruleId : ruleId, $qyrq : qyrq, $ruleMd5: ruleMd5, 65 + $sri: ScheduleRule_input(
  66 + $ruleId : ruleId, $qyrq : qyrq,
66 $lpindex : startGbdIndex, $ryindex: startEIndex) 67 $lpindex : startGbdIndex, $ryindex: startEIndex)
67 eval($qyrq.isBefore($fromDate)) 68 eval($qyrq.isBefore($fromDate))
68 then 69 then
@@ -71,7 +72,6 @@ rule &quot;calcu_days_1_&quot; @@ -71,7 +72,6 @@ rule &quot;calcu_days_1_&quot;
71 // 构造Calcu_days_result_pre,用于路牌 72 // 构造Calcu_days_result_pre,用于路牌
72 Calcu_days_result_pre cdrp = new Calcu_days_result_pre(); 73 Calcu_days_result_pre cdrp = new Calcu_days_result_pre();
73 cdrp.setRuleId($ruleId); 74 cdrp.setRuleId($ruleId);
74 - cdrp.setRuleMd5($ruleMd5);  
75 cdrp.setCalcu_index_lp($lpindex); 75 cdrp.setCalcu_index_lp($lpindex);
76 cdrp.setCalcu_index_ry($ryindex); 76 cdrp.setCalcu_index_ry($ryindex);
77 cdrp.setCalcu_start_date_1($qyrq); 77 cdrp.setCalcu_start_date_1($qyrq);
@@ -81,6 +81,19 @@ rule &quot;calcu_days_1_&quot; @@ -81,6 +81,19 @@ rule &quot;calcu_days_1_&quot;
81 cdrp.setCalcu_start_date_2($fromDate); 81 cdrp.setCalcu_start_date_2($fromDate);
82 cdrp.setCalcu_end_date_2($toDate); 82 cdrp.setCalcu_end_date_2($toDate);
83 83
  84 + /**
  85 + * 规则md5值(不使用id判定,使用md5判定)
  86 + * 使用,启用日期,路牌范围,结合生成md5编码
  87 + */
  88 + String ruleMd5 = Md5Util.getMd5(
  89 + String.valueOf($qyrq.getMillis()) +
  90 + "_" +
  91 + $sri.getSelf().getLpIds()
  92 + );
  93 + cdrp.setRuleMd5(ruleMd5);
  94 + // 人员范围个数
  95 + cdrp.setRuleEcCount($sri.getEmployeeConfigIds().size());
  96 +
84 insert(cdrp); 97 insert(cdrp);
85 98
86 // log.info("总共需要排班的天数 sdays={} ruleId={} from={} to={}", (p2.getDays() + 1), $ruleId, $fromDate, $toDate); 99 // log.info("总共需要排班的天数 sdays={} ruleId={} from={} to={}", (p2.getDays() + 1), $ruleId, $fromDate, $toDate);
@@ -97,8 +110,8 @@ rule &quot;calcu_days_2_&quot; @@ -97,8 +110,8 @@ rule &quot;calcu_days_2_&quot;
97 $toDate : toDate, 110 $toDate : toDate,
98 $xlId: xlId 111 $xlId: xlId
99 ) 112 )
100 - ScheduleRule_input(  
101 - $ruleId : ruleId, $qyrq : qyrq, $ruleMd5: ruleMd5, 113 + $sri: ScheduleRule_input(
  114 + $ruleId : ruleId, $qyrq : qyrq,
102 $lpindex : startGbdIndex, $ryindex: startEIndex) 115 $lpindex : startGbdIndex, $ryindex: startEIndex)
103 eval((!$qyrq.isBefore($fromDate)) && (!$qyrq.isAfter($toDate))) 116 eval((!$qyrq.isBefore($fromDate)) && (!$qyrq.isAfter($toDate)))
104 then 117 then
@@ -107,7 +120,6 @@ rule &quot;calcu_days_2_&quot; @@ -107,7 +120,6 @@ rule &quot;calcu_days_2_&quot;
107 // 构造Calcu_days_result_pre,用于路牌 120 // 构造Calcu_days_result_pre,用于路牌
108 Calcu_days_result_pre cdrp = new Calcu_days_result_pre(); 121 Calcu_days_result_pre cdrp = new Calcu_days_result_pre();
109 cdrp.setRuleId($ruleId); 122 cdrp.setRuleId($ruleId);
110 - cdrp.setRuleMd5($ruleMd5);  
111 cdrp.setCalcu_index_lp($lpindex); 123 cdrp.setCalcu_index_lp($lpindex);
112 cdrp.setCalcu_index_ry($ryindex); 124 cdrp.setCalcu_index_ry($ryindex);
113 cdrp.setCalcu_start_date_1($qyrq); 125 cdrp.setCalcu_start_date_1($qyrq);
@@ -117,6 +129,19 @@ rule &quot;calcu_days_2_&quot; @@ -117,6 +129,19 @@ rule &quot;calcu_days_2_&quot;
117 cdrp.setCalcu_start_date_2($qyrq); 129 cdrp.setCalcu_start_date_2($qyrq);
118 cdrp.setCalcu_end_date_2($toDate); 130 cdrp.setCalcu_end_date_2($toDate);
119 131
  132 + /**
  133 + * 规则md5值(不使用id判定,使用md5判定)
  134 + * 使用,启用日期,路牌范围,结合生成md5编码
  135 + */
  136 + String ruleMd5 = Md5Util.getMd5(
  137 + String.valueOf($qyrq.getMillis()) +
  138 + "_" +
  139 + $sri.getSelf().getLpIds()
  140 + );
  141 + cdrp.setRuleMd5(ruleMd5);
  142 + // 人员范围个数
  143 + cdrp.setRuleEcCount($sri.getEmployeeConfigIds().size());
  144 +
120 insert(cdrp); 145 insert(cdrp);
121 146
122 // log.info("总共需要排班的天数 sdays={} ruleId={} from={} to={}", (p2.getDays() + 1), $ruleId, $qyrq, $toDate); 147 // log.info("总共需要排班的天数 sdays={} ruleId={} from={} to={}", (p2.getDays() + 1), $ruleId, $qyrq, $toDate);
@@ -160,8 +185,9 @@ rule &quot;Calcu_SchedulePlanRuleResult_wrap&quot; @@ -160,8 +185,9 @@ rule &quot;Calcu_SchedulePlanRuleResult_wrap&quot;
160 185
161 // 规则Md5编码 186 // 规则Md5编码
162 String md5 = Md5Util.getMd5( 187 String md5 = Md5Util.getMd5(
163 - String.valueOf($sprr.getQyrq().getTime()) + "_" +  
164 - $sprr.getGids() + "_" + $sprr.getEcids() 188 + String.valueOf($sprr.getQyrq().getTime()) +
  189 + "_" +
  190 + $sprr.getGids()
165 ); 191 );
166 192
167 // System.out.println("修改后的md5:" + md5 + "车辆:" + $sprr.getCcZbh()); 193 // System.out.println("修改后的md5:" + md5 + "车辆:" + $sprr.getCcZbh());
@@ -181,7 +207,8 @@ rule &quot;calcu_days_1_with_result&quot; @@ -181,7 +207,8 @@ rule &quot;calcu_days_1_with_result&quot;
181 $cdrp: Calcu_days_result_pre( 207 $cdrp: Calcu_days_result_pre(
182 calcu_start_date_1.isBefore(calcu_start_date_2), 208 calcu_start_date_1.isBefore(calcu_start_date_2),
183 $ruleId: ruleId, 209 $ruleId: ruleId,
184 - $ruleMd5: ruleMd5 210 + $ruleMd5: ruleMd5,
  211 + $ruleEcCount: ruleEcCount
185 ) 212 )
186 $srrr_wrap: SchedulePlanRuleResult_wrap( 213 $srrr_wrap: SchedulePlanRuleResult_wrap(
187 // ruleId == $ruleId, 214 // ruleId == $ruleId,
@@ -196,8 +223,14 @@ rule &quot;calcu_days_1_with_result&quot; @@ -196,8 +223,14 @@ rule &quot;calcu_days_1_with_result&quot;
196 // 修正排班数据 223 // 修正排班数据
197 // log.info("准备修正 ruleId={} historyDate={}", $ruleId, $scheduleDate); 224 // log.info("准备修正 ruleId={} historyDate={}", $ruleId, $scheduleDate);
198 225
  226 + // 路牌范围起始index使用历史数据
199 $cdrp.setCalcu_index_lp(Integer.valueOf($self.getGidindex())); 227 $cdrp.setCalcu_index_lp(Integer.valueOf($self.getGidindex()));
200 - $cdrp.setCalcu_index_ry(Integer.valueOf($self.getEcindex())); 228 + // 人员范围起始index,需要判定,如果长度都是一样的,使用历史的,否则不更新,使用最新的
  229 + String history_ecids = $self.getEcids();
  230 + if ($ruleEcCount == history_ecids.split(",").length) {
  231 + $cdrp.setCalcu_index_ry(Integer.valueOf($self.getEcindex()));
  232 + }
  233 +
201 $cdrp.setCalcu_start_date_1($scheduleDate); 234 $cdrp.setCalcu_start_date_1($scheduleDate);
202 update($cdrp); 235 update($cdrp);
203 236
src/main/resources/rules/validplan.drl
1 -// TODO:  
2 \ No newline at end of file 1 \ No newline at end of file
  2 +package com.bsth.service.schedule.rules.validate;
  3 +
  4 +import com.bsth.entity.schedule.SchedulePlanInfo;
  5 +
  6 +import org.joda.time.*;
  7 +import java.util.*;
  8 +
  9 +import org.slf4j.Logger;
  10 +
  11 +// 全局日志类(一般使用调用此规则的service类)
  12 +global Logger log;
  13 +
  14 +// 输出
  15 +global ValidateResults_output validResult;
  16 +
  17 +//------------------------- 第一阶段、构造循环体 ----------------------------//
  18 +
  19 +declare Loop_param
  20 + start_date: DateTime // 开始日期(这个要不停的更新迭代)
  21 + end_date: DateTime // 结束日期
  22 + sdays: Integer // 总共循环的天数
  23 +end
  24 +
  25 +rule "Calcu_Loop_param"
  26 + salience 1000
  27 + when
  28 + ValidateParam(
  29 + $fd: fromDate,
  30 + $ed: toDate,
  31 + $days: days
  32 + )
  33 + then
  34 + Loop_param p = new Loop_param();
  35 + p.setStart_date($fd);
  36 + p.setEnd_date($ed);
  37 + p.setSdays($days);
  38 +
  39 + insert(p);
  40 +end
  41 +
  42 +//------------------------- 第二阶段、验证计算 ----------------------------//
  43 +
  44 +
  45 +rule "Valid_repeat_bc" // 验证是否存在重复班次
  46 + salience 600
  47 + when
  48 + $lp: Loop_param($sd: start_date, $ed: end_date)
  49 + eval($sd.isBefore($ed) || $sd.isEqual($ed))
  50 + $spiList: ArrayList() from collect (SchedulePlanInfo(scheduleDate.getTime() == $sd.millis))
  51 + $infos: ArrayList() from accumulate ($spi: SchedulePlanInfo() from $spiList, vrb($spi))
  52 + then
  53 + // TODO:
  54 +// log.info("日期={},班次重复错误数={}", $sd, $infos.size());
  55 +
  56 + validResult.getInfos().addAll($infos);
  57 +
  58 + // 迭代
  59 + $lp.setStart_date($sd.plusDays(1));
  60 + update($lp);
  61 +
  62 +end
  63 +
  64 +
  65 +
  66 +
  67 +
  68 +
  69 +
  70 +
src/main/resources/static/pages/base/section/editsection.html
1 <!-- 编辑路段 --> 1 <!-- 编辑路段 -->
2 -<div class="modal fade" id="edit_section_mobal" tabindex="-1" role="basic" aria-hidden="true"> 2 +<div class="modal fade" id="edit_section_mobal" role="basic" aria-hidden="true">
3 <div class="modal-dialog"> 3 <div class="modal-dialog">
4 <div class="modal-content"> 4 <div class="modal-content">
5 <div class="modal-header"> 5 <div class="modal-header">
@@ -49,7 +49,7 @@ @@ -49,7 +49,7 @@
49 上一路段: 49 上一路段:
50 </label> 50 </label>
51 <div class="col-md-6"> 51 <div class="col-md-6">
52 - <select name="sectionrouteCode" class="form-control" id="sectionrouteCodeSelect"></select> 52 + <select name="sectionrouteCode" class="form-control" id="sectionrouteCodeSelect" style="width:100%"></select>
53 <span class="help-block">说明:选择的路段将作为本路段序号的参考,成为选择路段的下一个路段。 </span> 53 <span class="help-block">说明:选择的路段将作为本路段序号的参考,成为选择路段的下一个路段。 </span>
54 </div> 54 </div>
55 </div> 55 </div>
@@ -162,7 +162,7 @@ $(&#39;#edit_section_mobal&#39;).on(&#39;editSectionMobal_show&#39;, function(e, map_,ajaxd,sect @@ -162,7 +162,7 @@ $(&#39;#edit_section_mobal&#39;).on(&#39;editSectionMobal_show&#39;, function(e, map_,ajaxd,sect
162 var sectionRouteId = Section.sectionRouteId; 162 var sectionRouteId = Section.sectionRouteId;
163 // 获取路段号元素,并添加下拉属性值 163 // 获取路段号元素,并添加下拉属性值
164 ajaxd.getStation(lineId,dir,function(treeData) { 164 ajaxd.getStation(lineId,dir,function(treeData) {
165 - var options = '<option value="">请选择...</option>'; 165 + /* var options = '<option value="">请选择...</option>';
166 var dArray = treeData[0].children[1].children; 166 var dArray = treeData[0].children[1].children;
167 var eq_stationRouteCode = Section.sectionRouteCode; 167 var eq_stationRouteCode = Section.sectionRouteCode;
168 for(var i = 0 ; i<dArray.length; i++){ 168 for(var i = 0 ; i<dArray.length; i++){
@@ -181,6 +181,33 @@ $(&#39;#edit_section_mobal&#39;).on(&#39;editSectionMobal_show&#39;, function(e, map_,ajaxd,sect @@ -181,6 +181,33 @@ $(&#39;#edit_section_mobal&#39;).on(&#39;editSectionMobal_show&#39;, function(e, map_,ajaxd,sect
181 }else { 181 }else {
182 $('#sectionrouteCodeSelect').val(''); 182 $('#sectionrouteCodeSelect').val('');
183 } 183 }
  184 + }); */
  185 + var array = treeData[0].children[1].children,paramsD =new Array();
  186 + var eq_scetionRouteCode = Section.sectionRouteCode;
  187 + paramsD.push({'id':'请选择...','text':'请选择...'});
  188 + // 遍历.
  189 + $.each(array, function(i, g){
  190 + // 判断.
  191 + if(g.sectionName!='' || g.sectionName != null) {
  192 + var ptions_v = g.sectionrouteCode;
  193 + if(eq_scetionRouteCode != ptions_v){
  194 + // 添加拼音检索下拉框格式数据数组.
  195 + paramsD.push({'id':ptions_v,
  196 + 'text':g.sectionName + '(' + ptions_v + ')' + ' --' + dirdmToName(g.sectionrouteDirections)});
  197 + }
  198 + }
  199 + });
  200 + // 初始化上一个路段拼音检索下拉框.
  201 + initPinYinSelect2($('#sectionrouteCodeSelect'),paramsD,function(selector) {
  202 + $('#sectionDirSelect').val('');// 设值方向.
  203 + ajaxd.findUpSectionRouteCode(lineId,dir,eq_scetionRouteCode,function(str) {
  204 + if(str.length>0){
  205 + var upStationRouteCode = str[0].sectionrouteCode;
  206 + $('#sectionrouteCodeSelect').select2('val',upStationRouteCode);
  207 + }else {
  208 + $('#sectionrouteCodeSelect').select2('val','请选择...');
  209 + }
  210 + });
184 }); 211 });
185 }); 212 });
186 function dirdmToName(value) { 213 function dirdmToName(value) {
@@ -257,6 +284,8 @@ $(&#39;#edit_section_mobal&#39;).on(&#39;editSectionMobal_show&#39;, function(e, map_,ajaxd,sect @@ -257,6 +284,8 @@ $(&#39;#edit_section_mobal&#39;).on(&#39;editSectionMobal_show&#39;, function(e, map_,ajaxd,sect
257 // 设置日期 284 // 设置日期
258 params.createDate = moment(Section.carParkCreateDate).format(fs); 285 params.createDate = moment(Section.carParkCreateDate).format(fs);
259 error.hide(); 286 error.hide();
  287 + if(params.sectionrouteCode=='请选择...')
  288 + params.sectionrouteCode='';
260 ajaxd.sectionUpdate(params,function(resuntDate) { 289 ajaxd.sectionUpdate(params,function(resuntDate) {
261 if(resuntDate.status=='SUCCESS') { 290 if(resuntDate.status=='SUCCESS') {
262 // 弹出添加成功提示消息 291 // 弹出添加成功提示消息
src/main/resources/static/pages/base/station/edit.html
1 <!-- 编辑站点弹出层mobal --> 1 <!-- 编辑站点弹出层mobal -->
2 -<div class="modal fade" id="editPoitsions_station_mobal" tabindex="-1" role="basic" aria-hidden="true"> 2 +<div class="modal fade" id="editPoitsions_station_mobal" role="basic" aria-hidden="true">
3 <div class="modal-dialog"> 3 <div class="modal-dialog">
4 <div class="modal-content"> 4 <div class="modal-content">
5 <!-- 弹出层标题title容器 --> 5 <!-- 弹出层标题title容器 -->
@@ -209,6 +209,7 @@ @@ -209,6 +209,7 @@
209 </div> 209 </div>
210 <script type="text/javascript"> 210 <script type="text/javascript">
211 $('#editPoitsions_station_mobal').on('editStationMobal_show', function(e, map,fun,stat){ 211 $('#editPoitsions_station_mobal').on('editStationMobal_show', function(e, map,fun,stat){
  212 + layer.closeAll();
212 // 获取站点对象信息 213 // 获取站点对象信息
213 var editStation = stat.getAddStation(); 214 var editStation = stat.getAddStation();
214 // 初始化表单值 215 // 初始化表单值
@@ -297,7 +298,9 @@ $(&#39;#editPoitsions_station_mobal&#39;).on(&#39;editStationMobal_show&#39;, function(e, map,fu @@ -297,7 +298,9 @@ $(&#39;#editPoitsions_station_mobal&#39;).on(&#39;editStationMobal_show&#39;, function(e, map,fu
297 // 站点序号值改变事件 298 // 站点序号值改变事件
298 $('#stationrouteSelect').on('change',function() { 299 $('#stationrouteSelect').on('change',function() {
299 var stationRValue = $('#stationrouteSelect').val(); 300 var stationRValue = $('#stationrouteSelect').val();
300 - if(stationRValue) { 301 + if(stationRValue=='请选择...') {
  302 + $('#stationMarkSelect').val('B');
  303 + }else {
301 var tempStr = stationRValue.split('_'); 304 var tempStr = stationRValue.split('_');
302 if(tempStr[1] == 'E') { 305 if(tempStr[1] == 'E') {
303 $('#stationMarkSelect').val('E'); 306 $('#stationMarkSelect').val('E');
@@ -318,8 +321,15 @@ $(&#39;#editPoitsions_station_mobal&#39;).on(&#39;editStationMobal_show&#39;, function(e, map,fu @@ -318,8 +321,15 @@ $(&#39;#editPoitsions_station_mobal&#39;).on(&#39;editStationMobal_show&#39;, function(e, map,fu
318 if(g.name!='' || g.name != null) { 321 if(g.name!='' || g.name != null) {
319 if(g.stationRouteCode != editStation.stationRouteCode) { 322 if(g.stationRouteCode != editStation.stationRouteCode) {
320 // 添加拼音检索下拉框格式数据数组. 323 // 添加拼音检索下拉框格式数据数组.
321 - paramsD.push({'id':g.stationRouteCode + '_' + g.stationMark + '_' + g.directions,  
322 - 'text':g.stationName + ' (' + g.stationRouteCode + ')' + ' --' + fun.dirdmToName(g.directions)}); 324 + /* paramsD.push({'id':g.stationRouteCode + '_' + g.stationMark + '_' + g.directions,
  325 + 'text':g.stationName + ' (' + g.stationRouteCode + ')' + ' --' + fun.dirdmToName(g.directions)}); */
  326 + if(editStation.stationRouteStationMark=='E' && i == (len_-2)){
  327 + paramsD.push({'id':g.stationRouteCode + '_' + 'E' + '_' + g.directions,
  328 + 'text':g.stationName + ' (' + g.stationRouteCode + ')' + ' --' + fun.dirdmToName(g.directions)});
  329 + }else {
  330 + paramsD.push({'id':g.stationRouteCode + '_' + g.stationMark + '_' + g.directions,
  331 + 'text':g.stationName + ' (' + g.stationRouteCode + ')' + ' --' + fun.dirdmToName(g.directions)});
  332 + }
323 } 333 }
324 } 334 }
325 }); 335 });
@@ -333,10 +343,17 @@ $(&#39;#editPoitsions_station_mobal&#39;).on(&#39;editStationMobal_show&#39;, function(e, map,fu @@ -333,10 +343,17 @@ $(&#39;#editPoitsions_station_mobal&#39;).on(&#39;editStationMobal_show&#39;, function(e, map,fu
333 } 343 }
334 function setZdlyValue() { 344 function setZdlyValue() {
335 fun.findUpStationRouteCode(editStation.stationRouteLine,editStation.stationRoutedirections,editStation.stationRouteCode,function(str) { 345 fun.findUpStationRouteCode(editStation.stationRouteLine,editStation.stationRoutedirections,editStation.stationRouteCode,function(str) {
336 - if(str.length>0){ 346 + /* if(str.length>0){
337 var upStationRouteCode = str[0].stationRouteCode + '_' + str[0].stationRouteMarke + '_' + editStation.stationRoutedirections; 347 var upStationRouteCode = str[0].stationRouteCode + '_' + str[0].stationRouteMarke + '_' + editStation.stationRoutedirections;
338 $('#stationrouteSelect').select2('val',upStationRouteCode); 348 $('#stationrouteSelect').select2('val',upStationRouteCode);
  349 + } */
  350 + if(str.length>0){
  351 + var upStationRouteCode = str[0].stationRouteCode + '_' + editStation.stationRouteStationMark + '_' + editStation.stationRoutedirections;
  352 + $('#stationrouteSelect').select2('val',upStationRouteCode);
  353 + }else {
  354 + $('#stationrouteSelect').select2('val','请选择...');
339 } 355 }
  356 + $('#stationMarkSelect').val(editStation.stationRouteStationMark);
340 }); 357 });
341 } 358 }
342 // 当站点类型为中途站或者终点站时,上一站点为必填项! 359 // 当站点类型为中途站或者终点站时,上一站点为必填项!
src/main/resources/static/pages/base/stationroute/add.html
1 <!-- 新增站点 --> 1 <!-- 新增站点 -->
2 -<div class="modal fade" id="add_station_mobal" tabindex="-1" role="basic" aria-hidden="true"> 2 +<div class="modal fade" id="add_station_mobal" role="basic" aria-hidden="true">
3 <div class="modal-dialog"> 3 <div class="modal-dialog">
4 <div class="modal-content"> 4 <div class="modal-content">
5 <div class="modal-header"> 5 <div class="modal-header">
@@ -180,7 +180,7 @@ @@ -180,7 +180,7 @@
180 180
181 <!-- 描述/说明 --> 181 <!-- 描述/说明 -->
182 <div class="form-group"> 182 <div class="form-group">
183 - <label class="control-label col-md-3"> 描述/说明&nbsp;&nbsp;&nbsp;: </label> 183 + <label class="control-label col-md-3"> 描述/说明&nbsp;&nbsp;&nbsp;&nbsp;: </label>
184 <div class="col-md-6"> 184 <div class="col-md-6">
185 <textarea class="form-control" rows="3" name="descriptions" id="descriptionsTextarea" placeholder="描述/说明"></textarea> 185 <textarea class="form-control" rows="3" name="descriptions" id="descriptionsTextarea" placeholder="描述/说明"></textarea>
186 </div> 186 </div>
@@ -243,7 +243,9 @@ $(&#39;#add_station_mobal&#39;).on(&#39;AddStationMobal.show&#39;, function(e, addMap,ajaxd,stao @@ -243,7 +243,9 @@ $(&#39;#add_station_mobal&#39;).on(&#39;AddStationMobal.show&#39;, function(e, addMap,ajaxd,stao
243 // 站点序号值改变事件 243 // 站点序号值改变事件
244 $('#stationrouteSelect').on('change',function() { 244 $('#stationrouteSelect').on('change',function() {
245 var stationRValue = $('#stationrouteSelect').val(); 245 var stationRValue = $('#stationrouteSelect').val();
246 - if(stationRValue) { 246 + if(stationRValue=='请选择...') {
  247 + $('#stationMarkSelect').val('B');
  248 + }else {
247 var tempStr = stationRValue.split('_'); 249 var tempStr = stationRValue.split('_');
248 if(tempStr[1] == 'E') { 250 if(tempStr[1] == 'E') {
249 $('#stationMarkSelect').val('E'); 251 $('#stationMarkSelect').val('E');
src/main/resources/static/pages/base/stationroute/css/bmap_base.css
@@ -93,4 +93,39 @@ html,body{ @@ -93,4 +93,39 @@ html,body{
93 93
94 box-shadow: 0 12px 15px 0 rgba(204, 204, 204, 0.33),0 17px 50px 0 rgba(204, 204, 204, 0.33)!important; 94 box-shadow: 0 12px 15px 0 rgba(204, 204, 204, 0.33),0 17px 50px 0 rgba(204, 204, 204, 0.33)!important;
95 95
  96 +}
  97 +
  98 +.defeat-scroll {
  99 +width: 98%;
  100 +height:380px;
  101 +/* overflow:auto; */
  102 +overflow:hidden;
  103 +}
  104 +.defeat-scroll::-webkit-scrollbar {
  105 +width:6px;
  106 +height:6px;
  107 +}
  108 +.defeat-scroll::-webkit-scrollbar-button {
  109 +/* background-color:#FF7677; */
  110 +background:rgba(255, 255, 255, 0);
  111 +}
  112 +.defeat-scroll::-webkit-scrollbar-track {
  113 +/* background:#FF66D5; */
  114 +background:rgba(255, 255, 255, 0);
  115 +}
  116 +.defeat-scroll::-webkit-scrollbar-track-piece {
  117 +/* background:#ff0000; */
  118 +background:rgba(255, 255, 255, 0);
  119 +}
  120 +.defeat-scroll::-webkit-scrollbar-thumb{
  121 +background:rgba(197, 196, 196, 0.81);
  122 +border-radius:10px !important;
  123 +}
  124 +.defeat-scroll::-webkit-scrollbar-corner {
  125 +/* background:#82AFFF; */
  126 +background:rgba(255, 255, 255, 0);
  127 +}
  128 +.defeat-scroll::-webkit-scrollbar-resizer {
  129 +/* background:#FF0BEE; */
  130 +background:rgba(255, 255, 255, 0);
96 } 131 }
97 \ No newline at end of file 132 \ No newline at end of file
src/main/resources/static/pages/base/stationroute/edit.html
1 <!-- 编辑站点 --> 1 <!-- 编辑站点 -->
2 -<div class="modal fade" id="edit_station_mobal" tabindex="-1" role="basic" aria-hidden="true"> 2 +<div class="modal fade" id="edit_station_mobal" role="basic" aria-hidden="true">
3 <div class="modal-dialog"> 3 <div class="modal-dialog">
4 <div class="modal-content"> 4 <div class="modal-content">
5 <div class="modal-header"> 5 <div class="modal-header">
@@ -50,7 +50,7 @@ @@ -50,7 +50,7 @@
50 <span class="required"> * </span> 站点编码&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: 50 <span class="required"> * </span> 站点编码&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:
51 </label> 51 </label>
52 <div class="col-md-6"> 52 <div class="col-md-6">
53 - <input type="text" class="form-control" name="stationCod" id="stationCodInput" placeholder="站点编码"> 53 + <input type="text" class="form-control" name="stationCod" id="stationCodInput" placeholder="站点编码" readonly="readonly">
54 </div> 54 </div>
55 </div> 55 </div>
56 </div> 56 </div>
@@ -177,7 +177,7 @@ @@ -177,7 +177,7 @@
177 </div> 177 </div>
178 <!-- 描述/说明 --> 178 <!-- 描述/说明 -->
179 <div class="form-group"> 179 <div class="form-group">
180 - <label class="control-label col-md-3"> 描述/说明&nbsp;&nbsp;: </label> 180 + <label class="control-label col-md-3"> 描述/说明&nbsp;&nbsp;&nbsp;: </label>
181 <div class="col-md-6"> 181 <div class="col-md-6">
182 <textarea class="form-control" rows="3" name="descriptions" id="descriptionsTextarea" placeholder="描述/说明"></textarea> 182 <textarea class="form-control" rows="3" name="descriptions" id="descriptionsTextarea" placeholder="描述/说明"></textarea>
183 </div> 183 </div>
@@ -194,6 +194,7 @@ @@ -194,6 +194,7 @@
194 <script type="text/javascript"> 194 <script type="text/javascript">
195 195
196 $('#edit_station_mobal').on('editSelectMobal_show', function(e, map_,ajaxd,station_,Line_,fun){ 196 $('#edit_station_mobal').on('editSelectMobal_show', function(e, map_,ajaxd,station_,Line_,fun){
  197 + layer.closeAll();
197 var editStationParmasObj = station_.getEitdStation(); 198 var editStationParmasObj = station_.getEitdStation();
198 var addLine = Line_.getLineObj(); 199 var addLine = Line_.getLineObj();
199 fun.setFormValue(editStationParmasObj); 200 fun.setFormValue(editStationParmasObj);
@@ -290,7 +291,9 @@ $(&#39;#edit_station_mobal&#39;).on(&#39;editSelectMobal_show&#39;, function(e, map_,ajaxd,stati @@ -290,7 +291,9 @@ $(&#39;#edit_station_mobal&#39;).on(&#39;editSelectMobal_show&#39;, function(e, map_,ajaxd,stati
290 // 站点序号值改变事件 291 // 站点序号值改变事件
291 $('#stationrouteSelect').on('change',function() { 292 $('#stationrouteSelect').on('change',function() {
292 var stationRValue = $('#stationrouteSelect').val(); 293 var stationRValue = $('#stationrouteSelect').val();
293 - if(stationRValue) { 294 + if(stationRValue=='请选择...') {
  295 + $('#stationMarkSelect').val('B');
  296 + }else {
294 var tempStr = stationRValue.split('_'); 297 var tempStr = stationRValue.split('_');
295 if(tempStr[1] == 'E') { 298 if(tempStr[1] == 'E') {
296 $('#stationMarkSelect').val('E'); 299 $('#stationMarkSelect').val('E');
@@ -311,8 +314,13 @@ $(&#39;#edit_station_mobal&#39;).on(&#39;editSelectMobal_show&#39;, function(e, map_,ajaxd,stati @@ -311,8 +314,13 @@ $(&#39;#edit_station_mobal&#39;).on(&#39;editSelectMobal_show&#39;, function(e, map_,ajaxd,stati
311 if(g.name!='' || g.name != null) { 314 if(g.name!='' || g.name != null) {
312 if(g.stationRouteCode != editStationParmasObj.stationRouteStationRouteCode) { 315 if(g.stationRouteCode != editStationParmasObj.stationRouteStationRouteCode) {
313 // 添加拼音检索下拉框格式数据数组. 316 // 添加拼音检索下拉框格式数据数组.
314 - paramsD.push({'id':g.stationRouteCode + '_' + g.stationMark + '_' + g.directions,  
315 - 'text':g.stationName + ' (' + g.stationRouteCode + ')' + ' --' + fun.dirdmToName(g.directions)}); 317 + if(editStationParmasObj.stationRouteStationMark=='E' && i == (len_-2)){
  318 + paramsD.push({'id':g.stationRouteCode + '_' + 'E' + '_' + g.directions,
  319 + 'text':g.stationName + ' (' + g.stationRouteCode + ')' + ' --' + fun.dirdmToName(g.directions)});
  320 + }else {
  321 + paramsD.push({'id':g.stationRouteCode + '_' + g.stationMark + '_' + g.directions,
  322 + 'text':g.stationName + ' (' + g.stationRouteCode + ')' + ' --' + fun.dirdmToName(g.directions)});
  323 + }
316 } 324 }
317 } 325 }
318 }); 326 });
@@ -327,12 +335,14 @@ $(&#39;#edit_station_mobal&#39;).on(&#39;editSelectMobal_show&#39;, function(e, map_,ajaxd,stati @@ -327,12 +335,14 @@ $(&#39;#edit_station_mobal&#39;).on(&#39;editSelectMobal_show&#39;, function(e, map_,ajaxd,stati
327 function setZdlyValue() { 335 function setZdlyValue() {
328 ajaxd.findUpStationRouteCode(editStationParmasObj.stationRouteLine,editStationParmasObj.stationRouteDirections,editStationParmasObj.stationRouteStationRouteCode,function(str) { 336 ajaxd.findUpStationRouteCode(editStationParmasObj.stationRouteLine,editStationParmasObj.stationRouteDirections,editStationParmasObj.stationRouteStationRouteCode,function(str) {
329 if(str.length>0){ 337 if(str.length>0){
330 - var upStationRouteCode = str[0].stationRouteCode + '_' + str[0].stationRouteMarke + '_' + editStationParmasObj.stationRouteDirections; 338 + /* var upStationRouteCode = str[0].stationRouteCode + '_' + str[0].stationRouteMarke + '_' + editStationParmasObj.stationRouteDirections; */
  339 + var upStationRouteCode = str[0].stationRouteCode + '_' + editStationParmasObj.stationRouteStationMark + '_' + editStationParmasObj.stationRouteDirections;
331 $('#stationrouteSelect').select2('val',upStationRouteCode); 340 $('#stationrouteSelect').select2('val',upStationRouteCode);
332 }else { 341 }else {
333 $('#stationrouteSelect').select2('val','请选择...'); 342 $('#stationrouteSelect').select2('val','请选择...');
334 - $('#stationMarkSelect').val(editStationParmasObj.stationRouteStationMark); 343 + /* $('#stationMarkSelect').val(editStationParmasObj.stationRouteStationMark); */
335 } 344 }
  345 + $('#stationMarkSelect').val(editStationParmasObj.stationRouteStationMark);
336 }); 346 });
337 } 347 }
338 // 当站点类型为中途站或者终点站时,上一站点为必填项! 348 // 当站点类型为中途站或者终点站时,上一站点为必填项!
src/main/resources/static/pages/base/stationroute/editsection.html
1 <!-- 编辑路段 --> 1 <!-- 编辑路段 -->
2 -<div class="modal fade" id="edit_section_mobal" tabindex="-1" role="basic" aria-hidden="true"> 2 +<div class="modal fade" id="edit_section_mobal" role="basic" aria-hidden="true">
3 <div class="modal-dialog"> 3 <div class="modal-dialog">
4 <div class="modal-content"> 4 <div class="modal-content">
5 <div class="modal-header"> 5 <div class="modal-header">
@@ -49,7 +49,7 @@ @@ -49,7 +49,7 @@
49 上一路段: 49 上一路段:
50 </label> 50 </label>
51 <div class="col-md-6"> 51 <div class="col-md-6">
52 - <select name="sectionrouteCode" class="form-control" id="sectionrouteCodeSelect"></select> 52 + <select name="sectionrouteCode" class="form-control" id="sectionrouteCodeSelect" style="width:100%"></select>
53 <span class="help-block">说明:选择的路段将作为本站序号的参考,成为选择路段的下一个路段。 </span> 53 <span class="help-block">说明:选择的路段将作为本站序号的参考,成为选择路段的下一个路段。 </span>
54 </div> 54 </div>
55 </div> 55 </div>
@@ -157,10 +157,9 @@ $(&#39;#edit_section_mobal&#39;).on(&#39;editSectionMobal_show&#39;, function(e, map_,ajaxd,sect @@ -157,10 +157,9 @@ $(&#39;#edit_section_mobal&#39;).on(&#39;editSectionMobal_show&#39;, function(e, map_,ajaxd,sect
157 var lineId = Section.sectionrouteLine; 157 var lineId = Section.sectionrouteLine;
158 // 获取路段号元素,并添加下拉属性值 158 // 获取路段号元素,并添加下拉属性值
159 ajaxd.getStation(lineId,dir,function(treeData) { 159 ajaxd.getStation(lineId,dir,function(treeData) {
160 - var options = '<option value="">请选择...</option>';  
161 - var dArray = treeData[0].children[1].children; 160 + var array = treeData[0].children[1].children,paramsD =new Array();
162 var eq_scetionRouteCode = Section.sectionrouteCode; 161 var eq_scetionRouteCode = Section.sectionrouteCode;
163 - for(var i = 0 ; i<dArray.length; i++){ 162 + /* for(var i = 0 ; i<dArray.length; i++){
164 var ptions_v = dArray[i].sectionrouteCode; 163 var ptions_v = dArray[i].sectionrouteCode;
165 if(eq_scetionRouteCode == ptions_v){ 164 if(eq_scetionRouteCode == ptions_v){
166 continue; 165 continue;
@@ -168,17 +167,32 @@ $(&#39;#edit_section_mobal&#39;).on(&#39;editSectionMobal_show&#39;, function(e, map_,ajaxd,sect @@ -168,17 +167,32 @@ $(&#39;#edit_section_mobal&#39;).on(&#39;editSectionMobal_show&#39;, function(e, map_,ajaxd,sect
168 options += '<option value="'+ ptions_v +'">'+dArray[i].sectionName + ' (' + ptions_v +')' 167 options += '<option value="'+ ptions_v +'">'+dArray[i].sectionName + ' (' + ptions_v +')'
169 + ' --' + fun.dirdmToName(dArray[i].sectionrouteDirections) + '</option>' ; 168 + ' --' + fun.dirdmToName(dArray[i].sectionrouteDirections) + '</option>' ;
170 } 169 }
171 - $('#sectionrouteCodeSelect').html(options);  
172 - ajaxd.findUpSectionRouteCode(lineId,dir,eq_scetionRouteCode,function(str) {  
173 - debugger;  
174 - console.log(eq_scetionRouteCode);  
175 - if(str.length>0){  
176 - var upStationRouteCode = str[0].sectionrouteCode;  
177 - $('#sectionrouteCodeSelect').val(upStationRouteCode);  
178 - }else {  
179 - $('#sectionrouteCodeSelect').val(''); 170 + $('#sectionrouteCodeSelect').html(options); */
  171 + paramsD.push({'id':'请选择...','text':'请选择...'});
  172 + // 遍历.
  173 + $.each(array, function(i, g){
  174 + // 判断.
  175 + if(g.sectionName!='' || g.sectionName != null) {
  176 + var ptions_v = g.sectionrouteCode;
  177 + if(eq_scetionRouteCode != ptions_v){
  178 + // 添加拼音检索下拉框格式数据数组.
  179 + paramsD.push({'id':ptions_v,
  180 + 'text':g.sectionName + '(' + ptions_v + ')' + ' --' + fun.dirdmToName(g.sectionrouteDirections)});
  181 + }
180 } 182 }
181 }); 183 });
  184 + // 初始化上一个路段拼音检索下拉框.
  185 + initPinYinSelect2($('#sectionrouteCodeSelect'),paramsD,function(selector) {
  186 + $('#sectionDirSelect').val('');// 设值方向.
  187 + ajaxd.findUpSectionRouteCode(lineId,dir,eq_scetionRouteCode,function(str) {
  188 + if(str.length>0){
  189 + var upStationRouteCode = str[0].sectionrouteCode;
  190 + $('#sectionrouteCodeSelect').select2('val',upStationRouteCode);
  191 + }else {
  192 + $('#sectionrouteCodeSelect').select2('val','请选择...');
  193 + }
  194 + });
  195 + });
182 }); 196 });
183 // 显示mobal 197 // 显示mobal
184 $('#edit_section_mobal').modal({show : true,backdrop: 'static',keyboard: false}); 198 $('#edit_section_mobal').modal({show : true,backdrop: 'static',keyboard: false});
@@ -238,6 +252,8 @@ $(&#39;#edit_section_mobal&#39;).on(&#39;editSectionMobal_show&#39;, function(e, map_,ajaxd,sect @@ -238,6 +252,8 @@ $(&#39;#edit_section_mobal&#39;).on(&#39;editSectionMobal_show&#39;, function(e, map_,ajaxd,sect
238 submitHandler : function(f) { 252 submitHandler : function(f) {
239 var params = form.serializeJSON(); 253 var params = form.serializeJSON();
240 error.hide(); 254 error.hide();
  255 + if(params.sectionrouteCode=='请选择...')
  256 + params.sectionrouteCode='';
241 ajaxd.sectionUpdate(params,function(resuntDate) { 257 ajaxd.sectionUpdate(params,function(resuntDate) {
242 if(resuntDate.status=='SUCCESS') { 258 if(resuntDate.status=='SUCCESS') {
243 // 弹出添加成功提示消息 259 // 弹出添加成功提示消息
src/main/resources/static/pages/base/stationroute/js/stationroute-list-events.js
@@ -238,4 +238,9 @@ $(function(){ @@ -238,4 +238,9 @@ $(function(){
238 } 238 }
239 }); 239 });
240 }); 240 });
  241 + $('#scrllmouseEvent').on('mousemove',function() {
  242 + $('.defeat-scroll').css('overflow','auto');
  243 + }).on('mouseleave',function() {
  244 + $('.defeat-scroll').css('overflow','hidden');
  245 + });
241 }); 246 });
242 \ No newline at end of file 247 \ No newline at end of file
src/main/resources/static/pages/base/stationroute/js/stationroute-list-function.js
@@ -354,7 +354,7 @@ var PublicFunctions = function () { @@ -354,7 +354,7 @@ var PublicFunctions = function () {
354 // 获取站点编码元素设值 354 // 获取站点编码元素设值
355 $('#stationCodInput').val(editStationParmas.stationStationCod); 355 $('#stationCodInput').val(editStationParmas.stationStationCod);
356 // 获取站点类型元素设值 356 // 获取站点类型元素设值
357 - $('#stationMarkSelect').val(editStationParmas.stationRouteStationMark); 357 + // $('#stationMarkSelect').val(editStationParmas.stationRouteStationMark);
358 // 获取站点方向元素设值 358 // 获取站点方向元素设值
359 $('#stationdirSelect').val(editStationParmas.stationRouteDirections); 359 $('#stationdirSelect').val(editStationParmas.stationRouteDirections);
360 // 获取站点道路编码元素设值 360 // 获取站点道路编码元素设值
src/main/resources/static/pages/base/stationroute/list.html
@@ -4,7 +4,7 @@ @@ -4,7 +4,7 @@
4 <div id="bmap_basic" class="bmaps"></div> 4 <div id="bmap_basic" class="bmaps"></div>
5 <div class="portlet box protlet-box" style="top:20px;border-radius: 6px !important;box-shadow: 10px 10px 5px #888888;"> 5 <div class="portlet box protlet-box" style="top:20px;border-radius: 6px !important;box-shadow: 10px 10px 5px #888888;">
6 <!-- 左边标题栏 --> 6 <!-- 左边标题栏 -->
7 - <div class="portlet-title" style="background-color:#3B3F51"> 7 + <div class="portlet-title" style="background-color:#12527f;">
8 <div class="caption"> 8 <div class="caption">
9 <!-- 途径站点 --> 9 <!-- 途径站点 -->
10 </div> 10 </div>
@@ -13,7 +13,7 @@ @@ -13,7 +13,7 @@
13 </div> 13 </div>
14 </div> 14 </div>
15 <!-- 左边栏 --> 15 <!-- 左边栏 -->
16 - <div class="portlet-body" style="border: 1px solid rgb(255, 255, 255); display: block;min-height: 200px;"> 16 + <div class="portlet-body" id="scrllmouseEvent" style="border: 1px solid rgb(255, 255, 255); display: block;min-height: 380px;">
17 <div class="row"> 17 <div class="row">
18 <!-- 上下行栏 --> 18 <!-- 上下行栏 -->
19 <div class="col-md-3 col-sm-3 col-xs-3"> 19 <div class="col-md-3 col-sm-3 col-xs-3">
@@ -83,8 +83,8 @@ @@ -83,8 +83,8 @@
83 </div> 83 </div>
84 </div> 84 </div>
85 <!-- 树 --> 85 <!-- 树 -->
86 - <div class="portlet-body">  
87 - <div id="station_Up_tree" style="height: auto;max-height: 500px;overflow-y: auto;"></div> 86 + <div class="portlet-body" >
  87 + <div id="station_Up_tree" class="defeat-scroll" style="height: auto;max-height: 500px;"></div>
88 </div> 88 </div>
89 </div> 89 </div>
90 <!-- 无上行站点添加方式 --> 90 <!-- 无上行站点添加方式 -->
@@ -176,7 +176,7 @@ @@ -176,7 +176,7 @@
176 </div> 176 </div>
177 <!-- 树 --> 177 <!-- 树 -->
178 <div class="portlet-body"> 178 <div class="portlet-body">
179 - <div id="station_Down_tree" style="height: auto;max-height: 500px;overflow-y: auto;"></div> 179 + <div id="station_Down_tree" class="defeat-scroll" style="height: auto;max-height: 500px;"></div>
180 </div> 180 </div>
181 </div> 181 </div>
182 <!-- 无上行站点添加方式 --> 182 <!-- 无上行站点添加方式 -->
src/main/resources/static/pages/scheduleApp/module/core/schedulePlanManage/list.html
@@ -9,7 +9,8 @@ @@ -9,7 +9,8 @@
9 <th style="width: 100%;">关联时刻表</th> 9 <th style="width: 100%;">关联时刻表</th>
10 <th style="width: 150px;">排班开始日期</th> 10 <th style="width: 150px;">排班开始日期</th>
11 <th style="width: 150px;">排班结束日期</th> 11 <th style="width: 150px;">排班结束日期</th>
12 - <th style="width: 250px;">排班人/操作时间</th> 12 + <th style="width: 150px;">排班人/操作时间</th>
  13 + <th style="width: 100px;">状态</th>
13 <th style="width: 180px;">操作</th> 14 <th style="width: 180px;">操作</th>
14 </tr> 15 </tr>
15 <tr role="row" class="filter"> 16 <tr role="row" class="filter">
@@ -60,6 +61,7 @@ @@ -60,6 +61,7 @@
60 </div> 61 </div>
61 </td> 62 </td>
62 <td></td> 63 <td></td>
  64 + <td></td>
63 <td> 65 <td>
64 <button class="btn btn-sm green btn-outline filter-submit margin-bottom" 66 <button class="btn btn-sm green btn-outline filter-submit margin-bottom"
65 ng-click="ctrl.doPage()"> 67 ng-click="ctrl.doPage()">
@@ -94,9 +96,28 @@ @@ -94,9 +96,28 @@
94 <span ng-bind="info.scheduleToTime | date: 'yyyy-MM-dd '"></span> 96 <span ng-bind="info.scheduleToTime | date: 'yyyy-MM-dd '"></span>
95 </td> 97 </td>
96 <td> 98 <td>
97 - <span ng-bind="info.updateBy.userName"></span>  
98 - /  
99 - <span ng-bind="info.updateDate | date: 'yyyy-MM-dd HH:mm:ss'"></span> 99 + <div>
  100 + <a href="#">
  101 + <i class="fa fa-user"></i>
  102 + <span ng-bind="info.updateBy.userName"></span>
  103 + </a>
  104 + </div>
  105 + <div>
  106 + <a href="#">
  107 + <span ng-bind="info.updateDate | date: 'yyyy-MM-dd HH:mm:ss'"></span>
  108 + </a>
  109 + </div>
  110 +
  111 + </td>
  112 + <td>
  113 + <a href="#" class="btn btn-success btn-sm" ng-if="info.planResult == 'ok'">
  114 + <span>成功</span>
  115 + </a>
  116 + <a sweetalert
  117 + sweet-options="{title: '排班错误信息',text: '线路:' + info.xl.name + '</br>开始时间:' + ctrl.toDateStr(info.scheduleFromTime) + '</br>结束时间:' + ctrl.toDateStr(info.scheduleToTime) + '</br>' + info.planResult, html: true,type: 'warning',showCancelButton: true,confirmButtonColor: '#DD6B55',confirmButtonText: '是',cancelButtonText: '取消'}"
  118 + sweet-on-confirm=""
  119 + class="btn btn-danger btn-sm"
  120 + ng-if="info.planResult != 'ok'">点击查错</a>
100 </td> 121 </td>
101 <td> 122 <td>
102 <!--<a href="details.html?lineId={{obj.id}}" class="btn default blue-stripe btn-sm"> 详细 </a>--> 123 <!--<a href="details.html?lineId={{obj.id}}" class="btn default blue-stripe btn-sm"> 详细 </a>-->
src/main/resources/static/pages/scheduleApp/module/core/scheduleRuleManage/list.html
@@ -66,6 +66,7 @@ @@ -66,6 +66,7 @@
66 <td> 66 <td>
67 <div> 67 <div>
68 <a href="#"> 68 <a href="#">
  69 + <i class="fa fa-user"></i>
69 <span ng-bind="info.updateBy.userName"></span> 70 <span ng-bind="info.updateBy.userName"></span>
70 </a> 71 </a>
71 </div> 72 </div>
src/main/resources/static/pages/scheduleApp/module/core/ttInfoManage/detailedit/edit3.html
@@ -40,51 +40,78 @@ @@ -40,51 +40,78 @@
40 <!--<i class="fa fa-adjust" aria-hidden="true"></i>--> 40 <!--<i class="fa fa-adjust" aria-hidden="true"></i>-->
41 <span style="padding-right: 10px;background: #adff00;color: #501a1a;text-align: center;">分班班次</span> 41 <span style="padding-right: 10px;background: #adff00;color: #501a1a;text-align: center;">分班班次</span>
42 42
43 - <div class="btn-group">  
44 - <a href="javascript:" class="btn red btn-outline btn-circle" data-toggle="dropdown">  
45 - <i class="fa fa-share"></i>  
46 - <span>数据工具</span>  
47 - <i class="fa fa-angle-down"></i>  
48 - </a>  
49 - <ul class="dropdown-menu pull-right">  
50 - <li>  
51 - <a href="javascript:" class="tool-action" ng-click="ctrl.multiselect()">  
52 - <i class="fa fa-file-excel-o"></i>  
53 - 批量选择  
54 - </a>  
55 - </li>  
56 - <li>  
57 - <a href="javascript:" class="tool-action" ng-click="ctrl.editInfos()">  
58 - <i class="fa fa-file-excel-o"></i>  
59 - 批量修改  
60 - </a>  
61 - </li>  
62 - <li>  
63 - <a href="javascript:" class="tool-action" ng-click="ctrl.deleteInfos()">  
64 - <i class="fa fa-file-excel-o"></i>  
65 - 批量删除  
66 - </a>  
67 - </li>  
68 - <li class="divider"></li>  
69 - <li>  
70 - <a href="javascript:" class="tool-action" ng-click="ctrl.clearsel()">  
71 - <i class="fa fa-refresh"></i>  
72 - 清除选择  
73 - </a>  
74 - </li>  
75 - <li>  
76 - <a href="javascript:" class="tool-action" ng-click="ctrl.refresh()">  
77 - <i class="fa fa-refresh"></i>  
78 - 刷行数据  
79 - </a>  
80 - </li>  
81 - </ul>  
82 - </div> 43 + <!--<div class="btn-group">-->
  44 + <!--<a href="javascript:" class="btn red btn-outline btn-circle" data-toggle="dropdown">-->
  45 + <!--<i class="fa fa-share"></i>-->
  46 + <!--<span>数据工具</span>-->
  47 + <!--<i class="fa fa-angle-down"></i>-->
  48 + <!--</a>-->
  49 + <!--<ul class="dropdown-menu pull-right">-->
  50 + <!--<li>-->
  51 + <!--<a href="javascript:" class="tool-action" ng-click="ctrl.multiselect()">-->
  52 + <!--<i class="fa fa-file-excel-o"></i>-->
  53 + <!--批量选择-->
  54 + <!--</a>-->
  55 + <!--</li>-->
  56 + <!--<li>-->
  57 + <!--<a href="javascript:" class="tool-action" ng-click="ctrl.editInfos()">-->
  58 + <!--<i class="fa fa-file-excel-o"></i>-->
  59 + <!--批量修改-->
  60 + <!--</a>-->
  61 + <!--</li>-->
  62 + <!--<li>-->
  63 + <!--<a href="javascript:" class="tool-action" ng-click="ctrl.deleteInfos()">-->
  64 + <!--<i class="fa fa-file-excel-o"></i>-->
  65 + <!--批量删除-->
  66 + <!--</a>-->
  67 + <!--</li>-->
  68 + <!--<li class="divider"></li>-->
  69 + <!--<li>-->
  70 + <!--<a href="javascript:" class="tool-action" ng-click="ctrl.clearsel()">-->
  71 + <!--<i class="fa fa-refresh"></i>-->
  72 + <!--清除选择-->
  73 + <!--</a>-->
  74 + <!--</li>-->
  75 + <!--<li>-->
  76 + <!--<a href="javascript:" class="tool-action" ng-click="ctrl.refresh()">-->
  77 + <!--<i class="fa fa-refresh"></i>-->
  78 + <!--刷行数据-->
  79 + <!--</a>-->
  80 + <!--</li>-->
  81 + <!--</ul>-->
  82 + <!--</div>-->
83 83
84 </div> 84 </div>
85 </div> 85 </div>
86 86
87 <div class="portlet-body"> 87 <div class="portlet-body">
  88 + <div style="padding-bottom: 5px;">
  89 + <a href="javascript:" style="padding-right: 5px;" ng-click="ctrl.multiselect()">
  90 + <i class="fa fa-file-excel-o"></i>
  91 + 批量选择
  92 + </a>
  93 + <a href="javascript:" style="padding-right: 5px;" ng-click="ctrl.editInfos()">
  94 + <i class="fa fa-pencil-square-o"></i>
  95 + 批量修改
  96 + </a>
  97 +
  98 + <a sweetalert
  99 + sweet-options="{title: '是否删除选定的班次?',text: '线路:' + ctrl.xlname + '</br>时刻表:' + ctrl.ttname + '</br>谨慎删除!', html: true,type: 'warning',showCancelButton: true,confirmButtonColor: '#DD6B55',confirmButtonText: '是',cancelButtonText: '取消'}"
  100 + sweet-on-confirm="ctrl.deleteInfos()"
  101 + style="padding-right: 5px;" >
  102 + <i class="fa fa-trash"></i>
  103 + 批量删除
  104 + </a>
  105 + <a href="javascript:" style="padding-right: 5px;" ng-click="ctrl.clearsel()">
  106 + <i class="fa fa-eraser"></i>
  107 + 取消选择
  108 + </a>
  109 + <a href="javascript:" style="padding-right: 5px;" ng-click="ctrl.refresh()">
  110 + <i class="fa fa-refresh"></i>
  111 + 刷行数据
  112 + </a>
  113 + </div>
  114 +
88 <!--<div ng-view></div>--> 115 <!--<div ng-view></div>-->
89 <div style="height: {{ctrl.ttHeight}}px;"> 116 <div style="height: {{ctrl.ttHeight}}px;">
90 <sa-Timetable name="tt" ng-model="ctrl.editInfo" ng-model-options="{ getterSetter: true }" celldbclick="ctrl.singleEditBcDetail"> 117 <sa-Timetable name="tt" ng-model="ctrl.editInfo" ng-model-options="{ getterSetter: true }" celldbclick="ctrl.singleEditBcDetail">
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/fcxxwt.html
@@ -116,10 +116,10 @@ @@ -116,10 +116,10 @@
116 <label class="uk-form-label" >调整说明</label> 116 <label class="uk-form-label" >调整说明</label>
117 <div class="uk-form-controls"> 117 <div class="uk-form-controls">
118 <select name="adjustExps"> 118 <select name="adjustExps">
119 - <option value="">请选择..</option>  
120 - {{each adjustExps as exp i}} 119 + <option value="">请选择..</option>
  120 + {{each adjustExps as exp i}}
121 <option value="{{exp}}">{{exp}}</option> 121 <option value="{{exp}}">{{exp}}</option>
122 - {{/each}} 122 + {{/each}}
123 </select> 123 </select>
124 </div> 124 </div>
125 </div> 125 </div>
@@ -129,7 +129,7 @@ @@ -129,7 +129,7 @@
129 <div class="uk-width-1-1"> 129 <div class="uk-width-1-1">
130 <div class="uk-form-row ct-stacked"> 130 <div class="uk-form-row ct-stacked">
131 <div class="uk-form-controls" style="margin-top: 5px;"> 131 <div class="uk-form-controls" style="margin-top: 5px;">
132 - <textarea id="form-s-t" cols="30" rows="5" name="remarks" data-fv-stringlength="true" data-fv-stringlength-max="50" placeholder="备注,不超过50个字符">{{sch.remarks}}</textarea> 132 + <textarea id="form-s-t" cols="30" rows="5" required name="remarks" data-fv-stringlength="true" data-fv-stringlength-max="50" placeholder="备注,不超过50个字符">{{sch.remarks}}</textarea>
133 </div> 133 </div>
134 </div> 134 </div>
135 </div> 135 </div>
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/sftz.html
@@ -54,7 +54,7 @@ @@ -54,7 +54,7 @@
54 <div class="uk-form-row ct-stacked"> 54 <div class="uk-form-row ct-stacked">
55 <label class="uk-form-label" for="form-s-t">调整说明<small class="font-danger">(不超过20个字符)</small></label> 55 <label class="uk-form-label" for="form-s-t">调整说明<small class="font-danger">(不超过20个字符)</small></label>
56 <div class="uk-form-controls"> 56 <div class="uk-form-controls">
57 - <textarea id="form-s-t" cols="30" rows="5" name="remarks" data-fv-stringlength="true" data-fv-stringlength-max="20" placeholder="不超过20个字符。非必填"></textarea> 57 + <textarea id="form-s-t" cols="30" rows="5" name="remarks" required data-fv-stringlength="true" data-fv-stringlength-max="20" placeholder="不超过20个字符。必填"></textarea>
58 </div> 58 </div>
59 </div> 59 </div>
60 </div> 60 </div>
src/main/resources/static/real_control_v2/js/main.js
@@ -169,8 +169,8 @@ var disabled_submit_btn = function (form) { @@ -169,8 +169,8 @@ var disabled_submit_btn = function (form) {
169 function showUpdateDescription() { 169 function showUpdateDescription() {
170 //更新说明 170 //更新说明
171 var updateDescription = { 171 var updateDescription = {
172 - date: '2017-05-09',  
173 - text: '<h5>恢复到了最新功能版本,并修复了临加时没有保存售票员的问题。</h5>' 172 + date: '2017-05-12',
  173 + text: '<h5>现在班次调整时,备注是必填项</h5><h5>现在中途更换设备后,需要刷新缓存数据后,再刷新线调页面。</h5><h5>分班套跑车辆将在上午最后一个班次完成后发送线路切换指令。捕捉到出场信号时也会切换至出场班次所在线路,驾驶员请求出场时候也会同步一次状态</h5><h5>修复了一些其他问题。</h5>'
174 }; 174 };
175 175
176 var storage = window.localStorage 176 var storage = window.localStorage
src/main/resources/static/real_control_v2/mapmonitor/fragments/playback_v2/main.html
@@ -864,6 +864,8 @@ @@ -864,6 +864,8 @@
864 if(typeof(upDown) == "undefined") 864 if(typeof(upDown) == "undefined")
865 upDown = roadUpdown; 865 upDown = roadUpdown;
866 866
  867 + if(upDown!= 0 && upDown != 1)
  868 + return;
867 map.clearOverlays(); 869 map.clearOverlays();
868 parkPolygons = {};//清除停车场对照 870 parkPolygons = {};//清除停车场对照
869 //路段 871 //路段
src/test/resources/testdata/problem.properties
1 ##1=时刻表明细导入,线路标准里所有的高峰低谷时间需要带入时刻表班次时间里,标准可以点击切换到线路标准界面 1 ##1=时刻表明细导入,线路标准里所有的高峰低谷时间需要带入时刻表班次时间里,标准可以点击切换到线路标准界面
2 -2=时刻表明细编辑功能,数据工具移到时刻表里,类似工具栏的样子 2 +##2=时刻表明细编辑功能,数据工具移到时刻表里,类似工具栏的样子
3 3=时刻表导入,可以选一个已经存在的时刻表导入,而不是excel文件 3 3=时刻表导入,可以选一个已经存在的时刻表导入,而不是excel文件
4 ##4=所有的删除,作废,都要有提示框操作 4 ##4=所有的删除,作废,都要有提示框操作
5 5=排班计划错误提示,如果选的排班日期之前没有排班,提示错误,排班结果有重复与时刻表不符合,显示错误 5 5=排班计划错误提示,如果选的排班日期之前没有排班,提示错误,排班结果有重复与时刻表不符合,显示错误
@@ -31,4 +31,4 @@ @@ -31,4 +31,4 @@
31 ##30=时刻表公里数 三位数 31 ##30=时刻表公里数 三位数
32 32
33 31=规则修改,路牌范围,人员范围可以拖动 33 31=规则修改,路牌范围,人员范围可以拖动
34 -32=人员配置不存在的情况下,导入规则ktr,找不到的人员不添加,人员范围不存在的,规则不导入 34 +#32=人员配置不存在的情况下,导入规则ktr,找不到的人员不添加,人员范围不存在的,规则不导入