Commit f23070e0e493df8c1cd23f022f97847392df9315
Merge branch 'minhang' of
http://222.66.0.204:8090/panzhaov5/bsth_control into minhang
Showing
29 changed files
with
1148 additions
and
182 deletions
src/main/java/com/bsth/controller/realcontrol/BasicDataController.java
| @@ -4,7 +4,9 @@ import com.alibaba.fastjson.JSON; | @@ -4,7 +4,9 @@ import com.alibaba.fastjson.JSON; | ||
| 4 | import com.alibaba.fastjson.serializer.PropertyFilter; | 4 | import com.alibaba.fastjson.serializer.PropertyFilter; |
| 5 | import com.bsth.common.ResponseCode; | 5 | import com.bsth.common.ResponseCode; |
| 6 | import com.bsth.data.BasicData; | 6 | import com.bsth.data.BasicData; |
| 7 | +import com.bsth.data.Station2ParkBuffer; | ||
| 7 | import com.bsth.entity.Line; | 8 | import com.bsth.entity.Line; |
| 9 | +import com.bsth.entity.realcontrol.StationToPark; | ||
| 8 | import com.google.common.base.Splitter; | 10 | import com.google.common.base.Splitter; |
| 9 | import com.google.common.collect.ArrayListMultimap; | 11 | import com.google.common.collect.ArrayListMultimap; |
| 10 | import com.google.common.collect.BiMap; | 12 | import com.google.common.collect.BiMap; |
| @@ -29,6 +31,9 @@ public class BasicDataController { | @@ -29,6 +31,9 @@ public class BasicDataController { | ||
| 29 | BasicData basicData; | 31 | BasicData basicData; |
| 30 | 32 | ||
| 31 | Logger logger = LoggerFactory.getLogger(this.getClass()); | 33 | Logger logger = LoggerFactory.getLogger(this.getClass()); |
| 34 | + | ||
| 35 | + @Autowired | ||
| 36 | + Station2ParkBuffer station2ParkBuffer; | ||
| 32 | 37 | ||
| 33 | @RequestMapping("/cars") | 38 | @RequestMapping("/cars") |
| 34 | public Iterable<String> findAllNbbm(Map<String, Object> map){ | 39 | public Iterable<String> findAllNbbm(Map<String, Object> map){ |
| @@ -180,4 +185,25 @@ public class BasicDataController { | @@ -180,4 +185,25 @@ public class BasicDataController { | ||
| 180 | 185 | ||
| 181 | return rs; | 186 | return rs; |
| 182 | } | 187 | } |
| 188 | + | ||
| 189 | + /** | ||
| 190 | + * 获取站点和停车场对照表 | ||
| 191 | + * @param idx | ||
| 192 | + * @return | ||
| 193 | + */ | ||
| 194 | + @RequestMapping("/station2ParkData") | ||
| 195 | + public Map<String, Collection<StationToPark>> findStation2ParkData(@RequestParam String idx){ | ||
| 196 | + List<String> lines = Splitter.on(",").splitToList(idx); | ||
| 197 | + ArrayListMultimap<String, StationToPark> rs = ArrayListMultimap.create(); | ||
| 198 | + | ||
| 199 | + for(String lineCode : lines){ | ||
| 200 | + rs.putAll(lineCode, Station2ParkBuffer.get(lineCode)); | ||
| 201 | + } | ||
| 202 | + return rs.asMap(); | ||
| 203 | + } | ||
| 204 | + | ||
| 205 | + @RequestMapping(value = "/deleteStation2Park", method = RequestMethod.POST) | ||
| 206 | + public Map<String, Object> deleteStation2Park(@RequestParam String lineCode,@RequestParam Integer id){ | ||
| 207 | + return station2ParkBuffer.delete(lineCode, id); | ||
| 208 | + } | ||
| 183 | } | 209 | } |
src/main/java/com/bsth/data/BasicData.java
| @@ -134,6 +134,9 @@ public class BasicData implements CommandLineRunner { | @@ -134,6 +134,9 @@ public class BasicData implements CommandLineRunner { | ||
| 134 | @Autowired | 134 | @Autowired |
| 135 | GeoCacheData geoCacheData; | 135 | GeoCacheData geoCacheData; |
| 136 | 136 | ||
| 137 | + @Autowired | ||
| 138 | + Station2ParkBuffer station2ParkBuffer; | ||
| 139 | + | ||
| 137 | 140 | ||
| 138 | @Override | 141 | @Override |
| 139 | public void run() { | 142 | public void run() { |
| @@ -160,6 +163,7 @@ public class BasicData implements CommandLineRunner { | @@ -160,6 +163,7 @@ public class BasicData implements CommandLineRunner { | ||
| 160 | loadBusinessInfo(); | 163 | loadBusinessInfo(); |
| 161 | 164 | ||
| 162 | geoCacheData.loadData(); | 165 | geoCacheData.loadData(); |
| 166 | + station2ParkBuffer.saveAll(); | ||
| 163 | logger.info("加载基础数据成功!,"); | 167 | logger.info("加载基础数据成功!,"); |
| 164 | } catch (Exception e) { | 168 | } catch (Exception e) { |
| 165 | logger.error("加载基础数据时出现异常,", e); | 169 | logger.error("加载基础数据时出现异常,", e); |
src/main/java/com/bsth/data/Station2ParkBuffer.java
0 → 100644
| 1 | +package com.bsth.data; | ||
| 2 | + | ||
| 3 | +import com.bsth.common.ResponseCode; | ||
| 4 | +import com.bsth.entity.realcontrol.ChildTaskPlan; | ||
| 5 | +import com.bsth.entity.realcontrol.StationToPark; | ||
| 6 | +import com.bsth.repository.realcontrol.StationToParkRepository; | ||
| 7 | +import com.bsth.util.Arith; | ||
| 8 | +import com.google.common.collect.ArrayListMultimap; | ||
| 9 | +import org.joda.time.format.DateTimeFormat; | ||
| 10 | +import org.joda.time.format.DateTimeFormatter; | ||
| 11 | +import org.slf4j.Logger; | ||
| 12 | +import org.slf4j.LoggerFactory; | ||
| 13 | +import org.springframework.beans.factory.annotation.Autowired; | ||
| 14 | +import org.springframework.boot.CommandLineRunner; | ||
| 15 | +import org.springframework.stereotype.Component; | ||
| 16 | + | ||
| 17 | +import java.util.*; | ||
| 18 | + | ||
| 19 | +/** | ||
| 20 | + * 站到场 历时、公里 数据缓存 | ||
| 21 | + * Created by panzhao on 2017/7/10. | ||
| 22 | + */ | ||
| 23 | +@Component | ||
| 24 | +public class Station2ParkBuffer implements CommandLineRunner { | ||
| 25 | + | ||
| 26 | + @Autowired | ||
| 27 | + StationToParkRepository stationToParkRepository; | ||
| 28 | + | ||
| 29 | + private static ArrayListMultimap listMultimap; | ||
| 30 | + | ||
| 31 | + private static Set<StationToPark> pstBuff; | ||
| 32 | + | ||
| 33 | + static Logger log = LoggerFactory.getLogger(Station2ParkBuffer.class); | ||
| 34 | + | ||
| 35 | + @Override | ||
| 36 | + public void run(String... strings) throws Exception { | ||
| 37 | + listMultimap = ArrayListMultimap.create(); | ||
| 38 | + pstBuff = new HashSet<>(); | ||
| 39 | + Iterator<StationToPark> iterator = stationToParkRepository.findAll().iterator(); | ||
| 40 | + StationToPark stp; | ||
| 41 | + while (iterator.hasNext()) { | ||
| 42 | + stp = iterator.next(); | ||
| 43 | + listMultimap.put(stp.getLineCode(), stp); | ||
| 44 | + } | ||
| 45 | + } | ||
| 46 | + | ||
| 47 | + public static List<StationToPark> get(String lineCode) { | ||
| 48 | + return listMultimap.get(lineCode); | ||
| 49 | + } | ||
| 50 | + | ||
| 51 | + public static StationToPark get(String lineCode, String sName, String eName) { | ||
| 52 | + List<StationToPark> list = get(lineCode); | ||
| 53 | + StationToPark stp = null; | ||
| 54 | + for (StationToPark s : list) { | ||
| 55 | + if (s.getStationName().equals(sName) && s.getParkName().equals(eName)) { | ||
| 56 | + stp = s; | ||
| 57 | + break; | ||
| 58 | + } | ||
| 59 | + } | ||
| 60 | + return stp; | ||
| 61 | + } | ||
| 62 | + | ||
| 63 | + private static DateTimeFormatter fmtHHmm = DateTimeFormat.forPattern("HH:mm"); | ||
| 64 | + | ||
| 65 | + public static void put(ChildTaskPlan ctask) { | ||
| 66 | + try{ | ||
| 67 | + String type2 = ctask.getType2(); | ||
| 68 | + String lineCode = ctask.getSchedule().getXlBm(), sName, eName; | ||
| 69 | + | ||
| 70 | + if (type2.equals("2")) { | ||
| 71 | + sName = ctask.getStartStationName(); | ||
| 72 | + eName = ctask.getEndStationName(); | ||
| 73 | + } else if (type2.equals("3")) { | ||
| 74 | + eName = ctask.getStartStationName(); | ||
| 75 | + sName = ctask.getEndStationName(); | ||
| 76 | + } else | ||
| 77 | + return; | ||
| 78 | + | ||
| 79 | + Float time = calcMinute(ctask); | ||
| 80 | + Float mileage = ctask.getMileage(); | ||
| 81 | + | ||
| 82 | + StationToPark stp = get(lineCode, sName, eName); | ||
| 83 | + if (stp == null) { | ||
| 84 | + stp = new StationToPark(); | ||
| 85 | + stp.setLineCode(lineCode); | ||
| 86 | + stp.setStationName(sName); | ||
| 87 | + stp.setParkName(eName); | ||
| 88 | + listMultimap.put(lineCode, stp); | ||
| 89 | + } | ||
| 90 | + | ||
| 91 | + if (type2.equals("2")) { | ||
| 92 | + stp.setTime1(time); | ||
| 93 | + stp.setMileage1(mileage); | ||
| 94 | + } else { | ||
| 95 | + stp.setTime2(time); | ||
| 96 | + stp.setMileage2(mileage); | ||
| 97 | + } | ||
| 98 | + | ||
| 99 | + pstBuff.add(stp); | ||
| 100 | + }catch (Exception e){ | ||
| 101 | + log.error("", e); | ||
| 102 | + } | ||
| 103 | + } | ||
| 104 | + | ||
| 105 | + public static Float calcMinute(ChildTaskPlan ctask) { | ||
| 106 | + long t = 0; | ||
| 107 | + | ||
| 108 | + try { | ||
| 109 | + long st = fmtHHmm.parseMillis(ctask.getStartDate()); | ||
| 110 | + long et = fmtHHmm.parseMillis(ctask.getEndDate()); | ||
| 111 | + | ||
| 112 | + t = et - st; | ||
| 113 | + } catch (Exception e) { | ||
| 114 | + e.printStackTrace(); | ||
| 115 | + } | ||
| 116 | + return Float.parseFloat(String.valueOf(Arith.div(Arith.div(t, 1000), 60))); | ||
| 117 | + } | ||
| 118 | + | ||
| 119 | + public void saveAll(){ | ||
| 120 | + if(pstBuff.size()==0) | ||
| 121 | + return; | ||
| 122 | + Set<StationToPark> pstBuffCopy = pstBuff; | ||
| 123 | + pstBuff = new HashSet<>(); | ||
| 124 | + //持久化到数据库 | ||
| 125 | + stationToParkRepository.save(pstBuffCopy); | ||
| 126 | + } | ||
| 127 | + | ||
| 128 | + public Map<String, Object> delete(String lineCode, Integer id) { | ||
| 129 | + Map<String, Object> rs = new HashMap<>(); | ||
| 130 | + try { | ||
| 131 | + List<StationToPark> list = listMultimap.get(lineCode); | ||
| 132 | + | ||
| 133 | + StationToPark stp = null; | ||
| 134 | + for(StationToPark temp : list){ | ||
| 135 | + if(temp.getId().equals(id)){ | ||
| 136 | + stp=temp; | ||
| 137 | + break; | ||
| 138 | + } | ||
| 139 | + } | ||
| 140 | + | ||
| 141 | + if(stp != null){ | ||
| 142 | + listMultimap.remove(lineCode, stp); | ||
| 143 | + stationToParkRepository.delete(id); | ||
| 144 | + rs.put("status", ResponseCode.SUCCESS); | ||
| 145 | + } | ||
| 146 | + else{ | ||
| 147 | + rs.put("status", ResponseCode.SUCCESS); | ||
| 148 | + rs.put("msg", "操作失败,可能数据已经被删除!"); | ||
| 149 | + } | ||
| 150 | + | ||
| 151 | + }catch (Exception e){ | ||
| 152 | + rs.put("status", ResponseCode.ERROR); | ||
| 153 | + rs.put("msg", e.getMessage()); | ||
| 154 | + log.error("", e); | ||
| 155 | + } | ||
| 156 | + return rs; | ||
| 157 | + } | ||
| 158 | +} |
src/main/java/com/bsth/data/gpsdata/recovery/GpsDataRecovery.java
| @@ -84,7 +84,7 @@ public class GpsDataRecovery implements ApplicationContextAware { | @@ -84,7 +84,7 @@ public class GpsDataRecovery implements ApplicationContextAware { | ||
| 84 | Calendar calendar = Calendar.getInstance(); | 84 | Calendar calendar = Calendar.getInstance(); |
| 85 | int dayOfYear = calendar.get(Calendar.DAY_OF_YEAR); | 85 | int dayOfYear = calendar.get(Calendar.DAY_OF_YEAR); |
| 86 | 86 | ||
| 87 | - String sql = "select DEVICE_ID,LAT,LON,TS,SPEED_GPS,LINE_ID,SERVICE_STATE from bsth_c_gps_info where days_year=173";// + dayOfYear; | 87 | + String sql = "select DEVICE_ID,LAT,LON,TS,SPEED_GPS,LINE_ID,SERVICE_STATE from bsth_c_gps_info where days_year=" + dayOfYear; |
| 88 | JdbcTemplate jdbcTemplate = new JdbcTemplate(DBUtils_MS.getDataSource()); | 88 | JdbcTemplate jdbcTemplate = new JdbcTemplate(DBUtils_MS.getDataSource()); |
| 89 | 89 | ||
| 90 | List<GpsEntity> list = | 90 | List<GpsEntity> list = |
src/main/java/com/bsth/data/schedule/DayOfSchedule.java
| @@ -944,6 +944,8 @@ public class DayOfSchedule { | @@ -944,6 +944,8 @@ public class DayOfSchedule { | ||
| 944 | ScheduleRealInfo sch = schAttrCalculator.calcCurrentExecSch(list); | 944 | ScheduleRealInfo sch = schAttrCalculator.calcCurrentExecSch(list); |
| 945 | carExecutePlanMap.put(nbbm, sch); | 945 | carExecutePlanMap.put(nbbm, sch); |
| 946 | 946 | ||
| 947 | + if(sch==null) | ||
| 948 | + return; | ||
| 947 | try { | 949 | try { |
| 948 | GpsEntity gps = gpsRealData.get(BasicData.deviceId2NbbmMap.inverse().get(nbbm)); | 950 | GpsEntity gps = gpsRealData.get(BasicData.deviceId2NbbmMap.inverse().get(nbbm)); |
| 949 | if(gps != null && gps.isOnline()){ | 951 | if(gps != null && gps.isOnline()){ |
src/main/java/com/bsth/data/schedule/edit_logs/ScheduleModifyLogger.java
| @@ -231,4 +231,20 @@ public class ScheduleModifyLogger { | @@ -231,4 +231,20 @@ public class ScheduleModifyLogger { | ||
| 231 | public static void put(SchEditInfo sei) { | 231 | public static void put(SchEditInfo sei) { |
| 232 | list.add(sei); | 232 | list.add(sei); |
| 233 | } | 233 | } |
| 234 | + | ||
| 235 | + public static void afterEdit(ScheduleRealInfo sch, String remarks, JSONArray jsonArray) { | ||
| 236 | + try { | ||
| 237 | + if (jsonArray == null || jsonArray.size() == 0) | ||
| 238 | + return; | ||
| 239 | + | ||
| 240 | + SchEditInfo sei = SchEditInfo.getInstance(sch); | ||
| 241 | + sei.setRemarks(remarks); | ||
| 242 | + sei.setJsonArray(jsonArray.toJSONString()); | ||
| 243 | + sei.setType(EditType.LSBCTZ); | ||
| 244 | + | ||
| 245 | + put(sei); | ||
| 246 | + } catch (Exception e) { | ||
| 247 | + log.error("", e); | ||
| 248 | + } | ||
| 249 | + } | ||
| 234 | } | 250 | } |
src/main/java/com/bsth/data/schedule/edit_logs/entity/EditType.java
| @@ -5,5 +5,5 @@ package com.bsth.data.schedule.edit_logs.entity; | @@ -5,5 +5,5 @@ package com.bsth.data.schedule.edit_logs.entity; | ||
| 5 | */ | 5 | */ |
| 6 | public enum EditType { | 6 | public enum EditType { |
| 7 | 7 | ||
| 8 | - DFTZ,SFTZ,FCXXWT,TZRC,LPDD,ZRW,JHLB,CXLB, CXSF, CXZX | 8 | + DFTZ,SFTZ,FCXXWT,TZRC,LPDD,ZRW,JHLB,CXLB, CXSF, LSBCTZ, CXZX |
| 9 | } | 9 | } |
| 10 | \ No newline at end of file | 10 | \ No newline at end of file |
src/main/java/com/bsth/data/schedule/edit_logs/loggers/AfterwardsLogger.java
0 → 100644
| 1 | +package com.bsth.data.schedule.edit_logs.loggers; | ||
| 2 | + | ||
| 3 | +import com.alibaba.fastjson.JSONArray; | ||
| 4 | +import com.alibaba.fastjson.JSONObject; | ||
| 5 | +import com.bsth.data.schedule.edit_logs.ScheduleModifyLogger; | ||
| 6 | +import com.bsth.entity.realcontrol.ScheduleRealInfo; | ||
| 7 | +import org.slf4j.Logger; | ||
| 8 | +import org.slf4j.LoggerFactory; | ||
| 9 | + | ||
| 10 | +/** | ||
| 11 | + * 事后历史班次编辑 | ||
| 12 | + * Created by panzhao on 2017/5/19. | ||
| 13 | + */ | ||
| 14 | +public class AfterwardsLogger { | ||
| 15 | + | ||
| 16 | + static Logger log = LoggerFactory.getLogger(AfterwardsLogger.class); | ||
| 17 | + | ||
| 18 | + private JSONArray jsonArray = new JSONArray(); | ||
| 19 | + private String remarks; | ||
| 20 | + private ScheduleRealInfo sch; | ||
| 21 | + | ||
| 22 | + public void log(String title, Object old, Object now){ | ||
| 23 | + try { | ||
| 24 | + | ||
| 25 | + JSONObject jsonObject = new JSONObject(); | ||
| 26 | + jsonObject.put("title", title); | ||
| 27 | + jsonObject.put("old", old); | ||
| 28 | + jsonObject.put("now", now); | ||
| 29 | + | ||
| 30 | + jsonArray.add(jsonObject); | ||
| 31 | + }catch (Exception e){ | ||
| 32 | + log.error("", e); | ||
| 33 | + } | ||
| 34 | + } | ||
| 35 | + | ||
| 36 | + public void log(String text){ | ||
| 37 | + try { | ||
| 38 | + JSONObject jsonObject = new JSONObject(); | ||
| 39 | + jsonObject.put("title", text); | ||
| 40 | + | ||
| 41 | + jsonArray.add(jsonObject); | ||
| 42 | + }catch (Exception e){ | ||
| 43 | + log.error("", e); | ||
| 44 | + } | ||
| 45 | + } | ||
| 46 | + | ||
| 47 | + public static AfterwardsLogger start(ScheduleRealInfo sch, String remarks){ | ||
| 48 | + AfterwardsLogger fLog = new AfterwardsLogger(); | ||
| 49 | + fLog.setSch(sch); | ||
| 50 | + fLog.setRemarks(remarks); | ||
| 51 | + return fLog; | ||
| 52 | + } | ||
| 53 | + | ||
| 54 | + public void end(){ | ||
| 55 | + ScheduleModifyLogger.afterEdit(sch, this.remarks, jsonArray); | ||
| 56 | + } | ||
| 57 | + | ||
| 58 | + public String getRemarks() { | ||
| 59 | + return remarks; | ||
| 60 | + } | ||
| 61 | + | ||
| 62 | + public void setRemarks(String remarks) { | ||
| 63 | + this.remarks = remarks; | ||
| 64 | + } | ||
| 65 | + | ||
| 66 | + public ScheduleRealInfo getSch() { | ||
| 67 | + return sch; | ||
| 68 | + } | ||
| 69 | + | ||
| 70 | + public void setSch(ScheduleRealInfo sch) { | ||
| 71 | + this.sch = sch; | ||
| 72 | + } | ||
| 73 | +} |
src/main/java/com/bsth/data/schedule/edit_logs/service/SchEditInfoServiceImpl.java
| @@ -41,7 +41,7 @@ public class SchEditInfoServiceImpl extends BaseServiceImpl<SchEditInfo, Long> i | @@ -41,7 +41,7 @@ public class SchEditInfoServiceImpl extends BaseServiceImpl<SchEditInfo, Long> i | ||
| 41 | for(String k : ks){ | 41 | for(String k : ks){ |
| 42 | v =map.get(k); | 42 | v =map.get(k); |
| 43 | if(StringUtils.isNotEmpty(v)) | 43 | if(StringUtils.isNotEmpty(v)) |
| 44 | - cont += " and t2." + BatchSaveUtils.propertyToField(k) + "='" + v + "'"; | 44 | + cont += " and " + BatchSaveUtils.propertyToField(k) + "='" + v + "'"; |
| 45 | } | 45 | } |
| 46 | String sql = "select t1.*, t2.fcsj,t2.lp_name,t2.cl_zbh,t2.j_gh,t2.j_name,t2.xl_dir,t2.real_exec_date from (select * from logger_sch_modify where rq=? and line_code=? ) t1 INNER JOIN bsth_c_s_sp_info_real t2 on t1.sch_id=t2.id where 1=1 " + cont; | 46 | String sql = "select t1.*, t2.fcsj,t2.lp_name,t2.cl_zbh,t2.j_gh,t2.j_name,t2.xl_dir,t2.real_exec_date from (select * from logger_sch_modify where rq=? and line_code=? ) t1 INNER JOIN bsth_c_s_sp_info_real t2 on t1.sch_id=t2.id where 1=1 " + cont; |
| 47 | 47 |
src/main/java/com/bsth/data/utils/CustomStringUtils.java
0 → 100644
| 1 | +package com.bsth.data.utils; | ||
| 2 | + | ||
| 3 | +import org.apache.commons.lang3.StringUtils; | ||
| 4 | + | ||
| 5 | +/** | ||
| 6 | + * Created by panzhao on 2017/7/10. | ||
| 7 | + */ | ||
| 8 | +public class CustomStringUtils { | ||
| 9 | + | ||
| 10 | + public static boolean equals(String s1, String s2){ | ||
| 11 | + if(s1 == null){ | ||
| 12 | + if(StringUtils.isNotEmpty(s2)) | ||
| 13 | + return false; | ||
| 14 | + else | ||
| 15 | + return true; | ||
| 16 | + } | ||
| 17 | + return s1.equals(s2); | ||
| 18 | + } | ||
| 19 | +} |
src/main/java/com/bsth/entity/realcontrol/ChildTaskPlan.java
src/main/java/com/bsth/entity/realcontrol/StationToPark.java
0 → 100644
| 1 | +package com.bsth.entity.realcontrol; | ||
| 2 | + | ||
| 3 | +import javax.persistence.Entity; | ||
| 4 | +import javax.persistence.GeneratedValue; | ||
| 5 | +import javax.persistence.Id; | ||
| 6 | +import javax.persistence.Table; | ||
| 7 | + | ||
| 8 | +/** | ||
| 9 | + * 站 到 场 | ||
| 10 | + * Created by panzhao on 2017/7/10. | ||
| 11 | + */ | ||
| 12 | +@Entity | ||
| 13 | +@Table(name = "bsth_c_station_to_park") | ||
| 14 | +public class StationToPark { | ||
| 15 | + | ||
| 16 | + @Id | ||
| 17 | + @GeneratedValue | ||
| 18 | + private Integer id; | ||
| 19 | + | ||
| 20 | + /** 线路编码 */ | ||
| 21 | + private String lineCode; | ||
| 22 | + | ||
| 23 | + /** 站点名称 */ | ||
| 24 | + private String stationName; | ||
| 25 | + | ||
| 26 | + /** 停车场编码 */ | ||
| 27 | + private String parkName; | ||
| 28 | + | ||
| 29 | + /** 站到场时间(分钟) */ | ||
| 30 | + private Float time1; | ||
| 31 | + | ||
| 32 | + /** 站到场公里 */ | ||
| 33 | + private Float mileage1; | ||
| 34 | + | ||
| 35 | + /** 场到站时间(分钟) */ | ||
| 36 | + private Float time2; | ||
| 37 | + | ||
| 38 | + /** 场到站公里 */ | ||
| 39 | + private Float mileage2; | ||
| 40 | + | ||
| 41 | + /** 排序字段 */ | ||
| 42 | + private int orderNo; | ||
| 43 | + | ||
| 44 | + public String getLineCode() { | ||
| 45 | + return lineCode; | ||
| 46 | + } | ||
| 47 | + | ||
| 48 | + public void setLineCode(String lineCode) { | ||
| 49 | + this.lineCode = lineCode; | ||
| 50 | + } | ||
| 51 | + | ||
| 52 | + public String getStationName() { | ||
| 53 | + return stationName; | ||
| 54 | + } | ||
| 55 | + | ||
| 56 | + public void setStationName(String stationName) { | ||
| 57 | + this.stationName = stationName; | ||
| 58 | + } | ||
| 59 | + | ||
| 60 | + | ||
| 61 | + public Float getTime1() { | ||
| 62 | + return time1; | ||
| 63 | + } | ||
| 64 | + | ||
| 65 | + public void setTime1(Float time1) { | ||
| 66 | + this.time1 = time1; | ||
| 67 | + } | ||
| 68 | + | ||
| 69 | + public Float getMileage1() { | ||
| 70 | + return mileage1; | ||
| 71 | + } | ||
| 72 | + | ||
| 73 | + public void setMileage1(Float mileage1) { | ||
| 74 | + this.mileage1 = mileage1; | ||
| 75 | + } | ||
| 76 | + | ||
| 77 | + public Float getTime2() { | ||
| 78 | + return time2; | ||
| 79 | + } | ||
| 80 | + | ||
| 81 | + public void setTime2(Float time2) { | ||
| 82 | + this.time2 = time2; | ||
| 83 | + } | ||
| 84 | + | ||
| 85 | + public Float getMileage2() { | ||
| 86 | + return mileage2; | ||
| 87 | + } | ||
| 88 | + | ||
| 89 | + public void setMileage2(Float mileage2) { | ||
| 90 | + this.mileage2 = mileage2; | ||
| 91 | + } | ||
| 92 | + | ||
| 93 | + public Integer getId() { | ||
| 94 | + return id; | ||
| 95 | + } | ||
| 96 | + | ||
| 97 | + public void setId(Integer id) { | ||
| 98 | + this.id = id; | ||
| 99 | + } | ||
| 100 | + | ||
| 101 | + public int getOrderNo() { | ||
| 102 | + return orderNo; | ||
| 103 | + } | ||
| 104 | + | ||
| 105 | + public void setOrderNo(int orderNo) { | ||
| 106 | + this.orderNo = orderNo; | ||
| 107 | + } | ||
| 108 | + | ||
| 109 | + public String getParkName() { | ||
| 110 | + return parkName; | ||
| 111 | + } | ||
| 112 | + | ||
| 113 | + public void setParkName(String parkName) { | ||
| 114 | + this.parkName = parkName; | ||
| 115 | + } | ||
| 116 | + | ||
| 117 | + @Override | ||
| 118 | + public int hashCode() { | ||
| 119 | + return ("stp_" + this.toString()).hashCode(); | ||
| 120 | + } | ||
| 121 | + | ||
| 122 | + @Override | ||
| 123 | + public boolean equals(Object obj) { | ||
| 124 | + return this.toString().equals(((StationToPark)obj).toString()); | ||
| 125 | + } | ||
| 126 | + | ||
| 127 | + @Override | ||
| 128 | + public String toString() { | ||
| 129 | + return this.lineCode + "_" + this.getStationName() + "_" + this.getParkName(); | ||
| 130 | + } | ||
| 131 | +} |
src/main/java/com/bsth/repository/realcontrol/StationToParkRepository.java
0 → 100644
| 1 | +package com.bsth.repository.realcontrol; | ||
| 2 | + | ||
| 3 | +import com.bsth.entity.realcontrol.StationToPark; | ||
| 4 | +import com.bsth.repository.BaseRepository; | ||
| 5 | +import org.springframework.stereotype.Repository; | ||
| 6 | + | ||
| 7 | +/** | ||
| 8 | + * Created by panzhao on 2017/7/10. | ||
| 9 | + */ | ||
| 10 | +@Repository | ||
| 11 | +public interface StationToParkRepository extends BaseRepository<StationToPark, Integer>{ | ||
| 12 | +} |
src/main/java/com/bsth/service/gps/GpsServiceImpl.java
| @@ -479,7 +479,7 @@ public class GpsServiceImpl implements GpsService { | @@ -479,7 +479,7 @@ public class GpsServiceImpl implements GpsService { | ||
| 479 | }); | 479 | }); |
| 480 | Map<String, Object> fs = list.get(0); | 480 | Map<String, Object> fs = list.get(0); |
| 481 | //替换设备号和时间 | 481 | //替换设备号和时间 |
| 482 | - int diff = (int) (sch.getDfsjT() - Long.parseLong(fs.get("ts").toString()) - 1000 * 70); | 482 | + long diff = ((sch.getDfsjT() - Long.parseLong(fs.get("ts").toString())) - 1000 * 70); |
| 483 | 483 | ||
| 484 | String deviceId = BasicData.deviceId2NbbmMap.inverse().get(sch.getClZbh()); | 484 | String deviceId = BasicData.deviceId2NbbmMap.inverse().get(sch.getClZbh()); |
| 485 | for (Map<String, Object> map : list) { | 485 | for (Map<String, Object> map : list) { |
src/main/java/com/bsth/service/impl/BusIntervalServiceImpl.java
| @@ -666,9 +666,10 @@ public class BusIntervalServiceImpl implements BusIntervalService { | @@ -666,9 +666,10 @@ public class BusIntervalServiceImpl implements BusIntervalService { | ||
| 666 | if(sfqr == 1){ | 666 | if(sfqr == 1){ |
| 667 | where += " and zdsj >= '"+times1+"' and fcsj <= '"+times2+"'"; | 667 | where += " and zdsj >= '"+times1+"' and fcsj <= '"+times2+"'"; |
| 668 | } | 668 | } |
| 669 | - where += " and bc_type != 'in' and bc_type != 'out' and bc_type != 'ldks'"; | 669 | +// where += " and bc_type != 'in' and bc_type != 'out' and bc_type != 'ldks'"; |
| 670 | + where += " and bc_type != 'ldks'"; | ||
| 670 | 671 | ||
| 671 | - String sql = "select id, schedule_date_Str, real_exec_date, xl_name, lp_name, bcs, bcsj, jhlc," | 672 | + String sql = "select id, schedule_date_Str, real_exec_date, xl_name, lp_name, bcs, bcsj, jhlc, bc_type," |
| 672 | + " fcsj, fcsj_actual, zdsj, zdsj_actual, qdz_name, zdz_name, xl_dir, status, remarks, gs_name, fgs_name, sp_id" | 673 | + " fcsj, fcsj_actual, zdsj, zdsj_actual, qdz_name, zdz_name, xl_dir, status, remarks, gs_name, fgs_name, sp_id" |
| 673 | + " from bsth_c_s_sp_info_real where DATE_FORMAT(schedule_date,'%Y-%m-%d') >= '"+startDate+"'" | 674 | + " from bsth_c_s_sp_info_real where DATE_FORMAT(schedule_date,'%Y-%m-%d') >= '"+startDate+"'" |
| 674 | + " and DATE_FORMAT(schedule_date,'%Y-%m-%d') <= '"+endDate+"'"+where+""; | 675 | + " and DATE_FORMAT(schedule_date,'%Y-%m-%d') <= '"+endDate+"'"+where+""; |
| @@ -692,6 +693,7 @@ public class BusIntervalServiceImpl implements BusIntervalService { | @@ -692,6 +693,7 @@ public class BusIntervalServiceImpl implements BusIntervalService { | ||
| 692 | schedule.setZdsjActual(rs.getString("zdsj_actual")); | 693 | schedule.setZdsjActual(rs.getString("zdsj_actual")); |
| 693 | schedule.setQdzName(rs.getString("qdz_name")); | 694 | schedule.setQdzName(rs.getString("qdz_name")); |
| 694 | schedule.setZdzName(rs.getString("zdz_name")); | 695 | schedule.setZdzName(rs.getString("zdz_name")); |
| 696 | + schedule.setBcType(rs.getString("bc_type")); | ||
| 695 | schedule.setXlDir(rs.getString("xl_dir")); | 697 | schedule.setXlDir(rs.getString("xl_dir")); |
| 696 | schedule.setStatus(rs.getInt("status")); | 698 | schedule.setStatus(rs.getInt("status")); |
| 697 | schedule.setRemarks(rs.getString("remarks")); | 699 | schedule.setRemarks(rs.getString("remarks")); |
| @@ -825,7 +827,7 @@ public class BusIntervalServiceImpl implements BusIntervalService { | @@ -825,7 +827,7 @@ public class BusIntervalServiceImpl implements BusIntervalService { | ||
| 825 | if(model.length() != 0){ | 827 | if(model.length() != 0){ |
| 826 | sql = "select sp.id from " | 828 | sql = "select sp.id from " |
| 827 | + "(select id, tt_info, xl_bm, lp, fcsj from bsth_c_s_sp_info where schedule_date >= '"+startDate+"' and schedule_date <= '"+endDate+"'" | 829 | + "(select id, tt_info, xl_bm, lp, fcsj from bsth_c_s_sp_info where schedule_date >= '"+startDate+"' and schedule_date <= '"+endDate+"'" |
| 828 | - + " and tt_info = '" + model + "' and bc_type != 'in' and bc_type != 'out' and bc_type != 'ldks') sp" | 830 | + + " and tt_info = '" + model + "' and bc_type != 'ldks') sp" |
| 829 | + " left join bsth_c_s_ttinfo_detail tt on sp.tt_info = tt.ttinfo and sp.xl_bm = tt.xl and sp.lp = tt.lp and sp.fcsj = tt.fcsj"; | 831 | + " left join bsth_c_s_ttinfo_detail tt on sp.tt_info = tt.ttinfo and sp.xl_bm = tt.xl and sp.lp = tt.lp and sp.fcsj = tt.fcsj"; |
| 830 | 832 | ||
| 831 | ttList = jdbcTemplate.query(sql, | 833 | ttList = jdbcTemplate.query(sql, |
| @@ -908,6 +910,7 @@ public class BusIntervalServiceImpl implements BusIntervalService { | @@ -908,6 +910,7 @@ public class BusIntervalServiceImpl implements BusIntervalService { | ||
| 908 | for(String key : keyMap.keySet()){ | 910 | for(String key : keyMap.keySet()){ |
| 909 | Map<String, Object> tempMap = new HashMap<String, Object>(); | 911 | Map<String, Object> tempMap = new HashMap<String, Object>(); |
| 910 | Map<Long, ScheduleRealInfo> sortMap = new HashMap<Long, ScheduleRealInfo>(); | 912 | Map<Long, ScheduleRealInfo> sortMap = new HashMap<Long, ScheduleRealInfo>(); |
| 913 | + Map<Long, Map<String, Object>> sortMap1 = new HashMap<Long, Map<String, Object>>(); | ||
| 911 | List<Map<String, Object>> mapList = new ArrayList<Map<String, Object>>(); | 914 | List<Map<String, Object>> mapList = new ArrayList<Map<String, Object>>(); |
| 912 | List<Long> keyList = new ArrayList<Long>(); | 915 | List<Long> keyList = new ArrayList<Long>(); |
| 913 | List<Long> keyList2 = new ArrayList<Long>(); | 916 | List<Long> keyList2 = new ArrayList<Long>(); |
| @@ -939,30 +942,25 @@ public class BusIntervalServiceImpl implements BusIntervalService { | @@ -939,30 +942,25 @@ public class BusIntervalServiceImpl implements BusIntervalService { | ||
| 939 | for(int i = 1; i < keyList.size(); i++){ | 942 | for(int i = 1; i < keyList.size(); i++){ |
| 940 | ScheduleRealInfo schedule1 = sortMap.get(keyList.get(i - 1)); | 943 | ScheduleRealInfo schedule1 = sortMap.get(keyList.get(i - 1)); |
| 941 | ScheduleRealInfo schedule2 = sortMap.get(keyList.get(i)); | 944 | ScheduleRealInfo schedule2 = sortMap.get(keyList.get(i)); |
| 942 | - if(!tsSet.contains(schedule1.getId())){ | ||
| 943 | - if(sfqr == 1 && time1 > schedule1.getFcsjT()){ | ||
| 944 | - jhyysj += schedule2.getFcsjT() - time1; | ||
| 945 | - }else if(sfqr == 1 && time2 < schedule2.getFcsjT()){ | ||
| 946 | - jhyysj += time2 - schedule1.getFcsjT(); | 945 | + if(!tsSet.contains(schedule1.getId()) && !schedule1.getBcType().toString().equals("in") && !schedule1.getBcType().toString().equals("out")){ |
| 946 | + long fcsj1 = schedule1.getFcsjT(); | ||
| 947 | + long fcsj2 = schedule2.getFcsjT(); | ||
| 948 | + if(tsSet.contains(schedule2.getId()) || schedule2.getBcType().toString().equals("in") || schedule2.getBcType().toString().equals("out")){ | ||
| 949 | + fcsj2 = schedule1.getZdsjT(); | ||
| 950 | + } | ||
| 951 | + if(sfqr == 1 && time1 > fcsj1){ | ||
| 952 | + jhyysj += fcsj2 - time1; | ||
| 953 | + }else if(sfqr == 1 && time2 < fcsj2){ | ||
| 954 | + jhyysj += time2 - fcsj1; | ||
| 947 | }else{ | 955 | }else{ |
| 948 | - jhyysj += schedule2.getFcsjT() - schedule1.getFcsjT(); | 956 | + jhyysj += fcsj2 - fcsj1; |
| 949 | } | 957 | } |
| 950 | - jhyysj1 += schedule2.getFcsjT() - schedule1.getFcsjT(); | ||
| 951 | - } | ||
| 952 | - long zdsj2 = schedule2.getZdsjT(); | ||
| 953 | - long fcsj2 = schedule2.getFcsjT(); | ||
| 954 | - if(fcsj2 > zdsj2) | ||
| 955 | - zdsj2 += 1440l; | ||
| 956 | - if(sfqr == 1 && time1 > fcsj2){ | ||
| 957 | - jhyssj += zdsj2 - time1; | ||
| 958 | - }else if(sfqr == 1 && time2 < zdsj2){ | ||
| 959 | - jhyssj += time2 - fcsj2; | ||
| 960 | - }else{ | ||
| 961 | - jhyssj += zdsj2 - fcsj2; | 958 | + if(jhyysj < 0){ |
| 959 | + System.out.println(fcsj2 + " - " + fcsj1); | ||
| 960 | + } | ||
| 961 | + jhyysj1 += fcsj2 - fcsj1; | ||
| 962 | } | 962 | } |
| 963 | - jhyssj1 += zdsj2 - fcsj2; | ||
| 964 | - jhlc += schedule2.getJhlc()==null?0:schedule2.getJhlc(); | ||
| 965 | - if(i == 1){ | 963 | + if(i == 1 && schedule1.getBcType().toString().equals("normal")){ |
| 966 | long zdsj1 = schedule1.getZdsjT(); | 964 | long zdsj1 = schedule1.getZdsjT(); |
| 967 | long fcsj1 = schedule1.getFcsjT(); | 965 | long fcsj1 = schedule1.getFcsjT(); |
| 968 | if(fcsj1 > zdsj1) | 966 | if(fcsj1 > zdsj1) |
| @@ -977,12 +975,27 @@ public class BusIntervalServiceImpl implements BusIntervalService { | @@ -977,12 +975,27 @@ public class BusIntervalServiceImpl implements BusIntervalService { | ||
| 977 | jhyssj1 += zdsj1 - fcsj1; | 975 | jhyssj1 += zdsj1 - fcsj1; |
| 978 | jhlc += schedule1.getJhlc()==null?0:schedule1.getJhlc(); | 976 | jhlc += schedule1.getJhlc()==null?0:schedule1.getJhlc(); |
| 979 | } | 977 | } |
| 978 | + if(schedule2.getBcType().toString().equals("normal")){ | ||
| 979 | + long zdsj2 = schedule2.getZdsjT(); | ||
| 980 | + long fcsj2 = schedule2.getFcsjT(); | ||
| 981 | + if(fcsj2 > zdsj2) | ||
| 982 | + zdsj2 += 1440l; | ||
| 983 | + if(sfqr == 1 && time1 > fcsj2){ | ||
| 984 | + jhyssj += zdsj2 - time1; | ||
| 985 | + }else if(sfqr == 1 && time2 < zdsj2){ | ||
| 986 | + jhyssj += time2 - fcsj2; | ||
| 987 | + }else{ | ||
| 988 | + jhyssj += zdsj2 - fcsj2; | ||
| 989 | + } | ||
| 990 | + jhyssj1 += zdsj2 - fcsj2; | ||
| 991 | + jhlc += schedule2.getJhlc()==null?0:schedule2.getJhlc(); | ||
| 992 | + } | ||
| 980 | } | 993 | } |
| 981 | 994 | ||
| 982 | for(int i = 0; i < keyList.size(); i++){ | 995 | for(int i = 0; i < keyList.size(); i++){ |
| 983 | Map<String, Object> m = new HashMap<String, Object>(); | 996 | Map<String, Object> m = new HashMap<String, Object>(); |
| 984 | ScheduleRealInfo schedule = sortMap.get(keyList.get(i)); | 997 | ScheduleRealInfo schedule = sortMap.get(keyList.get(i)); |
| 985 | - | 998 | + |
| 986 | if(cMap.containsKey(schedule.getId())){ | 999 | if(cMap.containsKey(schedule.getId())){ |
| 987 | List<ChildTaskPlan> cTasks = cMap.get(schedule.getId()); | 1000 | List<ChildTaskPlan> cTasks = cMap.get(schedule.getId()); |
| 988 | for(ChildTaskPlan childTaskPlan : cTasks){ | 1001 | for(ChildTaskPlan childTaskPlan : cTasks){ |
| @@ -1005,6 +1018,7 @@ public class BusIntervalServiceImpl implements BusIntervalService { | @@ -1005,6 +1018,7 @@ public class BusIntervalServiceImpl implements BusIntervalService { | ||
| 1005 | temp.put("fcsj", null); | 1018 | temp.put("fcsj", null); |
| 1006 | } | 1019 | } |
| 1007 | } | 1020 | } |
| 1021 | + temp.put("bcType", schedule.getBcType()); | ||
| 1008 | mapList.add(temp); | 1022 | mapList.add(temp); |
| 1009 | } | 1023 | } |
| 1010 | }else{ | 1024 | }else{ |
| @@ -1022,6 +1036,7 @@ public class BusIntervalServiceImpl implements BusIntervalService { | @@ -1022,6 +1036,7 @@ public class BusIntervalServiceImpl implements BusIntervalService { | ||
| 1022 | m.put("zdsj", null); | 1036 | m.put("zdsj", null); |
| 1023 | m.put("fcsj", null); | 1037 | m.put("fcsj", null); |
| 1024 | } | 1038 | } |
| 1039 | + m.put("bcType", schedule.getBcType()); | ||
| 1025 | mapList.add(m); | 1040 | mapList.add(m); |
| 1026 | } | 1041 | } |
| 1027 | } | 1042 | } |
| @@ -1029,6 +1044,7 @@ public class BusIntervalServiceImpl implements BusIntervalService { | @@ -1029,6 +1044,7 @@ public class BusIntervalServiceImpl implements BusIntervalService { | ||
| 1029 | for(Map<String, Object> m : mapList){ | 1044 | for(Map<String, Object> m : mapList){ |
| 1030 | if(m.get("fcsj") != null && m.get("fcsj").toString().trim().length()!=0){ | 1045 | if(m.get("fcsj") != null && m.get("fcsj").toString().trim().length()!=0){ |
| 1031 | keyList2.add(Long.valueOf(m.get("fcsj").toString())); | 1046 | keyList2.add(Long.valueOf(m.get("fcsj").toString())); |
| 1047 | + sortMap1.put(Long.valueOf(m.get("fcsj").toString()), m); | ||
| 1032 | } | 1048 | } |
| 1033 | } | 1049 | } |
| 1034 | Collections.sort(keyList2); | 1050 | Collections.sort(keyList2); |
| @@ -1036,36 +1052,31 @@ public class BusIntervalServiceImpl implements BusIntervalService { | @@ -1036,36 +1052,31 @@ public class BusIntervalServiceImpl implements BusIntervalService { | ||
| 1036 | for(int i = 1; i < keyList2.size(); i++){ | 1052 | for(int i = 1; i < keyList2.size(); i++){ |
| 1037 | long fcsj1 = keyList2.get(i - 1); | 1053 | long fcsj1 = keyList2.get(i - 1); |
| 1038 | long fcsj2 = keyList2.get(i); | 1054 | long fcsj2 = keyList2.get(i); |
| 1039 | - if(fcsj2 - fcsj1 < 90){ | ||
| 1040 | - if(sfqr == 1 && time1 > fcsj1){ | ||
| 1041 | - sjyysj += fcsj2 - time1; | ||
| 1042 | - }else if(sfqr == 1 && time2 < fcsj2){ | ||
| 1043 | - sjyysj += time2 - fcsj1; | ||
| 1044 | - }else{ | ||
| 1045 | - sjyysj += fcsj2 - fcsj1; | ||
| 1046 | - } | ||
| 1047 | - sjyysj1 += fcsj2 - fcsj1; | 1055 | + Map<String, Object> m1 = sortMap1.get(fcsj1); |
| 1056 | + Map<String, Object> m2 = sortMap1.get(fcsj2); | ||
| 1057 | + if(m1.get("bcType").toString().equals("in") || m1.get("bcType").toString().equals("out")) | ||
| 1058 | + continue; | ||
| 1059 | + if(m2.get("bcType").toString().equals("in") || m2.get("bcType").toString().equals("out")){ | ||
| 1060 | + fcsj2 = Long.valueOf(m1.get("zdsj").toString()); | ||
| 1061 | + } else if(i == keyList.size() - 1){ | ||
| 1062 | + fcsj2 = Long.valueOf(m2.get("zdsj").toString()); | ||
| 1063 | + } | ||
| 1064 | + if(sfqr == 1 && time1 > fcsj1){ | ||
| 1065 | + sjyysj += fcsj2 - time1; | ||
| 1066 | + }else if(sfqr == 1 && time2 < fcsj2){ | ||
| 1067 | + sjyysj += time2 - fcsj1; | ||
| 1068 | + }else{ | ||
| 1069 | + sjyysj += fcsj2 - fcsj1; | ||
| 1048 | } | 1070 | } |
| 1071 | + sjyysj1 += fcsj2 - fcsj1; | ||
| 1049 | } | 1072 | } |
| 1050 | 1073 | ||
| 1051 | - for(int i = 1; i < mapList.size(); i++){ | ||
| 1052 | - Map<String, Object> m1 = mapList.get(i - 1); | ||
| 1053 | - Map<String, Object> m2 = mapList.get(i); | ||
| 1054 | -// if(m1.get("fcsj") != null && m2.get("fcsj") != null){ | ||
| 1055 | -// long fcsj2 = Long.valueOf(m2.get("fcsj").toString()); | ||
| 1056 | -// long fcsj1 = Long.valueOf(m1.get("fcsj").toString()); | ||
| 1057 | -// if(sfqr == 1 && time1 > fcsj1){ | ||
| 1058 | -// sjyysj += fcsj2 - time1; | ||
| 1059 | -// }else if(sfqr == 1 && time2 < fcsj2){ | ||
| 1060 | -// sjyysj += time2 - fcsj1; | ||
| 1061 | -// }else{ | ||
| 1062 | -// sjyysj += fcsj2 - fcsj1; | ||
| 1063 | -// } | ||
| 1064 | -// sjyysj1 += fcsj2 - fcsj1; | ||
| 1065 | -// } | ||
| 1066 | - if(m2.get("fcsj") != null && m2.get("zdsj") != null){ | ||
| 1067 | - long zdsj = Long.valueOf(m2.get("zdsj").toString()); | ||
| 1068 | - long fcsj = Long.valueOf(m2.get("fcsj").toString()); | 1074 | + for(int i = 0; i < mapList.size(); i++){ |
| 1075 | + Map<String, Object> m = mapList.get(i); | ||
| 1076 | + if(m.get("fcsj") != null && m.get("zdsj") != null && | ||
| 1077 | + !m.get("bcType").toString().equals("in") && !m.get("bcType").toString().equals("out")){ | ||
| 1078 | + long zdsj = Long.valueOf(m.get("zdsj").toString()); | ||
| 1079 | + long fcsj = Long.valueOf(m.get("fcsj").toString()); | ||
| 1069 | if(fcsj > zdsj) | 1080 | if(fcsj > zdsj) |
| 1070 | zdsj += 1440l; | 1081 | zdsj += 1440l; |
| 1071 | if(sfqr == 1 && time1 > fcsj){ | 1082 | if(sfqr == 1 && time1 > fcsj){ |
| @@ -1076,22 +1087,7 @@ public class BusIntervalServiceImpl implements BusIntervalService { | @@ -1076,22 +1087,7 @@ public class BusIntervalServiceImpl implements BusIntervalService { | ||
| 1076 | sjyssj += zdsj - fcsj; | 1087 | sjyssj += zdsj - fcsj; |
| 1077 | } | 1088 | } |
| 1078 | sjyssj1 += zdsj - fcsj; | 1089 | sjyssj1 += zdsj - fcsj; |
| 1079 | - sjlc += Double.valueOf(m2.get("lc").toString()); | ||
| 1080 | - } | ||
| 1081 | - if(i == 1 && m1.get("fcsj") != null && m1.get("zdsj") != null){ | ||
| 1082 | - long zdsj = Long.valueOf(m1.get("zdsj").toString()); | ||
| 1083 | - long fcsj = Long.valueOf(m1.get("fcsj").toString()); | ||
| 1084 | - if(fcsj > zdsj) | ||
| 1085 | - zdsj += 1440l; | ||
| 1086 | - if(sfqr == 1 && time1 > fcsj){ | ||
| 1087 | - sjyssj += zdsj - time1; | ||
| 1088 | - }else if(sfqr == 1 && time2 < zdsj){ | ||
| 1089 | - sjyssj += time2 - fcsj; | ||
| 1090 | - }else{ | ||
| 1091 | - sjyssj += zdsj - fcsj; | ||
| 1092 | - } | ||
| 1093 | - sjyssj1 += zdsj - fcsj; | ||
| 1094 | - sjlc += Double.valueOf(m1.get("lc").toString()); | 1090 | + sjlc += Double.valueOf(m.get("lc").toString()); |
| 1095 | } | 1091 | } |
| 1096 | } | 1092 | } |
| 1097 | tempMap.put("company", companyName); | 1093 | tempMap.put("company", companyName); |
src/main/java/com/bsth/service/realcontrol/impl/ChildTaskPlanServiceImpl.java
| @@ -2,6 +2,7 @@ package com.bsth.service.realcontrol.impl; | @@ -2,6 +2,7 @@ package com.bsth.service.realcontrol.impl; | ||
| 2 | 2 | ||
| 3 | import com.bsth.common.ResponseCode; | 3 | import com.bsth.common.ResponseCode; |
| 4 | import com.bsth.data.BasicData; | 4 | import com.bsth.data.BasicData; |
| 5 | +import com.bsth.data.Station2ParkBuffer; | ||
| 5 | import com.bsth.data.schedule.DayOfSchedule; | 6 | import com.bsth.data.schedule.DayOfSchedule; |
| 6 | import com.bsth.entity.realcontrol.ChildTaskPlan; | 7 | import com.bsth.entity.realcontrol.ChildTaskPlan; |
| 7 | import com.bsth.entity.realcontrol.ScheduleRealInfo; | 8 | import com.bsth.entity.realcontrol.ScheduleRealInfo; |
| @@ -67,6 +68,9 @@ public class ChildTaskPlanServiceImpl extends BaseServiceImpl<ChildTaskPlan, Lon | @@ -67,6 +68,9 @@ public class ChildTaskPlanServiceImpl extends BaseServiceImpl<ChildTaskPlan, Lon | ||
| 67 | dayOfSchedule.save(sch); | 68 | dayOfSchedule.save(sch); |
| 68 | //直接持久化 | 69 | //直接持久化 |
| 69 | //scheduleRealInfoRepository.save(sch); | 70 | //scheduleRealInfoRepository.save(sch); |
| 71 | + //站到场对照 | ||
| 72 | + t.setSchedule(sch); | ||
| 73 | + Station2ParkBuffer.put(t); | ||
| 70 | 74 | ||
| 71 | rs.put("status", ResponseCode.SUCCESS); | 75 | rs.put("status", ResponseCode.SUCCESS); |
| 72 | rs.put("t", sch); | 76 | rs.put("t", sch); |
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
| @@ -15,9 +15,11 @@ import com.bsth.data.schedule.SchAttrCalculator; | @@ -15,9 +15,11 @@ import com.bsth.data.schedule.SchAttrCalculator; | ||
| 15 | import com.bsth.data.schedule.ScheduleComparator; | 15 | import com.bsth.data.schedule.ScheduleComparator; |
| 16 | import com.bsth.data.schedule.edit_logs.FormLogger; | 16 | import com.bsth.data.schedule.edit_logs.FormLogger; |
| 17 | import com.bsth.data.schedule.edit_logs.ScheduleModifyLogger; | 17 | import com.bsth.data.schedule.edit_logs.ScheduleModifyLogger; |
| 18 | +import com.bsth.data.schedule.edit_logs.loggers.AfterwardsLogger; | ||
| 18 | import com.bsth.data.schedule.edit_logs.loggers.FcxxwtLogger; | 19 | import com.bsth.data.schedule.edit_logs.loggers.FcxxwtLogger; |
| 19 | import com.bsth.data.schedule.edit_logs.service.dto.SchEditInfoDto; | 20 | import com.bsth.data.schedule.edit_logs.service.dto.SchEditInfoDto; |
| 20 | import com.bsth.data.schedule.late_adjust.LateAdjustHandle; | 21 | import com.bsth.data.schedule.late_adjust.LateAdjustHandle; |
| 22 | +import com.bsth.data.utils.CustomStringUtils; | ||
| 21 | import com.bsth.entity.Cars; | 23 | import com.bsth.entity.Cars; |
| 22 | import com.bsth.entity.Line; | 24 | import com.bsth.entity.Line; |
| 23 | import com.bsth.entity.Personnel; | 25 | import com.bsth.entity.Personnel; |
| @@ -3059,14 +3061,18 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -3059,14 +3061,18 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 3059 | rs.put("status", ResponseCode.ERROR); | 3061 | rs.put("status", ResponseCode.ERROR); |
| 3060 | 3062 | ||
| 3061 | ScheduleRealInfo oldSch = super.findById(sch.getId()); | 3063 | ScheduleRealInfo oldSch = super.findById(sch.getId()); |
| 3064 | + //事后日志记录 | ||
| 3065 | + AfterwardsLogger aflog = AfterwardsLogger.start(oldSch, "事后调整"); | ||
| 3062 | 3066 | ||
| 3063 | //换车 | 3067 | //换车 |
| 3064 | if (StringUtils.isNotEmpty(sch.getClZbh()) && !oldSch.getClZbh().equals(sch.getClZbh())) { | 3068 | if (StringUtils.isNotEmpty(sch.getClZbh()) && !oldSch.getClZbh().equals(sch.getClZbh())) { |
| 3065 | if (!carExist(oldSch.getGsBm(),sch.getClZbh())) { | 3069 | if (!carExist(oldSch.getGsBm(),sch.getClZbh())) { |
| 3066 | rs.put("msg", "车辆 " + sch.getClZbh() + " 不存在!"); | 3070 | rs.put("msg", "车辆 " + sch.getClZbh() + " 不存在!"); |
| 3067 | return rs; | 3071 | return rs; |
| 3068 | - } else | 3072 | + } else{ |
| 3073 | + aflog.log("换车", oldSch.getClZbh(), sch.getClZbh()); | ||
| 3069 | oldSch.setClZbh(sch.getClZbh()); | 3074 | oldSch.setClZbh(sch.getClZbh()); |
| 3075 | + } | ||
| 3070 | } | 3076 | } |
| 3071 | 3077 | ||
| 3072 | //换驾驶员 | 3078 | //换驾驶员 |
| @@ -3076,6 +3082,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -3076,6 +3082,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 3076 | rs.put("msg", oldSch.getXlName() + "所属的公司编码下找不到工号为【" + sch.getjGh() + "】的驾驶员"); | 3082 | rs.put("msg", oldSch.getXlName() + "所属的公司编码下找不到工号为【" + sch.getjGh() + "】的驾驶员"); |
| 3077 | return rs; | 3083 | return rs; |
| 3078 | } | 3084 | } |
| 3085 | + aflog.log("换驾驶员", oldSch.getjGh()+"/"+ oldSch.getjName(), sch.getjGh()+"/"+ sch.getjName()); | ||
| 3079 | persoChange(oldSch, sch.getjGh()); | 3086 | persoChange(oldSch, sch.getjGh()); |
| 3080 | } | 3087 | } |
| 3081 | 3088 | ||
| @@ -3086,6 +3093,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -3086,6 +3093,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 3086 | rs.put("msg", sch.getXlName() + "所属的公司编码下找不到工号为【" + sch.getsGh() + "】的售票员"); | 3093 | rs.put("msg", sch.getXlName() + "所属的公司编码下找不到工号为【" + sch.getsGh() + "】的售票员"); |
| 3087 | return rs; | 3094 | return rs; |
| 3088 | } | 3095 | } |
| 3096 | + aflog.log("换售票员", oldSch.getsGh()+"/"+ oldSch.getsName(), sch.getsGh()+"/"+ sch.getsName()); | ||
| 3089 | persoChangeSPY(oldSch, sch.getsGh()); | 3097 | persoChangeSPY(oldSch, sch.getsGh()); |
| 3090 | } | 3098 | } |
| 3091 | 3099 | ||
| @@ -3094,12 +3102,14 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -3094,12 +3102,14 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 3094 | boolean dest2 = sch.getStatus() == -1; | 3102 | boolean dest2 = sch.getStatus() == -1; |
| 3095 | if (!dest1 && dest2) { | 3103 | if (!dest1 && dest2) { |
| 3096 | oldSch.destroy(); | 3104 | oldSch.destroy(); |
| 3105 | + aflog.log("烂班"); | ||
| 3097 | } | 3106 | } |
| 3098 | else if(dest1 && !dest2){ | 3107 | else if(dest1 && !dest2){ |
| 3099 | //撤销烂班 | 3108 | //撤销烂班 |
| 3100 | oldSch.setJhlc(oldSch.getJhlcOrig()); | 3109 | oldSch.setJhlc(oldSch.getJhlcOrig()); |
| 3101 | oldSch.setStatus(0); | 3110 | oldSch.setStatus(0); |
| 3102 | oldSch.calcStatus(); | 3111 | oldSch.calcStatus(); |
| 3112 | + aflog.log("撤销烂班"); | ||
| 3103 | } | 3113 | } |
| 3104 | 3114 | ||
| 3105 | 3115 | ||
| @@ -3108,6 +3118,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -3108,6 +3118,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 3108 | */ | 3118 | */ |
| 3109 | if (!oldSch.getJhlc().equals(sch.getJhlc())) { | 3119 | if (!oldSch.getJhlc().equals(sch.getJhlc())) { |
| 3110 | double jhlcNum = sch.getJhlc(); | 3120 | double jhlcNum = sch.getJhlc(); |
| 3121 | + aflog.log("修改班次里程", oldSch.getJhlc(), jhlcNum); | ||
| 3111 | //烂班 | 3122 | //烂班 |
| 3112 | if(jhlcNum == 0 && oldSch.getJhlcOrig() != 0) | 3123 | if(jhlcNum == 0 && oldSch.getJhlcOrig() != 0) |
| 3113 | oldSch.destroy(); | 3124 | oldSch.destroy(); |
| @@ -3120,15 +3131,30 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -3120,15 +3131,30 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 3120 | } | 3131 | } |
| 3121 | 3132 | ||
| 3122 | //待发时间 | 3133 | //待发时间 |
| 3123 | - oldSch.setDfsj(sch.getDfsj()); | 3134 | + if(!CustomStringUtils.equals(oldSch.getDfsj(), sch.getDfsj())){ |
| 3135 | + aflog.log("修改待发时间", oldSch.getDfsj(), sch.getDfsj()); | ||
| 3136 | + oldSch.setDfsj(sch.getDfsj()); | ||
| 3137 | + } | ||
| 3124 | //实发时间 | 3138 | //实发时间 |
| 3125 | - oldSch.setFcsjActual(sch.getFcsjActual()); | 3139 | + if(!CustomStringUtils.equals(oldSch.getFcsjActual(), sch.getFcsjActual())){ |
| 3140 | + aflog.log("修改实发时间", oldSch.getFcsjActual(), sch.getFcsjActual()); | ||
| 3141 | + oldSch.setFcsjActual(sch.getFcsjActual()); | ||
| 3142 | + } | ||
| 3126 | //实际终点 | 3143 | //实际终点 |
| 3127 | - oldSch.setZdsjActual(sch.getZdsjActual()); | 3144 | + if(!CustomStringUtils.equals(oldSch.getZdsjActual(), sch.getZdsjActual())){ |
| 3145 | + aflog.log("修改实达时间", oldSch.getZdsjActual(), sch.getZdsjActual()); | ||
| 3146 | + oldSch.setZdsjActual(sch.getZdsjActual()); | ||
| 3147 | + } | ||
| 3148 | + | ||
| 3128 | //备注 | 3149 | //备注 |
| 3129 | - oldSch.setRemarks(sch.getRemarks()); | 3150 | + if(!CustomStringUtils.equals(oldSch.getRemarks(), sch.getRemarks())){ |
| 3151 | + aflog.log("修改备注", oldSch.getRemarks(), sch.getRemarks()); | ||
| 3152 | + oldSch.setRemarks(sch.getRemarks()); | ||
| 3153 | + } | ||
| 3130 | 3154 | ||
| 3131 | scheduleRealInfoRepository.save(oldSch); | 3155 | scheduleRealInfoRepository.save(oldSch); |
| 3156 | + | ||
| 3157 | + aflog.end(); | ||
| 3132 | rs.put("status", ResponseCode.SUCCESS); | 3158 | rs.put("status", ResponseCode.SUCCESS); |
| 3133 | return rs; | 3159 | return rs; |
| 3134 | } | 3160 | } |
src/main/resources/static/real_control_v2/css/main.css
| @@ -1341,25 +1341,6 @@ ul.left_tabs_lg li{ | @@ -1341,25 +1341,6 @@ ul.left_tabs_lg li{ | ||
| 1341 | margin-bottom: 0; | 1341 | margin-bottom: 0; |
| 1342 | } | 1342 | } |
| 1343 | 1343 | ||
| 1344 | -.sub_task_form_v2.repeat_main:before{ | ||
| 1345 | - content: '复'; | ||
| 1346 | - position: absolute; | ||
| 1347 | - top: -10px; | ||
| 1348 | - font-size: 12px; | ||
| 1349 | - color: #2196F3; | ||
| 1350 | - background: #ffffff; | ||
| 1351 | - padding: 0 3px; | ||
| 1352 | - font-weight: 600; | ||
| 1353 | -} | ||
| 1354 | - | ||
| 1355 | -.sub_task_form_v2.repeat_main.destroy_form:before{ | ||
| 1356 | - color: #F44336; | ||
| 1357 | -} | ||
| 1358 | - | ||
| 1359 | -.sub_task_form_v2.repeat_main{ | ||
| 1360 | - background: #f4faff; | ||
| 1361 | -} | ||
| 1362 | - | ||
| 1363 | .sub_task_form_v2.destroy_form{ | 1344 | .sub_task_form_v2.destroy_form{ |
| 1364 | background-color: #fff5f4 !important; | 1345 | background-color: #fff5f4 !important; |
| 1365 | } | 1346 | } |
| @@ -1434,4 +1415,161 @@ ul.left_tabs_lg li{ | @@ -1434,4 +1415,161 @@ ul.left_tabs_lg li{ | ||
| 1434 | font-size: 16px; | 1415 | font-size: 16px; |
| 1435 | color: #a44a4a; | 1416 | color: #a44a4a; |
| 1436 | font-family: 微软雅黑; | 1417 | font-family: 微软雅黑; |
| 1418 | +} | ||
| 1419 | + | ||
| 1420 | +#schedule-lp_change-modal .ct_table dl{ | ||
| 1421 | + height: 35px; | ||
| 1422 | +} | ||
| 1423 | + | ||
| 1424 | +#schedule-lp_change-modal .ct_table dl dd, #schedule-lp_change-modal .ct_table dl dt{ | ||
| 1425 | + line-height: 35px; | ||
| 1426 | +} | ||
| 1427 | + | ||
| 1428 | +/* | ||
| 1429 | +.sub_task_form_v2.repeat_main:before{ | ||
| 1430 | + content: '复'; | ||
| 1431 | + position: absolute; | ||
| 1432 | + top: -10px; | ||
| 1433 | + font-size: 12px; | ||
| 1434 | + color: #2196F3; | ||
| 1435 | + background: #ffffff; | ||
| 1436 | + padding: 0 3px; | ||
| 1437 | + font-weight: 600; | ||
| 1438 | +}*/ | ||
| 1439 | + | ||
| 1440 | +.sub_task_form_v2:before{ | ||
| 1441 | + position: absolute; | ||
| 1442 | + top: -7px; | ||
| 1443 | + font-size: 12px; | ||
| 1444 | + padding: 0 3px; | ||
| 1445 | + font-weight: 600; | ||
| 1446 | + line-height: 14px; | ||
| 1447 | +} | ||
| 1448 | + | ||
| 1449 | +.sub_task_form_v2.destroy_form:before{ | ||
| 1450 | + content: '烂班' !important; | ||
| 1451 | + color: #f14235 !important; | ||
| 1452 | + background: #ffffff !important; | ||
| 1453 | +} | ||
| 1454 | + | ||
| 1455 | +.sub_task_form_v2.service_form:before{ | ||
| 1456 | + content: '营运'; | ||
| 1457 | + color: #2196F3; | ||
| 1458 | + background: #ffffff; | ||
| 1459 | +} | ||
| 1460 | + | ||
| 1461 | +.sub_task_form_v2.empty_form:before{ | ||
| 1462 | + content: '空驶'; | ||
| 1463 | + color: #928f92; | ||
| 1464 | + background: #ffffff; | ||
| 1465 | +} | ||
| 1466 | + | ||
| 1467 | +.sub_task_form_v2.service_form{ | ||
| 1468 | + background: #f4faff; | ||
| 1469 | +} | ||
| 1470 | + | ||
| 1471 | +/*.sub_task_form_v2.repeat_main.destroy_form:before{ | ||
| 1472 | + color: #F44336; | ||
| 1473 | +} | ||
| 1474 | + | ||
| 1475 | +.sub_task_form_v2.repeat_main{ | ||
| 1476 | + background: #f4faff; | ||
| 1477 | +}*/ | ||
| 1478 | +.footer_tools{ | ||
| 1479 | + position: absolute; | ||
| 1480 | + left: 235px; | ||
| 1481 | + bottom: 19px; | ||
| 1482 | +} | ||
| 1483 | + | ||
| 1484 | +.footer_mileage_count{ | ||
| 1485 | + border: 1px solid #f2f2f2; | ||
| 1486 | + padding: 5px; | ||
| 1487 | + box-shadow: 0px 2px 5px 0 rgba(0, 0, 0, 0.2), 0px 2px 7px 0 rgba(0, 0, 0, 0.19); | ||
| 1488 | + display: inline-block; | ||
| 1489 | +} | ||
| 1490 | + | ||
| 1491 | +.footer_mileage_count>span{ | ||
| 1492 | + padding: 2px 5px; | ||
| 1493 | +} | ||
| 1494 | + | ||
| 1495 | +.footer_mileage_count>span.service_sum{ | ||
| 1496 | + color: #2196F3; | ||
| 1497 | +} | ||
| 1498 | + | ||
| 1499 | +.footer_mileage_count>span.empty_sum{ | ||
| 1500 | + color: #636363; | ||
| 1501 | +} | ||
| 1502 | + | ||
| 1503 | +.footer_mileage_count>span.destroy_sum{ | ||
| 1504 | + color: #f5574b; | ||
| 1505 | +} | ||
| 1506 | + | ||
| 1507 | +.station_to_park_link{ | ||
| 1508 | + display: inline-block; | ||
| 1509 | + margin-left: 15px; | ||
| 1510 | + vertical-align: bottom; | ||
| 1511 | + font-size: 12px; | ||
| 1512 | +} | ||
| 1513 | + | ||
| 1514 | +.station_to_park_link>a{ | ||
| 1515 | + color: #607D8B; | ||
| 1516 | +} | ||
| 1517 | + | ||
| 1518 | +#station_to_park-modal.ct-form-modal form input[type=text], | ||
| 1519 | +#station_to_park-modal.ct-form-modal form select{ | ||
| 1520 | + width: auto; | ||
| 1521 | +} | ||
| 1522 | + | ||
| 1523 | +.s_2_park_form_wrap{ | ||
| 1524 | + background: #fafafa; | ||
| 1525 | + border: 1px solid #e5e5e5; | ||
| 1526 | + padding: 7px 16px; | ||
| 1527 | + margin: 15px 0; | ||
| 1528 | + position: relative; | ||
| 1529 | +} | ||
| 1530 | + | ||
| 1531 | +.s_2_park_form_wrap .ct_close{ | ||
| 1532 | + position: absolute; | ||
| 1533 | + top: -12px; | ||
| 1534 | + padding: 0 4px; | ||
| 1535 | + right: -8px; | ||
| 1536 | + color: #939393; | ||
| 1537 | + border: 1px solid #f7dfdf; | ||
| 1538 | + border-radius: 25px; | ||
| 1539 | + cursor: pointer; | ||
| 1540 | +} | ||
| 1541 | + | ||
| 1542 | +.s_2_park_form_wrap .ct_close:hover{ | ||
| 1543 | + background: #e5e5e5; | ||
| 1544 | + color: #fd6e6e; | ||
| 1545 | +} | ||
| 1546 | + | ||
| 1547 | +.s_2_park_form_wrap label{ | ||
| 1548 | + color: #666; | ||
| 1549 | + font-size: 13px; | ||
| 1550 | +} | ||
| 1551 | + | ||
| 1552 | +#station_to_park-modal.ct-form-modal form input[readonly]{ | ||
| 1553 | + background: #fafafa; | ||
| 1554 | +} | ||
| 1555 | + | ||
| 1556 | +.s_2_park_form_wrap .bottom_label{ | ||
| 1557 | + margin-top: 25px; | ||
| 1558 | + display: block; | ||
| 1559 | +} | ||
| 1560 | + | ||
| 1561 | +.s_2_park_form_wrap .bottom_label_2{ | ||
| 1562 | + margin-top: 4px; | ||
| 1563 | + display: block; | ||
| 1564 | +} | ||
| 1565 | + | ||
| 1566 | +.ct_describe{ | ||
| 1567 | + font-size: 12px; | ||
| 1568 | + color: #909090; | ||
| 1569 | + font-family: FontAwesome; | ||
| 1570 | +} | ||
| 1571 | + | ||
| 1572 | +.ct_describe:before{ | ||
| 1573 | + content: "\f059"; | ||
| 1574 | + margin-right: 3px; | ||
| 1437 | } | 1575 | } |
| 1438 | \ No newline at end of file | 1576 | \ No newline at end of file |
src/main/resources/static/real_control_v2/css/north.css
| @@ -481,4 +481,13 @@ | @@ -481,4 +481,13 @@ | ||
| 481 | .ct-badge.ct-badge-TZRC:hover{ | 481 | .ct-badge.ct-badge-TZRC:hover{ |
| 482 | background: #97a50f; | 482 | background: #97a50f; |
| 483 | color: #fff; | 483 | color: #fff; |
| 484 | +} | ||
| 485 | + | ||
| 486 | +.ct-badge.ct-badge-LSBCTZ { | ||
| 487 | + color: red; | ||
| 488 | +} | ||
| 489 | + | ||
| 490 | +.ct-badge.ct-badge-LSBCTZ:hover{ | ||
| 491 | + background: red; | ||
| 492 | + color: #fff; | ||
| 484 | } | 493 | } |
| 485 | \ No newline at end of file | 494 | \ No newline at end of file |
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/lp_change.html
| 1 | -<div class="uk-modal ct_move_modal" id="schedule-lp_change-modal"> | 1 | +<div class="uk-modal" id="schedule-lp_change-modal"> |
| 2 | <div class="uk-modal-dialog" style="width: 1240px;"> | 2 | <div class="uk-modal-dialog" style="width: 1240px;"> |
| 3 | <a href="" class="uk-modal-close uk-close"></a> | 3 | <a href="" class="uk-modal-close uk-close"></a> |
| 4 | <div class="uk-modal-header"> | 4 | <div class="uk-modal-header"> |
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/sub_task_v2/add_custom.html
| @@ -88,6 +88,7 @@ | @@ -88,6 +88,7 @@ | ||
| 88 | gb_schedule_table.updateSchedule(rst); | 88 | gb_schedule_table.updateSchedule(rst); |
| 89 | UIkit.modal('#add-sub-task-main-modal').hide(); | 89 | UIkit.modal('#add-sub-task-main-modal').hide(); |
| 90 | $('#schedule-lj_zrw-modal .main-schedule-table').trigger('refresh', {sch: sch}); | 90 | $('#schedule-lj_zrw-modal .main-schedule-table').trigger('refresh', {sch: sch}); |
| 91 | + gb_data_basic.reload_stat_park_data(); | ||
| 91 | return; | 92 | return; |
| 92 | } | 93 | } |
| 93 | var data = dataArray[i]; | 94 | var data = dataArray[i]; |
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/sub_task_v2/add_in_out.html
| @@ -40,10 +40,20 @@ | @@ -40,10 +40,20 @@ | ||
| 40 | repeat_In(inf); | 40 | repeat_In(inf); |
| 41 | //出场子任务 | 41 | //出场子任务 |
| 42 | repeat_Out(outf); | 42 | repeat_Out(outf); |
| 43 | + | ||
| 44 | + //进场终点改变事件 | ||
| 45 | + $f('endStation', inf).on('change', function () { | ||
| 46 | + $f('startStation',outf).val($(this).val()).trigger('change'); | ||
| 47 | + }); | ||
| 48 | + | ||
| 43 | }, 500); | 49 | }, 500); |
| 44 | 50 | ||
| 45 | - //营运终点和进场起点改变事件 | 51 | + //营运终点改变事件 |
| 46 | $f('endStation', sf).on('change', changeServiceEnd); | 52 | $f('endStation', sf).on('change', changeServiceEnd); |
| 53 | + //进场公里改变 | ||
| 54 | + $f('mileage',inf).on('input', function () { | ||
| 55 | + $f('mileage',outf).val($(this).val()); | ||
| 56 | + }); | ||
| 47 | //$f('startStation', inf).on('change', changeServiceEnd); | 57 | //$f('startStation', inf).on('change', changeServiceEnd); |
| 48 | }); | 58 | }); |
| 49 | 59 | ||
| @@ -88,7 +98,7 @@ | @@ -88,7 +98,7 @@ | ||
| 88 | f.addClass('destroy_form'); | 98 | f.addClass('destroy_form'); |
| 89 | } | 99 | } |
| 90 | else if (sch.status == 2) { | 100 | else if (sch.status == 2) { |
| 91 | - $f('destroy', f).parents('label').hide(); | 101 | + $f('destroy', f).parents('label').remove(); |
| 92 | $f('endDate', f).val(sch.zdsjActual); | 102 | $f('endDate', f).val(sch.zdsjActual); |
| 93 | $('input,select', f).attr('disabled', 'disabled'); | 103 | $('input,select', f).attr('disabled', 'disabled'); |
| 94 | } | 104 | } |
| @@ -137,11 +147,14 @@ | @@ -137,11 +147,14 @@ | ||
| 137 | } | 147 | } |
| 138 | if(eCode==sch.qdzCode || eCode==sch.zdzCode){ | 148 | if(eCode==sch.qdzCode || eCode==sch.zdzCode){ |
| 139 | $f('startStation',inf).val(eCode).trigger('change'); | 149 | $f('startStation',inf).val(eCode).trigger('change'); |
| 150 | + $f('type2',outf).trigger('change'); | ||
| 140 | return; | 151 | return; |
| 141 | } | 152 | } |
| 142 | 153 | ||
| 143 | //进场起点 | 154 | //进场起点 |
| 144 | - $f('startStation',inf).val(eCode); | 155 | + $f('startStation',inf).val(eCode);//.trigger('change'); |
| 156 | + //终点trigger change 出发重计算 | ||
| 157 | + $f('endStation',inf).trigger('change'); | ||
| 145 | 158 | ||
| 146 | //中途进场 | 159 | //中途进场 |
| 147 | showHalfPanel(eCode); | 160 | showHalfPanel(eCode); |
| @@ -212,7 +225,7 @@ | @@ -212,7 +225,7 @@ | ||
| 212 | var htmlStr = template('st-v2-domains-changecar-form-temp', {inOutExps: gb_common.inOutExps}); | 225 | var htmlStr = template('st-v2-domains-changecar-form-temp', {inOutExps: gb_common.inOutExps}); |
| 213 | $('.domains', half_form).html(htmlStr); | 226 | $('.domains', half_form).html(htmlStr); |
| 214 | $('.domains', outf).html(htmlStr); | 227 | $('.domains', outf).html(htmlStr); |
| 215 | - half_form.css('z-index', 99).trigger('add_reason_field'); | 228 | + half_form.css('z-index', 99).formValidation('addField', 'reason').formValidation('addField', 'nbbm'); |
| 216 | outf.trigger('add_reason_field'); | 229 | outf.trigger('add_reason_field'); |
| 217 | 230 | ||
| 218 | //车辆 autocomplete | 231 | //车辆 autocomplete |
| @@ -221,13 +234,15 @@ | @@ -221,13 +234,15 @@ | ||
| 221 | 234 | ||
| 222 | //同步车辆编码 | 235 | //同步车辆编码 |
| 223 | $f('nbbm', half_form).on('input change', function () { | 236 | $f('nbbm', half_form).on('input change', function () { |
| 224 | - $f('nbbm', outf).val($(this).val()); | 237 | + $f('nbbm', outf).val($(this).val()); |
| 225 | }); | 238 | }); |
| 226 | 239 | ||
| 227 | half_form.removeClass('destroy_form'); | 240 | half_form.removeClass('destroy_form'); |
| 228 | 241 | ||
| 229 | //出场终点 | 242 | //出场终点 |
| 230 | - $f('endStation',outf).val($f('endStation',sf).val()); | 243 | + $f('endStation',outf).val($f('endStation',sf).val()).trigger('change'); |
| 244 | + //出发合计公里重新计算 | ||
| 245 | + $f('mileage', half_form).trigger('input'); | ||
| 231 | } | 246 | } |
| 232 | 247 | ||
| 233 | function disabledChangeCar() { | 248 | function disabledChangeCar() { |
| @@ -261,6 +276,7 @@ | @@ -261,6 +276,7 @@ | ||
| 261 | gb_schedule_table.updateSchedule(rst); | 276 | gb_schedule_table.updateSchedule(rst); |
| 262 | UIkit.modal('#add-sub-task-main-modal').hide(); | 277 | UIkit.modal('#add-sub-task-main-modal').hide(); |
| 263 | $('#schedule-lj_zrw-modal .main-schedule-table').trigger('refresh', {sch: sch}); | 278 | $('#schedule-lj_zrw-modal .main-schedule-table').trigger('refresh', {sch: sch}); |
| 279 | + gb_data_basic.reload_stat_park_data(); | ||
| 264 | return; | 280 | return; |
| 265 | } | 281 | } |
| 266 | var data = dataArray[i]; | 282 | var data = dataArray[i]; |
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/sub_task_v2/add_range_turn.html
| @@ -127,6 +127,14 @@ | @@ -127,6 +127,14 @@ | ||
| 127 | */ | 127 | */ |
| 128 | function changeTurnStation() { | 128 | function changeTurnStation() { |
| 129 | f1.nextAll('.sub_task_form_v2').remove(); | 129 | f1.nextAll('.sub_task_form_v2').remove(); |
| 130 | + //掉头站点编码 | ||
| 131 | + var eCode = $('#turnStationSelect', topf).val(); | ||
| 132 | + if(!eCode){ | ||
| 133 | + //$('.footer_mileage_count', '#add-sub-task-main-modal').trigger('refresh'); | ||
| 134 | + $f('endStation', f1).val(sch.zdzCode).trigger('change'); | ||
| 135 | + $('#emptyTurnCbox input')[0].checked=false; | ||
| 136 | + return; | ||
| 137 | + } | ||
| 130 | 138 | ||
| 131 | //烂班1 | 139 | //烂班1 |
| 132 | df1 = destroyForm(disabled_form(addTaskForm())); | 140 | df1 = destroyForm(disabled_form(addTaskForm())); |
| @@ -135,8 +143,7 @@ | @@ -135,8 +143,7 @@ | ||
| 135 | //营运2 | 143 | //营运2 |
| 136 | f2 = disabled_form(addTaskForm()); | 144 | f2 = disabled_form(addTaskForm()); |
| 137 | $('.domains', f2).empty(); | 145 | $('.domains', f2).empty(); |
| 138 | - //掉头站点编码 | ||
| 139 | - var eCode = $('#turnStationSelect', topf).val(); | 146 | + |
| 140 | 147 | ||
| 141 | //营运1终点 | 148 | //营运1终点 |
| 142 | $f('endStation', f1).val(eCode).trigger('change'); | 149 | $f('endStation', f1).val(eCode).trigger('change'); |
| @@ -155,7 +162,7 @@ | @@ -155,7 +162,7 @@ | ||
| 155 | $('[sch_id_inp]', f2).val(nextSch.id); | 162 | $('[sch_id_inp]', f2).val(nextSch.id); |
| 156 | 163 | ||
| 157 | //set css | 164 | //set css |
| 158 | - setCss(); | 165 | + //setCss(); |
| 159 | //reason | 166 | //reason |
| 160 | changeTurnReason(); | 167 | changeTurnReason(); |
| 161 | } | 168 | } |
| @@ -180,17 +187,17 @@ | @@ -180,17 +187,17 @@ | ||
| 180 | return f; | 187 | return f; |
| 181 | } | 188 | } |
| 182 | 189 | ||
| 183 | - function setCss() { | ||
| 184 | - $('.sub_task_form_v2', wrap).each(function () { | ||
| 185 | - if($(this).hasClass('destroy_form')) | ||
| 186 | - return true; | 190 | + /*function setCss() { |
| 191 | + $('.sub_task_form_v2', wrap).each(function () { | ||
| 192 | + if($(this).hasClass('destroy_form')) | ||
| 193 | + return true; | ||
| 187 | 194 | ||
| 188 | - if($f('mileageType', this).val()=='service') | ||
| 189 | - $(this).addClass('service_st_form'); | ||
| 190 | - else | ||
| 191 | - $(this).removeClass('service_st_form'); | ||
| 192 | - }); | ||
| 193 | - } | 195 | + if($f('mileageType', this).val()=='service') |
| 196 | + $(this).addClass('service_st_form'); | ||
| 197 | + else | ||
| 198 | + $(this).removeClass('service_st_form'); | ||
| 199 | + }); | ||
| 200 | + }*/ | ||
| 194 | 201 | ||
| 195 | /** | 202 | /** |
| 196 | * 空驶调头 | 203 | * 空驶调头 |
| @@ -209,12 +216,14 @@ | @@ -209,12 +216,14 @@ | ||
| 209 | $f('startDate', df2).val(nextSch.dfsj); | 216 | $f('startDate', df2).val(nextSch.dfsj); |
| 210 | $f('endDate', df2).val(nextSch.zdsj); | 217 | $f('endDate', df2).val(nextSch.zdsj); |
| 211 | //营运2 变空驶 | 218 | //营运2 变空驶 |
| 212 | - f2.removeClass('service_st_form'); | ||
| 213 | - $f('mileageType',f2).val('empty'); | 219 | + //f2.removeClass('service_st_form'); |
| 220 | + $f('mileageType',f2).val('empty').trigger('change'); | ||
| 214 | } | 221 | } |
| 215 | else{ | 222 | else{ |
| 216 | changeTurnStation(); | 223 | changeTurnStation(); |
| 217 | } | 224 | } |
| 225 | + | ||
| 226 | + //$f('mileage', df2).trigger('input'); | ||
| 218 | } | 227 | } |
| 219 | 228 | ||
| 220 | //提交 | 229 | //提交 |
| @@ -245,6 +254,7 @@ | @@ -245,6 +254,7 @@ | ||
| 245 | //gb_schedule_table.addRemarks([sch, nextSch], gb_common.trim(remarks, 'g')); | 254 | //gb_schedule_table.addRemarks([sch, nextSch], gb_common.trim(remarks, 'g')); |
| 246 | UIkit.modal('#add-sub-task-main-modal').hide(); | 255 | UIkit.modal('#add-sub-task-main-modal').hide(); |
| 247 | $('#schedule-lj_zrw-modal .main-schedule-table').trigger('refresh', {sch: sch}); | 256 | $('#schedule-lj_zrw-modal .main-schedule-table').trigger('refresh', {sch: sch}); |
| 257 | + gb_data_basic.reload_stat_park_data(); | ||
| 248 | return; | 258 | return; |
| 249 | } | 259 | } |
| 250 | var data = dataArray[i]; | 260 | var data = dataArray[i]; |
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/sub_task_v2/main.html
| @@ -20,6 +20,20 @@ | @@ -20,6 +20,20 @@ | ||
| 20 | </ul> | 20 | </ul> |
| 21 | </div> | 21 | </div> |
| 22 | </div> | 22 | </div> |
| 23 | + | ||
| 24 | + <div class="footer_tools"> | ||
| 25 | + <!-- 底部公里统计栏 --> | ||
| 26 | + <div class="footer_mileage_count"> | ||
| 27 | + 合计 | ||
| 28 | + <span class="service_sum"></span> | ||
| 29 | + <span class="destroy_sum"></span> | ||
| 30 | + <span class="empty_sum"></span> | ||
| 31 | + </div> | ||
| 32 | + <!-- 站到场 链接 --> | ||
| 33 | + <div class="station_to_park_link"> | ||
| 34 | + <a>站 <i class="uk-icon-exchange"></i> 场</a> | ||
| 35 | + </div> | ||
| 36 | + </div> | ||
| 23 | </div> | 37 | </div> |
| 24 | 38 | ||
| 25 | <script id="sub-task-v2-form-temp" type="text/html"> | 39 | <script id="sub-task-v2-form-temp" type="text/html"> |
| @@ -108,7 +122,7 @@ | @@ -108,7 +122,7 @@ | ||
| 108 | <label class="uk-form-label">车辆编码</label> | 122 | <label class="uk-form-label">车辆编码</label> |
| 109 | <div class="uk-form-controls"> | 123 | <div class="uk-form-controls"> |
| 110 | <div class="uk-autocomplete autocomplete-cars"> | 124 | <div class="uk-autocomplete autocomplete-cars"> |
| 111 | - <input type="text" name="nbbm" placeholder="车辆自编号"> | 125 | + <input type="text" name="nbbm" placeholder="车辆自编号" required> |
| 112 | </div> | 126 | </div> |
| 113 | </div> | 127 | </div> |
| 114 | </div> | 128 | </div> |
| @@ -189,12 +203,15 @@ | @@ -189,12 +203,15 @@ | ||
| 189 | var modal = '#add-sub-task-main-modal', sch, | 203 | var modal = '#add-sub-task-main-modal', sch, |
| 190 | stationRoutes, | 204 | stationRoutes, |
| 191 | parks, | 205 | parks, |
| 192 | - information; | 206 | + information, |
| 207 | + st_park_data; | ||
| 193 | 208 | ||
| 194 | $(modal).on('init', function (e, data) { | 209 | $(modal).on('init', function (e, data) { |
| 195 | e.stopPropagation(); | 210 | e.stopPropagation(); |
| 196 | sch = data.sch; | 211 | sch = data.sch; |
| 197 | 212 | ||
| 213 | + //站到场数据 | ||
| 214 | + st_park_data = gb_data_basic.get_stat_park_data()[sch.xlBm]; | ||
| 198 | //站点路由 | 215 | //站点路由 |
| 199 | stationRoutes = gb_common.groupBy(gb_data_basic.stationRoutes(sch.xlBm).sort(function (a, b) { | 216 | stationRoutes = gb_common.groupBy(gb_data_basic.stationRoutes(sch.xlBm).sort(function (a, b) { |
| 200 | return a.stationRouteCode - b.stationRouteCode; | 217 | return a.stationRouteCode - b.stationRouteCode; |
| @@ -230,15 +247,50 @@ | @@ -230,15 +247,50 @@ | ||
| 230 | $(modal).on('change', 'input[name=destroy]', destroyClick); | 247 | $(modal).on('change', 'input[name=destroy]', destroyClick); |
| 231 | //起终点站切换事件 | 248 | //起终点站切换事件 |
| 232 | $(modal).on('change', 'select[name=startStation],select[name=endStation]', reCalcInputs_station); | 249 | $(modal).on('change', 'select[name=startStation],select[name=endStation]', reCalcInputs_station); |
| 233 | - //开始时间和公里数改变 | ||
| 234 | - $(modal).on('input', 'input[name=startDate], input[name=mileage]', reCalcEndTime); | 250 | + //开始时间改变 |
| 251 | + $(modal).on('input', 'input[name=startDate]', reCalcEndTime); | ||
| 252 | + //公里数改变 | ||
| 253 | + $(modal).on('input', 'input[name=mileage]', reCalcMileageCount); | ||
| 235 | //终点时间改变 | 254 | //终点时间改变 |
| 236 | $(modal).on('input', 'input[name=endDate]', reCalcNext_s_time); | 255 | $(modal).on('input', 'input[name=endDate]', reCalcNext_s_time); |
| 237 | //进出场原因切换 | 256 | //进出场原因切换 |
| 238 | $(modal).on('change', 'select[name=reason]', reSynchroReason); | 257 | $(modal).on('change', 'select[name=reason]', reSynchroReason); |
| 258 | + //里程类型改变 | ||
| 259 | + $(modal).on('change', 'select[name=mileageType]', changeMileageType); | ||
| 239 | //关闭 | 260 | //关闭 |
| 240 | $(modal).on('click', '.task_form_close_icon', closeTaskForm); | 261 | $(modal).on('click', '.task_form_close_icon', closeTaskForm); |
| 241 | 262 | ||
| 263 | + //公里合计footer | ||
| 264 | + var re_count; | ||
| 265 | + $('.footer_mileage_count', modal).on('refresh', function () { | ||
| 266 | + if(re_count) | ||
| 267 | + return; | ||
| 268 | + re_count = true; | ||
| 269 | + var that=this; | ||
| 270 | + setTimeout(function () { | ||
| 271 | + var fs = $('#tempScheduleContent li.uk-active form.sub_task_form_v2', modal); | ||
| 272 | + var s=0,e=0,d=0,mileage; | ||
| 273 | + $.each(fs, function () { | ||
| 274 | + mileage = parseFloat($f('mileage',this).val()); | ||
| 275 | + if($(this).hasClass('destroy_form')) | ||
| 276 | + d = gb_common.accAdd(d, mileage); | ||
| 277 | + else if($(this).hasClass('service_form')) | ||
| 278 | + s = gb_common.accAdd(s, mileage); | ||
| 279 | + else if($(this).hasClass('empty_form')) | ||
| 280 | + e = gb_common.accAdd(e, mileage); | ||
| 281 | + }); | ||
| 282 | + | ||
| 283 | + $('span',that).hide(); | ||
| 284 | + if(s>0) | ||
| 285 | + $('span.service_sum',that).html('营运: ' + s).show(); | ||
| 286 | + if(e>0) | ||
| 287 | + $('span.empty_sum',that).html('空驶: ' + e).show(); | ||
| 288 | + if(d>0) | ||
| 289 | + $('span.destroy_sum',that).html('烂班: ' + d).show(); | ||
| 290 | + re_count=false; | ||
| 291 | + }, 200); | ||
| 292 | + }); | ||
| 293 | + | ||
| 242 | /** | 294 | /** |
| 243 | * 根据班次类型切换起终点下拉框 | 295 | * 根据班次类型切换起终点下拉框 |
| 244 | */ | 296 | */ |
| @@ -261,28 +313,28 @@ | @@ -261,28 +313,28 @@ | ||
| 261 | switch ($(this).val()) { | 313 | switch ($(this).val()) { |
| 262 | case '3'://出场 | 314 | case '3'://出场 |
| 263 | qdz.html(park_opts).val(information.carPark); | 315 | qdz.html(park_opts).val(information.carPark); |
| 264 | - zdz.html(opts); | ||
| 265 | - mType.val('empty').attr('disabled', 'disabled'); | 316 | + zdz.html(opts).trigger('change'); |
| 317 | + mType.val('empty').attr('disabled', 'disabled').trigger('change'); | ||
| 266 | domainsTemp = 'st-v2-domains-inout-form-temp'; | 318 | domainsTemp = 'st-v2-domains-inout-form-temp'; |
| 267 | - //如果上一个form是进场 | ||
| 268 | - try { | ||
| 269 | - var prev_f = f.prev('.sub_task_form_v2'); | ||
| 270 | - if ($f('type2', prev_f).val() == 2) | ||
| 271 | - zdz.val($f('startStation', prev_f).val()); | ||
| 272 | - } catch (e) { | ||
| 273 | - console.log(e); | ||
| 274 | - } | 319 | + /*//如果上一个form是进场 |
| 320 | + try { | ||
| 321 | + var prev_f = f.prev('.sub_task_form_v2'); | ||
| 322 | + if ($f('type2', prev_f).val() == 2) | ||
| 323 | + zdz.val($f('startStation', prev_f).val()); | ||
| 324 | + } catch (e) { | ||
| 325 | + console.log(e); | ||
| 326 | + }*/ | ||
| 275 | break; | 327 | break; |
| 276 | case '2'://进场 | 328 | case '2'://进场 |
| 277 | qdz.html(opts) | 329 | qdz.html(opts) |
| 278 | - zdz.html(park_opts).val(information.carPark); | ||
| 279 | - mType.val('empty').attr('disabled', 'disabled'); | 330 | + zdz.html(park_opts).val(information.carPark).trigger('change'); |
| 331 | + mType.val('empty').attr('disabled', 'disabled').trigger('change'); | ||
| 280 | domainsTemp = 'st-v2-domains-inout-form-temp'; | 332 | domainsTemp = 'st-v2-domains-inout-form-temp'; |
| 281 | break; | 333 | break; |
| 282 | default: | 334 | default: |
| 283 | qdz.html(opts); | 335 | qdz.html(opts); |
| 284 | - zdz.html(opts).val(lastCode); | ||
| 285 | - mType.val('service').removeAttr('disabled'); | 336 | + zdz.html(opts).val(lastCode).trigger('change'); |
| 337 | + mType.val('service').removeAttr('disabled').trigger('change'); | ||
| 286 | domainsTemp = 'st-v2-domains-service-form-temp'; | 338 | domainsTemp = 'st-v2-domains-service-form-temp'; |
| 287 | } | 339 | } |
| 288 | 340 | ||
| @@ -319,27 +371,37 @@ | @@ -319,27 +371,37 @@ | ||
| 319 | upDown = sch.xlDir | 371 | upDown = sch.xlDir |
| 320 | } | 372 | } |
| 321 | 373 | ||
| 322 | - switch (upDown + '_' + type2) { | ||
| 323 | - case '0_3'://上行出场 | ||
| 324 | - mileage = information.upOutMileage; | ||
| 325 | - time = information.upOutTimer; | ||
| 326 | - break; | ||
| 327 | - case '1_3'://下行出场 | ||
| 328 | - mileage = information.downOutMileage; | ||
| 329 | - time = information.downOutTimer; | ||
| 330 | - break; | ||
| 331 | - case '0_2'://上行进场 | ||
| 332 | - mileage = information.upInMileage; | ||
| 333 | - time = information.upInTimer; | ||
| 334 | - break; | ||
| 335 | - case '1_2'://下行进场 | ||
| 336 | - mileage = information.downInMileage; | ||
| 337 | - time = information.downInTimer; | ||
| 338 | - break; | ||
| 339 | - default: | ||
| 340 | - //线路上站点间 | ||
| 341 | - mileage = calcMileageByRoutes(stationRoutes[upDown], qdzCode, zdzCode); | ||
| 342 | - time = gb_common.mul(gb_common.accDiv(sch.bcsj, sch.jhlcOrig), mileage); | 374 | + //从站到场里获取数据 |
| 375 | + var stp = search_st_park(f); | ||
| 376 | + if(stp){ | ||
| 377 | + mileage=type2==2?stp['mileage1']:stp['mileage2']; | ||
| 378 | + time=type2==2?stp['time1']:stp['time2']; | ||
| 379 | + } | ||
| 380 | + else{ | ||
| 381 | + if(upDown==-1) | ||
| 382 | + return; | ||
| 383 | + switch (upDown + '_' + type2) { | ||
| 384 | + case '0_3'://上行出场 | ||
| 385 | + mileage = information.upOutMileage; | ||
| 386 | + time = information.upOutTimer; | ||
| 387 | + break; | ||
| 388 | + case '1_3'://下行出场 | ||
| 389 | + mileage = information.downOutMileage; | ||
| 390 | + time = information.downOutTimer; | ||
| 391 | + break; | ||
| 392 | + case '0_2'://上行进场 | ||
| 393 | + mileage = information.upInMileage; | ||
| 394 | + time = information.upInTimer; | ||
| 395 | + break; | ||
| 396 | + case '1_2'://下行进场 | ||
| 397 | + mileage = information.downInMileage; | ||
| 398 | + time = information.downInTimer; | ||
| 399 | + break; | ||
| 400 | + default: | ||
| 401 | + //线路上站点间 | ||
| 402 | + mileage = calcMileageByRoutes(stationRoutes[upDown], qdzCode, zdzCode); | ||
| 403 | + time = gb_common.mul(gb_common.accDiv(sch.bcsj, sch.jhlcOrig), mileage); | ||
| 404 | + } | ||
| 343 | } | 405 | } |
| 344 | 406 | ||
| 345 | $f('mileage', f).val(mileage); | 407 | $f('mileage', f).val(mileage); |
| @@ -349,6 +411,7 @@ | @@ -349,6 +411,7 @@ | ||
| 349 | if (type2 != 1) { | 411 | if (type2 != 1) { |
| 350 | reCalcEndTime.call(this); | 412 | reCalcEndTime.call(this); |
| 351 | } | 413 | } |
| 414 | + reCalcMileageCount(); | ||
| 352 | } | 415 | } |
| 353 | 416 | ||
| 354 | /** | 417 | /** |
| @@ -363,26 +426,34 @@ | @@ -363,26 +426,34 @@ | ||
| 363 | return; | 426 | return; |
| 364 | 427 | ||
| 365 | var time; | 428 | var time; |
| 366 | - if (type2 == 1) { | ||
| 367 | - time = gb_common.mul(gb_common.accDiv(sch.bcsj, sch.jhlcOrig), mileage); | ||
| 368 | - } | ||
| 369 | - else if (type2 == 2) { | ||
| 370 | - //进场 | ||
| 371 | - var qdzCode = $f('startStation', f).val(), | ||
| 372 | - updown = inout_updown(qdzCode, sch); | ||
| 373 | - | ||
| 374 | - if (updown == -1) | ||
| 375 | - return; | ||
| 376 | - time = updown == 0 ? information.upInTimer : information.downInTimer; | 429 | + //从站到场里获取数据 |
| 430 | + var stp = search_st_park(f); | ||
| 431 | + if(stp){ | ||
| 432 | + mileage=type2==2?stp['mileage1']:stp['mileage2']; | ||
| 433 | + time=type2==2?stp['time1']:stp['time2']; | ||
| 377 | } | 434 | } |
| 378 | - else if (type2 == 3) { | ||
| 379 | - //出场 | ||
| 380 | - var zdzCode = $f('endStation', f).val(), | ||
| 381 | - updown = inout_updown(zdzCode, sch); | ||
| 382 | - | ||
| 383 | - if (updown == -1) | ||
| 384 | - return; | ||
| 385 | - time = updown == 0 ? information.upOutTimer : information.downOutTimer; | 435 | + else{ |
| 436 | + if (type2 == 1) { | ||
| 437 | + time = gb_common.mul(gb_common.accDiv(sch.bcsj, sch.jhlcOrig), mileage); | ||
| 438 | + } | ||
| 439 | + else if (type2 == 2) { | ||
| 440 | + //进场 | ||
| 441 | + var qdzCode = $f('startStation', f).val(), | ||
| 442 | + updown = inout_updown(qdzCode, sch); | ||
| 443 | + | ||
| 444 | + if (updown == -1) | ||
| 445 | + return; | ||
| 446 | + time = updown == 0 ? information.upInTimer : information.downInTimer; | ||
| 447 | + } | ||
| 448 | + else if (type2 == 3) { | ||
| 449 | + //出场 | ||
| 450 | + var zdzCode = $f('endStation', f).val(), | ||
| 451 | + updown = inout_updown(zdzCode, sch); | ||
| 452 | + | ||
| 453 | + if (updown == -1) | ||
| 454 | + return; | ||
| 455 | + time = updown == 0 ? information.upOutTimer : information.downOutTimer; | ||
| 456 | + } | ||
| 386 | } | 457 | } |
| 387 | 458 | ||
| 388 | var et = moment(startDate, 'HH:mm').add(time, 'minutes'); | 459 | var et = moment(startDate, 'HH:mm').add(time, 'minutes'); |
| @@ -456,6 +527,16 @@ | @@ -456,6 +527,16 @@ | ||
| 456 | $('.destroy_reason_wrap', f).hide(); | 527 | $('.destroy_reason_wrap', f).hide(); |
| 457 | f.removeAttr('destroy').removeClass('destroy_form'); | 528 | f.removeAttr('destroy').removeClass('destroy_form'); |
| 458 | } | 529 | } |
| 530 | + reCalcMileageCount(); | ||
| 531 | + } | ||
| 532 | + | ||
| 533 | + function changeMileageType() { | ||
| 534 | + var f = $(this).parents('.sub_task_form_v2'), | ||
| 535 | + mileageType = $(this).val(); | ||
| 536 | + if (mileageType) { | ||
| 537 | + f.removeClass('service_form empty_form').addClass(mileageType + '_form'); | ||
| 538 | + reCalcMileageCount(); | ||
| 539 | + } | ||
| 459 | } | 540 | } |
| 460 | 541 | ||
| 461 | function $f(name, f) { | 542 | function $f(name, f) { |
| @@ -464,6 +545,7 @@ | @@ -464,6 +545,7 @@ | ||
| 464 | 545 | ||
| 465 | function closeTaskForm() { | 546 | function closeTaskForm() { |
| 466 | $(this).parents('.sub_task_form_v2').remove(); | 547 | $(this).parents('.sub_task_form_v2').remove(); |
| 548 | + reCalcMileageCount(); | ||
| 467 | } | 549 | } |
| 468 | 550 | ||
| 469 | /** | 551 | /** |
| @@ -480,6 +562,49 @@ | @@ -480,6 +562,49 @@ | ||
| 480 | return -1; | 562 | return -1; |
| 481 | } | 563 | } |
| 482 | 564 | ||
| 565 | + function search_st_park(f) { | ||
| 566 | + if(!st_park_data) | ||
| 567 | + return; | ||
| 568 | + var stp; | ||
| 569 | + var qdSelect=$f('startStation', f)[0],zdSelect=$f('endStation', f)[0]; | ||
| 570 | + | ||
| 571 | + var qdzName=qdSelect.options[qdSelect.options.selectedIndex].text, | ||
| 572 | + zdzName=zdSelect.options[zdSelect.options.selectedIndex].text, | ||
| 573 | + type2 = $f('type2', f).val(); | ||
| 574 | + | ||
| 575 | + if(type2!=2 && type2!=3) | ||
| 576 | + return; | ||
| 577 | + | ||
| 578 | + $.each(st_park_data, function () { | ||
| 579 | + if((type2==2 && this.stationName==qdzName && this.parkName==zdzName) | ||
| 580 | + || (type2==3 && this.stationName==zdzName && this.parkName==qdzName)){ | ||
| 581 | + stp = this; | ||
| 582 | + return false; | ||
| 583 | + } | ||
| 584 | + }); | ||
| 585 | + | ||
| 586 | + return stp; | ||
| 587 | + } | ||
| 588 | + | ||
| 589 | + $('.left_tabs_lg', modal).on('show.uk.switcher', reCalcMileageCount); | ||
| 590 | + | ||
| 591 | + function reCalcMileageCount() { | ||
| 592 | + $('.footer_mileage_count', modal).trigger('refresh'); | ||
| 593 | + var f = $(this).parents('.sub_task_form_v2'); | ||
| 594 | + if($f('type2',f).val()==1) | ||
| 595 | + reCalcEndTime.call(this); | ||
| 596 | + } | ||
| 597 | + | ||
| 598 | + | ||
| 599 | + var folder = '/real_control_v2/fragments/line_schedule/context_menu'; | ||
| 600 | + /** | ||
| 601 | + * 弹出站 到 场对照表 | ||
| 602 | + */ | ||
| 603 | + $('.station_to_park_link', modal).on('click', function () { | ||
| 604 | + open_modal(folder + '/utils/station_to_park.html', { | ||
| 605 | + sch: sch | ||
| 606 | + }, {center: false, bgclose: false, modal: false}); | ||
| 607 | + }); | ||
| 483 | })(); | 608 | })(); |
| 484 | </script> | 609 | </script> |
| 485 | </div> | 610 | </div> |
| 486 | \ No newline at end of file | 611 | \ No newline at end of file |
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/tzrc.html
| @@ -54,8 +54,7 @@ | @@ -54,8 +54,7 @@ | ||
| 54 | </div> | 54 | </div> |
| 55 | <div class="uk-width-1-2"> | 55 | <div class="uk-width-1-2"> |
| 56 | <div class="uk-form-row"> | 56 | <div class="uk-form-row"> |
| 57 | - <label class="uk-form-label">驾驶员 <i class="uk-icon-question-circle" data-uk-tooltip | ||
| 58 | - title="如果有驾驶员未提示,请至后台“基础信息 -人员信息”里纠正该员工的“工种”类别 "></i></label> | 57 | + <label class="uk-form-label">驾驶员 </label> |
| 59 | <div class="uk-form-controls"> | 58 | <div class="uk-form-controls"> |
| 60 | <div class="uk-autocomplete uk-form jsy-autocom"> | 59 | <div class="uk-autocomplete uk-form jsy-autocom"> |
| 61 | <input type="text" value="" name="jsy" required> | 60 | <input type="text" value="" name="jsy" required> |
| @@ -192,7 +191,10 @@ | @@ -192,7 +191,10 @@ | ||
| 192 | //}); | 191 | //}); |
| 193 | 192 | ||
| 194 | //submit | 193 | //submit |
| 195 | - var f = $('form.tzrc_form', modal).formValidation(gb_form_validation_opts); | 194 | + var f = $('form.tzrc_form', modal).formValidation({ |
| 195 | + framework: 'uikit', | ||
| 196 | + locale: 'zh_CN' | ||
| 197 | + }); | ||
| 196 | f.on('success.form.fv', function (e) { | 198 | f.on('success.form.fv', function (e) { |
| 197 | e.preventDefault(); | 199 | e.preventDefault(); |
| 198 | var param = $(this).serializeJSON(); | 200 | var param = $(this).serializeJSON(); |
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/utils/station_to_park.html
0 → 100644
| 1 | +<div class="uk-modal ct-form-modal" id="station_to_park-modal"> | ||
| 2 | + <div class="uk-modal-dialog" style="width: 780px;"> | ||
| 3 | + <a href="" class="uk-modal-close uk-close"></a> | ||
| 4 | + <div class="uk-modal-header"> | ||
| 5 | + <h2>站到场历时、公里对照表</h2></div> | ||
| 6 | + | ||
| 7 | + <div class="ct_lists"> | ||
| 8 | + </div> | ||
| 9 | + | ||
| 10 | + <div class="ct_describe" >从历史的子任务、临加里采集进出场历时和公里</div> | ||
| 11 | + </div> | ||
| 12 | + | ||
| 13 | + <script id="station_park_list-temp" type="text/html"> | ||
| 14 | + {{each list as obj i}} | ||
| 15 | + {{if obj.mileage1 != obj.mileage2}} | ||
| 16 | + <div class="s_2_park_form_wrap" data-id="{{obj.id}}"> | ||
| 17 | + <span class="ct_close"><i class="uk-icon-times"></i></span> | ||
| 18 | + <form class="uk-form"> | ||
| 19 | + {{if obj.time1!=null && obj.mileage1!=null}} | ||
| 20 | + <div class="uk-grid"> | ||
| 21 | + <div class="uk-width-1-4"> | ||
| 22 | + <label class="">起点:</label> | ||
| 23 | + <input type="text" value="{{obj.stationName}}" class="uk-width-1-1" readonly> | ||
| 24 | + </div> | ||
| 25 | + <div class="uk-width-1-4"> | ||
| 26 | + <label>终点:</label> | ||
| 27 | + <input type="text" value="{{obj.parkName}}" class="uk-width-1-1" readonly> | ||
| 28 | + </div> | ||
| 29 | + <div class="uk-width-2-4 uk-grid"> | ||
| 30 | + <div class="uk-width-1-3"> | ||
| 31 | + <label>历时:</label> | ||
| 32 | + <input type="text" value="{{obj.time1}}" class="uk-width-1-1" readonly> | ||
| 33 | + </div> | ||
| 34 | + <div class="uk-width-1-3"> | ||
| 35 | + <label>公里:</label> | ||
| 36 | + <input type="text" value="{{obj.mileage1}}" class="uk-width-1-1" readonly> | ||
| 37 | + </div> | ||
| 38 | + <div class="uk-width-1-3"> | ||
| 39 | + <label class="bottom_label">进场</label> | ||
| 40 | + </div> | ||
| 41 | + </div> | ||
| 42 | + </div> | ||
| 43 | + {{/if}} | ||
| 44 | + {{if obj.time2!=null && obj.mileage2!=null}} | ||
| 45 | + <div class="uk-grid"> | ||
| 46 | + <div class="uk-width-1-4"> | ||
| 47 | + <input type="text" value="{{obj.parkName}}" class="uk-width-1-1" readonly> | ||
| 48 | + </div> | ||
| 49 | + <div class="uk-width-1-4"> | ||
| 50 | + <input type="text" value="{{obj.stationName}}" class="uk-width-1-1" readonly> | ||
| 51 | + </div> | ||
| 52 | + <div class="uk-width-2-4 uk-grid"> | ||
| 53 | + <div class="uk-width-1-3"> | ||
| 54 | + <input type="text" value="{{obj.time2}}" class="uk-width-1-1" readonly> | ||
| 55 | + </div> | ||
| 56 | + <div class="uk-width-1-3"> | ||
| 57 | + <input type="text" value="{{obj.mileage2}}" class="uk-width-1-1" readonly> | ||
| 58 | + </div> | ||
| 59 | + <div class="uk-width-1-3"> | ||
| 60 | + <label class="bottom_label_2">出场</label> | ||
| 61 | + </div> | ||
| 62 | + </div> | ||
| 63 | + </div> | ||
| 64 | + {{/if}} | ||
| 65 | + </form> | ||
| 66 | + </div> | ||
| 67 | + {{else}} | ||
| 68 | + <div class="s_2_park_form_wrap" data-id="{{obj.id}}"> | ||
| 69 | + <span class="ct_close"><i class="uk-icon-times"></i></span> | ||
| 70 | + <form class="uk-form"> | ||
| 71 | + <div class="uk-grid"> | ||
| 72 | + <div class="uk-width-1-4"> | ||
| 73 | + <label class="">起点:</label> | ||
| 74 | + <input type="text" value="{{obj.stationName}}" class="uk-width-1-1" readonly> | ||
| 75 | + </div> | ||
| 76 | + <div class="uk-width-1-4"> | ||
| 77 | + <label>终点:</label> | ||
| 78 | + <input type="text" value="{{obj.parkName}}" class="uk-width-1-1" readonly> | ||
| 79 | + </div> | ||
| 80 | + <div class="uk-width-2-4 uk-grid"> | ||
| 81 | + <div class="uk-width-1-3"> | ||
| 82 | + <label>历时:</label> | ||
| 83 | + <input type="text" value="{{obj.time1}}" class="uk-width-1-1" readonly> | ||
| 84 | + </div> | ||
| 85 | + <div class="uk-width-1-3"> | ||
| 86 | + <label>公里:</label> | ||
| 87 | + <input type="text" value="{{obj.mileage1}}" class="uk-width-1-1" readonly> | ||
| 88 | + </div> | ||
| 89 | + <div class="uk-width-1-3"> | ||
| 90 | + <label class="bottom_label"><input type="checkbox" disabled checked> 进=出 </label> | ||
| 91 | + </div> | ||
| 92 | + </div> | ||
| 93 | + </div> | ||
| 94 | + </form> | ||
| 95 | + </div> | ||
| 96 | + {{/if}} | ||
| 97 | + {{/each}} | ||
| 98 | + </script> | ||
| 99 | + | ||
| 100 | + <script> | ||
| 101 | + (function () { | ||
| 102 | + var modal = '#station_to_park-modal', sch; | ||
| 103 | + | ||
| 104 | + $(modal).on('init', function (e, data) { | ||
| 105 | + e.stopPropagation(); | ||
| 106 | + sch = data.sch; | ||
| 107 | + | ||
| 108 | + var list = gb_data_basic.get_stat_park_data()[sch.xlBm]; | ||
| 109 | + if(!list) | ||
| 110 | + return; | ||
| 111 | + list.sort(function (a, b) { | ||
| 112 | + return a.stationName.localeCompare(b.stationName); | ||
| 113 | + }); | ||
| 114 | + | ||
| 115 | + var htmlStr = template('station_park_list-temp', {list: list}); | ||
| 116 | + $('.ct_lists', modal).html(htmlStr); | ||
| 117 | + }); | ||
| 118 | + | ||
| 119 | + $(modal).on('click', '.s_2_park_form_wrap>.ct_close', function () { | ||
| 120 | + var wrap=$(this).parent(), | ||
| 121 | + id=wrap.data('id'); | ||
| 122 | + | ||
| 123 | + gb_common.$post('/basic/deleteStation2Park', {lineCode: sch.xlBm, id: id}, function () { | ||
| 124 | + gb_data_basic.reload_stat_park_data(); | ||
| 125 | + wrap.remove(); | ||
| 126 | + }); | ||
| 127 | + }); | ||
| 128 | + })(); | ||
| 129 | + </script> | ||
| 130 | +</div> |
src/main/resources/static/real_control_v2/fragments/north/nav/sch_edit_info/list.html
| @@ -35,6 +35,22 @@ | @@ -35,6 +35,22 @@ | ||
| 35 | <div class="uk-autocomplete uk-form autocomplete-jsy"> | 35 | <div class="uk-autocomplete uk-form autocomplete-jsy"> |
| 36 | <input type="text" name="jGh" placeholder="驾驶员"> | 36 | <input type="text" name="jGh" placeholder="驾驶员"> |
| 37 | </div> | 37 | </div> |
| 38 | + | ||
| 39 | + <span class="horizontal-field">修正类型</span> | ||
| 40 | + <select name="type"> | ||
| 41 | + <option value="">全部</option> | ||
| 42 | + <option value="DFTZ">待发调整</option> | ||
| 43 | + <option value="SFTZ">实发调整</option> | ||
| 44 | + <option value="FCXXWT">发车信息微调</option> | ||
| 45 | + <option value="TZRC">调整人车</option> | ||
| 46 | + <option value="JHLB">计划烂班</option> | ||
| 47 | + <option value="CXLB">撤销烂班</option> | ||
| 48 | + <option value="CXSF">撤销实发</option> | ||
| 49 | + <option value="CXZX">撤销执行</option> | ||
| 50 | + <option value="LPDD">路牌对调</option> | ||
| 51 | + <option value="ZRW">添加子任务</option> | ||
| 52 | + <option value="LSBCTZ">历史班次调整</option> | ||
| 53 | + </select> | ||
| 38 | <button class="uk-button">检索</button> | 54 | <button class="uk-button">检索</button> |
| 39 | 55 | ||
| 40 | <label style="float: right;font-size: 12px;color: #989797;"> | 56 | <label style="float: right;font-size: 12px;color: #989797;"> |
| @@ -122,6 +138,19 @@ | @@ -122,6 +138,19 @@ | ||
| 122 | </div> | 138 | </div> |
| 123 | </script> | 139 | </script> |
| 124 | 140 | ||
| 141 | + <!-- 历史班次调整 tip --> | ||
| 142 | + <script id="edit-info-tip-lsbctz-temp" type="text/html"> | ||
| 143 | + <div class="edit-info-tip"> | ||
| 144 | + {{each jsonArray as obj i}} | ||
| 145 | + <p class="text">{{obj.title}} 由 {{obj.old==null?'无':obj.old}} 调整为 {{obj.now}}</p> | ||
| 146 | + {{/each}} | ||
| 147 | + <p class="sub_text">调整人:{{user}} 调整时间:{{ts_str}}</p> | ||
| 148 | + {{if remarks!=null && remarks != ''}} | ||
| 149 | + <p class="sub_text">备注:{{remarks}}</p> | ||
| 150 | + {{/if}} | ||
| 151 | + </div> | ||
| 152 | + </script> | ||
| 153 | + | ||
| 125 | <!-- 撤销实发tip --> | 154 | <!-- 撤销实发tip --> |
| 126 | <script id="edit-info-tip-cxsf-temp" type="text/html"> | 155 | <script id="edit-info-tip-cxsf-temp" type="text/html"> |
| 127 | <div class="edit-info-tip"> | 156 | <div class="edit-info-tip"> |
| @@ -248,6 +277,7 @@ | @@ -248,6 +277,7 @@ | ||
| 248 | $.each(rs.list, function () { | 277 | $.each(rs.list, function () { |
| 249 | this.jsonArray = JSON.parse(this.jsonArray); | 278 | this.jsonArray = JSON.parse(this.jsonArray); |
| 250 | etInfos[this.id] = this; | 279 | etInfos[this.id] = this; |
| 280 | + this['ts_str'] = moment(this.ts).format('YYYY-MM-DD HH:mm'); | ||
| 251 | 281 | ||
| 252 | nbbmArray.push({value: this.clZbh}); | 282 | nbbmArray.push({value: this.clZbh}); |
| 253 | jsyArray.push({value: this.jGh+'/'+this.jName, | 283 | jsyArray.push({value: this.jGh+'/'+this.jName, |
| @@ -365,7 +395,7 @@ | @@ -365,7 +395,7 @@ | ||
| 365 | return gb_common.get_vals(rs); | 395 | return gb_common.get_vals(rs); |
| 366 | } | 396 | } |
| 367 | 397 | ||
| 368 | - var types = {'DFTZ': '待发调整', 'FCXXWT':'发车信息微调', 'JHLB': '计划烂班', 'CXLB': '撤销烂班', 'CXZX': '撤销执行', 'CXSF': '撤销实发', 'SFTZ': '实发调整', 'TZRC': '调整人车'}; | 398 | + var types = {'DFTZ': '待发调整', 'FCXXWT':'发车信息微调', 'JHLB': '计划烂班', 'CXLB': '撤销烂班', 'CXZX': '撤销执行', 'CXSF': '撤销实发', 'SFTZ': '实发调整', 'TZRC': '调整人车', 'LSBCTZ':'历史班次调整'}; |
| 369 | function subData(data){ | 399 | function subData(data){ |
| 370 | return { | 400 | return { |
| 371 | id: data.id, | 401 | id: data.id, |
| @@ -535,6 +565,26 @@ | @@ -535,6 +565,26 @@ | ||
| 535 | }); | 565 | }); |
| 536 | 566 | ||
| 537 | 567 | ||
| 568 | + //发车信息微调tip | ||
| 569 | + $(modal).on('mouseenter', '.ct-badge.ct-badge-LSBCTZ', function() { | ||
| 570 | + $(this).qtip({ | ||
| 571 | + show: _opts.show, | ||
| 572 | + content: { | ||
| 573 | + title: '发车信息微调', | ||
| 574 | + text: function() { | ||
| 575 | + var obj = etInfos[$(this).data('id')]; | ||
| 576 | + return template('edit-info-tip-lsbctz-temp', obj); | ||
| 577 | + } | ||
| 578 | + }, | ||
| 579 | + position: _opts.position, | ||
| 580 | + style: { | ||
| 581 | + classes: 'qtip-blue qtip-rounded qtip-shadow sch-badge-tip' | ||
| 582 | + }, | ||
| 583 | + hide: _opts.hide, | ||
| 584 | + events: _opts.events | ||
| 585 | + }); | ||
| 586 | + }); | ||
| 587 | + | ||
| 538 | function sortFun(a, b) { | 588 | function sortFun(a, b) { |
| 539 | return (a.realExecDate + a.fcsj).localeCompare(b.realExecDate + b.fcsj); | 589 | return (a.realExecDate + a.fcsj).localeCompare(b.realExecDate + b.fcsj); |
| 540 | } | 590 | } |
src/main/resources/static/real_control_v2/js/data/data_basic.js
| @@ -75,6 +75,9 @@ var gb_data_basic = (function () { | @@ -75,6 +75,9 @@ var gb_data_basic = (function () { | ||
| 75 | var carparks = {}; | 75 | var carparks = {}; |
| 76 | //停车场数据 | 76 | //停车场数据 |
| 77 | gb_common.$get('/realMap/carParkSpatialData', {}, function (rs) { | 77 | gb_common.$get('/realMap/carParkSpatialData', {}, function (rs) { |
| 78 | + rs.list.sort(function (a, b) { | ||
| 79 | + return a.parkName.localeCompare(b.parkName); | ||
| 80 | + }); | ||
| 78 | $.each(rs.list, function () { | 81 | $.each(rs.list, function () { |
| 79 | carparks[this.parkCode] = this; | 82 | carparks[this.parkCode] = this; |
| 80 | }); | 83 | }); |
| @@ -116,6 +119,15 @@ var gb_data_basic = (function () { | @@ -116,6 +119,15 @@ var gb_data_basic = (function () { | ||
| 116 | ep.emit('svg_attrs', data); | 119 | ep.emit('svg_attrs', data); |
| 117 | }); | 120 | }); |
| 118 | 121 | ||
| 122 | + //站点和停车场历时、公里对照数据 | ||
| 123 | + var stat_park_data; | ||
| 124 | + var load_stat_park_data = function () { | ||
| 125 | + $.get('/basic/station2ParkData?t='+Math.random(), {idx: line_idx}, function (rs) { | ||
| 126 | + stat_park_data = rs; | ||
| 127 | + }); | ||
| 128 | + } | ||
| 129 | + load_stat_park_data(); | ||
| 130 | + | ||
| 119 | function findLineByCodes(codeArr) { | 131 | function findLineByCodes(codeArr) { |
| 120 | var rs = []; | 132 | var rs = []; |
| 121 | $.each(codeArr, function () { | 133 | $.each(codeArr, function () { |
| @@ -239,6 +251,12 @@ var gb_data_basic = (function () { | @@ -239,6 +251,12 @@ var gb_data_basic = (function () { | ||
| 239 | }, | 251 | }, |
| 240 | remarksMapps: function () { | 252 | remarksMapps: function () { |
| 241 | return remarksMapps; | 253 | return remarksMapps; |
| 254 | + }, | ||
| 255 | + get_stat_park_data: function () { | ||
| 256 | + return stat_park_data; | ||
| 257 | + }, | ||
| 258 | + reload_stat_park_data: function () { | ||
| 259 | + load_stat_park_data(); | ||
| 242 | } | 260 | } |
| 243 | }; | 261 | }; |
| 244 | })(); | 262 | })(); |
src/main/resources/static/real_control_v2/js/line_schedule/sch_table.js
| @@ -564,7 +564,7 @@ var gb_schedule_table = (function () { | @@ -564,7 +564,7 @@ var gb_schedule_table = (function () { | ||
| 564 | return a.clZbh == sch.clZbh && a.bcType=='normal'; | 564 | return a.clZbh == sch.clZbh && a.bcType=='normal'; |
| 565 | }).sort(schedule_sort); | 565 | }).sort(schedule_sort); |
| 566 | 566 | ||
| 567 | - for (var i = 0, item; item = array[i++];) { | 567 | + for (var i = 0; i < array.length; i++) { |
| 568 | if (array[i].id == sch.id) { | 568 | if (array[i].id == sch.id) { |
| 569 | return i < array.length ? array[i + 1] : null; | 569 | return i < array.length ? array[i + 1] : null; |
| 570 | } | 570 | } |