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 | 13 | import com.bsth.data.safe_driv.SafeDrivDataLoadThread; |
| 14 | 14 | import com.bsth.data.schedule.DayOfSchedule; |
| 15 | 15 | import com.bsth.data.schedule.auto_exec.AutoExecScanThread; |
| 16 | +import com.bsth.data.schedule.e_state_check.thread.FixedCheckStationCodeThread; | |
| 16 | 17 | import com.bsth.data.schedule.edit_logs.SeiPstThread; |
| 17 | 18 | import com.bsth.data.schedule.late_adjust.ScheduleLateThread; |
| 18 | 19 | import com.bsth.data.schedule.signal.SchSiginUpdateDBThread; |
| ... | ... | @@ -82,6 +83,9 @@ public class XDApplication implements CommandLineRunner { |
| 82 | 83 | @Autowired |
| 83 | 84 | SafeDrivDataLoadThread safeDrivDataLoadThread; |
| 84 | 85 | |
| 86 | + @Autowired | |
| 87 | + FixedCheckStationCodeThread fixedCheckStationCodeThread; | |
| 88 | + | |
| 85 | 89 | private static long timeDiff; |
| 86 | 90 | private static long timeDiffTraffic; |
| 87 | 91 | |
| ... | ... | @@ -128,8 +132,11 @@ public class XDApplication implements CommandLineRunner { |
| 128 | 132 | //sexec.scheduleWithFixedDelay(gpsDataLoader, 60, 4, TimeUnit.SECONDS); |
| 129 | 133 | //实际排班更新线程 |
| 130 | 134 | //sexec.scheduleWithFixedDelay(scheduleRefreshThread, 15, 240, TimeUnit.SECONDS); |
| 135 | + //sexec.scheduleWithFixedDelay(scheduleLateThread, 140, 30, TimeUnit.SECONDS);//检查班次误点 | |
| 131 | 136 | //sexec.scheduleWithFixedDelay(autoExecScanThread, 100, 50, TimeUnit.SECONDS);//班次自动执行 |
| 132 | 137 | //WebSocketPushQueue.start();//消息队列 -webSocket ,推送至线调web页面的 |
| 138 | + | |
| 139 | + //sexec.scheduleWithFixedDelay(fixedCheckStationCodeThread, 50, 60 * 5, TimeUnit.SECONDS);//检查班次站点编码 | |
| 133 | 140 | //实际排班延迟入库线程 |
| 134 | 141 | //sexec.scheduleWithFixedDelay(schedulePstThread, 60, 15, TimeUnit.SECONDS); |
| 135 | 142 | //班次修正日志延迟入库 |
| ... | ... | @@ -155,6 +162,7 @@ public class XDApplication implements CommandLineRunner { |
| 155 | 162 | sexec.scheduleWithFixedDelay(scheduleRefreshThread, 10, 120, TimeUnit.SECONDS);//班次更新线程 |
| 156 | 163 | sexec.scheduleWithFixedDelay(scheduleLateThread, 140, 30, TimeUnit.SECONDS);//检查班次误点 |
| 157 | 164 | sexec.scheduleWithFixedDelay(gpsDataLoader, 100, 2, TimeUnit.SECONDS);//抓取GPS数据 |
| 165 | + sexec.scheduleWithFixedDelay(fixedCheckStationCodeThread, 60, 60 * 5, TimeUnit.SECONDS);//检查班次站点编码 | |
| 158 | 166 | |
| 159 | 167 | sexec.scheduleWithFixedDelay(offlineMonitorThread, 120, 60, TimeUnit.SECONDS);//GPS设备掉离线 |
| 160 | 168 | sexec.scheduleWithFixedDelay(schedulePstThread, 180, 10, TimeUnit.SECONDS);//班次延迟入库线程 |
| ... | ... | @@ -162,7 +170,7 @@ public class XDApplication implements CommandLineRunner { |
| 162 | 170 | sexec.scheduleWithFixedDelay(directivesPstThread, 120, 60, TimeUnit.SECONDS);//调度指令延迟入库 |
| 163 | 171 | sexec.scheduleWithFixedDelay(threadMonotor, 240, 60, TimeUnit.SECONDS);//线程监听(防止重要的线程阻塞、异常结束。以及部分主备切换工作) |
| 164 | 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 | 174 | sexec.scheduleWithFixedDelay(autoExecScanThread, 180, 50, TimeUnit.SECONDS);//班次自动执行 |
| 167 | 175 | DirectivePushQueue.start();//消息队列 -指令,系统下发的 |
| 168 | 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 | 5 | import com.bsth.data.gpsdata_v2.entity.GpsEntity; |
| 6 | 6 | import com.bsth.data.gpsdata_v2.handlers.overspeed.GpsOverspeed; |
| 7 | 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 | 10 | import com.bsth.service.gps.GpsService; |
| 9 | 11 | import com.bsth.service.gps.entity.GpsSpeed; |
| 10 | 12 | import com.google.common.base.Splitter; |
| ... | ... | @@ -56,8 +58,13 @@ public class GpsController { |
| 56 | 58 | |
| 57 | 59 | //超速信息 |
| 58 | 60 | List<GpsOverspeed> overspeedList = overspeedProcess.findByLines(lineArray); |
| 61 | + | |
| 62 | + //班次站点检查信息 | |
| 63 | + List<SCodeInfo> scis = ScheduleStationCodeChecker.findByLineIdx(lineArray); | |
| 64 | + | |
| 59 | 65 | rs.put("gpsList", gpsList); |
| 60 | 66 | rs.put("overspeedList", overspeedList); |
| 67 | + rs.put("scis", scis); | |
| 61 | 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 | 29 | @Autowired |
| 30 | 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 | 37 | @RequestMapping(value = "/lines") |
| 33 | 38 | public Map<String, Collection<ScheduleRealInfo>> findByLines(@RequestParam String lines) { |
| 34 | 39 | return scheduleRealInfoService.findByLines(lines); | ... | ... |
src/main/java/com/bsth/data/BasicData.java
| ... | ... | @@ -36,6 +36,9 @@ public class BasicData { |
| 36 | 36 | |
| 37 | 37 | //车辆自编号和公司代码对照 (K: 车辆自编号 ,V:公司代码) |
| 38 | 38 | public static Map<String, String> nbbm2CompanyCodeMap; |
| 39 | + | |
| 40 | + //车辆自编号和分公司代码对照 (K: 车辆自编号 ,V:公司代码_分公司代码) | |
| 41 | + public static Map<String, String> nbbm2FgsCompanyCodeMap; | |
| 39 | 42 | |
| 40 | 43 | //车辆自编号和牌照号对照 (K: 车辆自编号 ,V:牌照号) |
| 41 | 44 | public static Map<String, String> nbbmCompanyPlateMap; |
| ... | ... | @@ -141,6 +144,7 @@ public class BasicData { |
| 141 | 144 | */ |
| 142 | 145 | public int loadAllData() { |
| 143 | 146 | try { |
| 147 | + logger.info("开始加载基础数据..,"); | |
| 144 | 148 | //设备信息 |
| 145 | 149 | loadDeviceInfo(); |
| 146 | 150 | //站点信息 |
| ... | ... | @@ -154,6 +158,7 @@ public class BasicData { |
| 154 | 158 | //公司信息 |
| 155 | 159 | loadBusinessInfo(); |
| 156 | 160 | |
| 161 | + logger.info("load geo cache..,"); | |
| 157 | 162 | geoCacheData.loadData(); |
| 158 | 163 | station2ParkBuffer.saveAll(); |
| 159 | 164 | logger.info("加载基础数据成功!,"); |
| ... | ... | @@ -189,6 +194,8 @@ public class BasicData { |
| 189 | 194 | BiMap<String, String> deviceId2Nbbm = HashBiMap.create(); |
| 190 | 195 | //车辆和公司代码对照 |
| 191 | 196 | Map<String, String> nbbm2CompanyCode = new HashMap<>(); |
| 197 | + //车辆和分公司代码对照 | |
| 198 | + Map<String, String> nbbm2FgsCompanyCode = new HashMap<>(); | |
| 192 | 199 | |
| 193 | 200 | //车辆自编号和拍照号对照 |
| 194 | 201 | Map<String, String> nbbmCompanyPlate = new HashMap<>(); |
| ... | ... | @@ -199,11 +206,13 @@ public class BasicData { |
| 199 | 206 | car = carIterator.next(); |
| 200 | 207 | deviceId2Nbbm.put(car.getEquipmentCode(), car.getInsideCode()); |
| 201 | 208 | nbbm2CompanyCode.put(car.getInsideCode(), car.getBusinessCode()); |
| 209 | + nbbm2FgsCompanyCode.put(car.getInsideCode(), car.getBusinessCode() + "_" + car.getBrancheCompanyCode()); | |
| 202 | 210 | nbbmCompanyPlate.put(car.getInsideCode(), car.getCarPlate()); |
| 203 | 211 | } |
| 204 | 212 | |
| 205 | 213 | deviceId2NbbmMap = deviceId2Nbbm; |
| 206 | 214 | nbbm2CompanyCodeMap = nbbm2CompanyCode; |
| 215 | + nbbm2FgsCompanyCodeMap = nbbm2FgsCompanyCode; | |
| 207 | 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 | 49 | @Query("select DISTINCT s from ScheduleRealInfo s where s.scheduleDateStr=?1 and s.xlBm=?2") |
| 50 | 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 | 4 | import java.util.Map; |
| 5 | 5 | |
| 6 | 6 | import com.bsth.entity.calc.CalcWaybill; |
| 7 | +import com.bsth.entity.realcontrol.ScheduleRealInfo; | |
| 7 | 8 | import com.bsth.entity.sys.Interval; |
| 8 | 9 | |
| 9 | 10 | /** |
| ... | ... | @@ -11,6 +12,6 @@ import com.bsth.entity.sys.Interval; |
| 11 | 12 | */ |
| 12 | 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 | 5 | import java.util.ArrayList; |
| 6 | 6 | import java.util.Date; |
| 7 | 7 | import java.util.HashMap; |
| 8 | +import java.util.HashSet; | |
| 8 | 9 | import java.util.List; |
| 9 | 10 | import java.util.Map; |
| 10 | 11 | import java.util.Set; |
| 11 | 12 | |
| 12 | -import javax.swing.text.Keymap; | |
| 13 | - | |
| 14 | 13 | import com.bsth.entity.calc.CalcInterval; |
| 15 | 14 | import com.bsth.entity.calc.CalcWaybill; |
| 16 | 15 | import com.bsth.entity.realcontrol.ChildTaskPlan; |
| ... | ... | @@ -53,26 +52,29 @@ public class CalcToolServiceImpl implements CalcToolService { |
| 53 | 52 | |
| 54 | 53 | |
| 55 | 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 | 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 | 78 | for (int i = 0; i < listMap.size(); i++) { |
| 77 | 79 | Map<String, String> m=listMap.get(i); |
| 78 | 80 | String jGh=m.get("jGh"); |
| ... | ... | @@ -196,6 +198,7 @@ public class CalcToolServiceImpl implements CalcToolService { |
| 196 | 198 | //list_ 全部班次 lists_执行了的班次(实到实发不为空) |
| 197 | 199 | private List<CalcWaybill> cul(List<ScheduleRealInfo> list_,List<ScheduleRealInfo> list_s, List<Map<String, Object>> xlList, List<Interval> djgList){ |
| 198 | 200 | List<CalcWaybill> list=new ArrayList<CalcWaybill>(); |
| 201 | + List<CalcWaybill> list2=new ArrayList<CalcWaybill>(); | |
| 199 | 202 | if(list_.size()>0){ |
| 200 | 203 | Date date=list_.get(0).getScheduleDate(); |
| 201 | 204 | String dateStr=list_.get(0).getScheduleDateStr(); |
| ... | ... | @@ -356,8 +359,28 @@ public class CalcToolServiceImpl implements CalcToolService { |
| 356 | 359 | t_.setDtbczgf(0); |
| 357 | 360 | t_.setDtbcwgf(0); |
| 358 | 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 | 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 | 33 | import com.bsth.service.impl.BaseServiceImpl; |
| 34 | 34 | import com.bsth.service.report.CulateMileageService; |
| 35 | 35 | import com.bsth.util.Arith; |
| 36 | +import com.bsth.util.BatchSaveUtils; | |
| 36 | 37 | import com.bsth.util.ReportUtils; |
| 37 | 38 | import com.github.stuxuhai.jpinyin.PinyinException; |
| 38 | 39 | import com.github.stuxuhai.jpinyin.PinyinFormat; |
| ... | ... | @@ -80,7 +81,7 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl<CalcWaybill, Integer |
| 80 | 81 | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
| 81 | 82 | if(date == null || date.trim().length() == 0){ |
| 82 | 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 | 85 | date = sdf.format(d); |
| 85 | 86 | } |
| 86 | 87 | if(line == null || line.trim().length() == 0){ |
| ... | ... | @@ -120,7 +121,7 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl<CalcWaybill, Integer |
| 120 | 121 | sql += " and xl_bm = '"+line+"'"; |
| 121 | 122 | // sql += " where t.line_code = " + line; |
| 122 | 123 | } |
| 123 | - sql += "group by xl_bm"; | |
| 124 | + sql += " group by xl_bm"; | |
| 124 | 125 | List<Map<String, Object>> listLineConfig = jdbcTemplate.query(sql, |
| 125 | 126 | new RowMapper<Map<String, Object>>(){ |
| 126 | 127 | @Override |
| ... | ... | @@ -148,7 +149,7 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl<CalcWaybill, Integer |
| 148 | 149 | Map<String, List<Map<String, Object>>> xlMap = new HashMap<String, List<Map<String, Object>>>(); |
| 149 | 150 | for(Map<String, Object> m : xlList){ |
| 150 | 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 | 153 | if(!xlMap.containsKey(key)) |
| 153 | 154 | xlMap.put(key, new ArrayList<Map<String, Object>>()); |
| 154 | 155 | xlMap.get(key).add(m); |
| ... | ... | @@ -166,7 +167,18 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl<CalcWaybill, Integer |
| 166 | 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 | 180 | Set<String> lineSet = new HashSet<String>(); |
| 181 | + List<CalcWaybill> all = new ArrayList<CalcWaybill>(); | |
| 170 | 182 | for (int i = 0; i < listLineConfig.size(); i++) { |
| 171 | 183 | Map<String, Object> m =listLineConfig.get(i); |
| 172 | 184 | String lineCode=m.get("line_code").toString().trim(); |
| ... | ... | @@ -179,13 +191,14 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl<CalcWaybill, Integer |
| 179 | 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 | 203 | newMap.put("status", ResponseCode.SUCCESS); |
| 191 | 204 | } catch (Exception e) { |
| ... | ... | @@ -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 | 422 | * @param line (留空""默认全部线路) |
| 410 | 423 | */ |
| 411 | 424 | @Transactional |
| ... | ... | @@ -419,7 +432,7 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl<CalcWaybill, Integer |
| 419 | 432 | Date dBefore = new Date(); |
| 420 | 433 | Calendar calendar = Calendar.getInstance(); //得到日历 |
| 421 | 434 | calendar.setTime(dNow);//把当前时间赋给日历 |
| 422 | - calendar.add(Calendar.DAY_OF_MONTH, -1); //设置为前一天 | |
| 435 | + calendar.add(Calendar.DAY_OF_MONTH, -2); //设置为前一天 | |
| 423 | 436 | dBefore = calendar.getTime(); //得到前一天的时间 |
| 424 | 437 | rq = sdf.format(dBefore); |
| 425 | 438 | } else { | ... | ... |
src/main/java/com/bsth/service/impl/TrafficManageServiceImpl.java
| ... | ... | @@ -527,11 +527,17 @@ public class TrafficManageServiceImpl implements TrafficManageService{ |
| 527 | 527 | } |
| 528 | 528 | e.printStackTrace(); |
| 529 | 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 | 542 | return result; |
| 537 | 543 | } | ... | ... |
src/main/java/com/bsth/service/realcontrol/ScheduleRealInfoService.java
| ... | ... | @@ -15,6 +15,8 @@ import java.util.Map; |
| 15 | 15 | @Service |
| 16 | 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 | 20 | Map<String, Collection<ScheduleRealInfo>> findByLines(String lines); |
| 19 | 21 | |
| 20 | 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 | 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 | 252 | * @param gsbm 公司编码 |
| 174 | 253 | * @param nbbm 车辆自编号 | ... | ... |
src/main/resources/static/real_control_v2/css/main.css
| ... | ... | @@ -2062,4 +2062,18 @@ dl.active > dd.disabled { |
| 2062 | 2062 | |
| 2063 | 2063 | .uk-tab>li.uk-active.destroy>a:hover{ |
| 2064 | 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 | 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 | 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 | 253 | return false; |
| 251 | 254 | }); |
| ... | ... | @@ -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 | 315 | function renderCell() { |
| 285 | 316 | var jsy = $('input[name=jsy]:enabled', modal).val(); |
| 286 | 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 | 42 | </div> |
| 43 | 43 | </div> |
| 44 | 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 | 59 | </div> | ... | ... |
src/main/resources/static/real_control_v2/fragments/line_schedule/sch_table.html
| ... | ... | @@ -24,6 +24,7 @@ |
| 24 | 24 | </div> |
| 25 | 25 | </div> |
| 26 | 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 | 28 | <div class="search_sch_panel"> |
| 28 | 29 | <form class="uk-form" onsubmit="javascript:return false;"> |
| 29 | 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 | 94 | var loadConfigEntity = function () { |
| 95 | 95 | $.get('/real_control_v2/fragments/north/nav/line_config/line_config_entity.html', function (attrDom) { |
| 96 | 96 | $('.right-container #line_config_entity_panel', modal) |
| 97 | - .append(attrDom) | |
| 97 | + .html(attrDom) | |
| 98 | 98 | .find('#line_config_entity_wrap') |
| 99 | 99 | .trigger('init', {lineConfig: lineConfig}); |
| 100 | 100 | }); |
| ... | ... | @@ -104,7 +104,7 @@ |
| 104 | 104 | var loadBufferConfig = function () { |
| 105 | 105 | $.get('/real_control_v2/fragments/north/nav/line_config/buffer_config.html', function (attrDom) { |
| 106 | 106 | $('.right-container #buffer_config_panel', modal) |
| 107 | - .append(attrDom) | |
| 107 | + .html(attrDom) | |
| 108 | 108 | .find('#buffer_config_wrap') |
| 109 | 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 | 114 | <span>停车场</span> |
| 115 | 115 | <select class="z-depth-input" name="twinsPark"> |
| 116 | 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 | 118 | {{/each}} |
| 119 | 119 | </select> |
| 120 | 120 | <span> 既是站点</span> |
| 121 | 121 | <select class="z-depth-input" name="twinsStation"> |
| 122 | 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 | 124 | </option> |
| 125 | 125 | {{/each}} |
| 126 | 126 | </select> |
| 127 | - | |
| 128 | - | |
| 127 | + {{if index>0}} | |
| 128 | + <a class="uk-close uk-close-alt"></a> | |
| 129 | + {{/if}} | |
| 129 | 130 | </div> |
| 130 | 131 | </script> |
| 131 | 132 | |
| ... | ... | @@ -134,16 +135,17 @@ |
| 134 | 135 | <span>停车场</span> |
| 135 | 136 | <select class="z-depth-input" name="twinsPark"> |
| 136 | 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 | 139 | {{/each}} |
| 139 | 140 | </select> |
| 140 | 141 | <span> 既是站点</span> |
| 141 | 142 | <select class="z-depth-input" name="twinsStation"> |
| 142 | 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 | 145 | </option> |
| 145 | 146 | {{/each}} |
| 146 | 147 | </select> |
| 148 | + <a class="uk-close uk-close-alt"></a> | |
| 147 | 149 | </div> |
| 148 | 150 | </script> |
| 149 | 151 | <script> |
| ... | ... | @@ -196,6 +198,10 @@ |
| 196 | 198 | for (var code in rs) { |
| 197 | 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 | 205 | renderPSDom(); |
| 200 | 206 | }); |
| 201 | 207 | //上行站点路由 |
| ... | ... | @@ -221,14 +227,28 @@ |
| 221 | 227 | }); |
| 222 | 228 | |
| 223 | 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 | 246 | gb_common.$post('/lineConfig/parkAndStationSet', { |
| 227 | 247 | lineCode: conf.line.lineCode, |
| 228 | - twinsPark: park, | |
| 229 | - twinsStation: station | |
| 248 | + twinsPark: parks, | |
| 249 | + twinsStation: stations | |
| 230 | 250 | }, function (rs) { |
| 231 | - notify_succ('设置成功!!'); | |
| 251 | + notify_succ('已保存!!'); | |
| 232 | 252 | conf = rs.conf; |
| 233 | 253 | }); |
| 234 | 254 | } |
| ... | ... | @@ -261,10 +281,15 @@ |
| 261 | 281 | var data = {lineCode: lineCode, type: type, parkCode: '', stationCode: ''}; |
| 262 | 282 | //出站既是出场 |
| 263 | 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 | 294 | gb_common.$post('/lineConfig/editOutTimeType', data, function (rs) { |
| 270 | 295 | notify_succ('调整出场时间类型成功!'); |
| ... | ... | @@ -292,22 +317,36 @@ |
| 292 | 317 | * 渲染场既是站dom |
| 293 | 318 | */ |
| 294 | 319 | function renderPSDom() { |
| 320 | + $('.c_2_s_list', $panel).html(''); | |
| 321 | + var pArray = conf.twinsParks.split(','), | |
| 322 | + cArray = conf.twinsStations.split(','); | |
| 295 | 323 | var htmlStr = '', |
| 296 | 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 | 335 | htmlStr = template('park-and-station-temp', { |
| 299 | 336 | parks: parks, |
| 300 | 337 | conf: conf, |
| 338 | + cPark: pArray[i], | |
| 339 | + cStation: cArray[i], | |
| 340 | + index: i, | |
| 301 | 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 | 391 | */ |
| 353 | 392 | $(wrap).on('click', '.add_btn_span', function () { |
| 354 | 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 | 400 | if (conf['outConfig'] == 2) { |
| 357 | - htmlStr = template('park-and-station-temp', { | |
| 401 | + htmlStr = template('park-and-station-2-temp', { | |
| 358 | 402 | parks: parks, |
| 359 | 403 | conf: conf, |
| 404 | + cPark: lastTcc, | |
| 405 | + cStation: lastStation, | |
| 360 | 406 | routes: [upStationRoutes[0], upStationRoutes[upStationRoutes.length - 1]] |
| 361 | 407 | }); |
| 362 | 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 | 424 | </script> |
| 371 | 425 | </div> |
| 372 | 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 | 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 | 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 | 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 | 93 | return { |
| 56 | 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 | 7 | var line2Schedule = {}; |
| 8 | 8 | //车辆应发未发车辆数 |
| 9 | 9 | var car_yfwf_map = {}; |
| 10 | + //班次站点编码和实际不符数据 | |
| 11 | + var errorCodeData = {}; | |
| 10 | 12 | |
| 11 | 13 | var bcTypeOrderMap = { |
| 12 | 14 | 'out':0, |
| ... | ... | @@ -812,6 +814,38 @@ var gb_schedule_table = (function () { |
| 812 | 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 | 850 | return { |
| 817 | 851 | show: show, |
| ... | ... | @@ -837,6 +871,8 @@ var gb_schedule_table = (function () { |
| 837 | 871 | getNextNormalSch: getNextNormalSch, |
| 838 | 872 | findNbbmByLineCode:findNbbmByLineCode, |
| 839 | 873 | showLpMileageTipBySch: showLpMileageTipBySch, |
| 840 | - renderCarRemark: renderCarRemark | |
| 874 | + renderCarRemark: renderCarRemark, | |
| 875 | + putSCodeErrorInfo: putSCodeErrorInfo, | |
| 876 | + findSCodeErrorInfo: findSCodeErrorInfo | |
| 841 | 877 | }; |
| 842 | 878 | })(); | ... | ... |