Commit fc5ba155a4473152bb5847dbb5350dace7285bce

Authored by ljq
1 parent 4362cc23

车辆出场异常修复、线调退出异常

src/main/java/com/bsth/controller/zndd/LoggerZnddController.java
@@ -44,4 +44,10 @@ public class LoggerZnddController extends BaseController<LoggerZndd, Integer> { @@ -44,4 +44,10 @@ public class LoggerZnddController extends BaseController<LoggerZndd, Integer> {
44 public ScheduleRealInfo thissch(@PathVariable("id") Integer id){ 44 public ScheduleRealInfo thissch(@PathVariable("id") Integer id){
45 return loggerZnddService.thissch(id); 45 return loggerZnddService.thissch(id);
46 } 46 }
  47 +
  48 + @RequestMapping(value = "LineUserAll", method = RequestMethod.GET)
  49 + public String LineUserAll(@RequestParam Integer userId) {
  50 +
  51 + return loggerZnddService.LineUserAll(userId);
  52 + }
47 } 53 }
src/main/java/com/bsth/data/gpsdata_v2/handlers/StationInsideProcess.java
@@ -5,6 +5,8 @@ import com.bsth.data.gpsdata_v2.cache.GpsCacheData; @@ -5,6 +5,8 @@ import com.bsth.data.gpsdata_v2.cache.GpsCacheData;
5 import com.bsth.data.gpsdata_v2.entity.GpsEntity; 5 import com.bsth.data.gpsdata_v2.entity.GpsEntity;
6 import com.bsth.data.gpsdata_v2.entity.StationRoute; 6 import com.bsth.data.gpsdata_v2.entity.StationRoute;
7 import com.bsth.data.gpsdata_v2.utils.GeoUtils; 7 import com.bsth.data.gpsdata_v2.utils.GeoUtils;
  8 +import com.bsth.data.schedule.DayOfSchedule;
  9 +import org.springframework.beans.factory.annotation.Autowired;
8 import org.springframework.stereotype.Component; 10 import org.springframework.stereotype.Component;
9 11
10 import java.util.List; 12 import java.util.List;
@@ -16,6 +18,9 @@ import java.util.List; @@ -16,6 +18,9 @@ import java.util.List;
16 @Component 18 @Component
17 public class StationInsideProcess { 19 public class StationInsideProcess {
18 20
  21 + @Autowired
  22 + DayOfSchedule dayOfSchedule;
  23 +
19 public void process(GpsEntity gps) { 24 public void process(GpsEntity gps) {
20 //是否在场内 25 //是否在场内
21 String parkCode = GeoUtils.gpsInCarpark(gps); 26 String parkCode = GeoUtils.gpsInCarpark(gps);
@@ -25,7 +30,8 @@ public class StationInsideProcess { @@ -25,7 +30,8 @@ public class StationInsideProcess {
25 gps.setStopNo(parkCode); 30 gps.setStopNo(parkCode);
26 gps.setCarparkNo(parkCode); 31 gps.setCarparkNo(parkCode);
27 } 32 }
28 - 33 + //重新计算车辆执行班次
  34 + dayOfSchedule.reCalcExecPlan(gps.getNbbm());
29 //是否在站内 35 //是否在站内
30 List<StationRoute> srs = GeoCacheData.getStationRoute(gps.getLineId(), gps.getUpDown()); 36 List<StationRoute> srs = GeoCacheData.getStationRoute(gps.getLineId(), gps.getUpDown());
31 StationRoute station = GeoUtils.gpsInStation(gps, srs); 37 StationRoute station = GeoUtils.gpsInStation(gps, srs);
src/main/java/com/bsth/service/schedule/datatools/TTInfoDetailDataToolsImpl.java
@@ -471,8 +471,8 @@ public class TTInfoDetailDataToolsImpl implements DataToolsService, TTInfoDetail @@ -471,8 +471,8 @@ public class TTInfoDetailDataToolsImpl implements DataToolsService, TTInfoDetail
471 // 构造表头 471 // 构造表头
472 excelPoiOperator.createStringCell(wb, lpHeadRow, (short) 0, "路牌", new Color(0x96b9d7)); 472 excelPoiOperator.createStringCell(wb, lpHeadRow, (short) 0, "路牌", new Color(0x96b9d7));
473 473
474 - StationRoute station1 = stationRouteService.findById(lpObjList.get(0).getStationRouteId1());  
475 - StationRoute station2 = stationRouteService.findById(lpObjList.get(1).getStationRouteId2()); 474 + StationRoute station1 = null;
  475 + StationRoute station2 = null;
476 476
477 // TODO 477 // TODO
478 Map<String, Object> param = new HashMap<>(); 478 Map<String, Object> param = new HashMap<>();
@@ -596,8 +596,8 @@ public class TTInfoDetailDataToolsImpl implements DataToolsService, TTInfoDetail @@ -596,8 +596,8 @@ public class TTInfoDetailDataToolsImpl implements DataToolsService, TTInfoDetail
596 excelPoiOperator.createStringCell(wb, lpHeadRow, (short) 2, "出场", new Color(0x96b9d7)); 596 excelPoiOperator.createStringCell(wb, lpHeadRow, (short) 2, "出场", new Color(0x96b9d7));
597 597
598 598
599 - StationRoute station1 = stationRouteService.findById(lpObjList.get(0).getStationRouteId1());  
600 - StationRoute station2 = stationRouteService.findById(lpObjList.get(1).getStationRouteId2()); 599 + StationRoute station1 = null;
  600 + StationRoute station2 = null;
601 601
602 // TODO 602 // TODO
603 Map<String, Object> param = new HashMap<>(); 603 Map<String, Object> param = new HashMap<>();
src/main/java/com/bsth/service/zndd/LoggerZnddService.java
@@ -3,6 +3,7 @@ package com.bsth.service.zndd; @@ -3,6 +3,7 @@ package com.bsth.service.zndd;
3 import com.bsth.entity.realcontrol.ScheduleRealInfo; 3 import com.bsth.entity.realcontrol.ScheduleRealInfo;
4 import com.bsth.entity.zndd.LoggerZndd; 4 import com.bsth.entity.zndd.LoggerZndd;
5 import com.bsth.service.BaseService; 5 import com.bsth.service.BaseService;
  6 +import org.springframework.web.bind.annotation.RequestParam;
6 7
7 import java.util.List; 8 import java.util.List;
8 import java.util.Map; 9 import java.util.Map;
@@ -18,4 +19,6 @@ public interface LoggerZnddService extends BaseService&lt;LoggerZndd, Integer&gt; { @@ -18,4 +19,6 @@ public interface LoggerZnddService extends BaseService&lt;LoggerZndd, Integer&gt; {
18 19
19 20
20 ScheduleRealInfo thissch(Integer ids); 21 ScheduleRealInfo thissch(Integer ids);
  22 +
  23 + String LineUserAll(@RequestParam Integer userId);
21 } 24 }
src/main/java/com/bsth/service/zndd/impl/LoggerZnddServiceImpl.java
@@ -4,19 +4,21 @@ import com.bsth.controller.realcontrol.dto.DfsjChange; @@ -4,19 +4,21 @@ import com.bsth.controller.realcontrol.dto.DfsjChange;
4 import com.bsth.data.schedule.DayOfSchedule; 4 import com.bsth.data.schedule.DayOfSchedule;
5 import com.bsth.data.schedule.ScheduleComparator; 5 import com.bsth.data.schedule.ScheduleComparator;
6 import com.bsth.entity.realcontrol.ScheduleRealInfo; 6 import com.bsth.entity.realcontrol.ScheduleRealInfo;
  7 +import com.bsth.entity.sys.RealControAuthority;
7 import com.bsth.entity.zndd.LoggerZndd; 8 import com.bsth.entity.zndd.LoggerZndd;
8 import com.bsth.repository.realcontrol.ScheduleRealInfoRepository; 9 import com.bsth.repository.realcontrol.ScheduleRealInfoRepository;
9 import com.bsth.repository.zndd.LoggerZnddRepository; 10 import com.bsth.repository.zndd.LoggerZnddRepository;
10 import com.bsth.service.impl.BaseServiceImpl; 11 import com.bsth.service.impl.BaseServiceImpl;
11 import com.bsth.service.realcontrol.ScheduleRealInfoService; 12 import com.bsth.service.realcontrol.ScheduleRealInfoService;
  13 +import com.bsth.service.sys.RealControAuthorityService;
12 import com.bsth.service.zndd.LoggerZnddService; 14 import com.bsth.service.zndd.LoggerZnddService;
13 import org.slf4j.Logger; 15 import org.slf4j.Logger;
14 import org.slf4j.LoggerFactory; 16 import org.slf4j.LoggerFactory;
15 import org.springframework.beans.factory.annotation.Autowired; 17 import org.springframework.beans.factory.annotation.Autowired;
16 -  
17 import org.springframework.data.domain.Sort; 18 import org.springframework.data.domain.Sort;
18 import org.springframework.stereotype.Service; 19 import org.springframework.stereotype.Service;
19 import org.springframework.transaction.annotation.Transactional; 20 import org.springframework.transaction.annotation.Transactional;
  21 +import org.springframework.web.bind.annotation.RequestParam;
20 22
21 import java.text.SimpleDateFormat; 23 import java.text.SimpleDateFormat;
22 import java.time.LocalTime; 24 import java.time.LocalTime;
@@ -35,7 +37,8 @@ public class LoggerZnddServiceImpl extends BaseServiceImpl&lt;LoggerZndd, Integer&gt; @@ -35,7 +37,8 @@ public class LoggerZnddServiceImpl extends BaseServiceImpl&lt;LoggerZndd, Integer&gt;
35 @Autowired 37 @Autowired
36 ScheduleRealInfoRepository scheduleRealInfoRepository; 38 ScheduleRealInfoRepository scheduleRealInfoRepository;
37 39
38 - 40 + @Autowired
  41 + RealControAuthorityService realControAuthorityService;
39 Logger logger = LoggerFactory.getLogger(this.getClass()); 42 Logger logger = LoggerFactory.getLogger(this.getClass());
40 private static SimpleDateFormat sdfMonth = new SimpleDateFormat("HH:mm"); 43 private static SimpleDateFormat sdfMonth = new SimpleDateFormat("HH:mm");
41 private static SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm"); 44 private static SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
@@ -179,4 +182,24 @@ public class LoggerZnddServiceImpl extends BaseServiceImpl&lt;LoggerZndd, Integer&gt; @@ -179,4 +182,24 @@ public class LoggerZnddServiceImpl extends BaseServiceImpl&lt;LoggerZndd, Integer&gt;
179 } 182 }
180 183
181 184
  185 +
  186 + public String LineUserAll(@RequestParam Integer userId){
  187 + String xlNames ="";
  188 + RealControAuthority rcay = realControAuthorityService.findByUserId(userId);
  189 + String lineCodeStr = rcay.getLineCodeStr();
  190 + String[] lineArray = lineCodeStr.split(",");
  191 + for(String line : lineArray){
  192 + List<ScheduleRealInfo> schList = dayOfSchedule.findByLineCode(line);
  193 + for(ScheduleRealInfo sc : schList){
  194 + if (sc.getStatus() == 0){
  195 + xlNames += sc.getXlName()+",";
  196 + break;
  197 + }
  198 + }
  199 + }
  200 + return xlNames;
  201 +
  202 + }
  203 +
  204 +
182 } 205 }
src/main/resources/static/real_control_v2/js/north/toolbar.js
@@ -36,17 +36,26 @@ var gb_northToolbar = (function () { @@ -36,17 +36,26 @@ var gb_northToolbar = (function () {
36 //exit 36 //exit
37 $('.north .north-toolbar .exit-system').on('click', function () { 37 $('.north .north-toolbar .exit-system').on('click', function () {
38 //调度员退出时提示未全部完成班次的线路 38 //调度员退出时提示未全部完成班次的线路
39 - debugger  
40 //默认只取一个角色 39 //默认只取一个角色
41 - /* if(currentUser.currentUser[0].codeName == "BSTH_A"){ 40 + if(user.roles[0].codeName == "LG_DDY" || user.roles[0].codeName == "LG_GLY" || user.roles[0].codeName == "BSTH_A"){
42 //提示未完成线路 搜索该用户下所有的线路 判断是否完成 41 //提示未完成线路 搜索该用户下所有的线路 判断是否完成
  42 + $.get('/logZndd/LineUserAll', {userId: user.id}, function (rs) {
  43 + notify_err(rs+"班次还有未完成");
  44 + layer.confirm('班次还有未完成,是否要退出线调?', {
  45 + btn: ['确定','取消'] //按钮
  46 + }, function(){
  47 + gb_sch_websocket.sock().close(3000, '退出线调');
  48 + window.location.href = '/pages/control/lineallot_v2/iframe_wrap.html';
  49 + }, function(){
  50 + });
43 51
  52 + })
  53 + }else {
  54 + //关闭websocket 连接
  55 + gb_sch_websocket.sock().close(1000, '退出线调');
  56 + window.location.href = '/pages/control/lineallot_v2/iframe_wrap.html';
44 } 57 }
45 -*/  
46 58
47 - //关闭websocket 连接  
48 - gb_sch_websocket.sock().close(1000, '退出线调');  
49 - window.location.href = '/pages/control/lineallot_v2/iframe_wrap.html';  
50 }); 59 });
51 60
52 //过滤菜单 61 //过滤菜单
src/main/resources/static/real_control_v2/js/zndd/data_zndd.js
@@ -88,6 +88,11 @@ var gb_dataZndd = (function (){ @@ -88,6 +88,11 @@ var gb_dataZndd = (function (){
88 if (closetwo) closetwo = false 88 if (closetwo) closetwo = false
89 }); 89 });
90 90
  91 + var modal_opts = {
  92 + center: false,
  93 + bgclose: false
  94 + }
  95 +
91 96
92 //1078路,1135路,南临专线,临港4路,浦东111路,浦东74路,临港13路,申港3路,浦东29路,新芦专线 97 //1078路,1135路,南临专线,临港4路,浦东111路,浦东74路,临港13路,申港3路,浦东29路,新芦专线
93 function ycsf_sx(line){ 98 function ycsf_sx(line){
@@ -110,6 +115,23 @@ var gb_dataZndd = (function (){ @@ -110,6 +115,23 @@ var gb_dataZndd = (function (){
110 } 115 }
111 return false; 116 return false;
112 } 117 }
  118 + //发车信息微调
  119 + $pop.on('click', '.fcxxwts', function () {
  120 + if (close) close = false
  121 + var that = $(this);
  122 + debugger
  123 + var folder = '/real_control_v2/fragments/line_schedule/context_menu';
  124 + let id = that.data('id')
  125 +
  126 + $.post('/logZndd/thissch/'+id, function(res) {
  127 + open_modal(folder + '/fcxxwt.html?r=' + Math.random(), {
  128 + sch: res
  129 + }, modal_opts);
  130 +
  131 + });
  132 +
  133 + });
  134 +
113 135
114 136
115 //撤销实发 137 //撤销实发
src/main/resources/static/real_control_v2/zndd/type/dkl.html
@@ -430,6 +430,9 @@ @@ -430,6 +430,9 @@
430 gb_common.$post('/realSchedule', data, function (rs) { 430 gb_common.$post('/realSchedule', data, function (rs) {
431 notify_succ('新增临加班次成功'); 431 notify_succ('新增临加班次成功');
432 cb && cb(rs); 432 cb && cb(rs);
  433 + var folder = '/real_control_v2/zndd/yanshi';
  434 + open_modal(folder + '/yanshi.html', {
  435 + }, {center: true, bgclose: false, modal: true});
433 }, err); 436 }, err);
434 } 437 }
435 438