Commit 4c9efba639e5d928bf05557e2aa2e2104762cd41

Authored by 潘钊
1 parent 0131ec0e

修正日志1

src/main/java/com/bsth/XDApplication.java
@@ -6,6 +6,7 @@ import com.bsth.data.car_out_info.UpdateDBThread; @@ -6,6 +6,7 @@ import com.bsth.data.car_out_info.UpdateDBThread;
6 import com.bsth.data.directive.DirectivesPstThread; 6 import com.bsth.data.directive.DirectivesPstThread;
7 import com.bsth.data.gpsdata.thread.GpsDataLoaderThread; 7 import com.bsth.data.gpsdata.thread.GpsDataLoaderThread;
8 import com.bsth.data.gpsdata.thread.OfflineMonitorThread; 8 import com.bsth.data.gpsdata.thread.OfflineMonitorThread;
  9 +import com.bsth.data.schedule.edit_logs.SeiPstThread;
9 import com.bsth.data.schedule.late_adjust.ScheduleLateThread; 10 import com.bsth.data.schedule.late_adjust.ScheduleLateThread;
10 import com.bsth.data.schedule.thread.CalcOilThread; 11 import com.bsth.data.schedule.thread.CalcOilThread;
11 import com.bsth.data.schedule.thread.SchedulePstThread; 12 import com.bsth.data.schedule.thread.SchedulePstThread;
@@ -53,6 +54,8 @@ public class XDApplication implements CommandLineRunner { @@ -53,6 +54,8 @@ public class XDApplication implements CommandLineRunner {
53 DirectivesPstThread directivesPstThread; 54 DirectivesPstThread directivesPstThread;
54 @Autowired 55 @Autowired
55 ThreadMonotor threadMonotor; 56 ThreadMonotor threadMonotor;
  57 + @Autowired
  58 + SeiPstThread seiPstThread;
56 59
57 private static long timeDiff; 60 private static long timeDiff;
58 61
@@ -93,6 +96,8 @@ public class XDApplication implements CommandLineRunner { @@ -93,6 +96,8 @@ public class XDApplication implements CommandLineRunner {
93 //sexec.scheduleWithFixedDelay(scheduleRefreshThread, 15, 240, TimeUnit.SECONDS); 96 //sexec.scheduleWithFixedDelay(scheduleRefreshThread, 15, 240, TimeUnit.SECONDS);
94 //实际排班延迟入库线程 97 //实际排班延迟入库线程
95 //sexec.scheduleWithFixedDelay(schedulePstThread, 60, 15, TimeUnit.SECONDS); 98 //sexec.scheduleWithFixedDelay(schedulePstThread, 60, 15, TimeUnit.SECONDS);
  99 + //班次修正日志延迟入库
  100 + //sexec.scheduleWithFixedDelay(seiPstThread, 60, 60, TimeUnit.SECONDS);
96 101
97 //线程监听(防止重要的线程阻塞、异常结束。以及部分主备切换工作) 102 //线程监听(防止重要的线程阻塞、异常结束。以及部分主备切换工作)
98 //sexec.scheduleWithFixedDelay(threadMonotor, 240, 60, TimeUnit.SECONDS); 103 //sexec.scheduleWithFixedDelay(threadMonotor, 240, 60, TimeUnit.SECONDS);
@@ -107,10 +112,12 @@ public class XDApplication implements CommandLineRunner { @@ -107,10 +112,12 @@ public class XDApplication implements CommandLineRunner {
107 sexec.scheduleWithFixedDelay(gpsDataLoader, 30, 2, TimeUnit.SECONDS); 112 sexec.scheduleWithFixedDelay(gpsDataLoader, 30, 2, TimeUnit.SECONDS);
108 //GPS设备掉离线 113 //GPS设备掉离线
109 sexec.scheduleWithFixedDelay(offlineMonitorThread, 120, 60, TimeUnit.SECONDS); 114 sexec.scheduleWithFixedDelay(offlineMonitorThread, 120, 60, TimeUnit.SECONDS);
110 - //实际排班更新线程 115 + //班次更新线程
111 sexec.scheduleWithFixedDelay(scheduleRefreshThread, 15, 240, TimeUnit.SECONDS); 116 sexec.scheduleWithFixedDelay(scheduleRefreshThread, 15, 240, TimeUnit.SECONDS);
112 - //实际排班延迟入库线程 117 + //班次延迟入库线程
113 sexec.scheduleWithFixedDelay(schedulePstThread, 60, 15, TimeUnit.SECONDS); 118 sexec.scheduleWithFixedDelay(schedulePstThread, 60, 15, TimeUnit.SECONDS);
  119 + //班次修正日志延迟入库
  120 + sexec.scheduleWithFixedDelay(seiPstThread, 60, 60, TimeUnit.SECONDS);
114 //检查班次误点 121 //检查班次误点
115 sexec.scheduleWithFixedDelay(scheduleLateThread, 60, 30, TimeUnit.SECONDS); 122 sexec.scheduleWithFixedDelay(scheduleLateThread, 60, 30, TimeUnit.SECONDS);
116 //调度指令延迟入库 123 //调度指令延迟入库
src/main/java/com/bsth/data/safe_driv/SafeDrivCenter.java
1 package com.bsth.data.safe_driv; 1 package com.bsth.data.safe_driv;
2 2
3 -import com.bsth.Application;  
4 import com.bsth.websocket.handler.SendUtils; 3 import com.bsth.websocket.handler.SendUtils;
5 import org.joda.time.format.DateTimeFormat; 4 import org.joda.time.format.DateTimeFormat;
6 import org.joda.time.format.DateTimeFormatter; 5 import org.joda.time.format.DateTimeFormatter;
@@ -15,7 +14,6 @@ import java.util.HashMap; @@ -15,7 +14,6 @@ import java.util.HashMap;
15 import java.util.HashSet; 14 import java.util.HashSet;
16 import java.util.Map; 15 import java.util.Map;
17 import java.util.Set; 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,7 +67,7 @@ public class SafeDrivCenter implements CommandLineRunner,ApplicationContextAware
69 @Override 67 @Override
70 public void run(String... strings) throws Exception { 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 @Override 73 @Override
src/main/java/com/bsth/data/schedule/edit_logs/ScheduleModifyLogger.java
1 package com.bsth.data.schedule.edit_logs; 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 * Created by panzhao on 2017/5/16. 15 * Created by panzhao on 2017/5/16.
6 */ 16 */
7 public class ScheduleModifyLogger { 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 \ No newline at end of file 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,6 +15,8 @@ import com.bsth.data.schedule.DayOfSchedule;
15 import com.bsth.data.schedule.SchAttrCalculator; 15 import com.bsth.data.schedule.SchAttrCalculator;
16 import com.bsth.data.schedule.edit_logs.FormLogger; 16 import com.bsth.data.schedule.edit_logs.FormLogger;
17 import com.bsth.data.schedule.ScheduleComparator; 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 import com.bsth.data.schedule.late_adjust.LateAdjustHandle; 20 import com.bsth.data.schedule.late_adjust.LateAdjustHandle;
19 import com.bsth.entity.Cars; 21 import com.bsth.entity.Cars;
20 import com.bsth.entity.Line; 22 import com.bsth.entity.Line;
@@ -221,6 +223,9 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -221,6 +223,9 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
221 schedule.setRealExecDate(schedule.getScheduleDateStr()); 223 schedule.setRealExecDate(schedule.getScheduleDateStr());
222 } 224 }
223 225
  226 + //记录日志
  227 + ScheduleModifyLogger.dftz(schedule,opType, schedule.getDfsj(),dfsj,remarks);
  228 +
224 schedule.setDfsjAll(dfsj); 229 schedule.setDfsjAll(dfsj);
225 schedule.setDfAuto(false); 230 schedule.setDfAuto(false);
226 schedule.addRemarks(remarks); 231 schedule.addRemarks(remarks);
@@ -276,6 +281,8 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -276,6 +281,8 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
276 map.put("msg", "不必要的重复烂班!"); 281 map.put("msg", "不必要的重复烂班!");
277 return map; 282 return map;
278 } 283 }
  284 + //记录日志
  285 + ScheduleModifyLogger.jhlb(schedule, remarks);
279 286
280 schedule.setAdjustExps(reason); 287 schedule.setAdjustExps(reason);
281 schedule.destroy(); 288 schedule.destroy();
@@ -1163,7 +1170,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -1163,7 +1170,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1163 sch = list.get(i); 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 rs.put("status", ResponseCode.SUCCESS); 1176 rs.put("status", ResponseCode.SUCCESS);
@@ -1186,6 +1193,8 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -1186,6 +1193,8 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1186 List<ScheduleRealInfo> ts = new ArrayList<>(); 1193 List<ScheduleRealInfo> ts = new ArrayList<>();
1187 try { 1194 try {
1188 Long id = Long.parseLong(map.get("id")); 1195 Long id = Long.parseLong(map.get("id"));
  1196 + String remarks = map.get("remarks");
  1197 +
1189 ScheduleRealInfo sch = dayOfSchedule.get(id); 1198 ScheduleRealInfo sch = dayOfSchedule.get(id);
1190 1199
1191 if(null == sch){ 1200 if(null == sch){
@@ -1194,6 +1203,9 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -1194,6 +1203,9 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1194 return rs; 1203 return rs;
1195 } 1204 }
1196 1205
  1206 + //日志记录器
  1207 + FcxxwtLogger fLog = FcxxwtLogger.start(sch, remarks);
  1208 +
1197 String clZbh = map.get("clZbh"); 1209 String clZbh = map.get("clZbh");
1198 String jsy = map.get("jsy"); 1210 String jsy = map.get("jsy");
1199 if(!clZbh.equals(sch.getClZbh()) 1211 if(!clZbh.equals(sch.getClZbh())
@@ -1208,7 +1220,8 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -1208,7 +1220,8 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1208 rs.put("status", ResponseCode.ERROR); 1220 rs.put("status", ResponseCode.ERROR);
1209 rs.put("msg", "车辆 " + clZbh + " 不存在!"); 1221 rs.put("msg", "车辆 " + clZbh + " 不存在!");
1210 return rs; 1222 return rs;
1211 - } else { 1223 + } else if(!clZbh.equals(sch.getClZbh())){
  1224 + fLog.log("换车", sch.getClZbh(), clZbh);
1212 dayOfSchedule.changeCar(sch, clZbh); 1225 dayOfSchedule.changeCar(sch, clZbh);
1213 } 1226 }
1214 } 1227 }
@@ -1224,7 +1237,10 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -1224,7 +1237,10 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1224 rs.put("status", ResponseCode.ERROR); 1237 rs.put("status", ResponseCode.ERROR);
1225 return rs; 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,9 +1255,13 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1239 rs.put("status", ResponseCode.ERROR); 1255 rs.put("status", ResponseCode.ERROR);
1240 return rs; 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 sch.setsGh(""); 1265 sch.setsGh("");
1246 sch.setsName(""); 1266 sch.setsName("");
1247 } 1267 }
@@ -1261,6 +1281,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -1261,6 +1281,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1261 else 1281 else
1262 t = fmtyyyyMMddHHmm.parseMillis(sch.getScheduleDateStr() + fcsjActual); 1282 t = fmtyyyyMMddHHmm.parseMillis(sch.getScheduleDateStr() + fcsjActual);
1263 1283
  1284 + fLog.log("调整实发时间", sch.getFcsjActual(), fcsjActual);
1264 sch.setFcsjActualAll(t); 1285 sch.setFcsjActualAll(t);
1265 //取消应发未到标记 1286 //取消应发未到标记
1266 if(sch.isLate2()){ 1287 if(sch.isLate2()){
@@ -1268,6 +1289,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -1268,6 +1289,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1268 LateAdjustHandle.remove(sch); 1289 LateAdjustHandle.remove(sch);
1269 } 1290 }
1270 } else if (StringUtils.isNotEmpty(sch.getFcsjActual()) && StringUtils.isEmpty(fcsjActual)){ 1291 } else if (StringUtils.isNotEmpty(sch.getFcsjActual()) && StringUtils.isEmpty(fcsjActual)){
  1292 + fLog.log("撤销实发时间", sch.getFcsjActual(), "");
1271 //撤销实发 1293 //撤销实发
1272 revokeRealOutgo(sch.getId()); 1294 revokeRealOutgo(sch.getId());
1273 } 1295 }
@@ -1280,6 +1302,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -1280,6 +1302,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1280 && !zdsjActual.equals(sch.getZdsjActual())) { 1302 && !zdsjActual.equals(sch.getZdsjActual())) {
1281 1303
1282 //调整实达 1304 //调整实达
  1305 + fLog.log("调整实达时间", sch.getZdsjActual(), zdsjActual);
1283 sch.setZdsjActualAll(zdsjActual); 1306 sch.setZdsjActualAll(zdsjActual);
1284 //路牌下一班起点到达时间 1307 //路牌下一班起点到达时间
1285 ScheduleRealInfo next = dayOfSchedule.nextByLp(sch); 1308 ScheduleRealInfo next = dayOfSchedule.nextByLp(sch);
@@ -1294,7 +1317,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -1294,7 +1317,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1294 ScheduleRealInfo carNext = dayOfSchedule.next(sch); 1317 ScheduleRealInfo carNext = dayOfSchedule.next(sch);
1295 if(carNext != null && !carNext.getXlBm().equals(sch.getXlBm())){ 1318 if(carNext != null && !carNext.getXlBm().equals(sch.getXlBm())){
1296 DirectivePushQueue.put64(carNext.getClZbh(), carNext.getXlBm(), "套跑@系统"); 1319 DirectivePushQueue.put64(carNext.getClZbh(), carNext.getXlBm(), "套跑@系统");
1297 - //directiveService.lineChange(carNext.getClZbh(), carNext.getXlBm(), "套跑@系统"); 1320 + fLog.log("下发线路切换指令", sch.getXlName(), carNext.getXlName());
1298 } 1321 }
1299 }catch (Exception e){logger.error("", e);} 1322 }catch (Exception e){logger.error("", e);}
1300 1323
@@ -1302,6 +1325,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -1302,6 +1325,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1302 dayOfSchedule.reCalcExecPlan(sch.getClZbh()); 1325 dayOfSchedule.reCalcExecPlan(sch.getClZbh());
1303 } else if(StringUtils.isNotEmpty(sch.getZdsjActual()) && StringUtils.isEmpty(zdsjActual)){ 1326 } else if(StringUtils.isNotEmpty(sch.getZdsjActual()) && StringUtils.isEmpty(zdsjActual)){
1304 //清除实达时间 1327 //清除实达时间
  1328 + fLog.log("撤销实达时间", sch.getZdsjActual(), "");
1305 sch.clearZdsjActual(); 1329 sch.clearZdsjActual();
1306 //清除路牌下一班起点到达时间 1330 //清除路牌下一班起点到达时间
1307 ScheduleRealInfo next = dayOfSchedule.nextByLp(sch); 1331 ScheduleRealInfo next = dayOfSchedule.nextByLp(sch);
@@ -1316,7 +1340,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -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,6 +1348,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1324 if (map.get("status") != null 1348 if (map.get("status") != null
1325 && Integer.parseInt(map.get("status").toString()) == -1) { 1349 && Integer.parseInt(map.get("status").toString()) == -1) {
1326 destroy(sch.getId() + "", "", map.get("adjustExps").toString()); 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,9 +1358,12 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1333 if (StringUtils.isNotEmpty(jhlc)) { 1358 if (StringUtils.isNotEmpty(jhlc)) {
1334 double jhlcNum = Double.parseDouble(jhlc); 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 destroy(sch.getId() + "", "", map.get("adjustExps").toString()); 1362 destroy(sch.getId() + "", "", map.get("adjustExps").toString());
  1363 + fLog.log("里程设置为0,自动烂班");
  1364 + }
1338 else if(jhlcNum != sch.getJhlc()){ 1365 else if(jhlcNum != sch.getJhlc()){
  1366 + fLog.log("设置里程", sch.getJhlc(), jhlcNum);
1339 sch.setJhlc(jhlcNum); 1367 sch.setJhlc(jhlcNum);
1340 //临加班次,实际计划一起改 1368 //临加班次,实际计划一起改
1341 if(sch.isSflj()) 1369 if(sch.isSflj())
@@ -1347,7 +1375,8 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -1347,7 +1375,8 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1347 * 修改班次类型 1375 * 修改班次类型
1348 */ 1376 */
1349 String bcType = map.get("bcType"); 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 sch.setBcType(bcType); 1380 sch.setBcType(bcType);
1352 } 1381 }
1353 1382
@@ -1359,6 +1388,9 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -1359,6 +1388,9 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1359 1388
1360 rs.put("status", ResponseCode.SUCCESS); 1389 rs.put("status", ResponseCode.SUCCESS);
1361 rs.put("ts", ts); 1390 rs.put("ts", ts);
  1391 +
  1392 + //日志记录结束
  1393 + fLog.end();
1362 } catch (Exception e) { 1394 } catch (Exception e) {
1363 logger.error("", e); 1395 logger.error("", e);
1364 rs.put("status", ResponseCode.ERROR); 1396 rs.put("status", ResponseCode.ERROR);
@@ -1383,7 +1415,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -1383,7 +1415,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1383 schedule = dayOfSchedule.get(id); 1415 schedule = dayOfSchedule.get(id);
1384 1416
1385 if(schedule != null) 1417 if(schedule != null)
1386 - outgoAdjust(id, null, dfsj, null, "批量调整"); 1418 + outgoAdjust(id, null, dfsj, null, "2");
1387 } 1419 }
1388 1420
1389 rs.put("status", ResponseCode.SUCCESS); 1421 rs.put("status", ResponseCode.SUCCESS);
@@ -3144,7 +3176,6 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -3144,7 +3176,6 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
3144 Set<ScheduleRealInfo> set = new HashSet<>(); 3176 Set<ScheduleRealInfo> set = new HashSet<>();
3145 3177
3146 ScheduleRealInfo sch; 3178 ScheduleRealInfo sch;
3147 - //BiMap<String, String> map = BasicData.deviceId2NbbmMap.inverse();  
3148 3179
3149 String jGh = null,jName,sGh,sName; 3180 String jGh = null,jName,sGh,sName;
3150 for (ChangePersonCar cpc : cpcs) { 3181 for (ChangePersonCar cpc : cpcs) {
@@ -3257,7 +3288,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -3257,7 +3288,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
3257 if (StringUtils.isEmpty(dc.getOld_dfsj()) || StringUtils.isEmpty(dc.getNew_dfsj())) 3288 if (StringUtils.isEmpty(dc.getOld_dfsj()) || StringUtils.isEmpty(dc.getNew_dfsj()))
3258 continue; 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 if (tempMap.get("status").equals(ResponseCode.SUCCESS)) { 3293 if (tempMap.get("status").equals(ResponseCode.SUCCESS)) {
3263 list.addAll((Collection<? extends ScheduleRealInfo>) tempMap.get("ts")); 3294 list.addAll((Collection<? extends ScheduleRealInfo>) tempMap.get("ts"));
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/dftz.html
@@ -9,6 +9,7 @@ @@ -9,6 +9,7 @@
9 9
10 <script id="schedule-dftz-form-temp" type="text/html"> 10 <script id="schedule-dftz-form-temp" type="text/html">
11 <input type="hidden" name="id" value="{{id}}"/> 11 <input type="hidden" name="id" value="{{id}}"/>
  12 + <input type="hidden" name="opType" value="1"/>
12 <div class="uk-grid"> 13 <div class="uk-grid">
13 <div class="uk-width-1-2"> 14 <div class="uk-width-1-2">
14 <div class="uk-form-row"> 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,8 +191,9 @@
191 e.preventDefault(); 191 e.preventDefault();
192 var data = $(this).serializeJSON(); 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 return; 197 return;
197 } 198 }
198 199
src/main/resources/static/real_control_v2/js/line_schedule/dbclick.js
@@ -18,7 +18,8 @@ var gb_schedule_table_dbclick = (function() { @@ -18,7 +18,8 @@ var gb_schedule_table_dbclick = (function() {
18 gb_common.$post('/realSchedule/outgoAdjust', { 18 gb_common.$post('/realSchedule/outgoAdjust', {
19 id: id, 19 id: id,
20 dfsj: val, 20 dfsj: val,
21 - remarks: '' 21 + remarks: '',
  22 + opType: '0'
22 }, function(rs) { 23 }, function(rs) {
23 gb_schedule_table.updateSchedule(rs.ts); 24 gb_schedule_table.updateSchedule(rs.ts);
24 notify_succ('待发调整成功!'); 25 notify_succ('待发调整成功!');