Commit bd8ecc8dbcdff513feb4cd11882dcf3f7cdf58a5
Merge branch 'pudong' of 192.168.168.201:panzhaov5/bsth_control into pudong
Showing
23 changed files
with
683 additions
and
74 deletions
src/main/java/com/bsth/XDApplication.java
| @@ -13,6 +13,7 @@ import com.bsth.data.msg_queue.WebSocketPushQueue; | @@ -13,6 +13,7 @@ import com.bsth.data.msg_queue.WebSocketPushQueue; | ||
| 13 | import com.bsth.data.safe_driv.SafeDrivDataLoadThread; | 13 | import com.bsth.data.safe_driv.SafeDrivDataLoadThread; |
| 14 | import com.bsth.data.schedule.DayOfSchedule; | 14 | import com.bsth.data.schedule.DayOfSchedule; |
| 15 | import com.bsth.data.schedule.auto_exec.AutoExecScanThread; | 15 | import com.bsth.data.schedule.auto_exec.AutoExecScanThread; |
| 16 | +import com.bsth.data.schedule.e_state_check.thread.FixedCheckStationCodeThread; | ||
| 16 | import com.bsth.data.schedule.edit_logs.SeiPstThread; | 17 | import com.bsth.data.schedule.edit_logs.SeiPstThread; |
| 17 | import com.bsth.data.schedule.late_adjust.ScheduleLateThread; | 18 | import com.bsth.data.schedule.late_adjust.ScheduleLateThread; |
| 18 | import com.bsth.data.schedule.signal.SchSiginUpdateDBThread; | 19 | import com.bsth.data.schedule.signal.SchSiginUpdateDBThread; |
| @@ -82,6 +83,9 @@ public class XDApplication implements CommandLineRunner { | @@ -82,6 +83,9 @@ public class XDApplication implements CommandLineRunner { | ||
| 82 | @Autowired | 83 | @Autowired |
| 83 | SafeDrivDataLoadThread safeDrivDataLoadThread; | 84 | SafeDrivDataLoadThread safeDrivDataLoadThread; |
| 84 | 85 | ||
| 86 | + @Autowired | ||
| 87 | + FixedCheckStationCodeThread fixedCheckStationCodeThread; | ||
| 88 | + | ||
| 85 | private static long timeDiff; | 89 | private static long timeDiff; |
| 86 | private static long timeDiffTraffic; | 90 | private static long timeDiffTraffic; |
| 87 | 91 | ||
| @@ -128,8 +132,11 @@ public class XDApplication implements CommandLineRunner { | @@ -128,8 +132,11 @@ public class XDApplication implements CommandLineRunner { | ||
| 128 | //sexec.scheduleWithFixedDelay(gpsDataLoader, 60, 4, TimeUnit.SECONDS); | 132 | //sexec.scheduleWithFixedDelay(gpsDataLoader, 60, 4, TimeUnit.SECONDS); |
| 129 | //实际排班更新线程 | 133 | //实际排班更新线程 |
| 130 | //sexec.scheduleWithFixedDelay(scheduleRefreshThread, 15, 240, TimeUnit.SECONDS); | 134 | //sexec.scheduleWithFixedDelay(scheduleRefreshThread, 15, 240, TimeUnit.SECONDS); |
| 135 | + //sexec.scheduleWithFixedDelay(scheduleLateThread, 140, 30, TimeUnit.SECONDS);//检查班次误点 | ||
| 131 | //sexec.scheduleWithFixedDelay(autoExecScanThread, 100, 50, TimeUnit.SECONDS);//班次自动执行 | 136 | //sexec.scheduleWithFixedDelay(autoExecScanThread, 100, 50, TimeUnit.SECONDS);//班次自动执行 |
| 132 | //WebSocketPushQueue.start();//消息队列 -webSocket ,推送至线调web页面的 | 137 | //WebSocketPushQueue.start();//消息队列 -webSocket ,推送至线调web页面的 |
| 138 | + | ||
| 139 | + //sexec.scheduleWithFixedDelay(fixedCheckStationCodeThread, 50, 60 * 5, TimeUnit.SECONDS);//检查班次站点编码 | ||
| 133 | //实际排班延迟入库线程 | 140 | //实际排班延迟入库线程 |
| 134 | //sexec.scheduleWithFixedDelay(schedulePstThread, 60, 15, TimeUnit.SECONDS); | 141 | //sexec.scheduleWithFixedDelay(schedulePstThread, 60, 15, TimeUnit.SECONDS); |
| 135 | //班次修正日志延迟入库 | 142 | //班次修正日志延迟入库 |
| @@ -155,6 +162,7 @@ public class XDApplication implements CommandLineRunner { | @@ -155,6 +162,7 @@ public class XDApplication implements CommandLineRunner { | ||
| 155 | sexec.scheduleWithFixedDelay(scheduleRefreshThread, 10, 120, TimeUnit.SECONDS);//班次更新线程 | 162 | sexec.scheduleWithFixedDelay(scheduleRefreshThread, 10, 120, TimeUnit.SECONDS);//班次更新线程 |
| 156 | sexec.scheduleWithFixedDelay(scheduleLateThread, 140, 30, TimeUnit.SECONDS);//检查班次误点 | 163 | sexec.scheduleWithFixedDelay(scheduleLateThread, 140, 30, TimeUnit.SECONDS);//检查班次误点 |
| 157 | sexec.scheduleWithFixedDelay(gpsDataLoader, 100, 2, TimeUnit.SECONDS);//抓取GPS数据 | 164 | sexec.scheduleWithFixedDelay(gpsDataLoader, 100, 2, TimeUnit.SECONDS);//抓取GPS数据 |
| 165 | + sexec.scheduleWithFixedDelay(fixedCheckStationCodeThread, 60, 60 * 5, TimeUnit.SECONDS);//检查班次站点编码 | ||
| 158 | 166 | ||
| 159 | sexec.scheduleWithFixedDelay(offlineMonitorThread, 120, 60, TimeUnit.SECONDS);//GPS设备掉离线 | 167 | sexec.scheduleWithFixedDelay(offlineMonitorThread, 120, 60, TimeUnit.SECONDS);//GPS设备掉离线 |
| 160 | sexec.scheduleWithFixedDelay(schedulePstThread, 180, 10, TimeUnit.SECONDS);//班次延迟入库线程 | 168 | sexec.scheduleWithFixedDelay(schedulePstThread, 180, 10, TimeUnit.SECONDS);//班次延迟入库线程 |
| @@ -162,7 +170,7 @@ public class XDApplication implements CommandLineRunner { | @@ -162,7 +170,7 @@ public class XDApplication implements CommandLineRunner { | ||
| 162 | sexec.scheduleWithFixedDelay(directivesPstThread, 120, 60, TimeUnit.SECONDS);//调度指令延迟入库 | 170 | sexec.scheduleWithFixedDelay(directivesPstThread, 120, 60, TimeUnit.SECONDS);//调度指令延迟入库 |
| 163 | sexec.scheduleWithFixedDelay(threadMonotor, 240, 60, TimeUnit.SECONDS);//线程监听(防止重要的线程阻塞、异常结束。以及部分主备切换工作) | 171 | sexec.scheduleWithFixedDelay(threadMonotor, 240, 60, TimeUnit.SECONDS);//线程监听(防止重要的线程阻塞、异常结束。以及部分主备切换工作) |
| 164 | sexec.scheduleWithFixedDelay(sampleTimeDataLoader, 140, 120 * 60, TimeUnit.SECONDS);//到离站预测需要的站点间耗时数据 | 172 | sexec.scheduleWithFixedDelay(sampleTimeDataLoader, 140, 120 * 60, TimeUnit.SECONDS);//到离站预测需要的站点间耗时数据 |
| 165 | - sexec.scheduleWithFixedDelay(basicDataLoader, 2, 2, TimeUnit.HOURS);//基础数据更新 | 173 | + sexec.scheduleWithFixedDelay(basicDataLoader, 1, 1, TimeUnit.HOURS);//基础数据更新 |
| 166 | sexec.scheduleWithFixedDelay(autoExecScanThread, 180, 50, TimeUnit.SECONDS);//班次自动执行 | 174 | sexec.scheduleWithFixedDelay(autoExecScanThread, 180, 50, TimeUnit.SECONDS);//班次自动执行 |
| 167 | DirectivePushQueue.start();//消息队列 -指令,系统下发的 | 175 | DirectivePushQueue.start();//消息队列 -指令,系统下发的 |
| 168 | WebSocketPushQueue.start();//消息队列 -webSocket ,推送至线调web页面的 | 176 | WebSocketPushQueue.start();//消息队列 -webSocket ,推送至线调web页面的 |
src/main/java/com/bsth/controller/gps/GpsController.java
| @@ -5,6 +5,8 @@ import com.bsth.data.gpsdata_v2.GpsRealData; | @@ -5,6 +5,8 @@ import com.bsth.data.gpsdata_v2.GpsRealData; | ||
| 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.handlers.overspeed.GpsOverspeed; | 6 | import com.bsth.data.gpsdata_v2.handlers.overspeed.GpsOverspeed; |
| 7 | import com.bsth.data.gpsdata_v2.handlers.overspeed.OverspeedProcess; | 7 | import com.bsth.data.gpsdata_v2.handlers.overspeed.OverspeedProcess; |
| 8 | +import com.bsth.data.schedule.e_state_check.ScheduleStationCodeChecker; | ||
| 9 | +import com.bsth.data.schedule.e_state_check.entity.SCodeInfo; | ||
| 8 | import com.bsth.service.gps.GpsService; | 10 | import com.bsth.service.gps.GpsService; |
| 9 | import com.bsth.service.gps.entity.GpsSpeed; | 11 | import com.bsth.service.gps.entity.GpsSpeed; |
| 10 | import com.google.common.base.Splitter; | 12 | import com.google.common.base.Splitter; |
| @@ -56,8 +58,13 @@ public class GpsController { | @@ -56,8 +58,13 @@ public class GpsController { | ||
| 56 | 58 | ||
| 57 | //超速信息 | 59 | //超速信息 |
| 58 | List<GpsOverspeed> overspeedList = overspeedProcess.findByLines(lineArray); | 60 | List<GpsOverspeed> overspeedList = overspeedProcess.findByLines(lineArray); |
| 61 | + | ||
| 62 | + //班次站点检查信息 | ||
| 63 | + List<SCodeInfo> scis = ScheduleStationCodeChecker.findByLineIdx(lineArray); | ||
| 64 | + | ||
| 59 | rs.put("gpsList", gpsList); | 65 | rs.put("gpsList", gpsList); |
| 60 | rs.put("overspeedList", overspeedList); | 66 | rs.put("overspeedList", overspeedList); |
| 67 | + rs.put("scis", scis); | ||
| 61 | return rs; | 68 | return rs; |
| 62 | } | 69 | } |
| 63 | 70 |
src/main/java/com/bsth/controller/realcontrol/ScheduleRealInfoController.java
| @@ -29,6 +29,11 @@ public class ScheduleRealInfoController extends BaseController<ScheduleRealInfo, | @@ -29,6 +29,11 @@ public class ScheduleRealInfoController extends BaseController<ScheduleRealInfo, | ||
| 29 | @Autowired | 29 | @Autowired |
| 30 | DayOfSchedule dayOfSchedule; | 30 | DayOfSchedule dayOfSchedule; |
| 31 | 31 | ||
| 32 | + @RequestMapping(value = "check_fgs_ascription", method = RequestMethod.POST) | ||
| 33 | + public Map<String, Object> checkPCFgsAscription(@RequestParam Long schId,@RequestParam String jGh, String sGh,@RequestParam String nbbm){ | ||
| 34 | + return scheduleRealInfoService.checkPCFgsAscription(schId, jGh, sGh, nbbm); | ||
| 35 | + } | ||
| 36 | + | ||
| 32 | @RequestMapping(value = "/lines") | 37 | @RequestMapping(value = "/lines") |
| 33 | public Map<String, Collection<ScheduleRealInfo>> findByLines(@RequestParam String lines) { | 38 | public Map<String, Collection<ScheduleRealInfo>> findByLines(@RequestParam String lines) { |
| 34 | return scheduleRealInfoService.findByLines(lines); | 39 | return scheduleRealInfoService.findByLines(lines); |
src/main/java/com/bsth/data/BasicData.java
| @@ -36,6 +36,9 @@ public class BasicData { | @@ -36,6 +36,9 @@ public class BasicData { | ||
| 36 | 36 | ||
| 37 | //车辆自编号和公司代码对照 (K: 车辆自编号 ,V:公司代码) | 37 | //车辆自编号和公司代码对照 (K: 车辆自编号 ,V:公司代码) |
| 38 | public static Map<String, String> nbbm2CompanyCodeMap; | 38 | public static Map<String, String> nbbm2CompanyCodeMap; |
| 39 | + | ||
| 40 | + //车辆自编号和分公司代码对照 (K: 车辆自编号 ,V:公司代码_分公司代码) | ||
| 41 | + public static Map<String, String> nbbm2FgsCompanyCodeMap; | ||
| 39 | 42 | ||
| 40 | //车辆自编号和牌照号对照 (K: 车辆自编号 ,V:牌照号) | 43 | //车辆自编号和牌照号对照 (K: 车辆自编号 ,V:牌照号) |
| 41 | public static Map<String, String> nbbmCompanyPlateMap; | 44 | public static Map<String, String> nbbmCompanyPlateMap; |
| @@ -141,6 +144,7 @@ public class BasicData { | @@ -141,6 +144,7 @@ public class BasicData { | ||
| 141 | */ | 144 | */ |
| 142 | public int loadAllData() { | 145 | public int loadAllData() { |
| 143 | try { | 146 | try { |
| 147 | + logger.info("开始加载基础数据..,"); | ||
| 144 | //设备信息 | 148 | //设备信息 |
| 145 | loadDeviceInfo(); | 149 | loadDeviceInfo(); |
| 146 | //站点信息 | 150 | //站点信息 |
| @@ -154,6 +158,7 @@ public class BasicData { | @@ -154,6 +158,7 @@ public class BasicData { | ||
| 154 | //公司信息 | 158 | //公司信息 |
| 155 | loadBusinessInfo(); | 159 | loadBusinessInfo(); |
| 156 | 160 | ||
| 161 | + logger.info("load geo cache..,"); | ||
| 157 | geoCacheData.loadData(); | 162 | geoCacheData.loadData(); |
| 158 | station2ParkBuffer.saveAll(); | 163 | station2ParkBuffer.saveAll(); |
| 159 | logger.info("加载基础数据成功!,"); | 164 | logger.info("加载基础数据成功!,"); |
| @@ -189,6 +194,8 @@ public class BasicData { | @@ -189,6 +194,8 @@ public class BasicData { | ||
| 189 | BiMap<String, String> deviceId2Nbbm = HashBiMap.create(); | 194 | BiMap<String, String> deviceId2Nbbm = HashBiMap.create(); |
| 190 | //车辆和公司代码对照 | 195 | //车辆和公司代码对照 |
| 191 | Map<String, String> nbbm2CompanyCode = new HashMap<>(); | 196 | Map<String, String> nbbm2CompanyCode = new HashMap<>(); |
| 197 | + //车辆和分公司代码对照 | ||
| 198 | + Map<String, String> nbbm2FgsCompanyCode = new HashMap<>(); | ||
| 192 | 199 | ||
| 193 | //车辆自编号和拍照号对照 | 200 | //车辆自编号和拍照号对照 |
| 194 | Map<String, String> nbbmCompanyPlate = new HashMap<>(); | 201 | Map<String, String> nbbmCompanyPlate = new HashMap<>(); |
| @@ -199,11 +206,13 @@ public class BasicData { | @@ -199,11 +206,13 @@ public class BasicData { | ||
| 199 | car = carIterator.next(); | 206 | car = carIterator.next(); |
| 200 | deviceId2Nbbm.put(car.getEquipmentCode(), car.getInsideCode()); | 207 | deviceId2Nbbm.put(car.getEquipmentCode(), car.getInsideCode()); |
| 201 | nbbm2CompanyCode.put(car.getInsideCode(), car.getBusinessCode()); | 208 | nbbm2CompanyCode.put(car.getInsideCode(), car.getBusinessCode()); |
| 209 | + nbbm2FgsCompanyCode.put(car.getInsideCode(), car.getBusinessCode() + "_" + car.getBrancheCompanyCode()); | ||
| 202 | nbbmCompanyPlate.put(car.getInsideCode(), car.getCarPlate()); | 210 | nbbmCompanyPlate.put(car.getInsideCode(), car.getCarPlate()); |
| 203 | } | 211 | } |
| 204 | 212 | ||
| 205 | deviceId2NbbmMap = deviceId2Nbbm; | 213 | deviceId2NbbmMap = deviceId2Nbbm; |
| 206 | nbbm2CompanyCodeMap = nbbm2CompanyCode; | 214 | nbbm2CompanyCodeMap = nbbm2CompanyCode; |
| 215 | + nbbm2FgsCompanyCodeMap = nbbm2FgsCompanyCode; | ||
| 207 | nbbmCompanyPlateMap =nbbmCompanyPlate; | 216 | nbbmCompanyPlateMap =nbbmCompanyPlate; |
| 208 | } | 217 | } |
| 209 | 218 |
src/main/java/com/bsth/data/schedule/e_state_check/ScheduleStationCodeChecker.java
0 → 100644
| 1 | +package com.bsth.data.schedule.e_state_check; | ||
| 2 | + | ||
| 3 | +import com.bsth.data.schedule.DayOfSchedule; | ||
| 4 | +import com.bsth.data.schedule.e_state_check.entity.SCodeInfo; | ||
| 5 | +import com.bsth.entity.realcontrol.ScheduleRealInfo; | ||
| 6 | +import com.google.common.collect.ArrayListMultimap; | ||
| 7 | +import org.slf4j.Logger; | ||
| 8 | +import org.slf4j.LoggerFactory; | ||
| 9 | +import org.springframework.beans.factory.annotation.Autowired; | ||
| 10 | +import org.springframework.jdbc.core.BeanPropertyRowMapper; | ||
| 11 | +import org.springframework.jdbc.core.JdbcTemplate; | ||
| 12 | +import org.springframework.stereotype.Component; | ||
| 13 | + | ||
| 14 | +import java.util.*; | ||
| 15 | + | ||
| 16 | +/** | ||
| 17 | + * 检查班次站点编码和路由编码是否相符合 | ||
| 18 | + * Created by panzhao on 2018/4/2. | ||
| 19 | + */ | ||
| 20 | +@Component | ||
| 21 | +public class ScheduleStationCodeChecker { | ||
| 22 | + | ||
| 23 | + @Autowired | ||
| 24 | + DayOfSchedule dayOfSchedule; | ||
| 25 | + | ||
| 26 | + private static ArrayListMultimap<String, SCodeInfo> multimap; | ||
| 27 | + | ||
| 28 | + static { | ||
| 29 | + multimap = ArrayListMultimap.create(); | ||
| 30 | + } | ||
| 31 | + | ||
| 32 | + @Autowired | ||
| 33 | + JdbcTemplate jdbcTemplate; | ||
| 34 | + | ||
| 35 | + Logger logger = LoggerFactory.getLogger(this.getClass()); | ||
| 36 | + | ||
| 37 | + public static List<SCodeInfo> findByLineIdx(List<String> lineArray){ | ||
| 38 | + List<SCodeInfo> rs = new ArrayList<>(); | ||
| 39 | + | ||
| 40 | + for(String coed : lineArray){ | ||
| 41 | + rs.addAll(multimap.get(coed)); | ||
| 42 | + } | ||
| 43 | + return rs; | ||
| 44 | + } | ||
| 45 | + | ||
| 46 | + public void checkAll() { | ||
| 47 | + try { | ||
| 48 | + logger.info("start...."); | ||
| 49 | + List<ScheduleRealInfo> all = new ArrayList(dayOfSchedule.findAll()); | ||
| 50 | + | ||
| 51 | + //按线路站点分组数据(上行) | ||
| 52 | + Map<String, ScheduleRealInfo> ups = new HashMap<>(); | ||
| 53 | + //按线路站点分组数据(下行) | ||
| 54 | + Map<String, ScheduleRealInfo> downs = new HashMap(); | ||
| 55 | + | ||
| 56 | + String key; | ||
| 57 | + for (ScheduleRealInfo sch : all) { | ||
| 58 | + if (sch.getBcType().equals("out") | ||
| 59 | + || sch.getBcType().equals("in")) | ||
| 60 | + continue; | ||
| 61 | + key = sch.getXlBm() + "_" + sch.getXlDir() + "_"; | ||
| 62 | + | ||
| 63 | + ups.put(key + sch.getQdzCode(), sch); | ||
| 64 | + downs.put(key + sch.getZdzCode(), sch); | ||
| 65 | + } | ||
| 66 | + | ||
| 67 | + //获取全部实际的站点编码 | ||
| 68 | + Map<String, SCodeInfo> realMap = allRealCodeInfo(); | ||
| 69 | + | ||
| 70 | + List<SCodeInfo> rs = new ArrayList<>(); | ||
| 71 | + rs.addAll(checkCode(ups.values(), realMap, "qd")); | ||
| 72 | + rs.addAll(checkCode(downs.values(), realMap, "zd")); | ||
| 73 | + | ||
| 74 | + //按线路分组 | ||
| 75 | + ArrayListMultimap<String, SCodeInfo> mList = ArrayListMultimap.create(); | ||
| 76 | + for (SCodeInfo sci : rs) { | ||
| 77 | + mList.put(sci.getLineCode(), sci); | ||
| 78 | + } | ||
| 79 | + | ||
| 80 | + multimap = mList; | ||
| 81 | + logger.info("end...."); | ||
| 82 | + } catch (Exception e) { | ||
| 83 | + logger.error("", e); | ||
| 84 | + } | ||
| 85 | + } | ||
| 86 | + | ||
| 87 | + private List<SCodeInfo> checkCode(Collection<ScheduleRealInfo> list, Map<String, SCodeInfo> realMap, String qdOrZd) { | ||
| 88 | + List<SCodeInfo> rs = new ArrayList<>(); | ||
| 89 | + String k; | ||
| 90 | + SCodeInfo sci; | ||
| 91 | + for(ScheduleRealInfo sch : list){ | ||
| 92 | + k = sch.getXlBm() + "_" + sch.getXlDir() + "_"; | ||
| 93 | + | ||
| 94 | + sci = realMap.get(k + getName(sch, qdOrZd));//名称和编码都不存在 | ||
| 95 | + if(null == sci && !realMap.containsKey(k + getCode(sch, qdOrZd))){ | ||
| 96 | + sci = SCodeInfo.getInstance(sch, qdOrZd); | ||
| 97 | + rs.add(sci); | ||
| 98 | + continue; | ||
| 99 | + } | ||
| 100 | + else if(null != sci && !sci.getRealStationCode().equals(getCode(sch, qdOrZd))){//名称一致的站点,编码不一致 | ||
| 101 | + sci.setStationCode(getCode(sch, qdOrZd)); | ||
| 102 | + rs.add(sci); | ||
| 103 | + continue; | ||
| 104 | + } | ||
| 105 | + } | ||
| 106 | + return rs; | ||
| 107 | + } | ||
| 108 | + | ||
| 109 | + private String getName(ScheduleRealInfo sch, String qdOrZd) { | ||
| 110 | + return qdOrZd.equals("qd")?sch.getQdzName():sch.getZdzName(); | ||
| 111 | + } | ||
| 112 | + | ||
| 113 | + private String getCode(ScheduleRealInfo sch, String qdOrZd) { | ||
| 114 | + return qdOrZd.equals("qd")?sch.getQdzCode():sch.getZdzCode(); | ||
| 115 | + } | ||
| 116 | + | ||
| 117 | + | ||
| 118 | + private Map<String, SCodeInfo> allRealCodeInfo() { | ||
| 119 | + String sql = "select line_code,directions as up_down,station_code as real_station_code,station_name from bsth_c_stationroute where line in (select id from bsth_c_line where destroy=0)"; | ||
| 120 | + List<SCodeInfo> realList = jdbcTemplate.query(sql, BeanPropertyRowMapper.newInstance(SCodeInfo.class)); | ||
| 121 | + Map<String, SCodeInfo> realMap = new HashMap<>(); | ||
| 122 | + | ||
| 123 | + for (SCodeInfo sci : realList) { | ||
| 124 | + realMap.put(sci.getLineCode() + "_" + sci.getUpDown() + "_" + sci.getStationName(), sci); | ||
| 125 | + realMap.put(sci.getLineCode() + "_" + sci.getUpDown() + "_" + sci.getStationCode(), sci); | ||
| 126 | + } | ||
| 127 | + | ||
| 128 | + return realMap; | ||
| 129 | + } | ||
| 130 | +} |
src/main/java/com/bsth/data/schedule/e_state_check/entity/SCodeInfo.java
0 → 100644
| 1 | +package com.bsth.data.schedule.e_state_check.entity; | ||
| 2 | + | ||
| 3 | +import com.bsth.entity.realcontrol.ScheduleRealInfo; | ||
| 4 | + | ||
| 5 | +/** | ||
| 6 | + * Created by panzhao on 2018/4/2. | ||
| 7 | + */ | ||
| 8 | +public class SCodeInfo { | ||
| 9 | + | ||
| 10 | + /** | ||
| 11 | + * 线路编码 | ||
| 12 | + */ | ||
| 13 | + private String lineCode; | ||
| 14 | + | ||
| 15 | + /** | ||
| 16 | + * 上下行 | ||
| 17 | + */ | ||
| 18 | + private int upDown; | ||
| 19 | + | ||
| 20 | + /** | ||
| 21 | + * 站点编码 | ||
| 22 | + */ | ||
| 23 | + private String stationCode; | ||
| 24 | + | ||
| 25 | + /** | ||
| 26 | + * 站点名称 | ||
| 27 | + */ | ||
| 28 | + private String stationName; | ||
| 29 | + | ||
| 30 | + /** | ||
| 31 | + * 实际站点编码 | ||
| 32 | + */ | ||
| 33 | + private String realStationCode; | ||
| 34 | + | ||
| 35 | + public String getLineCode() { | ||
| 36 | + return lineCode; | ||
| 37 | + } | ||
| 38 | + | ||
| 39 | + public void setLineCode(String lineCode) { | ||
| 40 | + this.lineCode = lineCode; | ||
| 41 | + } | ||
| 42 | + | ||
| 43 | + public int getUpDown() { | ||
| 44 | + return upDown; | ||
| 45 | + } | ||
| 46 | + | ||
| 47 | + public void setUpDown(int upDown) { | ||
| 48 | + this.upDown = upDown; | ||
| 49 | + } | ||
| 50 | + | ||
| 51 | + public String getStationCode() { | ||
| 52 | + return stationCode; | ||
| 53 | + } | ||
| 54 | + | ||
| 55 | + public void setStationCode(String stationCode) { | ||
| 56 | + this.stationCode = stationCode; | ||
| 57 | + } | ||
| 58 | + | ||
| 59 | + public String getStationName() { | ||
| 60 | + return stationName; | ||
| 61 | + } | ||
| 62 | + | ||
| 63 | + public void setStationName(String stationName) { | ||
| 64 | + this.stationName = stationName; | ||
| 65 | + } | ||
| 66 | + | ||
| 67 | + public String getRealStationCode() { | ||
| 68 | + return realStationCode; | ||
| 69 | + } | ||
| 70 | + | ||
| 71 | + public void setRealStationCode(String realStationCode) { | ||
| 72 | + this.realStationCode = realStationCode; | ||
| 73 | + } | ||
| 74 | + | ||
| 75 | + public static SCodeInfo getUpInstance(ScheduleRealInfo sch) { | ||
| 76 | + SCodeInfo sci = new SCodeInfo(); | ||
| 77 | + sci.setLineCode(sch.getXlBm()); | ||
| 78 | + sci.setUpDown(Integer.parseInt(sch.getXlDir())); | ||
| 79 | + sci.setStationName(sch.getQdzName()); | ||
| 80 | + sci.setStationCode(sch.getQdzCode()); | ||
| 81 | + return sci; | ||
| 82 | + } | ||
| 83 | + | ||
| 84 | + public static SCodeInfo geDownInstance(ScheduleRealInfo sch) { | ||
| 85 | + SCodeInfo sci = new SCodeInfo(); | ||
| 86 | + sci.setLineCode(sch.getXlBm()); | ||
| 87 | + sci.setUpDown(Integer.parseInt(sch.getXlDir())); | ||
| 88 | + sci.setStationName(sch.getZdzName()); | ||
| 89 | + sci.setStationCode(sch.getZdzCode()); | ||
| 90 | + return sci; | ||
| 91 | + } | ||
| 92 | + | ||
| 93 | + public static SCodeInfo getInstance(ScheduleRealInfo sch, String qdOrZd) { | ||
| 94 | + return qdOrZd.equals("qd")?getUpInstance(sch):geDownInstance(sch); | ||
| 95 | + } | ||
| 96 | +} |
src/main/java/com/bsth/data/schedule/e_state_check/thread/FixedCheckStationCodeThread.java
0 → 100644
| 1 | +package com.bsth.data.schedule.e_state_check.thread; | ||
| 2 | + | ||
| 3 | +import com.bsth.data.schedule.e_state_check.ScheduleStationCodeChecker; | ||
| 4 | +import org.slf4j.Logger; | ||
| 5 | +import org.slf4j.LoggerFactory; | ||
| 6 | +import org.springframework.beans.factory.annotation.Autowired; | ||
| 7 | +import org.springframework.stereotype.Component; | ||
| 8 | + | ||
| 9 | +/** | ||
| 10 | + * 定时检查班次站点编码线程 | ||
| 11 | + * Created by panzhao on 2018/4/2. | ||
| 12 | + */ | ||
| 13 | +@Component | ||
| 14 | +public class FixedCheckStationCodeThread extends Thread { | ||
| 15 | + | ||
| 16 | + @Autowired | ||
| 17 | + ScheduleStationCodeChecker scheduleStationCodeChecker; | ||
| 18 | + | ||
| 19 | + Logger logger = LoggerFactory.getLogger(this.getClass()); | ||
| 20 | + | ||
| 21 | + @Override | ||
| 22 | + public void run() { | ||
| 23 | + try { | ||
| 24 | + scheduleStationCodeChecker.checkAll(); | ||
| 25 | + } catch (Exception e) { | ||
| 26 | + logger.error("", e); | ||
| 27 | + } | ||
| 28 | + } | ||
| 29 | +} |
src/main/java/com/bsth/repository/calc/CalcWaybillRepository.java
| @@ -49,4 +49,13 @@ public interface CalcWaybillRepository extends BaseRepository<CalcWaybill, Integ | @@ -49,4 +49,13 @@ public interface CalcWaybillRepository extends BaseRepository<CalcWaybill, Integ | ||
| 49 | @Query("select DISTINCT s from ScheduleRealInfo s where s.scheduleDateStr=?1 and s.xlBm=?2") | 49 | @Query("select DISTINCT s from ScheduleRealInfo s where s.scheduleDateStr=?1 and s.xlBm=?2") |
| 50 | List<ScheduleRealInfo> findAllSchedule(String schDate, String lineCode); | 50 | List<ScheduleRealInfo> findAllSchedule(String schDate, String lineCode); |
| 51 | 51 | ||
| 52 | + /** | ||
| 53 | + * 根据日期获取班次信息 | ||
| 54 | + * @param schDate | ||
| 55 | + * @return | ||
| 56 | + */ | ||
| 57 | + @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH) | ||
| 58 | + @Query("select DISTINCT s from ScheduleRealInfo s where s.scheduleDateStr=?1") | ||
| 59 | + List<ScheduleRealInfo> findAllScheduleByDate(String schDate); | ||
| 60 | + | ||
| 52 | } | 61 | } |
src/main/java/com/bsth/service/calc/CalcToolService.java
| @@ -4,6 +4,7 @@ import java.util.List; | @@ -4,6 +4,7 @@ import java.util.List; | ||
| 4 | import java.util.Map; | 4 | import java.util.Map; |
| 5 | 5 | ||
| 6 | import com.bsth.entity.calc.CalcWaybill; | 6 | import com.bsth.entity.calc.CalcWaybill; |
| 7 | +import com.bsth.entity.realcontrol.ScheduleRealInfo; | ||
| 7 | import com.bsth.entity.sys.Interval; | 8 | import com.bsth.entity.sys.Interval; |
| 8 | 9 | ||
| 9 | /** | 10 | /** |
| @@ -11,6 +12,6 @@ import com.bsth.entity.sys.Interval; | @@ -11,6 +12,6 @@ import com.bsth.entity.sys.Interval; | ||
| 11 | */ | 12 | */ |
| 12 | public interface CalcToolService { | 13 | public interface CalcToolService { |
| 13 | 14 | ||
| 14 | - List<CalcWaybill> findAll(String date, String line, List<Map<String, Object>> xlList, List<Interval> djgList); | 15 | + List<CalcWaybill> findAll(String date, String line, List<ScheduleRealInfo> list, List<Map<String, Object>> xlList, List<Interval> djgList); |
| 15 | 16 | ||
| 16 | } | 17 | } |
src/main/java/com/bsth/service/calc/impl/CalcToolServiceImpl.java
| @@ -5,12 +5,11 @@ import java.sql.SQLException; | @@ -5,12 +5,11 @@ import java.sql.SQLException; | ||
| 5 | import java.util.ArrayList; | 5 | import java.util.ArrayList; |
| 6 | import java.util.Date; | 6 | import java.util.Date; |
| 7 | import java.util.HashMap; | 7 | import java.util.HashMap; |
| 8 | +import java.util.HashSet; | ||
| 8 | import java.util.List; | 9 | import java.util.List; |
| 9 | import java.util.Map; | 10 | import java.util.Map; |
| 10 | import java.util.Set; | 11 | import java.util.Set; |
| 11 | 12 | ||
| 12 | -import javax.swing.text.Keymap; | ||
| 13 | - | ||
| 14 | import com.bsth.entity.calc.CalcInterval; | 13 | import com.bsth.entity.calc.CalcInterval; |
| 15 | import com.bsth.entity.calc.CalcWaybill; | 14 | import com.bsth.entity.calc.CalcWaybill; |
| 16 | import com.bsth.entity.realcontrol.ChildTaskPlan; | 15 | import com.bsth.entity.realcontrol.ChildTaskPlan; |
| @@ -53,26 +52,29 @@ public class CalcToolServiceImpl implements CalcToolService { | @@ -53,26 +52,29 @@ public class CalcToolServiceImpl implements CalcToolService { | ||
| 53 | 52 | ||
| 54 | 53 | ||
| 55 | @Override | 54 | @Override |
| 56 | - public List<CalcWaybill> findAll(String rq, String lineCode, List<Map<String, Object>> xlList, List<Interval> djgList) { | 55 | + public List<CalcWaybill> findAll(String rq, String lineCode, List<ScheduleRealInfo> list, List<Map<String, Object>> xlList, List<Interval> djgList) { |
| 57 | List<CalcWaybill> listCal=new ArrayList<CalcWaybill>(); | 56 | List<CalcWaybill> listCal=new ArrayList<CalcWaybill>(); |
| 58 | - List<ScheduleRealInfo> list = clacRepository.findAllSchedule(rq,lineCode); | ||
| 59 | - String sql ="select r.j_gh ,r.s_gh,r.cl_zbh,r.xl_bm, r.lp_name FROM" | ||
| 60 | - + " bsth_c_s_sp_info_real r where " | ||
| 61 | - + " r.schedule_date_str='"+rq+"' and r.xl_bm = '"+lineCode+"'" | ||
| 62 | - + " GROUP BY r.j_gh,r.s_gh,r.cl_zbh,r.xl_bm,r.lp_name "; | ||
| 63 | - | ||
| 64 | - List<Map<String, String>> listMap = jdbcTemplate.query(sql, new RowMapper<Map<String, String>>() { | ||
| 65 | - @Override | ||
| 66 | - public Map<String, String> mapRow(ResultSet arg0, int arg1) throws SQLException { | ||
| 67 | - Map<String, String> c = new HashMap<String,String>(); | ||
| 68 | - c.put("jGh", arg0.getString("j_gh")); | ||
| 69 | - c.put("sGh", arg0.getString("s_gh")==null?"":arg0.getString("s_gh")); | ||
| 70 | - c.put("clZbh", arg0.getString("cl_zbh")); | ||
| 71 | - c.put("xlBm", arg0.getString("xl_bm")); | ||
| 72 | - c.put("lpName", arg0.getString("lp_name")); | ||
| 73 | - return c; | 57 | + |
| 58 | + List<Map<String, String>> listMap = new ArrayList<Map<String, String>>(); | ||
| 59 | + Set<String> tempSet = new HashSet<String>(); | ||
| 60 | + for(ScheduleRealInfo s : list){ | ||
| 61 | + String jGh = s.getjGh()!=null?s.getjGh().trim():""; | ||
| 62 | + String sGh = s.getsGh()!=null?s.getsGh().trim():""; | ||
| 63 | + String clZbh = s.getClZbh()!=null?s.getClZbh().trim():""; | ||
| 64 | + String xlBm = s.getXlBm()!=null?s.getXlBm().trim():""; | ||
| 65 | + String lpName = s.getLpName()!=null?s.getLpName().trim():""; | ||
| 66 | + String key = jGh + sGh + clZbh + xlBm + lpName; | ||
| 67 | + if(tempSet.add(key)){ | ||
| 68 | + Map<String, String> m = new HashMap<String, String>(); | ||
| 69 | + m.put("jGh", jGh); | ||
| 70 | + m.put("sGh", sGh); | ||
| 71 | + m.put("clZbh", clZbh); | ||
| 72 | + m.put("xlBm", xlBm); | ||
| 73 | + m.put("lpName", lpName); | ||
| 74 | + listMap.add(m); | ||
| 74 | } | 75 | } |
| 75 | - }); | 76 | + } |
| 77 | + | ||
| 76 | for (int i = 0; i < listMap.size(); i++) { | 78 | for (int i = 0; i < listMap.size(); i++) { |
| 77 | Map<String, String> m=listMap.get(i); | 79 | Map<String, String> m=listMap.get(i); |
| 78 | String jGh=m.get("jGh"); | 80 | String jGh=m.get("jGh"); |
| @@ -196,6 +198,7 @@ public class CalcToolServiceImpl implements CalcToolService { | @@ -196,6 +198,7 @@ public class CalcToolServiceImpl implements CalcToolService { | ||
| 196 | //list_ 全部班次 lists_执行了的班次(实到实发不为空) | 198 | //list_ 全部班次 lists_执行了的班次(实到实发不为空) |
| 197 | private List<CalcWaybill> cul(List<ScheduleRealInfo> list_,List<ScheduleRealInfo> list_s, List<Map<String, Object>> xlList, List<Interval> djgList){ | 199 | private List<CalcWaybill> cul(List<ScheduleRealInfo> list_,List<ScheduleRealInfo> list_s, List<Map<String, Object>> xlList, List<Interval> djgList){ |
| 198 | List<CalcWaybill> list=new ArrayList<CalcWaybill>(); | 200 | List<CalcWaybill> list=new ArrayList<CalcWaybill>(); |
| 201 | + List<CalcWaybill> list2=new ArrayList<CalcWaybill>(); | ||
| 199 | if(list_.size()>0){ | 202 | if(list_.size()>0){ |
| 200 | Date date=list_.get(0).getScheduleDate(); | 203 | Date date=list_.get(0).getScheduleDate(); |
| 201 | String dateStr=list_.get(0).getScheduleDateStr(); | 204 | String dateStr=list_.get(0).getScheduleDateStr(); |
| @@ -356,8 +359,28 @@ public class CalcToolServiceImpl implements CalcToolService { | @@ -356,8 +359,28 @@ public class CalcToolServiceImpl implements CalcToolService { | ||
| 356 | t_.setDtbczgf(0); | 359 | t_.setDtbczgf(0); |
| 357 | t_.setDtbcwgf(0); | 360 | t_.setDtbcwgf(0); |
| 358 | list.add(t_); | 361 | list.add(t_); |
| 362 | + list2.add(t_); | ||
| 359 | } | 363 | } |
| 360 | } | 364 | } |
| 365 | + for(CalcWaybill c2 : list2){ | ||
| 366 | + boolean flag = true; | ||
| 367 | + String key2 = c2.getjGh() + c2.getsGh()==null?"":c2.getsGh().trim() | ||
| 368 | + + c2.getCl() + c2.getXl() + c2.getLp(); | ||
| 369 | + for(CalcWaybill c : list){ | ||
| 370 | + String key = c.getjGh() + c.getsGh()==null?"":c.getsGh().trim() | ||
| 371 | + + c.getCl() + c.getXl() + c.getLp(); | ||
| 372 | + if(key2.equals(key)){ | ||
| 373 | + c.setSjyylc(Arith.add(c.getSjyylc(), c2.getSjyylc())); | ||
| 374 | + c.setSjfyylc(Arith.add(c.getSjfyylc(), c2.getSjfyylc())); | ||
| 375 | + c.setLjyylc(Arith.add(c.getLjyylc(), c2.getLjyylc())); | ||
| 376 | + c.setLjfyylc(Arith.add(c.getLjfyylc(), c2.getLjfyylc())); | ||
| 377 | + flag = false; | ||
| 378 | + break; | ||
| 379 | + } | ||
| 380 | + } | ||
| 381 | + if(flag) | ||
| 382 | + list.add(c2); | ||
| 383 | + } | ||
| 361 | return list; | 384 | return list; |
| 362 | } | 385 | } |
| 363 | 386 |
src/main/java/com/bsth/service/calc/impl/CalcWaybillServiceImpl.java
| @@ -33,6 +33,7 @@ import com.bsth.service.calc.CalcWaybillService; | @@ -33,6 +33,7 @@ import com.bsth.service.calc.CalcWaybillService; | ||
| 33 | import com.bsth.service.impl.BaseServiceImpl; | 33 | import com.bsth.service.impl.BaseServiceImpl; |
| 34 | import com.bsth.service.report.CulateMileageService; | 34 | import com.bsth.service.report.CulateMileageService; |
| 35 | import com.bsth.util.Arith; | 35 | import com.bsth.util.Arith; |
| 36 | +import com.bsth.util.BatchSaveUtils; | ||
| 36 | import com.bsth.util.ReportUtils; | 37 | import com.bsth.util.ReportUtils; |
| 37 | import com.github.stuxuhai.jpinyin.PinyinException; | 38 | import com.github.stuxuhai.jpinyin.PinyinException; |
| 38 | import com.github.stuxuhai.jpinyin.PinyinFormat; | 39 | import com.github.stuxuhai.jpinyin.PinyinFormat; |
| @@ -80,7 +81,7 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl<CalcWaybill, Integer | @@ -80,7 +81,7 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl<CalcWaybill, Integer | ||
| 80 | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); | 81 | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
| 81 | if(date == null || date.trim().length() == 0){ | 82 | if(date == null || date.trim().length() == 0){ |
| 82 | Date d = new Date(); | 83 | Date d = new Date(); |
| 83 | - d.setTime(d.getTime() - (2 * 1000 * 60 * 60 * 24)); | 84 | + d.setTime(d.getTime() - (4 * 1000 * 60 * 60 * 24)); |
| 84 | date = sdf.format(d); | 85 | date = sdf.format(d); |
| 85 | } | 86 | } |
| 86 | if(line == null || line.trim().length() == 0){ | 87 | if(line == null || line.trim().length() == 0){ |
| @@ -120,7 +121,7 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl<CalcWaybill, Integer | @@ -120,7 +121,7 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl<CalcWaybill, Integer | ||
| 120 | sql += " and xl_bm = '"+line+"'"; | 121 | sql += " and xl_bm = '"+line+"'"; |
| 121 | // sql += " where t.line_code = " + line; | 122 | // sql += " where t.line_code = " + line; |
| 122 | } | 123 | } |
| 123 | - sql += "group by xl_bm"; | 124 | + sql += " group by xl_bm"; |
| 124 | List<Map<String, Object>> listLineConfig = jdbcTemplate.query(sql, | 125 | List<Map<String, Object>> listLineConfig = jdbcTemplate.query(sql, |
| 125 | new RowMapper<Map<String, Object>>(){ | 126 | new RowMapper<Map<String, Object>>(){ |
| 126 | @Override | 127 | @Override |
| @@ -148,7 +149,7 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl<CalcWaybill, Integer | @@ -148,7 +149,7 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl<CalcWaybill, Integer | ||
| 148 | Map<String, List<Map<String, Object>>> xlMap = new HashMap<String, List<Map<String, Object>>>(); | 149 | Map<String, List<Map<String, Object>>> xlMap = new HashMap<String, List<Map<String, Object>>>(); |
| 149 | for(Map<String, Object> m : xlList){ | 150 | for(Map<String, Object> m : xlList){ |
| 150 | if(m.containsKey("line") && m.get("line").toString().trim().length() > 0){ | 151 | if(m.containsKey("line") && m.get("line").toString().trim().length() > 0){ |
| 151 | - String key = m.get("line").toString(); | 152 | + String key = m.get("line").toString().trim(); |
| 152 | if(!xlMap.containsKey(key)) | 153 | if(!xlMap.containsKey(key)) |
| 153 | xlMap.put(key, new ArrayList<Map<String, Object>>()); | 154 | xlMap.put(key, new ArrayList<Map<String, Object>>()); |
| 154 | xlMap.get(key).add(m); | 155 | xlMap.get(key).add(m); |
| @@ -166,7 +167,18 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl<CalcWaybill, Integer | @@ -166,7 +167,18 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl<CalcWaybill, Integer | ||
| 166 | return m; | 167 | return m; |
| 167 | }}); | 168 | }}); |
| 168 | 169 | ||
| 170 | + Map<String, List<ScheduleRealInfo>> scheMap = new HashMap<String, List<ScheduleRealInfo>>(); | ||
| 171 | + List<ScheduleRealInfo> list = calcRepository.findAllScheduleByDate(date); | ||
| 172 | + for(ScheduleRealInfo s : list){ | ||
| 173 | + String xlBm = s.getXlBm(); | ||
| 174 | + if(!scheMap.containsKey(xlBm)){ | ||
| 175 | + scheMap.put(xlBm, new ArrayList<ScheduleRealInfo>()); | ||
| 176 | + } | ||
| 177 | + scheMap.get(xlBm).add(s); | ||
| 178 | + } | ||
| 179 | + | ||
| 169 | Set<String> lineSet = new HashSet<String>(); | 180 | Set<String> lineSet = new HashSet<String>(); |
| 181 | + List<CalcWaybill> all = new ArrayList<CalcWaybill>(); | ||
| 170 | for (int i = 0; i < listLineConfig.size(); i++) { | 182 | for (int i = 0; i < listLineConfig.size(); i++) { |
| 171 | Map<String, Object> m =listLineConfig.get(i); | 183 | Map<String, Object> m =listLineConfig.get(i); |
| 172 | String lineCode=m.get("line_code").toString().trim(); | 184 | String lineCode=m.get("line_code").toString().trim(); |
| @@ -179,13 +191,14 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl<CalcWaybill, Integer | @@ -179,13 +191,14 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl<CalcWaybill, Integer | ||
| 179 | tempList = xlMap.get(lineCode); | 191 | tempList = xlMap.get(lineCode); |
| 180 | } | 192 | } |
| 181 | 193 | ||
| 182 | - List<CalcWaybill> findAll = calcToolService.findAll(date, lineCode, tempList, djgList); | 194 | + if(!scheMap.containsKey(lineCode)) |
| 195 | + continue; | ||
| 196 | + List<CalcWaybill> findAll = calcToolService.findAll(date, lineCode, scheMap.get(lineCode), tempList, djgList); | ||
| 197 | + all.addAll(findAll); | ||
| 183 | 198 | ||
| 184 | -// new BatchSaveUtils<CalcWaybill>().saveList2(findAll, CalcWaybill.class); | ||
| 185 | - | ||
| 186 | -// if(xlMap.get(lineCode).size() == 0) | ||
| 187 | - calcRepository.save(findAll); | ||
| 188 | } | 199 | } |
| 200 | +// new BatchSaveUtils<CalcWaybill>().saveList2(all, CalcWaybill.class); | ||
| 201 | + calcRepository.save(all); | ||
| 189 | 202 | ||
| 190 | newMap.put("status", ResponseCode.SUCCESS); | 203 | newMap.put("status", ResponseCode.SUCCESS); |
| 191 | } catch (Exception e) { | 204 | } catch (Exception e) { |
| @@ -405,7 +418,7 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl<CalcWaybill, Integer | @@ -405,7 +418,7 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl<CalcWaybill, Integer | ||
| 405 | } | 418 | } |
| 406 | 419 | ||
| 407 | /** | 420 | /** |
| 408 | - * @param rq 格式如:2018-03-22(留空""默认当前日期前一天) | 421 | + * @param rq 格式如:2018-03-22(留空""默认当前日期前两天) |
| 409 | * @param line (留空""默认全部线路) | 422 | * @param line (留空""默认全部线路) |
| 410 | */ | 423 | */ |
| 411 | @Transactional | 424 | @Transactional |
| @@ -419,7 +432,7 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl<CalcWaybill, Integer | @@ -419,7 +432,7 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl<CalcWaybill, Integer | ||
| 419 | Date dBefore = new Date(); | 432 | Date dBefore = new Date(); |
| 420 | Calendar calendar = Calendar.getInstance(); //得到日历 | 433 | Calendar calendar = Calendar.getInstance(); //得到日历 |
| 421 | calendar.setTime(dNow);//把当前时间赋给日历 | 434 | calendar.setTime(dNow);//把当前时间赋给日历 |
| 422 | - calendar.add(Calendar.DAY_OF_MONTH, -1); //设置为前一天 | 435 | + calendar.add(Calendar.DAY_OF_MONTH, -2); //设置为前一天 |
| 423 | dBefore = calendar.getTime(); //得到前一天的时间 | 436 | dBefore = calendar.getTime(); //得到前一天的时间 |
| 424 | rq = sdf.format(dBefore); | 437 | rq = sdf.format(dBefore); |
| 425 | } else { | 438 | } else { |
src/main/java/com/bsth/service/impl/TrafficManageServiceImpl.java
| @@ -527,11 +527,17 @@ public class TrafficManageServiceImpl implements TrafficManageService{ | @@ -527,11 +527,17 @@ public class TrafficManageServiceImpl implements TrafficManageService{ | ||
| 527 | } | 527 | } |
| 528 | e.printStackTrace(); | 528 | e.printStackTrace(); |
| 529 | }finally{ | 529 | }finally{ |
| 530 | - //发送邮件 | ||
| 531 | - EmailBean mail = new EmailBean(); | ||
| 532 | - mail.setSubject("路单日志数据"+date); | ||
| 533 | - mail.setContent(logSuccess+"<br/>成功数:"+countSuccess+"<br/>" +logFailure+"<br/>失败数:"+countFailure); | ||
| 534 | - sendEmailController.sendMail(emailSendToAddress, mail); | 530 | + try { |
| 531 | + //发送邮件 | ||
| 532 | + EmailBean mail = new EmailBean(); | ||
| 533 | + mail.setSubject("路单日志数据"+date); | ||
| 534 | + mail.setContent(logSuccess+"<br/>成功数:"+countSuccess+"<br/>" +logFailure+"<br/>失败数:"+countFailure); | ||
| 535 | + sendEmailController.sendMail(emailSendToAddress, mail); | ||
| 536 | + logger.info("setLD-sendMail:邮件发送成功!"); | ||
| 537 | + }catch (Exception e){ | ||
| 538 | + e.printStackTrace(); | ||
| 539 | + logger.error("setLD-sendMail:",e); | ||
| 540 | + } | ||
| 535 | } | 541 | } |
| 536 | return result; | 542 | return result; |
| 537 | } | 543 | } |
src/main/java/com/bsth/service/realcontrol/ScheduleRealInfoService.java
| @@ -15,6 +15,8 @@ import java.util.Map; | @@ -15,6 +15,8 @@ import java.util.Map; | ||
| 15 | @Service | 15 | @Service |
| 16 | public interface ScheduleRealInfoService extends BaseService<ScheduleRealInfo, Long>{ | 16 | public interface ScheduleRealInfoService extends BaseService<ScheduleRealInfo, Long>{ |
| 17 | 17 | ||
| 18 | + Map<String, Object> checkPCFgsAscription(Long schId, String jsy, String spy, String nbbm); | ||
| 19 | + | ||
| 18 | Map<String, Collection<ScheduleRealInfo>> findByLines(String lines); | 20 | Map<String, Collection<ScheduleRealInfo>> findByLines(String lines); |
| 19 | 21 | ||
| 20 | Map<String, Object> outgoAdjust(Long id, String remarks, String dfsj, String bcType, String opType,String userId); | 22 | Map<String, Object> outgoAdjust(Long id, String remarks, String dfsj, String bcType, String opType,String userId); |
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
| @@ -169,6 +169,85 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -169,6 +169,85 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 169 | 169 | ||
| 170 | 170 | ||
| 171 | /** | 171 | /** |
| 172 | + * 校验人车 和 班次的公司和分公司归属 | ||
| 173 | + * @param schId | ||
| 174 | + * @param jsy | ||
| 175 | + * @param spy | ||
| 176 | + * @param nbbm | ||
| 177 | + * @return | ||
| 178 | + * -2 跨营运公司,校验不过 | ||
| 179 | + * -1 跨分公司,二次确认 | ||
| 180 | + * 1 校验通过 | ||
| 181 | + */ | ||
| 182 | + @Override | ||
| 183 | + public Map<String, Object> checkPCFgsAscription(Long schId, String jGh, String sGh, String nbbm) { | ||
| 184 | + Map<String, Object> rs = new HashMap<>(); | ||
| 185 | + try{ | ||
| 186 | + rs.put("status", ResponseCode.SUCCESS); | ||
| 187 | + rs.put("checkStatus", -2); | ||
| 188 | + | ||
| 189 | + String msg = null; | ||
| 190 | + ScheduleRealInfo sch = dayOfSchedule.get(schId); | ||
| 191 | + String gsbm = sch.getGsBm(), fgsbm = sch.getFgsBm(); | ||
| 192 | + | ||
| 193 | + //校验运营公司 | ||
| 194 | + Personnel jsy = BasicData.perMap.get(gsbm + "-" + jGh); | ||
| 195 | + if(null == jsy){ | ||
| 196 | + msg = "【驾驶员】:" + sch.getGsName() + "暂无工号为" + "【"+jGh+"】的人员"; | ||
| 197 | + rs.put("msg", msg); | ||
| 198 | + return rs; | ||
| 199 | + } | ||
| 200 | + if(!carExist(gsbm, nbbm)){ | ||
| 201 | + msg = sch.getGsName() + "没有自编号为" + "["+nbbm+"]的车辆"; | ||
| 202 | + rs.put("msg", msg); | ||
| 203 | + return rs; | ||
| 204 | + } | ||
| 205 | + | ||
| 206 | + Personnel spy = null; | ||
| 207 | + if(StringUtils.isNotEmpty(sGh)){ | ||
| 208 | + spy = BasicData.perMap.get(gsbm + "-" + sGh); | ||
| 209 | + if(null == spy){ | ||
| 210 | + msg = "【售票员】: " + sch.getGsName() + "暂无工号为" + "【"+sGh+"】的人员"; | ||
| 211 | + rs.put("msg", msg); | ||
| 212 | + return rs; | ||
| 213 | + } | ||
| 214 | + } | ||
| 215 | + | ||
| 216 | + | ||
| 217 | + //校验分公司 | ||
| 218 | + if(null != jsy && !fgsbm.equals(jsy.getBrancheCompanyCode())){ | ||
| 219 | + msg = ("【驾驶员】:" + jGh + "/" + jsy.getPersonnelName() + "是" + jsy.getBrancheCompany() + "的人员"); | ||
| 220 | + rs.put("msg", msg); | ||
| 221 | + rs.put("checkStatus", -1); | ||
| 222 | + return rs; | ||
| 223 | + } | ||
| 224 | + | ||
| 225 | + if(StringUtils.isNotEmpty(sGh)){ | ||
| 226 | + if(null != spy && !fgsbm.equals(spy.getBrancheCompanyCode())){ | ||
| 227 | + msg = ("【售票员】: " + jGh + "/" + spy.getPersonnelName() + "是" + spy.getBrancheCompany() + "的人员"); | ||
| 228 | + rs.put("msg", msg); | ||
| 229 | + rs.put("checkStatus", -1); | ||
| 230 | + return rs; | ||
| 231 | + } | ||
| 232 | + } | ||
| 233 | + | ||
| 234 | + if(!(gsbm + "_" + fgsbm).equals(BasicData.nbbm2FgsCompanyCodeMap.get(nbbm))){ | ||
| 235 | + msg = ("【" + nbbm + "】" + "是" + sch.getFgsName() + "的车辆!"); | ||
| 236 | + rs.put("msg", msg); | ||
| 237 | + rs.put("checkStatus", -1); | ||
| 238 | + return rs; | ||
| 239 | + } | ||
| 240 | + | ||
| 241 | + rs.put("checkStatus", 1); | ||
| 242 | + }catch (Exception e){ | ||
| 243 | + logger.error("", e); | ||
| 244 | + rs.put("status", ResponseCode.ERROR); | ||
| 245 | + } | ||
| 246 | + return rs; | ||
| 247 | + } | ||
| 248 | + | ||
| 249 | + | ||
| 250 | + /** | ||
| 172 | * 车辆是否存在 | 251 | * 车辆是否存在 |
| 173 | * @param gsbm 公司编码 | 252 | * @param gsbm 公司编码 |
| 174 | * @param nbbm 车辆自编号 | 253 | * @param nbbm 车辆自编号 |
src/main/resources/static/real_control_v2/css/main.css
| @@ -2062,4 +2062,18 @@ dl.active > dd.disabled { | @@ -2062,4 +2062,18 @@ dl.active > dd.disabled { | ||
| 2062 | 2062 | ||
| 2063 | .uk-tab>li.uk-active.destroy>a:hover{ | 2063 | .uk-tab>li.uk-active.destroy>a:hover{ |
| 2064 | background: #fff !important; | 2064 | background: #fff !important; |
| 2065 | +} | ||
| 2066 | + | ||
| 2067 | +.warn_multi_station{ | ||
| 2068 | + font-size: 12px; | ||
| 2069 | + margin-left: 40px; | ||
| 2070 | + background: yellow; | ||
| 2071 | + color: #1c1c1c; | ||
| 2072 | + padding: 4px 10px; | ||
| 2073 | + cursor: pointer; | ||
| 2074 | + display: none; | ||
| 2075 | +} | ||
| 2076 | + | ||
| 2077 | +.warn_multi_station:hover{ | ||
| 2078 | + background: #f8f81e; | ||
| 2065 | } | 2079 | } |
| 2066 | \ No newline at end of file | 2080 | \ No newline at end of file |
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/tzrc.html
| @@ -238,14 +238,17 @@ | @@ -238,14 +238,17 @@ | ||
| 238 | }); | 238 | }); |
| 239 | }); | 239 | }); |
| 240 | 240 | ||
| 241 | - gb_common.$post('/realSchedule/multi_tzrc', { | ||
| 242 | - cpcsJson: JSON.stringify(data) | ||
| 243 | - }, function (rs) { | ||
| 244 | - if (rs.ts && rs.ts.length > 0) { | ||
| 245 | - gb_schedule_table.updateSchedule(rs.ts); | ||
| 246 | - UIkit.modal(modal).hide(); | ||
| 247 | - notify_succ('调整人车成功'); | ||
| 248 | - } | 241 | + //提交之前做一次公司校验 |
| 242 | + check_fgs_ascription(data[0], function () { | ||
| 243 | + gb_common.$post('/realSchedule/multi_tzrc', { | ||
| 244 | + cpcsJson: JSON.stringify(data) | ||
| 245 | + }, function (rs) { | ||
| 246 | + if (rs.ts && rs.ts.length > 0) { | ||
| 247 | + gb_schedule_table.updateSchedule(rs.ts); | ||
| 248 | + UIkit.modal(modal).hide(); | ||
| 249 | + notify_succ('调整人车成功'); | ||
| 250 | + } | ||
| 251 | + }); | ||
| 249 | }); | 252 | }); |
| 250 | return false; | 253 | return false; |
| 251 | }); | 254 | }); |
| @@ -281,6 +284,34 @@ | @@ -281,6 +284,34 @@ | ||
| 281 | }); | 284 | }); |
| 282 | }); | 285 | }); |
| 283 | 286 | ||
| 287 | + function check_fgs_ascription(data, cb) { | ||
| 288 | + var jGh = data.jsy.split('/')[0] | ||
| 289 | + ,sGh | ||
| 290 | + ,nbbm = data.clZbh; | ||
| 291 | + if(data.spy) | ||
| 292 | + sGh = data.spy.split('/')[0]; | ||
| 293 | + | ||
| 294 | + gb_common.$post('/realSchedule/check_fgs_ascription',{ | ||
| 295 | + schId: data.schId, | ||
| 296 | + jGh: jGh, | ||
| 297 | + sGh: sGh, | ||
| 298 | + nbbm: nbbm | ||
| 299 | + } | ||
| 300 | + , function (rs) { | ||
| 301 | + $('form.tzrc_form [type=submit]', modal).removeAttr('disabled'); | ||
| 302 | + if(rs['checkStatus']==1) | ||
| 303 | + cb && cb(); | ||
| 304 | + else if (rs['checkStatus']==-2){ | ||
| 305 | + UIkit.modal.alert('<p style="color: #ff4141;font-size: 15px;">'+rs.msg+'</p>', {labels: {Ok: '确定'}}); | ||
| 306 | + return; | ||
| 307 | + } | ||
| 308 | + else if (rs['checkStatus']==-1){ | ||
| 309 | + //二次确认 | ||
| 310 | + alt_confirm('<p style="font-weight: 600;font-size: 15px;">'+rs.msg+'</p>', cb, '我确定要操作!', true); | ||
| 311 | + } | ||
| 312 | + }); | ||
| 313 | + } | ||
| 314 | + | ||
| 284 | function renderCell() { | 315 | function renderCell() { |
| 285 | var jsy = $('input[name=jsy]:enabled', modal).val(); | 316 | var jsy = $('input[name=jsy]:enabled', modal).val(); |
| 286 | var spy = $('input[name=spy]', modal).val(); | 317 | var spy = $('input[name=spy]', modal).val(); |
src/main/resources/static/real_control_v2/fragments/line_schedule/layout.html
| @@ -42,4 +42,18 @@ | @@ -42,4 +42,18 @@ | ||
| 42 | </div> | 42 | </div> |
| 43 | </div> | 43 | </div> |
| 44 | </script> | 44 | </script> |
| 45 | + | ||
| 46 | + <script id="sch-table-m_station_error-temp" type="text/html"> | ||
| 47 | + <div class="tl-tip-panel"> | ||
| 48 | + <ul class="uk-list uk-list-line" style="margin-bottom: 0;"> | ||
| 49 | + {{each list as obj i}} | ||
| 50 | + {{if obj.realStationCode!=null}} | ||
| 51 | + <li>【{{obj.stationName}}】班次编码 <span style="color: red;">{{obj.stationCode}}</span> -实际:{{obj.realStationCode}}</li> | ||
| 52 | + {{else}} | ||
| 53 | + <li>【{{obj.stationName}}】班次编码 <span style="color: red;">{{obj.stationCode}}</span> -在当前线路站点中不存在</li> | ||
| 54 | + {{/if}} | ||
| 55 | + {{/each}} | ||
| 56 | + </ul> | ||
| 57 | + </div> | ||
| 58 | + </script> | ||
| 45 | </div> | 59 | </div> |
src/main/resources/static/real_control_v2/fragments/line_schedule/sch_table.html
| @@ -24,6 +24,7 @@ | @@ -24,6 +24,7 @@ | ||
| 24 | </div> | 24 | </div> |
| 25 | </div> | 25 | </div> |
| 26 | <i class="uk-icon-eye uk-icon-hover ct_eye_icon"></i> | 26 | <i class="uk-icon-eye uk-icon-hover ct_eye_icon"></i> |
| 27 | + <span class="warn_multi_station" data-updown="{{dir}}" data-code="{{line.lineCode}}"></span> | ||
| 27 | <div class="search_sch_panel"> | 28 | <div class="search_sch_panel"> |
| 28 | <form class="uk-form" onsubmit="javascript:return false;"> | 29 | <form class="uk-form" onsubmit="javascript:return false;"> |
| 29 | <div class="uk-autocomplete sch-search-autocom"> | 30 | <div class="uk-autocomplete sch-search-autocom"> |
src/main/resources/static/real_control_v2/fragments/north/nav/line_config/line_config.html
| @@ -94,7 +94,7 @@ | @@ -94,7 +94,7 @@ | ||
| 94 | var loadConfigEntity = function () { | 94 | var loadConfigEntity = function () { |
| 95 | $.get('/real_control_v2/fragments/north/nav/line_config/line_config_entity.html', function (attrDom) { | 95 | $.get('/real_control_v2/fragments/north/nav/line_config/line_config_entity.html', function (attrDom) { |
| 96 | $('.right-container #line_config_entity_panel', modal) | 96 | $('.right-container #line_config_entity_panel', modal) |
| 97 | - .append(attrDom) | 97 | + .html(attrDom) |
| 98 | .find('#line_config_entity_wrap') | 98 | .find('#line_config_entity_wrap') |
| 99 | .trigger('init', {lineConfig: lineConfig}); | 99 | .trigger('init', {lineConfig: lineConfig}); |
| 100 | }); | 100 | }); |
| @@ -104,7 +104,7 @@ | @@ -104,7 +104,7 @@ | ||
| 104 | var loadBufferConfig = function () { | 104 | var loadBufferConfig = function () { |
| 105 | $.get('/real_control_v2/fragments/north/nav/line_config/buffer_config.html', function (attrDom) { | 105 | $.get('/real_control_v2/fragments/north/nav/line_config/buffer_config.html', function (attrDom) { |
| 106 | $('.right-container #buffer_config_panel', modal) | 106 | $('.right-container #buffer_config_panel', modal) |
| 107 | - .append(attrDom) | 107 | + .html(attrDom) |
| 108 | .find('#buffer_config_wrap') | 108 | .find('#buffer_config_wrap') |
| 109 | .trigger('init', {lineConfig: lineConfig}); | 109 | .trigger('init', {lineConfig: lineConfig}); |
| 110 | }); | 110 | }); |
src/main/resources/static/real_control_v2/fragments/north/nav/line_config/line_config_entity.html
| @@ -114,18 +114,19 @@ | @@ -114,18 +114,19 @@ | ||
| 114 | <span>停车场</span> | 114 | <span>停车场</span> |
| 115 | <select class="z-depth-input" name="twinsPark"> | 115 | <select class="z-depth-input" name="twinsPark"> |
| 116 | {{each parks as p i}} | 116 | {{each parks as p i}} |
| 117 | - <option value="{{p.code}}" {{if p.code==conf.twinsPark}}selected{{/if}}>{{p.name}}</option> | 117 | + <option value="{{p.code}}" {{if p.code==cPark}}selected{{/if}}>{{p.name}}</option> |
| 118 | {{/each}} | 118 | {{/each}} |
| 119 | </select> | 119 | </select> |
| 120 | <span> 既是站点</span> | 120 | <span> 既是站点</span> |
| 121 | <select class="z-depth-input" name="twinsStation"> | 121 | <select class="z-depth-input" name="twinsStation"> |
| 122 | {{each routes as r i}} | 122 | {{each routes as r i}} |
| 123 | - <option value="{{r.stationCode}}" {{if r.stationCode==conf.twinsStation}}selected{{/if}}>{{r.stationName}} | 123 | + <option value="{{r.stationCode}}" {{if r.stationCode==cStation}}selected{{/if}}>{{r.stationName}} |
| 124 | </option> | 124 | </option> |
| 125 | {{/each}} | 125 | {{/each}} |
| 126 | </select> | 126 | </select> |
| 127 | - | ||
| 128 | - | 127 | + {{if index>0}} |
| 128 | + <a class="uk-close uk-close-alt"></a> | ||
| 129 | + {{/if}} | ||
| 129 | </div> | 130 | </div> |
| 130 | </script> | 131 | </script> |
| 131 | 132 | ||
| @@ -134,16 +135,17 @@ | @@ -134,16 +135,17 @@ | ||
| 134 | <span>停车场</span> | 135 | <span>停车场</span> |
| 135 | <select class="z-depth-input" name="twinsPark"> | 136 | <select class="z-depth-input" name="twinsPark"> |
| 136 | {{each parks as p i}} | 137 | {{each parks as p i}} |
| 137 | - <option value="{{p.code}}" {{if p.code==conf.twinsPark}}selected{{/if}}>{{p.name}}</option> | 138 | + <option value="{{p.code}}" {{if p.code==cPark}}selected{{/if}}>{{p.name}}</option> |
| 138 | {{/each}} | 139 | {{/each}} |
| 139 | </select> | 140 | </select> |
| 140 | <span> 既是站点</span> | 141 | <span> 既是站点</span> |
| 141 | <select class="z-depth-input" name="twinsStation"> | 142 | <select class="z-depth-input" name="twinsStation"> |
| 142 | {{each routes as r i}} | 143 | {{each routes as r i}} |
| 143 | - <option value="{{r.stationCode}}" {{if r.stationCode==conf.twinsStation}}selected{{/if}}>{{r.stationName}} | 144 | + <option value="{{r.stationCode}}" {{if r.stationCode==cStation}}selected{{/if}}>{{r.stationName}} |
| 144 | </option> | 145 | </option> |
| 145 | {{/each}} | 146 | {{/each}} |
| 146 | </select> | 147 | </select> |
| 148 | + <a class="uk-close uk-close-alt"></a> | ||
| 147 | </div> | 149 | </div> |
| 148 | </script> | 150 | </script> |
| 149 | <script> | 151 | <script> |
| @@ -196,6 +198,10 @@ | @@ -196,6 +198,10 @@ | ||
| 196 | for (var code in rs) { | 198 | for (var code in rs) { |
| 197 | parks.push({code: code, name: rs[code]}); | 199 | parks.push({code: code, name: rs[code]}); |
| 198 | } | 200 | } |
| 201 | + | ||
| 202 | + parks.sort(function (a, b) { | ||
| 203 | + return $.trim(a.name).localeCompare($.trim(b.name), 'zh-CN'); | ||
| 204 | + }); | ||
| 199 | renderPSDom(); | 205 | renderPSDom(); |
| 200 | }); | 206 | }); |
| 201 | //上行站点路由 | 207 | //上行站点路由 |
| @@ -221,14 +227,28 @@ | @@ -221,14 +227,28 @@ | ||
| 221 | }); | 227 | }); |
| 222 | 228 | ||
| 223 | function changeTwinsParkAndStation() { | 229 | function changeTwinsParkAndStation() { |
| 224 | - var park = $('select[name=twinsPark]', wrap).val(); | ||
| 225 | - var station = $('select[name=twinsStation]', wrap).val(); | 230 | + var parks='',stations='' |
| 231 | + ,$panel = $('.park-and-station-wrap', wrap); | ||
| 232 | + | ||
| 233 | + $('select[name=twinsPark]', $panel).each(function () { | ||
| 234 | + parks += ($(this).val() + ','); | ||
| 235 | + }); | ||
| 236 | + | ||
| 237 | + $('select[name=twinsStation]', $panel).each(function () { | ||
| 238 | + stations += ($(this).val() + ','); | ||
| 239 | + }); | ||
| 240 | + | ||
| 241 | + if(parks.length > 0) | ||
| 242 | + parks = parks.substr(0, parks.length - 1); | ||
| 243 | + if(stations.length > 0) | ||
| 244 | + stations = stations.substr(0, stations.length - 1); | ||
| 245 | + | ||
| 226 | gb_common.$post('/lineConfig/parkAndStationSet', { | 246 | gb_common.$post('/lineConfig/parkAndStationSet', { |
| 227 | lineCode: conf.line.lineCode, | 247 | lineCode: conf.line.lineCode, |
| 228 | - twinsPark: park, | ||
| 229 | - twinsStation: station | 248 | + twinsPark: parks, |
| 249 | + twinsStation: stations | ||
| 230 | }, function (rs) { | 250 | }, function (rs) { |
| 231 | - notify_succ('设置成功!!'); | 251 | + notify_succ('已保存!!'); |
| 232 | conf = rs.conf; | 252 | conf = rs.conf; |
| 233 | }); | 253 | }); |
| 234 | } | 254 | } |
| @@ -261,10 +281,15 @@ | @@ -261,10 +281,15 @@ | ||
| 261 | var data = {lineCode: lineCode, type: type, parkCode: '', stationCode: ''}; | 281 | var data = {lineCode: lineCode, type: type, parkCode: '', stationCode: ''}; |
| 262 | //出站既是出场 | 282 | //出站既是出场 |
| 263 | if (type == 2) { | 283 | if (type == 2) { |
| 264 | - //默认关联 线路标准停车场 | ||
| 265 | - data.parkCode = gb_data_basic.getLineInformation(lineCode).carPark; | ||
| 266 | - //和上行起点站 | ||
| 267 | - data.stationCode = upStationRoutes[0].stationCode; | 284 | + //如果配置上有信息 |
| 285 | + if(conf.twinsParks){ | ||
| 286 | + data.parkCode = conf.twinsParks; | ||
| 287 | + data.stationCode = conf.twinsStations; | ||
| 288 | + } | ||
| 289 | + else{ | ||
| 290 | + data.parkCode = gb_data_basic.getLineInformation(lineCode).carPark;//默认关联 线路标准停车场 | ||
| 291 | + data.stationCode = upStationRoutes[0].stationCode;//和上行起点站 | ||
| 292 | + } | ||
| 268 | } | 293 | } |
| 269 | gb_common.$post('/lineConfig/editOutTimeType', data, function (rs) { | 294 | gb_common.$post('/lineConfig/editOutTimeType', data, function (rs) { |
| 270 | notify_succ('调整出场时间类型成功!'); | 295 | notify_succ('调整出场时间类型成功!'); |
| @@ -292,22 +317,36 @@ | @@ -292,22 +317,36 @@ | ||
| 292 | * 渲染场既是站dom | 317 | * 渲染场既是站dom |
| 293 | */ | 318 | */ |
| 294 | function renderPSDom() { | 319 | function renderPSDom() { |
| 320 | + $('.c_2_s_list', $panel).html(''); | ||
| 321 | + var pArray = conf.twinsParks.split(','), | ||
| 322 | + cArray = conf.twinsStations.split(','); | ||
| 295 | var htmlStr = '', | 323 | var htmlStr = '', |
| 296 | $panel = $('.park-and-station-wrap', wrap); | 324 | $panel = $('.park-and-station-wrap', wrap); |
| 297 | - if (conf['outConfig'] == 2) { | 325 | + |
| 326 | + if(conf['outConfig']!=2){ | ||
| 327 | + $panel.hide().find('.c_2_s_list').empty(); | ||
| 328 | + return; | ||
| 329 | + } | ||
| 330 | + | ||
| 331 | + if(!conf.twinsParks) | ||
| 332 | + return; | ||
| 333 | + | ||
| 334 | + for(var i=0,len=pArray.length; i<len; i++){ | ||
| 298 | htmlStr = template('park-and-station-temp', { | 335 | htmlStr = template('park-and-station-temp', { |
| 299 | parks: parks, | 336 | parks: parks, |
| 300 | conf: conf, | 337 | conf: conf, |
| 338 | + cPark: pArray[i], | ||
| 339 | + cStation: cArray[i], | ||
| 340 | + index: i, | ||
| 301 | routes: [upStationRoutes[0], upStationRoutes[upStationRoutes.length - 1]] | 341 | routes: [upStationRoutes[0], upStationRoutes[upStationRoutes.length - 1]] |
| 302 | }); | 342 | }); |
| 303 | - $panel.show().find('.c_2_s_list').html(htmlStr); | 343 | + $('.c_2_s_list', $panel).append(htmlStr); |
| 304 | } | 344 | } |
| 305 | - else | ||
| 306 | - $panel.hide().find('.c_2_s_list').empty(); | 345 | + $panel.show(); |
| 307 | 346 | ||
| 308 | //切换场既是站的,停车场和站点 | 347 | //切换场既是站的,停车场和站点 |
| 309 | - $('select[name=twinsPark]', wrap).on('change', changeTwinsParkAndStation); | ||
| 310 | - $('select[name=twinsStation]', wrap).on('change', changeTwinsParkAndStation); | 348 | + //$('select[name=twinsPark]', wrap).on('change', changeTwinsParkAndStation); |
| 349 | + //$('select[name=twinsStation]', wrap).on('change', changeTwinsParkAndStation); | ||
| 311 | } | 350 | } |
| 312 | 351 | ||
| 313 | /** | 352 | /** |
| @@ -352,20 +391,35 @@ | @@ -352,20 +391,35 @@ | ||
| 352 | */ | 391 | */ |
| 353 | $(wrap).on('click', '.add_btn_span', function () { | 392 | $(wrap).on('click', '.add_btn_span', function () { |
| 354 | var htmlStr = '', | 393 | var htmlStr = '', |
| 355 | - $panel = $('.park-and-station-2-wrap', wrap); | 394 | + $panel = $('.park-and-station-wrap', wrap); |
| 395 | + | ||
| 396 | + var $lastItem = $('.c_2_s_list>.item:last', $panel) | ||
| 397 | + ,lastTcc = $('select[name=twinsPark]', $lastItem).val() | ||
| 398 | + ,lastStation = $('select[name=twinsStation]', $lastItem).val(); | ||
| 399 | + | ||
| 356 | if (conf['outConfig'] == 2) { | 400 | if (conf['outConfig'] == 2) { |
| 357 | - htmlStr = template('park-and-station-temp', { | 401 | + htmlStr = template('park-and-station-2-temp', { |
| 358 | parks: parks, | 402 | parks: parks, |
| 359 | conf: conf, | 403 | conf: conf, |
| 404 | + cPark: lastTcc, | ||
| 405 | + cStation: lastStation, | ||
| 360 | routes: [upStationRoutes[0], upStationRoutes[upStationRoutes.length - 1]] | 406 | routes: [upStationRoutes[0], upStationRoutes[upStationRoutes.length - 1]] |
| 361 | }); | 407 | }); |
| 362 | $('.c_2_s_list', $panel).append(htmlStr); | 408 | $('.c_2_s_list', $panel).append(htmlStr); |
| 363 | } | 409 | } |
| 410 | + }); | ||
| 364 | 411 | ||
| 365 | - //切换场既是站的,停车场和站点 | ||
| 366 | - //$('select[name=twinsPark]', wrap).on('change', changeTwinsParkAndStation); | ||
| 367 | - //$('select[name=twinsStation]', wrap).on('change', changeTwinsParkAndStation); | 412 | + /** |
| 413 | + * 删除 场既是站 项目 | ||
| 414 | + */ | ||
| 415 | + $(wrap).on('click', '.c_2_s_list .item .uk-close', function () { | ||
| 416 | + $(this).parents('.item').remove(); | ||
| 417 | + changeTwinsParkAndStation(); | ||
| 368 | }); | 418 | }); |
| 419 | + | ||
| 420 | + | ||
| 421 | + $(wrap).on('change', 'select[name=twinsPark]', changeTwinsParkAndStation); | ||
| 422 | + $(wrap).on('change', 'select[name=twinsStation]', changeTwinsParkAndStation); | ||
| 369 | })(); | 423 | })(); |
| 370 | </script> | 424 | </script> |
| 371 | </div> | 425 | </div> |
| 372 | \ No newline at end of file | 426 | \ No newline at end of file |
src/main/resources/static/real_control_v2/js/data/data_gps.js
| @@ -72,6 +72,10 @@ var gb_data_gps = (function () { | @@ -72,6 +72,10 @@ var gb_data_gps = (function () { | ||
| 72 | cb(addArr, upArr, upDownChange, rs.overspeedList); | 72 | cb(addArr, upArr, upDownChange, rs.overspeedList); |
| 73 | }); | 73 | }); |
| 74 | 74 | ||
| 75 | + //班次站点编码检查信息 | ||
| 76 | + if(rs['scis'] && rs['scis'].length > 0) | ||
| 77 | + gb_schedule_table.putSCodeErrorInfo(rs['scis']); | ||
| 78 | + | ||
| 75 | //超速数据回调 | 79 | //超速数据回调 |
| 76 | //console.log('超速,,,', rs.overspeedList); | 80 | //console.log('超速,,,', rs.overspeedList); |
| 77 | 81 |
src/main/resources/static/real_control_v2/js/line_schedule/layout.js
| @@ -52,6 +52,44 @@ var gb_line_layout = (function() { | @@ -52,6 +52,44 @@ var gb_line_layout = (function() { | ||
| 52 | }); | 52 | }); |
| 53 | }); | 53 | }); |
| 54 | 54 | ||
| 55 | + //站点编码不符 tootip | ||
| 56 | + $(document).on('mouseenter', '.schedule-wrap .header-title span.warn_multi_station', function() { | ||
| 57 | + $(this).qtip({ | ||
| 58 | + show: { | ||
| 59 | + ready: true, | ||
| 60 | + delay: 300 | ||
| 61 | + }, | ||
| 62 | + content: { | ||
| 63 | + text: function() { | ||
| 64 | + var lineCode = $(this).data('code') | ||
| 65 | + ,updown = $(this).data('updown') | ||
| 66 | + ,list = gb_schedule_table.findSCodeErrorInfo(lineCode, updown); | ||
| 67 | + //console.log('this', this); | ||
| 68 | + //var data = gb_schedule_table.findSCodeErrorInfo(); | ||
| 69 | + return temps['sch-table-m_station_error-temp']({list: list}); | ||
| 70 | + } | ||
| 71 | + }, | ||
| 72 | + position: { | ||
| 73 | + viewport: $(window), | ||
| 74 | + my: 'top left', | ||
| 75 | + at: 'bottom center' | ||
| 76 | + }, | ||
| 77 | + style: { | ||
| 78 | + classes: 'qtip-rounded qtip-shadow sch-tl-tip' | ||
| 79 | + }, | ||
| 80 | + hide: { | ||
| 81 | + fixed: true, | ||
| 82 | + delay: 300 | ||
| 83 | + }, | ||
| 84 | + events: { | ||
| 85 | + hidden: function(event, api) { | ||
| 86 | + //destroy dom | ||
| 87 | + $(this).qtip('destroy', true); | ||
| 88 | + } | ||
| 89 | + } | ||
| 90 | + }); | ||
| 91 | + }); | ||
| 92 | + | ||
| 55 | return { | 93 | return { |
| 56 | layout: layout | 94 | layout: layout |
| 57 | }; | 95 | }; |
src/main/resources/static/real_control_v2/js/line_schedule/sch_table.js
| @@ -7,6 +7,8 @@ var gb_schedule_table = (function () { | @@ -7,6 +7,8 @@ var gb_schedule_table = (function () { | ||
| 7 | var line2Schedule = {}; | 7 | var line2Schedule = {}; |
| 8 | //车辆应发未发车辆数 | 8 | //车辆应发未发车辆数 |
| 9 | var car_yfwf_map = {}; | 9 | var car_yfwf_map = {}; |
| 10 | + //班次站点编码和实际不符数据 | ||
| 11 | + var errorCodeData = {}; | ||
| 10 | 12 | ||
| 11 | var bcTypeOrderMap = { | 13 | var bcTypeOrderMap = { |
| 12 | 'out':0, | 14 | 'out':0, |
| @@ -812,6 +814,38 @@ var gb_schedule_table = (function () { | @@ -812,6 +814,38 @@ var gb_schedule_table = (function () { | ||
| 812 | console.log(e); | 814 | console.log(e); |
| 813 | } | 815 | } |
| 814 | }; | 816 | }; |
| 817 | + | ||
| 818 | + /** | ||
| 819 | + * 班次站点编码异常信息 | ||
| 820 | + * @param list | ||
| 821 | + */ | ||
| 822 | + var putSCodeErrorInfo = function (list) { | ||
| 823 | + //按线路走向分组 | ||
| 824 | + var data = {}; | ||
| 825 | + var k; | ||
| 826 | + for(var i=0,obj;obj=list[i++];){ | ||
| 827 | + k = obj.lineCode+'_'+obj.upDown; | ||
| 828 | + if(!data[k]) | ||
| 829 | + data[k] = []; | ||
| 830 | + data[k].push(obj); | ||
| 831 | + } | ||
| 832 | + | ||
| 833 | + var wrap; | ||
| 834 | + for(var k in data){ | ||
| 835 | + wrap = $('.line_schedule[data-id=' + (k.split('_')[0]) + ']'); | ||
| 836 | + if(wrap.length==0) | ||
| 837 | + continue; | ||
| 838 | + | ||
| 839 | + $('.schedule-wrap span.warn_multi_station', wrap) | ||
| 840 | + .html('班次站点编码与实际不符!!!').show(); | ||
| 841 | + } | ||
| 842 | + | ||
| 843 | + errorCodeData = data; | ||
| 844 | + }; | ||
| 845 | + | ||
| 846 | + var findSCodeErrorInfo = function (lineCode, upDown) { | ||
| 847 | + return errorCodeData[lineCode+'_'+upDown]; | ||
| 848 | + }; | ||
| 815 | 849 | ||
| 816 | return { | 850 | return { |
| 817 | show: show, | 851 | show: show, |
| @@ -837,6 +871,8 @@ var gb_schedule_table = (function () { | @@ -837,6 +871,8 @@ var gb_schedule_table = (function () { | ||
| 837 | getNextNormalSch: getNextNormalSch, | 871 | getNextNormalSch: getNextNormalSch, |
| 838 | findNbbmByLineCode:findNbbmByLineCode, | 872 | findNbbmByLineCode:findNbbmByLineCode, |
| 839 | showLpMileageTipBySch: showLpMileageTipBySch, | 873 | showLpMileageTipBySch: showLpMileageTipBySch, |
| 840 | - renderCarRemark: renderCarRemark | 874 | + renderCarRemark: renderCarRemark, |
| 875 | + putSCodeErrorInfo: putSCodeErrorInfo, | ||
| 876 | + findSCodeErrorInfo: findSCodeErrorInfo | ||
| 841 | }; | 877 | }; |
| 842 | })(); | 878 | })(); |