Commit 894496d9d59000db8b46c55c7ae1024afe345b15

Authored by 廖磊
2 parents da064e9b 136a8f3a

Merge branch 'minhang' of

http://222.66.0.204:8090/panzhaov5/bsth_control into minhang
src/main/java/com/bsth/XDApplication.java
... ... @@ -6,6 +6,7 @@ import com.bsth.data.car_out_info.UpdateDBThread;
6 6 import com.bsth.data.directive.DirectivesPstThread;
7 7 import com.bsth.data.gpsdata.thread.GpsDataLoaderThread;
8 8 import com.bsth.data.gpsdata.thread.OfflineMonitorThread;
  9 +import com.bsth.data.schedule.edit_logs.SeiPstThread;
9 10 import com.bsth.data.schedule.late_adjust.ScheduleLateThread;
10 11 import com.bsth.data.schedule.thread.CalcOilThread;
11 12 import com.bsth.data.schedule.thread.SchedulePstThread;
... ... @@ -53,6 +54,8 @@ public class XDApplication implements CommandLineRunner {
53 54 DirectivesPstThread directivesPstThread;
54 55 @Autowired
55 56 ThreadMonotor threadMonotor;
  57 + @Autowired
  58 + SeiPstThread seiPstThread;
56 59  
57 60 private static long timeDiff;
58 61  
... ... @@ -93,6 +96,8 @@ public class XDApplication implements CommandLineRunner {
93 96 //sexec.scheduleWithFixedDelay(scheduleRefreshThread, 15, 240, TimeUnit.SECONDS);
94 97 //实际排班延迟入库线程
95 98 //sexec.scheduleWithFixedDelay(schedulePstThread, 60, 15, TimeUnit.SECONDS);
  99 + //班次修正日志延迟入库
  100 + //sexec.scheduleWithFixedDelay(seiPstThread, 60, 60, TimeUnit.SECONDS);
96 101  
97 102 //线程监听(防止重要的线程阻塞、异常结束。以及部分主备切换工作)
98 103 //sexec.scheduleWithFixedDelay(threadMonotor, 240, 60, TimeUnit.SECONDS);
... ... @@ -107,10 +112,12 @@ public class XDApplication implements CommandLineRunner {
107 112 sexec.scheduleWithFixedDelay(gpsDataLoader, 30, 2, TimeUnit.SECONDS);
108 113 //GPS设备掉离线
109 114 sexec.scheduleWithFixedDelay(offlineMonitorThread, 120, 60, TimeUnit.SECONDS);
110   - //实际排班更新线程
  115 + //班次更新线程
111 116 sexec.scheduleWithFixedDelay(scheduleRefreshThread, 15, 240, TimeUnit.SECONDS);
112   - //实际排班延迟入库线程
  117 + //班次延迟入库线程
113 118 sexec.scheduleWithFixedDelay(schedulePstThread, 60, 15, TimeUnit.SECONDS);
  119 + //班次修正日志延迟入库
  120 + sexec.scheduleWithFixedDelay(seiPstThread, 60, 60, TimeUnit.SECONDS);
114 121 //检查班次误点
115 122 sexec.scheduleWithFixedDelay(scheduleLateThread, 60, 30, TimeUnit.SECONDS);
116 123 //调度指令延迟入库
... ...
src/main/java/com/bsth/data/safe_driv/SafeDrivCenter.java
1 1 package com.bsth.data.safe_driv;
2 2  
3   -import com.bsth.Application;
4 3 import com.bsth.websocket.handler.SendUtils;
5 4 import org.joda.time.format.DateTimeFormat;
6 5 import org.joda.time.format.DateTimeFormatter;
... ... @@ -15,7 +14,6 @@ import java.util.HashMap;
15 14 import java.util.HashSet;
16 15 import java.util.Map;
17 16 import java.util.Set;
18   -import java.util.concurrent.TimeUnit;
19 17  
20 18 /**
21 19 * 安全驾驶
... ... @@ -69,7 +67,7 @@ public class SafeDrivCenter implements CommandLineRunner,ApplicationContextAware
69 67 @Override
70 68 public void run(String... strings) throws Exception {
71 69 //定时加载安全驾驶数据
72   - Application.mainServices.scheduleWithFixedDelay(safeDrivDataLoadThread, 60, 7, TimeUnit.SECONDS);
  70 + //Application.mainServices.scheduleWithFixedDelay(safeDrivDataLoadThread, 80, 7, TimeUnit.SECONDS);
73 71 }
74 72  
75 73 @Override
... ...
src/main/java/com/bsth/data/schedule/edit_logs/ScheduleModifyLogger.java
1 1 package com.bsth.data.schedule.edit_logs;
2 2  
  3 +import com.alibaba.fastjson.JSONArray;
  4 +import com.alibaba.fastjson.JSONObject;
  5 +import com.bsth.data.schedule.edit_logs.entity.EditType;
  6 +import com.bsth.data.schedule.edit_logs.entity.SchEditInfo;
  7 +import com.bsth.entity.realcontrol.ScheduleRealInfo;
  8 +import org.slf4j.Logger;
  9 +import org.slf4j.LoggerFactory;
  10 +
  11 +import java.util.LinkedList;
  12 +
3 13 /**
4 14 * 班次修正记录
5 15 * Created by panzhao on 2017/5/16.
6 16 */
7 17 public class ScheduleModifyLogger {
8 18  
  19 + public static LinkedList<SchEditInfo> list;
  20 +
  21 + static {
  22 + list = new LinkedList<>();
  23 + }
  24 +
  25 + static Logger log = LoggerFactory.getLogger(ScheduleModifyLogger.class);
  26 +
9 27 /**
10 28 * 待发调整
  29 + * opType 0: 双击调整、 1:待发调整、2:批量待发调整、3:间隔调整
11 30 */
12   - public static void dftz(Long id, String remarks, String dfsj, String bcType, String opType){
  31 + public static void dftz(ScheduleRealInfo sch, String opType, String oldDfsj, String nowDfsj, String remarks){
  32 + try {
  33 + if(oldDfsj.equals(nowDfsj))
  34 + return;
  35 +
  36 + SchEditInfo sei = SchEditInfo.getInstance(sch);
  37 + sei.setType(EditType.DFTZ);
  38 + sei.setType2(opType);
  39 + sei.setRemarks(remarks==null?"":remarks);
  40 +
  41 + //detail
  42 + JSONObject jobj = new JSONObject();
  43 + jobj.put("old", oldDfsj);
  44 + jobj.put("now", nowDfsj);
  45 +
  46 + sei.setJsonArray(jobj.toJSONString());
  47 +
  48 + put(sei);
  49 + }catch (Exception e){
  50 + log.error("", e);
  51 + }
  52 + }
  53 +
  54 + /**
  55 + * 发车信息微调记录器
  56 + */
  57 + public static void fcxxwt(ScheduleRealInfo sch, String remarks, JSONArray jsonArray){
  58 +
  59 + try {
  60 + if(jsonArray == null || jsonArray.size() == 0)
  61 + return;
  62 +
  63 + SchEditInfo sei = SchEditInfo.getInstance(sch);
  64 + sei.setRemarks(remarks);
  65 + sei.setJsonArray(jsonArray.toJSONString());
  66 + sei.setType(EditType.FCXXWT);
  67 +
  68 + put(sei);
  69 + }catch (Exception e){
  70 + log.error("", e);
  71 + }
  72 + }
  73 +
  74 + /**
  75 + * 计划烂班
  76 + * @param remarks
  77 + */
  78 + public static void jhlb(ScheduleRealInfo sch, String remarks){
  79 + try {
  80 + SchEditInfo sei = SchEditInfo.getInstance(sch);
  81 + sei.setRemarks(remarks);
  82 + sei.setType(EditType.JHLB);
  83 +
  84 + put(sei);
  85 + }catch (Exception e){
  86 + log.error("", e);
  87 + }
  88 + }
13 89  
  90 + public static void put(SchEditInfo sei){
  91 + list.add(sei);
14 92 }
15 93 }
16 94 \ No newline at end of file
... ...
src/main/java/com/bsth/data/schedule/edit_logs/SeiPstThread.java 0 → 100644
  1 +package com.bsth.data.schedule.edit_logs;
  2 +
  3 +import com.bsth.data.schedule.edit_logs.entity.SchEditInfo;
  4 +import com.bsth.data.schedule.edit_logs.repository.EditInfoRepository;
  5 +import org.slf4j.Logger;
  6 +import org.slf4j.LoggerFactory;
  7 +import org.springframework.beans.factory.annotation.Autowired;
  8 +import org.springframework.stereotype.Component;
  9 +
  10 +import java.util.LinkedList;
  11 +
  12 +/**
  13 + * 班次修正日志入库
  14 + * Created by panzhao on 2017/5/19.
  15 + */
  16 +@Component
  17 +public class SeiPstThread extends Thread{
  18 +
  19 + @Autowired
  20 + EditInfoRepository repository;
  21 +
  22 + Logger log = LoggerFactory.getLogger(this.getClass());
  23 +
  24 + @Override
  25 + public void run() {
  26 + try{
  27 + LinkedList<SchEditInfo> list = ScheduleModifyLogger.list;
  28 + SchEditInfo sei;
  29 + for(int i = 0; i < 1000; i ++){
  30 + sei = list.poll();
  31 + if(sei == null)
  32 + break;
  33 + else{
  34 + repository.save(sei);
  35 + }
  36 + }
  37 + }catch (Exception e){
  38 + log.error("", e);
  39 + }
  40 + }
  41 +}
... ...
src/main/java/com/bsth/data/schedule/edit_logs/entity/EditType.java 0 → 100644
  1 +package com.bsth.data.schedule.edit_logs.entity;
  2 +
  3 +/**
  4 + * Created by panzhao on 2017/5/18.
  5 + */
  6 +public enum EditType {
  7 +
  8 + DFTZ,SFTZ,FCXXWT,TZRC,LPDD,ZRW,JHLB
  9 +}
... ...
src/main/java/com/bsth/data/schedule/edit_logs/entity/SchEditInfo.java 0 → 100644
  1 +package com.bsth.data.schedule.edit_logs.entity;
  2 +
  3 +import com.bsth.entity.realcontrol.ScheduleRealInfo;
  4 +import com.bsth.entity.sys.SysUser;
  5 +import com.bsth.security.util.SecurityUtils;
  6 +import org.joda.time.format.DateTimeFormat;
  7 +import org.joda.time.format.DateTimeFormatter;
  8 +
  9 +import javax.persistence.*;
  10 +
  11 +/**
  12 + * Created by panzhao on 2017/5/18.
  13 + */
  14 +@Entity
  15 +@Table(name = "logger_sch_modify")
  16 +public class SchEditInfo {
  17 +
  18 + @Id
  19 + @GeneratedValue
  20 + private long id;
  21 + /**
  22 + * 日期 yyyy-MM-dd
  23 + */
  24 + private String rq;
  25 +
  26 + /**
  27 + * 时间 HH:mm
  28 + */
  29 + private String timeStr;
  30 +
  31 + private String lineCode;
  32 +
  33 + private String gsbm;
  34 +
  35 + private String fgsbm;
  36 +
  37 + /**
  38 + * 班次ID
  39 + */
  40 + private long schId;
  41 +
  42 + /**
  43 + * 类型
  44 + */
  45 + @Enumerated(EnumType.STRING)
  46 + private EditType type;
  47 +
  48 + private String type2;
  49 + /**
  50 + * 操作人 @system 系统/用户名
  51 + */
  52 + private String user;
  53 +
  54 + /**
  55 + * 操作明细
  56 + */
  57 + @Column(length = 2000)
  58 + private String jsonArray;
  59 +
  60 + private String remarks;
  61 +
  62 + public String getRq() {
  63 + return rq;
  64 + }
  65 +
  66 + public void setRq(String rq) {
  67 + this.rq = rq;
  68 + }
  69 +
  70 + public String getTimeStr() {
  71 + return timeStr;
  72 + }
  73 +
  74 + public void setTimeStr(String timeStr) {
  75 + this.timeStr = timeStr;
  76 + }
  77 +
  78 + public long getSchId() {
  79 + return schId;
  80 + }
  81 +
  82 + public void setSchId(long schId) {
  83 + this.schId = schId;
  84 + }
  85 +
  86 + public EditType getType() {
  87 + return type;
  88 + }
  89 +
  90 + public void setType(EditType type) {
  91 + this.type = type;
  92 + }
  93 +
  94 + public String getUser() {
  95 + return user;
  96 + }
  97 +
  98 + public void setUser(String user) {
  99 + this.user = user;
  100 + }
  101 +
  102 + public long getId() {
  103 + return id;
  104 + }
  105 +
  106 + public void setId(long id) {
  107 + this.id = id;
  108 + }
  109 +
  110 + public String getJsonArray() {
  111 + return jsonArray;
  112 + }
  113 +
  114 + public void setJsonArray(String jsonArray) {
  115 + this.jsonArray = jsonArray;
  116 + }
  117 +
  118 + public String getType2() {
  119 + return type2;
  120 + }
  121 +
  122 + public void setType2(String type2) {
  123 + this.type2 = type2;
  124 + }
  125 +
  126 + public String getRemarks() {
  127 + return remarks;
  128 + }
  129 +
  130 + public void setRemarks(String remarks) {
  131 + this.remarks = remarks;
  132 + }
  133 +
  134 +
  135 + @Transient
  136 + private static DateTimeFormatter fmtHHmm = DateTimeFormat.forPattern("HH:mm");
  137 + @Transient
  138 + private static DateTimeFormatter fmtyyyyMMdd = DateTimeFormat.forPattern("yyyy-MM-dd");
  139 + public static SchEditInfo getInstance(ScheduleRealInfo sch){
  140 + SchEditInfo sei = new SchEditInfo();
  141 + long t = System.currentTimeMillis();
  142 +
  143 + sei.setRq(fmtyyyyMMdd.print(t));
  144 + sei.setTimeStr(fmtHHmm.print(t));
  145 +
  146 + SysUser user = SecurityUtils.getCurrentUser();
  147 + if(user != null)
  148 + sei.setUser(user.getUserName());
  149 +
  150 + if(sch != null){
  151 + sei.setSchId(sch.getId());
  152 + sei.setLineCode(sch.getXlBm());
  153 + sei.setGsbm(sch.getGsBm());
  154 + sei.setFgsbm(sch.getFgsBm());
  155 + }
  156 + return sei;
  157 + }
  158 +
  159 + public String getLineCode() {
  160 + return lineCode;
  161 + }
  162 +
  163 + public void setLineCode(String lineCode) {
  164 + this.lineCode = lineCode;
  165 + }
  166 +
  167 + public String getGsbm() {
  168 + return gsbm;
  169 + }
  170 +
  171 + public void setGsbm(String gsbm) {
  172 + this.gsbm = gsbm;
  173 + }
  174 +
  175 + public String getFgsbm() {
  176 + return fgsbm;
  177 + }
  178 +
  179 + public void setFgsbm(String fgsbm) {
  180 + this.fgsbm = fgsbm;
  181 + }
  182 +}
... ...
src/main/java/com/bsth/data/schedule/edit_logs/loggers/FcxxwtLogger.java 0 → 100644
  1 +package com.bsth.data.schedule.edit_logs.loggers;
  2 +
  3 +import com.alibaba.fastjson.JSONArray;
  4 +import com.alibaba.fastjson.JSONObject;
  5 +import com.bsth.data.schedule.edit_logs.ScheduleModifyLogger;
  6 +import com.bsth.entity.realcontrol.ScheduleRealInfo;
  7 +import org.slf4j.Logger;
  8 +import org.slf4j.LoggerFactory;
  9 +
  10 +/**
  11 + * 发车信息微调记录
  12 + * Created by panzhao on 2017/5/19.
  13 + */
  14 +public class FcxxwtLogger {
  15 +
  16 + static Logger log = LoggerFactory.getLogger(FcxxwtLogger.class);
  17 +
  18 + private JSONArray jsonArray = new JSONArray();
  19 + private String remarks;
  20 + private ScheduleRealInfo sch;
  21 +
  22 + public void log(String title, Object old, Object now){
  23 + try {
  24 +
  25 + JSONObject jsonObject = new JSONObject();
  26 + jsonObject.put("title", title);
  27 + jsonObject.put("old", old);
  28 + jsonObject.put("now", now);
  29 +
  30 + jsonArray.add(jsonObject);
  31 + }catch (Exception e){
  32 + log.error("", e);
  33 + }
  34 + }
  35 +
  36 + public void log(String text){
  37 + try {
  38 + JSONObject jsonObject = new JSONObject();
  39 + jsonObject.put("title", text);
  40 +
  41 + jsonArray.add(jsonObject);
  42 + }catch (Exception e){
  43 + log.error("", e);
  44 + }
  45 + }
  46 +
  47 + public static FcxxwtLogger start(ScheduleRealInfo sch, String remarks){
  48 + FcxxwtLogger fLog = new FcxxwtLogger();
  49 + fLog.setSch(sch);
  50 + fLog.setRemarks(remarks);
  51 + return fLog;
  52 + }
  53 +
  54 + public void end(){
  55 + ScheduleModifyLogger.fcxxwt(sch, this.remarks, jsonArray);
  56 + }
  57 +
  58 + public String getRemarks() {
  59 + return remarks;
  60 + }
  61 +
  62 + public void setRemarks(String remarks) {
  63 + this.remarks = remarks;
  64 + }
  65 +
  66 + public ScheduleRealInfo getSch() {
  67 + return sch;
  68 + }
  69 +
  70 + public void setSch(ScheduleRealInfo sch) {
  71 + this.sch = sch;
  72 + }
  73 +}
... ...
src/main/java/com/bsth/data/schedule/edit_logs/repository/EditInfoRepository.java 0 → 100644
  1 +package com.bsth.data.schedule.edit_logs.repository;
  2 +
  3 +import com.bsth.data.schedule.edit_logs.entity.SchEditInfo;
  4 +import com.bsth.repository.BaseRepository;
  5 +import org.springframework.stereotype.Repository;
  6 +
  7 +/**
  8 + * Created by panzhao on 2017/5/19.
  9 + */
  10 +@Repository
  11 +public interface EditInfoRepository extends BaseRepository<SchEditInfo, Long>{
  12 +}
... ...
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
... ... @@ -15,6 +15,8 @@ import com.bsth.data.schedule.DayOfSchedule;
15 15 import com.bsth.data.schedule.SchAttrCalculator;
16 16 import com.bsth.data.schedule.edit_logs.FormLogger;
17 17 import com.bsth.data.schedule.ScheduleComparator;
  18 +import com.bsth.data.schedule.edit_logs.ScheduleModifyLogger;
  19 +import com.bsth.data.schedule.edit_logs.loggers.FcxxwtLogger;
18 20 import com.bsth.data.schedule.late_adjust.LateAdjustHandle;
19 21 import com.bsth.entity.Cars;
20 22 import com.bsth.entity.Line;
... ... @@ -221,6 +223,9 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
221 223 schedule.setRealExecDate(schedule.getScheduleDateStr());
222 224 }
223 225  
  226 + //记录日志
  227 + ScheduleModifyLogger.dftz(schedule,opType, schedule.getDfsj(),dfsj,remarks);
  228 +
224 229 schedule.setDfsjAll(dfsj);
225 230 schedule.setDfAuto(false);
226 231 schedule.addRemarks(remarks);
... ... @@ -276,6 +281,8 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
276 281 map.put("msg", "不必要的重复烂班!");
277 282 return map;
278 283 }
  284 + //记录日志
  285 + ScheduleModifyLogger.jhlb(schedule, remarks);
279 286  
280 287 schedule.setAdjustExps(reason);
281 288 schedule.destroy();
... ... @@ -1163,7 +1170,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1163 1170 sch = list.get(i);
1164 1171  
1165 1172 //调整待发
1166   - outgoAdjust(sch.getId(), null, fmtHHmm.print(st), null, "间隔调整");
  1173 + outgoAdjust(sch.getId(), null, fmtHHmm.print(st), null, "3");
1167 1174 }
1168 1175  
1169 1176 rs.put("status", ResponseCode.SUCCESS);
... ... @@ -1186,6 +1193,8 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1186 1193 List<ScheduleRealInfo> ts = new ArrayList<>();
1187 1194 try {
1188 1195 Long id = Long.parseLong(map.get("id"));
  1196 + String remarks = map.get("remarks");
  1197 +
1189 1198 ScheduleRealInfo sch = dayOfSchedule.get(id);
1190 1199  
1191 1200 if(null == sch){
... ... @@ -1194,6 +1203,9 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1194 1203 return rs;
1195 1204 }
1196 1205  
  1206 + //日志记录器
  1207 + FcxxwtLogger fLog = FcxxwtLogger.start(sch, remarks);
  1208 +
1197 1209 String clZbh = map.get("clZbh");
1198 1210 String jsy = map.get("jsy");
1199 1211 if(!clZbh.equals(sch.getClZbh())
... ... @@ -1208,7 +1220,8 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1208 1220 rs.put("status", ResponseCode.ERROR);
1209 1221 rs.put("msg", "车辆 " + clZbh + " 不存在!");
1210 1222 return rs;
1211   - } else {
  1223 + } else if(!clZbh.equals(sch.getClZbh())){
  1224 + fLog.log("换车", sch.getClZbh(), clZbh);
1212 1225 dayOfSchedule.changeCar(sch, clZbh);
1213 1226 }
1214 1227 }
... ... @@ -1224,7 +1237,10 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1224 1237 rs.put("status", ResponseCode.ERROR);
1225 1238 return rs;
1226 1239 }
1227   - persoChange(sch, jGh);
  1240 + else if(!jGh.equals(sch.getjGh())){
  1241 + fLog.log("换驾驶员", sch.getjGh() + "/" + sch.getjName(), jsy);
  1242 + persoChange(sch, jGh);
  1243 + }
1228 1244 }
1229 1245  
1230 1246 /**
... ... @@ -1239,9 +1255,13 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1239 1255 rs.put("status", ResponseCode.ERROR);
1240 1256 return rs;
1241 1257 }
1242   - persoChangeSPY(sch, sGh);
  1258 + else if(!sGh.equals(sch.getsGh())){
  1259 + fLog.log("换售票员", sch.getsGh() + "/" + sch.getsName(), spy);
  1260 + persoChangeSPY(sch, sGh);
  1261 + }
1243 1262 }
1244   - else{
  1263 + else if(StringUtils.isNotEmpty(sch.getsGh())){
  1264 + fLog.log("撤销售票员");
1245 1265 sch.setsGh("");
1246 1266 sch.setsName("");
1247 1267 }
... ... @@ -1261,6 +1281,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1261 1281 else
1262 1282 t = fmtyyyyMMddHHmm.parseMillis(sch.getScheduleDateStr() + fcsjActual);
1263 1283  
  1284 + fLog.log("调整实发时间", sch.getFcsjActual(), fcsjActual);
1264 1285 sch.setFcsjActualAll(t);
1265 1286 //取消应发未到标记
1266 1287 if(sch.isLate2()){
... ... @@ -1268,6 +1289,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1268 1289 LateAdjustHandle.remove(sch);
1269 1290 }
1270 1291 } else if (StringUtils.isNotEmpty(sch.getFcsjActual()) && StringUtils.isEmpty(fcsjActual)){
  1292 + fLog.log("撤销实发时间", sch.getFcsjActual(), "");
1271 1293 //撤销实发
1272 1294 revokeRealOutgo(sch.getId());
1273 1295 }
... ... @@ -1280,6 +1302,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1280 1302 && !zdsjActual.equals(sch.getZdsjActual())) {
1281 1303  
1282 1304 //调整实达
  1305 + fLog.log("调整实达时间", sch.getZdsjActual(), zdsjActual);
1283 1306 sch.setZdsjActualAll(zdsjActual);
1284 1307 //路牌下一班起点到达时间
1285 1308 ScheduleRealInfo next = dayOfSchedule.nextByLp(sch);
... ... @@ -1294,7 +1317,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1294 1317 ScheduleRealInfo carNext = dayOfSchedule.next(sch);
1295 1318 if(carNext != null && !carNext.getXlBm().equals(sch.getXlBm())){
1296 1319 DirectivePushQueue.put64(carNext.getClZbh(), carNext.getXlBm(), "套跑@系统");
1297   - //directiveService.lineChange(carNext.getClZbh(), carNext.getXlBm(), "套跑@系统");
  1320 + fLog.log("下发线路切换指令", sch.getXlName(), carNext.getXlName());
1298 1321 }
1299 1322 }catch (Exception e){logger.error("", e);}
1300 1323  
... ... @@ -1302,6 +1325,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1302 1325 dayOfSchedule.reCalcExecPlan(sch.getClZbh());
1303 1326 } else if(StringUtils.isNotEmpty(sch.getZdsjActual()) && StringUtils.isEmpty(zdsjActual)){
1304 1327 //清除实达时间
  1328 + fLog.log("撤销实达时间", sch.getZdsjActual(), "");
1305 1329 sch.clearZdsjActual();
1306 1330 //清除路牌下一班起点到达时间
1307 1331 ScheduleRealInfo next = dayOfSchedule.nextByLp(sch);
... ... @@ -1316,7 +1340,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1316 1340 /**
1317 1341 * 备注
1318 1342 */
1319   - sch.setRemarks(map.get("remarks"));
  1343 + sch.setRemarks(remarks);
1320 1344  
1321 1345 /**
1322 1346 * 烂班
... ... @@ -1324,6 +1348,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1324 1348 if (map.get("status") != null
1325 1349 && Integer.parseInt(map.get("status").toString()) == -1) {
1326 1350 destroy(sch.getId() + "", "", map.get("adjustExps").toString());
  1351 + fLog.log("烂班");
1327 1352 }
1328 1353  
1329 1354 /**
... ... @@ -1333,9 +1358,12 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1333 1358 if (StringUtils.isNotEmpty(jhlc)) {
1334 1359 double jhlcNum = Double.parseDouble(jhlc);
1335 1360 //烂班
1336   - if(jhlcNum == 0 && sch.getJhlcOrig() != 0 && !sch._isInout())
  1361 + if(jhlcNum == 0 && sch.getJhlcOrig() != 0 && !sch._isInout() && !sch.isDestroy()){
1337 1362 destroy(sch.getId() + "", "", map.get("adjustExps").toString());
  1363 + fLog.log("里程设置为0,自动烂班");
  1364 + }
1338 1365 else if(jhlcNum != sch.getJhlc()){
  1366 + fLog.log("设置里程", sch.getJhlc(), jhlcNum);
1339 1367 sch.setJhlc(jhlcNum);
1340 1368 //临加班次,实际计划一起改
1341 1369 if(sch.isSflj())
... ... @@ -1347,7 +1375,8 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1347 1375 * 修改班次类型
1348 1376 */
1349 1377 String bcType = map.get("bcType");
1350   - if (StringUtils.isNotEmpty(bcType)) {
  1378 + if (StringUtils.isNotEmpty(bcType) && !bcType.equals(sch.getBcType())) {
  1379 + fLog.log("修改班次类型", sch.getBcType(), bcType);
1351 1380 sch.setBcType(bcType);
1352 1381 }
1353 1382  
... ... @@ -1359,6 +1388,9 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1359 1388  
1360 1389 rs.put("status", ResponseCode.SUCCESS);
1361 1390 rs.put("ts", ts);
  1391 +
  1392 + //日志记录结束
  1393 + fLog.end();
1362 1394 } catch (Exception e) {
1363 1395 logger.error("", e);
1364 1396 rs.put("status", ResponseCode.ERROR);
... ... @@ -1383,7 +1415,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1383 1415 schedule = dayOfSchedule.get(id);
1384 1416  
1385 1417 if(schedule != null)
1386   - outgoAdjust(id, null, dfsj, null, "批量调整");
  1418 + outgoAdjust(id, null, dfsj, null, "2");
1387 1419 }
1388 1420  
1389 1421 rs.put("status", ResponseCode.SUCCESS);
... ... @@ -3144,7 +3176,6 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
3144 3176 Set<ScheduleRealInfo> set = new HashSet<>();
3145 3177  
3146 3178 ScheduleRealInfo sch;
3147   - //BiMap<String, String> map = BasicData.deviceId2NbbmMap.inverse();
3148 3179  
3149 3180 String jGh = null,jName,sGh,sName;
3150 3181 for (ChangePersonCar cpc : cpcs) {
... ... @@ -3257,7 +3288,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
3257 3288 if (StringUtils.isEmpty(dc.getOld_dfsj()) || StringUtils.isEmpty(dc.getNew_dfsj()))
3258 3289 continue;
3259 3290  
3260   - tempMap = outgoAdjust(dc.getSchId(), "", dc.getNew_dfsj(), null, "批量调整");
  3291 + tempMap = outgoAdjust(dc.getSchId(), "", dc.getNew_dfsj(), null, "2");
3261 3292  
3262 3293 if (tempMap.get("status").equals(ResponseCode.SUCCESS)) {
3263 3294 list.addAll((Collection<? extends ScheduleRealInfo>) tempMap.get("ts"));
... ...
src/main/java/com/bsth/service/report/impl/ReportServiceImpl.java
... ... @@ -573,191 +573,77 @@ public class ReportServiceImpl implements ReportService{
573 573  
574 574 //查询全程
575 575 String sqlqc="select t.*,x.station_name as qdz_name from ( "
576   - + "(SELECT fcsj,qdz,2 as xh,xl_dir FROM bsth_c_s_ttinfo_detail "
577   - + " where ttinfo ='"+ttinfo+"' and bc_type='normal' and fcsj <='"+minfcsj+"' ) "
  576 + + " (SELECT bc_type, fcsj,qdz,2 as xh,xl_dir FROM bsth_c_s_ttinfo_detail "
  577 + + " where ttinfo ='"+ttinfo+"' and (bc_type='normal' || bc_type='region') "
  578 + + " and fcsj <='"+minfcsj+"') "
578 579 + " union "
579   - + " (SELECT fcsj,qdz,1 as xh,xl_dir FROM bsth_c_s_ttinfo_detail "
580   - + " where ttinfo ='"+ttinfo+"' and bc_type='normal' and fcsj > '"+minfcsj+"') "
581   - + "order by xl_dir,xh,fcsj ) t left join bsth_c_station x on t.qdz=x.id";
  580 + + " (SELECT bc_type, fcsj,qdz,1 as xh,xl_dir FROM bsth_c_s_ttinfo_detail "
  581 + + " where ttinfo ='"+ttinfo+"' and (bc_type='normal' || bc_type='region') "
  582 + + " and fcsj > '"+minfcsj+"') "
  583 + + "order by xl_dir,xh,fcsj ) t left join bsth_c_station x on t.qdz=x.id";
582 584 List<Map<String, String>> qclist= jdbcTemplate.query(sqlqc,
583 585 new RowMapper<Map<String, String>>(){
584 586 @Override
585   - public Map<String, String> mapRow(ResultSet rs, int rowNum) throws SQLException {
586   - Map<String, String> m=new HashMap<String,String>();
587   - m.put("qdz_name", rs.getString("qdz_name"));
588   - m.put("fcsj", rs.getString("fcsj"));
589   - m.put("xl", rs.getString("xl_dir"));
590   - return m;
591   - }
  587 + public Map<String, String> mapRow(ResultSet rs, int rowNum) throws SQLException {
  588 + Map<String, String> m=new HashMap<String,String>();
  589 + m.put("qdz_name", rs.getString("qdz_name"));
  590 + m.put("bcType", rs.getString("bc_type"));
  591 + m.put("fcsj", rs.getString("fcsj"));
  592 + m.put("xl", rs.getString("xl_dir"));
  593 + m.put("xh", rs.getString("xh"));
  594 + return m;
  595 + }
592 596  
593 597 });
594   -
595   - Map<String, Object> qcMap=new HashMap<String,Object>();
596   - int num=0;
597   - String sxfcsj="";
598   - String xxfcsj="";
599   - String sxzd="";
600   - String xxzd="";
601   - for (int i = 0; i < qclist.size(); i++) {
602   - Map<String, String> map=qclist.get(i);
603   - if(map.get("xl").equals("0")){
604   - if(sxzd.equals("")){
605   - sxzd=map.get("qdz_name").toString();
606   - qcMap.put("sxzm", sxzd);
607   - sxfcsj +=map.get("fcsj").toString()+"-";
608   - }
609   - if(!(qclist.get(i+1).get("xl").equals("0"))){
610   - sxfcsj +=map.get("fcsj").toString();
611   - qcMap.put("sxsj",sxfcsj);
612   - qcMap.put("sxbc", i+1);
613   - num=i+1;
614   - }
615   - }
616   - if(map.get("xl").equals("1")){
617   - if(xxzd.equals("")){
618   - xxzd=map.get("qdz_name").toString();
619   - xxfcsj+=map.get("fcsj").toString()+"-";
620   - qcMap.put("xxzm", xxzd);
621   - }
  598 +
  599 + List<List<Map<String, String>>> mapList = new ArrayList<List<Map<String,String>>>();
  600 + mapList.add(new ArrayList<Map<String, String>>());
  601 + mapList.add(new ArrayList<Map<String, String>>());
  602 + for(Map<String, String> m : qclist){
  603 + String bcType = m.get("bcType");
  604 + if(bcType.equals("normal")){
  605 + mapList.get(0).add(m);
  606 + } else {
  607 + mapList.get(1).add(m);
622 608 }
623 609 }
624   - xxfcsj +=qclist.get(qclist.size()-1).get("fcsj").toString();
625   - qcMap.put("xxsj", xxfcsj);
626   - qcMap.put("xxbc", qclist.size()-num);
627   - list.add(qcMap);
628 610  
629   -
630   - //查询区间
631   - String sqlqj="select t.*,x.station_name as qdz_name from ( "
632   - + "(SELECT fcsj,qdz,'1' as gf,xl_dir FROM bsth_c_s_ttinfo_detail "
633   - + "where ttinfo ='"+ttinfo+"' and bc_type='region' and fcsj >='06:31'"
634   - + "and fcsj <'08:30')"
635   - + " union ( SELECT fcsj,qdz,'2' as gf,xl_dir FROM bsth_c_s_ttinfo_detail "
636   - + "where ttinfo ='"+ttinfo+"' and bc_type='region' "
637   - + "and fcsj > '16:01' and fcsj < '18:00') order by xl_dir,gf,fcsj ) t "
638   - + "left join bsth_c_station x on t.qdz=x.id";
639   -
640   - List<Map<String, String>> qjlist= jdbcTemplate.query(sqlqj,
641   - new RowMapper<Map<String, String>>(){
642   - @Override
643   - public Map<String, String> mapRow(ResultSet rs, int rowNum) throws SQLException {
644   - Map<String, String> m=new HashMap<String,String>();
645   - m.put("qdz_name", rs.getString("qdz_name"));
646   - m.put("fcsj", rs.getString("fcsj"));
647   - m.put("xl", rs.getString("xl_dir"));
648   - m.put("gf", rs.getString("gf"));
649   - return m;
650   - }
651   - });
652   -
653   - Map<String, Object> qjzMap=new HashMap<String,Object>();
654   - Map<String, Object> qjwMap=new HashMap<String,Object>();
655   - int numqj=0;
656   - String sxfcsjqj="";
657   - String xxfcsjqj="";
658   - String sxzdqj="";
659   - String xxzdqj="";
660   - for(int i=0;i<qjlist.size();i++){
661   - Map<String, String> map=qjlist.get(i);
662   - if(map.get("xl").toString().equals("0")){
663   - if(map.get("gf").toString().equals("1")){
664   - if(sxzdqj.equals("")){
665   - sxzdqj =map.get("qdz_name").toString();
666   - qjzMap.put("sxzm", sxzdqj);
667   - sxfcsjqj +=map.get("fcsj").toString()+"-";
668   - }
669   - if(i<qjlist.size()-1){
670   - if(!(qjlist.get(i+1).get("gf").equals("1"))){
671   - sxfcsjqj +=map.get("fcsj").toString();
672   - qjzMap.put("sxsj",sxfcsjqj);
673   - qjzMap.put("sxbc", i+1);
674   - numqj=i+1;
675   - sxzdqj ="";
676   - sxfcsjqj="";
677   - }
678   - }else{
679   - qjzMap.put("sxsj",sxfcsjqj+"-"+map.get("fcsj").toString());
680   - qjzMap.put("sxbc", i+1);
681   - numqj=i+1;
682   - sxzdqj ="";
683   - sxfcsjqj="";
684   - }
685   - }
686   - if(map.get("gf").toString().equals("2")){
687   - if(sxzdqj.equals("")){
688   - sxzdqj =map.get("qdz_name").toString();
689   - qjwMap.put("sxzm", sxzdqj);
690   - sxfcsjqj +=map.get("fcsj").toString()+"-";
691   - }
692   - if(i<qjlist.size()-1){
693   - if(!(qjlist.get(i+1).get("xl").equals("0"))){
694   - sxfcsjqj +=map.get("fcsj").toString();
695   - qjwMap.put("sxsj",sxfcsjqj);
696   - qjwMap.put("sxbc", i+1-numqj);
697   - numqj=i+1;
698   - }
699   - }else{
700   - qjwMap.put("sxsj",sxfcsjqj+"-"+map.get("fcsj").toString());
701   - qjwMap.put("sxbc", i+1-numqj);
702   - numqj=i+1;
703   - }
704   - }
705   -
706   - }else{
707   - if(map.get("gf").toString().equals("1")){
708   - if(xxzdqj.equals("")){
709   - xxzdqj =map.get("qdz_name").toString();
710   - qjzMap.put("xxzm", xxzdqj);
711   - xxfcsjqj +=map.get("fcsj").toString()+"-";
712   - }
713   - if(i<qjlist.size()-1){
714   - if(!(qjlist.get(i+1).get("gf").equals("1"))){
715   - xxfcsjqj +=map.get("fcsj").toString();
716   - qjzMap.put("xxsj",xxfcsjqj);
717   - qjzMap.put("xxbc", i+1-numqj);
718   - numqj=i+1;
719   - xxzdqj ="";
720   - xxfcsjqj="";
721   - }
722   - }else{
723   - qjzMap.put("xxsj",xxfcsjqj+"-"+map.get("fcsj").toString());
724   - qjzMap.put("xxbc", i+1-numqj);
725   - numqj=i+1;
726   - xxzdqj ="";
727   - xxfcsjqj="";
728   - }
729   - }
730   - if(map.get("gf").toString().equals("2")){
731   - if(xxzdqj.equals("")){
732   - xxzdqj =map.get("qdz_name").toString();
733   - qjwMap.put("xxzm", xxzdqj);
734   - xxfcsjqj +=map.get("fcsj").toString()+"-";
735   - }
736   - if(i<qjlist.size()){
737   - if(i==qjlist.size()-1){
738   - xxfcsjqj +=map.get("fcsj").toString();
739   - qjwMap.put("xxsj",xxfcsjqj);
740   - qjwMap.put("xxbc", i+1-numqj);
741   - numqj=i+1;
742   - }
743   - }else{
744   - qjwMap.put("xxsj",xxfcsjqj+"-"+xxfcsjqj);
745   - qjwMap.put("xxbc", i+1-numqj);
746   - numqj=i+1;
747   - }
  611 + for(int i = 0; i < mapList.size(); i++){
  612 + List<Map<String, String>> l = mapList.get(i);
  613 + Map<String, Object> tempMap = new HashMap<String, Object>();
  614 + List<String> upfcsj = new ArrayList<String>();
  615 + List<String> downfcsj = new ArrayList<String>();
  616 + String sxqdz = "", xxqdz = "";
  617 + String sxfcsj = "", xxfcsj = "";
  618 + int sxbc = 0, xxbc = 0;
  619 + for(Map<String, String> m : l){
  620 + if(m.get("xl").equals("0")){
  621 + sxbc++;
  622 + upfcsj.add(m.get("fcsj"));
  623 + if(sxqdz.length() == 0 && m.containsKey("qdz_name"))
  624 + sxqdz = m.get("qdz_name");
  625 + } else {
  626 + xxbc++;
  627 + downfcsj.add(m.get("fcsj"));
  628 + if(xxqdz.length() == 0 && m.containsKey("qdz_name"))
  629 + xxqdz = m.get("qdz_name");
748 630 }
749   -
750   -
751 631 }
  632 + if(upfcsj.size() != 0)
  633 + sxfcsj = upfcsj.get(0) + "-" + upfcsj.get(upfcsj.size() - 1);
  634 + if(downfcsj.size() != 0)
  635 + xxfcsj = downfcsj.get(0) + "-" + downfcsj.get(downfcsj.size() - 1);
  636 + tempMap.put("sxqdz", sxqdz);
  637 + tempMap.put("sxfcsj", i==0?sxfcsj:"");
  638 + tempMap.put("sxbc", sxbc!=0?sxbc:"");
  639 + tempMap.put("xxqdz", xxqdz);
  640 + tempMap.put("xxfcsj", i==0?xxfcsj:"");
  641 + tempMap.put("xxbc", xxbc!=0?xxbc:"");
  642 + tempMap.put("bcType", i);
  643 + if(sxqdz.length()!=0 || xxqdz.length()!=0)
  644 + list.add(tempMap);
752 645 }
753 646  
754   - if(!qjzMap.isEmpty()){
755   - list.add(qjzMap);
756   - }
757   - if(!qjwMap.isEmpty()){
758   - list.add(qjwMap);
759   -
760   - }
761 647 return list;
762 648 }
763 649 @Override
... ... @@ -769,15 +655,14 @@ public class ReportServiceImpl implements ReportService{
769 655 String[] minSjs = minfcsj.split(":");
770 656 int minSj=Integer.parseInt(minSjs[0])*60+Integer.parseInt(minSjs[1]);
771 657 //查询时间里程
772   - String sqlPc=" (SELECT jhlc,fcsj,bcsj,bc_type,lp,xl_dir,2 as xh FROM "
  658 + String sqlPc=" (SELECT jhlc,fcsj,bcsj,bc_type,lp,xl_dir,ists,2 as xh FROM "
773 659 + " bsth_c_s_ttinfo_detail where ttinfo ='"+ttinfo+"' and "
774   - + " fcsj <='"+minfcsj+"' and bc_type = 'normal') "
  660 + + " fcsj <='"+minfcsj+"' and bc_type!='in' and bc_type!='out' and bc_type!='ldks') "
775 661 + " union "
776   - + " (SELECT jhlc,fcsj,bcsj,bc_type,lp,xl_dir,1 as xh FROM "
  662 + + " (SELECT jhlc,fcsj,bcsj,bc_type,lp,xl_dir,ists,1 as xh FROM "
777 663 + " bsth_c_s_ttinfo_detail where ttinfo ='"+ttinfo+"' and "
778   - + " fcsj >'"+minfcsj+"' and bc_type ='normal') "
  664 + + " fcsj > '"+minfcsj+"' and bc_type!='in' and bc_type!='out' and bc_type!='ldks') "
779 665 + " order by xl_dir, xh,fcsj";
780   -
781 666 Map<String, Object> map=new HashMap<String,Object>();
782 667 List<Map<String, Object>> list= jdbcTemplate.query(sqlPc,
783 668 new RowMapper<Map<String, Object>>(){
... ... @@ -790,9 +675,10 @@ public class ReportServiceImpl implements ReportService{
790 675 m.put("bcType", rs.getString("bc_type"));
791 676 m.put("lp", rs.getString("lp"));
792 677 m.put("dir", rs.getString("xl_dir"));
  678 + m.put("ists", rs.getString("ists")!=null?rs.getString("ists"):"");
793 679 return m;
794 680 }
795   - });
  681 + });
796 682  
797 683 List<Map<String, Object>> newList=new ArrayList<Map<String,Object>>();
798 684 Map<String, List<Map<String, Object>>> keyMap = new HashMap<String, List<Map<String, Object>>>();
... ... @@ -824,8 +710,9 @@ public class ReportServiceImpl implements ReportService{
824 710 Map<String, Object> tempMap = new HashMap<String, Object>();
825 711 List<Map<String, Object>> list2 = keyMap.get(key);
826 712 List<Integer> cjs = new ArrayList<Integer>();
827   - int sxsj = 0, xxsj = 0, zcj = 0;
  713 + int sxsj = 0, xxsj = 0, zcj = 0, tssj = 0;
828 714 int temp = 24*60+1;
  715 + boolean ists = false;
829 716 for(Map<String, Object> m : list2){
830 717 String[] split = m.get("fcsj").toString().split(":");
831 718 int fcsj = Integer.valueOf(split[0])*60 + Integer.valueOf(split[1]);
... ... @@ -838,9 +725,18 @@ public class ReportServiceImpl implements ReportService{
838 725 }
839 726 if(temp >= fcsj){
840 727 temp = fcsj;
  728 + ists = false;
841 729 } else {
842   - cjs.add(fcsj - temp);
  730 + if(ists){
  731 + tssj += fcsj - temp;
  732 + ists = false;
  733 + } else {
  734 + cjs.add(fcsj - temp);
  735 + }
843 736 temp = fcsj;
  737 + if(m.get("ists").equals("1")){
  738 + ists = true;
  739 + }
844 740 }
845 741 }
846 742 Collections.sort(cjs);
... ... @@ -852,7 +748,8 @@ public class ReportServiceImpl implements ReportService{
852 748 tempMap.put("xxsj", xxsj);
853 749 tempMap.put("fqsj", sxsj + xxsj);
854 750 tempMap.put("cjqj", cjs.size()>0?cjs.get(0)+"——"+cjs.get(cjs.size()-1):"——");
855   - tempMap.put("pjcj", cjs.size()>0?zcj/(cjs.size()-1):"/");
  751 + tempMap.put("pjcj", cjs.size()>0?zcj/cjs.size():"/");
  752 + tempMap.put("tssj", tssj);
856 753 maps.put(key, tempMap);
857 754 }
858 755 newList.add(maps.get("(首)——6:30"));
... ...
src/main/resources/static/pages/report/timetable/timetable.html
... ... @@ -45,7 +45,7 @@
45 45 </div>
46 46 <div class="form-group">
47 47 <input class="btn btn-default" type="button" id="query" value="查询"/>
48   - <input class="btn btn-default" type="button" id="export" value="导出"/>
  48 +<!-- <input class="btn btn-default" type="button" id="export" value="导出"/> -->
49 49 </div>
50 50 </form>
51 51 </div>
... ... @@ -165,18 +165,19 @@
165 165 <div class="col-md-6" >
166 166 <table class="table table-bordered table-checkable" id="formsTime5">
167 167 <tr>
168   - <td colspan="6">全日分组行驶时间(区间除外)</td>
  168 + <td colspan="7">全日分组行驶时间(区间除外)</td>
169 169 </tr>
170 170 <tr>
171 171 <td width="20%" rowspan="2" style="text-align:center;vertical-align:middle;">分组 时间</td>
172   - <td width="25%" colspan="2" style="text-align:center;vertical-align:middle;">计划行驶(分)</td>
173   - <td width="20%" rowspan="2" style="text-align:center;vertical-align:middle;">分圈 时间</td>
174   - <td width="20%" rowspan="2" style="text-align:center;vertical-align:middle;">车距区间</td>
175   - <td width="15%" rowspan="2" style="text-align:center;vertical-align:middle;">平均车距</td>
  172 + <td width="23%" colspan="2" style="text-align:center;vertical-align:middle;">计划行驶(分)</td>
  173 + <td width="15%" rowspan="2" style="text-align:center;vertical-align:middle;">分圈时间</td>
  174 + <td width="15%" rowspan="2" style="text-align:center;vertical-align:middle;">停驶时间</td>
  175 + <td width="15%" rowspan="2" style="text-align:center;vertical-align:middle;">车距区间</td>
  176 + <td width="12%" rowspan="2" style="text-align:center;vertical-align:middle;">平均车距</td>
176 177 </tr>
177 178 <tr>
178 179 <td>上行</td>
179   - <td>下行</td>
  180 + <td style="text-align:center;">下行</td>
180 181 </tr>
181 182 <tbody class="tbody_time_5">
182 183  
... ... @@ -313,8 +314,8 @@
313 314 });
314 315  
315 316 $.get('/report/tbodyTime4',{line:line,ttinfo:ttinfo},function(result){
316   - $("#skb_sxzd").html(result[0].sxzm);
317   - $("#skb_xxzd").html(result[0].xxzm);
  317 + $("#skb_sxzd").html(result[0].sxqdz);
  318 + $("#skb_xxzd").html(result[0].xxqdz);
318 319 var tbodyTime4 = template('tbodyTime4',{list:result});
319 320 $('#formsTime4 .tbody_time_4').html(tbodyTime4);
320 321 });
... ... @@ -377,11 +378,11 @@
377 378 {{each list as result i}}
378 379  
379 380 <tr>
380   - <td align="center">{{result.sxzm}}</td>
381   - <td align="center">{{result.sxsj}}</td>
  381 + <td align="center">{{result.sxqdz}}</td>
  382 + <td align="center">{{result.sxfcsj}}</td>
382 383 <td align="center">{{result.sxbc}}</td>
383   - <td align="center">{{result.xxzm}}</td>
384   - <td align="center">{{result.xxsj}}</td>
  384 + <td align="center">{{result.xxqdz}}</td>
  385 + <td align="center">{{result.xxfcsj}}</td>
385 386 <td align="center">{{result.xxbc}}</td>
386 387 </tr>
387 388 {{/each}}
... ... @@ -399,13 +400,14 @@
399 400 <td align="center">{{result.sxsj}}</td>
400 401 <td align="center">{{result.xxsj}}</td>
401 402 <td align="center">{{result.fqsj}}</td>
  403 + <td align="center">{{result.tssj}}</td>
402 404 <td align="center">{{result.cjqj}}</td>
403 405 <td align="center">{{result.pjcj}}</td>
404 406 </tr>
405 407 {{/each}}
406 408 {{if list.length == 0}}
407 409 <tr>
408   - <td colspan="6"><h6 class="muted">没有找到相关数据</h6></td>
  410 + <td colspan="7"><h6 class="muted">没有找到相关数据</h6></td>
409 411 </tr>
410 412 {{/if}}
411 413 </script>
... ...
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/dftz.html
... ... @@ -9,6 +9,7 @@
9 9  
10 10 <script id="schedule-dftz-form-temp" type="text/html">
11 11 <input type="hidden" name="id" value="{{id}}"/>
  12 + <input type="hidden" name="opType" value="1"/>
12 13 <div class="uk-grid">
13 14 <div class="uk-width-1-2">
14 15 <div class="uk-form-row">
... ...
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/fcxxwt.html
... ... @@ -191,8 +191,9 @@
191 191 e.preventDefault();
192 192 var data = $(this).serializeJSON();
193 193  
194   - if(data.status==-1 && !data.adjustExps){
195   - notify_err("烂班需要选择调整原因!");
  194 + if(!data.adjustExps && (data.status==-1
  195 + || (data.jhlc==0 && sch.bcType != 'in' && sch.bcType != 'out'))){
  196 + notify_err("当前操作需要选择调整原因!");
196 197 return;
197 198 }
198 199  
... ...
src/main/resources/static/real_control_v2/fragments/north/nav/safeDriving.html
1 1 <div class="uk-modal ct_move_modal" id="safe_dring_list-modal" style="z-index: 99;">
2   - <div class="uk-modal-dialog" style="width: 1100px;">
  2 + <div class="uk-modal-dialog" style="width: 1150px;">
3 3 <a href="" class="uk-modal-close uk-close"></a>
4 4 <div class="uk-modal-header">
5 5 <h2>安全驾驶图像信息(当日)</h2></div>
... ... @@ -26,7 +26,7 @@
26 26 <option value="A7">行驶中与人交谈</option>
27 27 </select>
28 28 <button class="uk-button">检索</button>
29   - <a id="showSSSpVedioModal" style="color: red;float: right;font-size: 12px;">查看实时视频</a>
  29 + <!--<a id="showSSSpVedioModal" style="color: red;float: right;font-size: 12px;">查看实时视频</a>-->
30 30 </fieldset>
31 31 </form>
32 32 </div>
... ... @@ -34,14 +34,15 @@
34 34 <table class="ct-fixed-table uk-table uk-table-hover">
35 35 <thead>
36 36 <tr>
37   - <th style="width: 12%;">线路</th>
38   - <th style="width: 13%;">车辆自编号</th>
39   - <th style="width: 13%;">设备</th>
40   - <th style="width: 13%;">异常类型</th>
41   - <th style="width: 17%;">时间</th>
42   - <th style="width: 11%;">检查属性</th>
43   - <th style="width: 11%;">图像</th>
  37 + <th style="width: 10%;">线路</th>
  38 + <th style="width: 11%;">车辆自编号</th>
  39 + <th style="width: 12%;">设备</th>
  40 + <th style="width: 12%;">异常类型</th>
  41 + <th style="width: 16%;">时间</th>
  42 + <th style="width: 10%;">检查属性</th>
  43 + <th style="width: 10%;">图像</th>
44 44 <th>视频</th>
  45 + <th style="width: 8%;">实时视频</th>
45 46 </tr>
46 47 </thead>
47 48 <tbody data-uk-observe>
... ... @@ -75,7 +76,10 @@
75 76 <a class="image_link" href="{{sd.url}}.jpg" data-uk-lightbox="{group:'jpg_group1'}" title="{{sd.title}}">JPG</a>
76 77 </td>
77 78 <td>
78   - <a class="image_link" href="{{sd.url}}.gif" data-uk-lightbox="{group:'gif_group2'}" title="{{sd.title}}">查看视频</a>
  79 + <a class="image_link" href="{{sd.url}}.gif" data-uk-lightbox="{group:'gif_group2'}" title="{{sd.title}}">查看</a>
  80 + </td>
  81 + <td>
  82 + <a data-type="{{sd.yczltype}}" class="show_vedio_modal">DVR</a>
79 83 </td>
80 84 </tr>
81 85 {{/each}}
... ... @@ -88,9 +92,14 @@
88 92 var page = 0;
89 93 var pageSize = 12;
90 94  
91   - $('#showSSSpVedioModal', modal).on('click', function () {
  95 + /*$('#showSSSpVedioModal', modal).on('click', function () {
92 96 gb_safe_driv.showVedioModal();
  97 + });*/
  98 + //show_vedio_modal
  99 + $(modal).on('click', '.show_vedio_modal', function () {
  100 + gb_safe_driv.showVedioModal($(this).data('type'));
93 101 });
  102 +
94 103 $(modal).on('init', function(e, data) {
95 104 e.stopPropagation();
96 105  
... ...
src/main/resources/static/real_control_v2/js/line_schedule/dbclick.js
... ... @@ -18,7 +18,8 @@ var gb_schedule_table_dbclick = (function() {
18 18 gb_common.$post('/realSchedule/outgoAdjust', {
19 19 id: id,
20 20 dfsj: val,
21   - remarks: ''
  21 + remarks: '',
  22 + opType: '0'
22 23 }, function(rs) {
23 24 gb_schedule_table.updateSchedule(rs.ts);
24 25 notify_succ('待发调整成功!');
... ...
src/main/resources/static/real_control_v2/js/safe_driv/safeDriv.js
... ... @@ -10,7 +10,8 @@ var gb_safe_driv = (function () {
10 10 'A4': '未戴袖章',
11 11 'A5': '眨眼/疲劳驾驶',
12 12 'A6': '打哈欠/打瞌睡',
13   - 'A7': '与人交谈'
  13 + 'A7': '与人交谈',
  14 + 'A9': '玩手机'
14 15 };
15 16  
16 17 var path = 'http://118.178.187.115/CurrentSafeDriving/';
... ... @@ -32,7 +33,7 @@ var gb_safe_driv = (function () {
32 33 //图片地址
33 34 var p = (sd.sbbh+'_'+sd.yczltype+'_'+stm.format('YYYYMMDDHHmmss'));
34 35 var url = stm.format('YYYYMMDD')+'/'+p+'/'+p;
35   - sd.url = path + url + '.jpg';
  36 + sd.url = path + url + '.gif';
36 37  
37 38 var htmlStr = template('safe_driv_item-temp', sd);
38 39 var items = $wrap.find('.safe_driv_pop'), len = items.length;
... ... @@ -46,12 +47,12 @@ var gb_safe_driv = (function () {
46 47 '<div class="uk-modal-dialog uk-modal-dialog-large">' +
47 48 '<button type="button" class="uk-modal-close uk-close"></button>' +
48 49 '<div class="uk-modal-header"> <h2>实时视频</h2> </div> '+
49   - '<p class="loading"><i class="uk-icon-spinner uk-icon-spin"></i> 载入资源...</p><iframe id="vedioIframe" src="http://222.66.0.204:8910/transport_server/dvr_monitor1.jsp?deviceId=229L0650&channel=0"></iframe>' +
  50 + '<p class="loading"><i class="uk-icon-spinner uk-icon-spin"></i> 载入资源...</p><iframe id="vedioIframe" src="http://222.66.0.204:8910/transport_server/dvr_monitor1.jsp?deviceId=229L0650&channel=^^channel^^"></iframe>' +
50 51 '</div>' +
51 52 '</div>';
52 53  
53 54 $wrap.on('click', '.safe_driv_pop', function () {
54   - var title = $(this).data('title') + '&nbsp;<button class="uk-button uk-button-mini uk-button-primary" id="openVedioModalBtn" type="button">查看实时视频</button>';
  55 + var title = $(this).data('title') + '&nbsp;<button data-type="'+$(this).data('type')+'" class="uk-button uk-button-mini uk-button-primary" id="openVedioModalBtn" type="button">查看实时视频</button>';
55 56 var url = $(this).data('url');
56 57 $(this).remove();
57 58 var lightbox = UIkit.lightbox.create([
... ... @@ -61,8 +62,19 @@ var gb_safe_driv = (function () {
61 62 lightbox.show();
62 63 });
63 64  
64   - var showVedioModal = function () {
65   - open_modal_dom(vedioModal ,{}, {modal: false});
  65 + var channelMap = {
  66 + 'A1': 1,
  67 + 'A2': 1,
  68 + 'A3': 1,
  69 + 'A9': 1,
  70 + 'A4': 2,
  71 + 'A5': 2,
  72 + 'A6': 2,
  73 + 'A7': 2
  74 + };
  75 + var showVedioModal = function (type) {
  76 + var channel = channelMap[type]?channelMap[type]:1;
  77 + open_modal_dom(vedioModal.replace('^^channel^^', channel) ,{}, {modal: false});
66 78 $('#ssspVedioModal #vedioIframe').on('load', function () {
67 79 var that = this;
68 80 setTimeout(function () {
... ... @@ -72,7 +84,9 @@ var gb_safe_driv = (function () {
72 84 });
73 85 };
74 86  
75   - $(document).on('click', '#openVedioModalBtn', showVedioModal);
  87 + $(document).on('click', '#openVedioModalBtn', function () {
  88 + showVedioModal($(this).data('type'));
  89 + });
76 90  
77 91  
78 92 return {
... ...
src/main/resources/static/real_control_v2/main.html
... ... @@ -206,7 +206,7 @@
206 206 <!-- #### 安全驾驶 start ### -->
207 207 <div class="safe_driv_pop_wrap" ></div>
208 208 <script id="safe_driv_item-temp" type="text/html">
209   - <div class="safe_driv_pop uk-animation-slide-bottom" data-title="{{clzbh}} {{timeStr}} {{ycztText}}" data-url="{{url}}">
  209 + <div class="safe_driv_pop uk-animation-slide-bottom" data-type="{{yczltype}}" data-title="{{clzbh}} {{timeStr}} {{ycztText}}" data-url="{{url}}">
210 210 <div>
211 211 <span class="title">异常&nbsp;{{clzbh}}</span>
212 212 <span class="text"> {{timeStr}} 出现违规驾驶({{ycztText}})</span>
... ...