Commit 89431cf9499cb178eebfa1a25471fa0e66c45cc3

Authored by 潘钊
1 parent f8fb8f8c

update...

src/main/java/com/bsth/controller/gps/GpsController.java
... ... @@ -5,6 +5,8 @@ import com.bsth.data.gpsdata_v2.GpsRealData;
5 5 import com.bsth.data.gpsdata_v2.entity.GpsEntity;
6 6 import com.bsth.data.gpsdata_v2.handlers.overspeed.GpsOverspeed;
7 7 import com.bsth.data.gpsdata_v2.handlers.overspeed.OverspeedProcess;
  8 +import com.bsth.data.schedule.e_state_check.ScheduleStationCodeChecker;
  9 +import com.bsth.data.schedule.e_state_check.entity.SCodeInfo;
8 10 import com.bsth.service.gps.GpsService;
9 11 import com.bsth.service.gps.entity.GpsSpeed;
10 12 import com.google.common.base.Splitter;
... ... @@ -56,8 +58,13 @@ public class GpsController {
56 58  
57 59 //超速信息
58 60 List<GpsOverspeed> overspeedList = overspeedProcess.findByLines(lineArray);
  61 +
  62 + //班次站点检查信息
  63 + List<SCodeInfo> scis = ScheduleStationCodeChecker.findByLineIdx(lineArray);
  64 +
59 65 rs.put("gpsList", gpsList);
60 66 rs.put("overspeedList", overspeedList);
  67 + rs.put("scis", scis);
61 68 return rs;
62 69 }
63 70  
... ...
src/main/java/com/bsth/controller/realcontrol/ScheduleRealInfoController.java
... ... @@ -29,6 +29,11 @@ public class ScheduleRealInfoController extends BaseController&lt;ScheduleRealInfo,
29 29 @Autowired
30 30 DayOfSchedule dayOfSchedule;
31 31  
  32 + @RequestMapping(value = "check_fgs_ascription", method = RequestMethod.POST)
  33 + public Map<String, Object> checkPCFgsAscription(@RequestParam Long schId,@RequestParam String jGh, String sGh,@RequestParam String nbbm){
  34 + return scheduleRealInfoService.checkPCFgsAscription(schId, jGh, sGh, nbbm);
  35 + }
  36 +
32 37 @RequestMapping(value = "/lines")
33 38 public Map<String, Collection<ScheduleRealInfo>> findByLines(@RequestParam String lines) {
34 39 return scheduleRealInfoService.findByLines(lines);
... ...
src/main/java/com/bsth/data/BasicData.java
... ... @@ -36,6 +36,9 @@ public class BasicData {
36 36  
37 37 //车辆自编号和公司代码对照 (K: 车辆自编号 ,V:公司代码)
38 38 public static Map<String, String> nbbm2CompanyCodeMap;
  39 +
  40 + //车辆自编号和分公司代码对照 (K: 车辆自编号 ,V:公司代码_分公司代码)
  41 + public static Map<String, String> nbbm2FgsCompanyCodeMap;
39 42  
40 43 //车辆自编号和牌照号对照 (K: 车辆自编号 ,V:牌照号)
41 44 public static Map<String, String> nbbmCompanyPlateMap;
... ... @@ -141,6 +144,7 @@ public class BasicData {
141 144 */
142 145 public int loadAllData() {
143 146 try {
  147 + logger.info("开始加载基础数据..,");
144 148 //设备信息
145 149 loadDeviceInfo();
146 150 //站点信息
... ... @@ -154,6 +158,7 @@ public class BasicData {
154 158 //公司信息
155 159 loadBusinessInfo();
156 160  
  161 + logger.info("load geo cache..,");
157 162 geoCacheData.loadData();
158 163 station2ParkBuffer.saveAll();
159 164 logger.info("加载基础数据成功!,");
... ... @@ -189,6 +194,8 @@ public class BasicData {
189 194 BiMap<String, String> deviceId2Nbbm = HashBiMap.create();
190 195 //车辆和公司代码对照
191 196 Map<String, String> nbbm2CompanyCode = new HashMap<>();
  197 + //车辆和分公司代码对照
  198 + Map<String, String> nbbm2FgsCompanyCode = new HashMap<>();
192 199  
193 200 //车辆自编号和拍照号对照
194 201 Map<String, String> nbbmCompanyPlate = new HashMap<>();
... ... @@ -199,11 +206,13 @@ public class BasicData {
199 206 car = carIterator.next();
200 207 deviceId2Nbbm.put(car.getEquipmentCode(), car.getInsideCode());
201 208 nbbm2CompanyCode.put(car.getInsideCode(), car.getBusinessCode());
  209 + nbbm2FgsCompanyCode.put(car.getInsideCode(), car.getBusinessCode() + "_" + car.getBrancheCompanyCode());
202 210 nbbmCompanyPlate.put(car.getInsideCode(), car.getCarPlate());
203 211 }
204 212  
205 213 deviceId2NbbmMap = deviceId2Nbbm;
206 214 nbbm2CompanyCodeMap = nbbm2CompanyCode;
  215 + nbbm2FgsCompanyCodeMap = nbbm2FgsCompanyCode;
207 216 nbbmCompanyPlateMap =nbbmCompanyPlate;
208 217 }
209 218  
... ...
src/main/java/com/bsth/data/schedule/e_state_check/ScheduleStationCodeChecker.java 0 → 100644
  1 +package com.bsth.data.schedule.e_state_check;
  2 +
  3 +import com.bsth.data.schedule.DayOfSchedule;
  4 +import com.bsth.data.schedule.e_state_check.entity.SCodeInfo;
  5 +import com.bsth.entity.realcontrol.ScheduleRealInfo;
  6 +import com.google.common.collect.ArrayListMultimap;
  7 +import org.slf4j.Logger;
  8 +import org.slf4j.LoggerFactory;
  9 +import org.springframework.beans.factory.annotation.Autowired;
  10 +import org.springframework.jdbc.core.BeanPropertyRowMapper;
  11 +import org.springframework.jdbc.core.JdbcTemplate;
  12 +import org.springframework.stereotype.Component;
  13 +
  14 +import java.util.*;
  15 +
  16 +/**
  17 + * 检查班次站点编码和路由编码是否相符合
  18 + * Created by panzhao on 2018/4/2.
  19 + */
  20 +@Component
  21 +public class ScheduleStationCodeChecker {
  22 +
  23 + @Autowired
  24 + DayOfSchedule dayOfSchedule;
  25 +
  26 + private static ArrayListMultimap<String, SCodeInfo> multimap;
  27 +
  28 + static {
  29 + multimap = ArrayListMultimap.create();
  30 + }
  31 +
  32 + @Autowired
  33 + JdbcTemplate jdbcTemplate;
  34 +
  35 + Logger logger = LoggerFactory.getLogger(this.getClass());
  36 +
  37 + public static List<SCodeInfo> findByLineIdx(List<String> lineArray){
  38 + List<SCodeInfo> rs = new ArrayList<>();
  39 +
  40 + for(String coed : lineArray){
  41 + rs.addAll(multimap.get(coed));
  42 + }
  43 + return rs;
  44 + }
  45 +
  46 + public void checkAll() {
  47 + try {
  48 + logger.info("start....");
  49 + List<ScheduleRealInfo> all = new ArrayList(dayOfSchedule.findAll());
  50 +
  51 + //按线路站点分组数据(上行)
  52 + Map<String, ScheduleRealInfo> ups = new HashMap<>();
  53 + //按线路站点分组数据(下行)
  54 + Map<String, ScheduleRealInfo> downs = new HashMap();
  55 +
  56 + String key;
  57 + for (ScheduleRealInfo sch : all) {
  58 + if (sch.getBcType().equals("out")
  59 + || sch.getBcType().equals("in"))
  60 + continue;
  61 + key = sch.getXlBm() + "_" + sch.getXlDir() + "_";
  62 +
  63 + ups.put(key + sch.getQdzCode(), sch);
  64 + downs.put(key + sch.getZdzCode(), sch);
  65 + }
  66 +
  67 + //获取全部实际的站点编码
  68 + Map<String, SCodeInfo> realMap = allRealCodeInfo();
  69 +
  70 + List<SCodeInfo> rs = new ArrayList<>();
  71 + rs.addAll(checkCode(ups.values(), realMap, "qd"));
  72 + rs.addAll(checkCode(downs.values(), realMap, "zd"));
  73 +
  74 + //按线路分组
  75 + ArrayListMultimap<String, SCodeInfo> mList = ArrayListMultimap.create();
  76 + for (SCodeInfo sci : rs) {
  77 + mList.put(sci.getLineCode(), sci);
  78 + }
  79 +
  80 + multimap = mList;
  81 + logger.info("end....");
  82 + } catch (Exception e) {
  83 + logger.error("", e);
  84 + }
  85 + }
  86 +
  87 + private List<SCodeInfo> checkCode(Collection<ScheduleRealInfo> list, Map<String, SCodeInfo> realMap, String qdOrZd) {
  88 + List<SCodeInfo> rs = new ArrayList<>();
  89 + String k;
  90 + SCodeInfo sci;
  91 + for(ScheduleRealInfo sch : list){
  92 + k = sch.getXlBm() + "_" + sch.getXlDir() + "_";
  93 +
  94 + sci = realMap.get(k + getName(sch, qdOrZd));//名称和编码都不存在
  95 + if(null == sci && !realMap.containsKey(k + getCode(sch, qdOrZd))){
  96 + sci = SCodeInfo.getInstance(sch, qdOrZd);
  97 + rs.add(sci);
  98 + continue;
  99 + }
  100 + else if(null != sci && !sci.getRealStationCode().equals(getCode(sch, qdOrZd))){//名称一致的站点,编码不一致
  101 + sci.setStationCode(getCode(sch, qdOrZd));
  102 + rs.add(sci);
  103 + continue;
  104 + }
  105 + }
  106 + return rs;
  107 + }
  108 +
  109 + private String getName(ScheduleRealInfo sch, String qdOrZd) {
  110 + return qdOrZd.equals("qd")?sch.getQdzName():sch.getZdzName();
  111 + }
  112 +
  113 + private String getCode(ScheduleRealInfo sch, String qdOrZd) {
  114 + return qdOrZd.equals("qd")?sch.getQdzCode():sch.getZdzCode();
  115 + }
  116 +
  117 +
  118 + private Map<String, SCodeInfo> allRealCodeInfo() {
  119 + String sql = "select line_code,directions as up_down,station_code as real_station_code,station_name from bsth_c_stationroute where line in (select id from bsth_c_line where destroy=0)";
  120 + List<SCodeInfo> realList = jdbcTemplate.query(sql, BeanPropertyRowMapper.newInstance(SCodeInfo.class));
  121 + Map<String, SCodeInfo> realMap = new HashMap<>();
  122 +
  123 + for (SCodeInfo sci : realList) {
  124 + realMap.put(sci.getLineCode() + "_" + sci.getUpDown() + "_" + sci.getStationName(), sci);
  125 + realMap.put(sci.getLineCode() + "_" + sci.getUpDown() + "_" + sci.getStationCode(), sci);
  126 + }
  127 +
  128 + return realMap;
  129 + }
  130 +}
... ...
src/main/java/com/bsth/data/schedule/e_state_check/entity/SCodeInfo.java 0 → 100644
  1 +package com.bsth.data.schedule.e_state_check.entity;
  2 +
  3 +import com.bsth.entity.realcontrol.ScheduleRealInfo;
  4 +
  5 +/**
  6 + * Created by panzhao on 2018/4/2.
  7 + */
  8 +public class SCodeInfo {
  9 +
  10 + /**
  11 + * 线路编码
  12 + */
  13 + private String lineCode;
  14 +
  15 + /**
  16 + * 上下行
  17 + */
  18 + private int upDown;
  19 +
  20 + /**
  21 + * 站点编码
  22 + */
  23 + private String stationCode;
  24 +
  25 + /**
  26 + * 站点名称
  27 + */
  28 + private String stationName;
  29 +
  30 + /**
  31 + * 实际站点编码
  32 + */
  33 + private String realStationCode;
  34 +
  35 + public String getLineCode() {
  36 + return lineCode;
  37 + }
  38 +
  39 + public void setLineCode(String lineCode) {
  40 + this.lineCode = lineCode;
  41 + }
  42 +
  43 + public int getUpDown() {
  44 + return upDown;
  45 + }
  46 +
  47 + public void setUpDown(int upDown) {
  48 + this.upDown = upDown;
  49 + }
  50 +
  51 + public String getStationCode() {
  52 + return stationCode;
  53 + }
  54 +
  55 + public void setStationCode(String stationCode) {
  56 + this.stationCode = stationCode;
  57 + }
  58 +
  59 + public String getStationName() {
  60 + return stationName;
  61 + }
  62 +
  63 + public void setStationName(String stationName) {
  64 + this.stationName = stationName;
  65 + }
  66 +
  67 + public String getRealStationCode() {
  68 + return realStationCode;
  69 + }
  70 +
  71 + public void setRealStationCode(String realStationCode) {
  72 + this.realStationCode = realStationCode;
  73 + }
  74 +
  75 + public static SCodeInfo getUpInstance(ScheduleRealInfo sch) {
  76 + SCodeInfo sci = new SCodeInfo();
  77 + sci.setLineCode(sch.getXlBm());
  78 + sci.setUpDown(Integer.parseInt(sch.getXlDir()));
  79 + sci.setStationName(sch.getQdzName());
  80 + sci.setStationCode(sch.getQdzCode());
  81 + return sci;
  82 + }
  83 +
  84 + public static SCodeInfo geDownInstance(ScheduleRealInfo sch) {
  85 + SCodeInfo sci = new SCodeInfo();
  86 + sci.setLineCode(sch.getXlBm());
  87 + sci.setUpDown(Integer.parseInt(sch.getXlDir()));
  88 + sci.setStationName(sch.getZdzName());
  89 + sci.setStationCode(sch.getZdzCode());
  90 + return sci;
  91 + }
  92 +
  93 + public static SCodeInfo getInstance(ScheduleRealInfo sch, String qdOrZd) {
  94 + return qdOrZd.equals("qd")?getUpInstance(sch):geDownInstance(sch);
  95 + }
  96 +}
... ...
src/main/java/com/bsth/data/schedule/e_state_check/thread/FixedCheckStationCodeThread.java 0 → 100644
  1 +package com.bsth.data.schedule.e_state_check.thread;
  2 +
  3 +import com.bsth.data.schedule.e_state_check.ScheduleStationCodeChecker;
  4 +import org.slf4j.Logger;
  5 +import org.slf4j.LoggerFactory;
  6 +import org.springframework.beans.factory.annotation.Autowired;
  7 +import org.springframework.stereotype.Component;
  8 +
  9 +/**
  10 + * 定时检查班次站点编码线程
  11 + * Created by panzhao on 2018/4/2.
  12 + */
  13 +@Component
  14 +public class FixedCheckStationCodeThread extends Thread {
  15 +
  16 + @Autowired
  17 + ScheduleStationCodeChecker scheduleStationCodeChecker;
  18 +
  19 + Logger logger = LoggerFactory.getLogger(this.getClass());
  20 +
  21 + @Override
  22 + public void run() {
  23 + try {
  24 + scheduleStationCodeChecker.checkAll();
  25 + } catch (Exception e) {
  26 + logger.error("", e);
  27 + }
  28 + }
  29 +}
... ...
src/main/java/com/bsth/service/realcontrol/ScheduleRealInfoService.java
... ... @@ -15,6 +15,8 @@ import java.util.Map;
15 15 @Service
16 16 public interface ScheduleRealInfoService extends BaseService<ScheduleRealInfo, Long>{
17 17  
  18 + Map<String, Object> checkPCFgsAscription(Long schId, String jsy, String spy, String nbbm);
  19 +
18 20 Map<String, Collection<ScheduleRealInfo>> findByLines(String lines);
19 21  
20 22 Map<String, Object> outgoAdjust(Long id, String remarks, String dfsj, String bcType, String opType,String userId);
... ...
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
... ... @@ -169,6 +169,85 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
169 169  
170 170  
171 171 /**
  172 + * 校验人车 和 班次的公司和分公司归属
  173 + * @param schId
  174 + * @param jsy
  175 + * @param spy
  176 + * @param nbbm
  177 + * @return
  178 + * -2 跨营运公司,校验不过
  179 + * -1 跨分公司,二次确认
  180 + * 1 校验通过
  181 + */
  182 + @Override
  183 + public Map<String, Object> checkPCFgsAscription(Long schId, String jGh, String sGh, String nbbm) {
  184 + Map<String, Object> rs = new HashMap<>();
  185 + try{
  186 + rs.put("status", ResponseCode.SUCCESS);
  187 + rs.put("checkStatus", -2);
  188 +
  189 + String msg = null;
  190 + ScheduleRealInfo sch = dayOfSchedule.get(schId);
  191 + String gsbm = sch.getGsBm(), fgsbm = sch.getFgsBm();
  192 +
  193 + //校验运营公司
  194 + Personnel jsy = BasicData.perMap.get(gsbm + "-" + jGh);
  195 + if(null == jsy){
  196 + msg = "【驾驶员】:" + sch.getGsName() + "暂无工号为" + "【"+jGh+"】的人员";
  197 + rs.put("msg", msg);
  198 + return rs;
  199 + }
  200 + if(!carExist(gsbm, nbbm)){
  201 + msg = sch.getGsName() + "没有自编号为" + "["+nbbm+"]的车辆";
  202 + rs.put("msg", msg);
  203 + return rs;
  204 + }
  205 +
  206 + Personnel spy = null;
  207 + if(StringUtils.isNotEmpty(sGh)){
  208 + spy = BasicData.perMap.get(gsbm + "-" + sGh);
  209 + if(null == spy){
  210 + msg = "【售票员】: " + sch.getGsName() + "暂无工号为" + "【"+sGh+"】的人员";
  211 + rs.put("msg", msg);
  212 + return rs;
  213 + }
  214 + }
  215 +
  216 +
  217 + //校验分公司
  218 + if(null != jsy && !fgsbm.equals(jsy.getBrancheCompanyCode())){
  219 + msg = ("【驾驶员】:" + jGh + "/" + jsy.getPersonnelName() + "是" + jsy.getBrancheCompany() + "的人员");
  220 + rs.put("msg", msg);
  221 + rs.put("checkStatus", -1);
  222 + return rs;
  223 + }
  224 +
  225 + if(StringUtils.isNotEmpty(sGh)){
  226 + if(null != spy && !fgsbm.equals(spy.getBrancheCompanyCode())){
  227 + msg = ("【售票员】: " + jGh + "/" + spy.getPersonnelName() + "是" + spy.getBrancheCompany() + "的人员");
  228 + rs.put("msg", msg);
  229 + rs.put("checkStatus", -1);
  230 + return rs;
  231 + }
  232 + }
  233 +
  234 + if(!(gsbm + "_" + fgsbm).equals(BasicData.nbbm2FgsCompanyCodeMap.get(nbbm))){
  235 + msg = ("【" + nbbm + "】" + "是" + sch.getFgsName() + "的车辆!");
  236 + rs.put("msg", msg);
  237 + rs.put("checkStatus", -1);
  238 + return rs;
  239 + }
  240 +
  241 + rs.put("checkStatus", 1);
  242 + }catch (Exception e){
  243 + logger.error("", e);
  244 + rs.put("status", ResponseCode.ERROR);
  245 + }
  246 + return rs;
  247 + }
  248 +
  249 +
  250 + /**
172 251 * 车辆是否存在
173 252 * @param gsbm 公司编码
174 253 * @param nbbm 车辆自编号
... ...
src/main/resources/static/real_control_v2/css/main.css
... ... @@ -2062,4 +2062,18 @@ dl.active &gt; dd.disabled {
2062 2062  
2063 2063 .uk-tab>li.uk-active.destroy>a:hover{
2064 2064 background: #fff !important;
  2065 +}
  2066 +
  2067 +.warn_multi_station{
  2068 + font-size: 12px;
  2069 + margin-left: 40px;
  2070 + background: yellow;
  2071 + color: #1c1c1c;
  2072 + padding: 4px 10px;
  2073 + cursor: pointer;
  2074 + display: none;
  2075 +}
  2076 +
  2077 +.warn_multi_station:hover{
  2078 + background: #f8f81e;
2065 2079 }
2066 2080 \ No newline at end of file
... ...
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/tzrc.html
... ... @@ -238,14 +238,17 @@
238 238 });
239 239 });
240 240  
241   - gb_common.$post('/realSchedule/multi_tzrc', {
242   - cpcsJson: JSON.stringify(data)
243   - }, function (rs) {
244   - if (rs.ts && rs.ts.length > 0) {
245   - gb_schedule_table.updateSchedule(rs.ts);
246   - UIkit.modal(modal).hide();
247   - notify_succ('调整人车成功');
248   - }
  241 + //提交之前做一次公司校验
  242 + check_fgs_ascription(data[0], function () {
  243 + gb_common.$post('/realSchedule/multi_tzrc', {
  244 + cpcsJson: JSON.stringify(data)
  245 + }, function (rs) {
  246 + if (rs.ts && rs.ts.length > 0) {
  247 + gb_schedule_table.updateSchedule(rs.ts);
  248 + UIkit.modal(modal).hide();
  249 + notify_succ('调整人车成功');
  250 + }
  251 + });
249 252 });
250 253 return false;
251 254 });
... ... @@ -281,6 +284,34 @@
281 284 });
282 285 });
283 286  
  287 + function check_fgs_ascription(data, cb) {
  288 + var jGh = data.jsy.split('/')[0]
  289 + ,sGh
  290 + ,nbbm = data.clZbh;
  291 + if(data.spy)
  292 + sGh = data.spy.split('/')[0];
  293 +
  294 + gb_common.$post('/realSchedule/check_fgs_ascription',{
  295 + schId: data.schId,
  296 + jGh: jGh,
  297 + sGh: sGh,
  298 + nbbm: nbbm
  299 + }
  300 + , function (rs) {
  301 + $('form.tzrc_form [type=submit]', modal).removeAttr('disabled');
  302 + if(rs['checkStatus']==1)
  303 + cb && cb();
  304 + else if (rs['checkStatus']==-2){
  305 + UIkit.modal.alert('<p style="color: #ff4141;font-size: 15px;">'+rs.msg+'</p>', {labels: {Ok: '确定'}});
  306 + return;
  307 + }
  308 + else if (rs['checkStatus']==-1){
  309 + //二次确认
  310 + alt_confirm('<p style="font-weight: 600;font-size: 15px;">'+rs.msg+'</p>', cb, '我确定要操作!', true);
  311 + }
  312 + });
  313 + }
  314 +
284 315 function renderCell() {
285 316 var jsy = $('input[name=jsy]:enabled', modal).val();
286 317 var spy = $('input[name=spy]', modal).val();
... ...
src/main/resources/static/real_control_v2/fragments/line_schedule/layout.html
... ... @@ -42,4 +42,18 @@
42 42 </div>
43 43 </div>
44 44 </script>
  45 +
  46 + <script id="sch-table-m_station_error-temp" type="text/html">
  47 + <div class="tl-tip-panel">
  48 + <ul class="uk-list uk-list-line" style="margin-bottom: 0;">
  49 + {{each list as obj i}}
  50 + {{if obj.realStationCode!=null}}
  51 + <li>【{{obj.stationName}}】班次编码 <span style="color: red;">{{obj.stationCode}}</span> -实际:{{obj.realStationCode}}</li>
  52 + {{else}}
  53 + <li>【{{obj.stationName}}】班次编码 <span style="color: red;">{{obj.stationCode}}</span> -在当前线路站点中不存在</li>
  54 + {{/if}}
  55 + {{/each}}
  56 + </ul>
  57 + </div>
  58 + </script>
45 59 </div>
... ...
src/main/resources/static/real_control_v2/fragments/line_schedule/sch_table.html
... ... @@ -24,6 +24,7 @@
24 24 </div>
25 25 </div>
26 26 <i class="uk-icon-eye uk-icon-hover ct_eye_icon"></i>
  27 + <span class="warn_multi_station" data-updown="{{dir}}" data-code="{{line.lineCode}}"></span>
27 28 <div class="search_sch_panel">
28 29 <form class="uk-form" onsubmit="javascript:return false;">
29 30 <div class="uk-autocomplete sch-search-autocom">
... ...
src/main/resources/static/real_control_v2/fragments/north/nav/line_config/line_config.html
... ... @@ -94,7 +94,7 @@
94 94 var loadConfigEntity = function () {
95 95 $.get('/real_control_v2/fragments/north/nav/line_config/line_config_entity.html', function (attrDom) {
96 96 $('.right-container #line_config_entity_panel', modal)
97   - .append(attrDom)
  97 + .html(attrDom)
98 98 .find('#line_config_entity_wrap')
99 99 .trigger('init', {lineConfig: lineConfig});
100 100 });
... ... @@ -104,7 +104,7 @@
104 104 var loadBufferConfig = function () {
105 105 $.get('/real_control_v2/fragments/north/nav/line_config/buffer_config.html', function (attrDom) {
106 106 $('.right-container #buffer_config_panel', modal)
107   - .append(attrDom)
  107 + .html(attrDom)
108 108 .find('#buffer_config_wrap')
109 109 .trigger('init', {lineConfig: lineConfig});
110 110 });
... ...
src/main/resources/static/real_control_v2/fragments/north/nav/line_config/line_config_entity.html
... ... @@ -114,18 +114,19 @@
114 114 <span>停车场</span>
115 115 <select class="z-depth-input" name="twinsPark">
116 116 {{each parks as p i}}
117   - <option value="{{p.code}}" {{if p.code==conf.twinsPark}}selected{{/if}}>{{p.name}}</option>
  117 + <option value="{{p.code}}" {{if p.code==cPark}}selected{{/if}}>{{p.name}}</option>
118 118 {{/each}}
119 119 </select>
120 120 <span>&nbsp;既是站点</span>
121 121 <select class="z-depth-input" name="twinsStation">
122 122 {{each routes as r i}}
123   - <option value="{{r.stationCode}}" {{if r.stationCode==conf.twinsStation}}selected{{/if}}>{{r.stationName}}
  123 + <option value="{{r.stationCode}}" {{if r.stationCode==cStation}}selected{{/if}}>{{r.stationName}}
124 124 </option>
125 125 {{/each}}
126 126 </select>
127   -
128   -
  127 + {{if index>0}}
  128 + <a class="uk-close uk-close-alt"></a>
  129 + {{/if}}
129 130 </div>
130 131 </script>
131 132  
... ... @@ -134,16 +135,17 @@
134 135 <span>停车场</span>
135 136 <select class="z-depth-input" name="twinsPark">
136 137 {{each parks as p i}}
137   - <option value="{{p.code}}" {{if p.code==conf.twinsPark}}selected{{/if}}>{{p.name}}</option>
  138 + <option value="{{p.code}}" {{if p.code==cPark}}selected{{/if}}>{{p.name}}</option>
138 139 {{/each}}
139 140 </select>
140 141 <span>&nbsp;既是站点</span>
141 142 <select class="z-depth-input" name="twinsStation">
142 143 {{each routes as r i}}
143   - <option value="{{r.stationCode}}" {{if r.stationCode==conf.twinsStation}}selected{{/if}}>{{r.stationName}}
  144 + <option value="{{r.stationCode}}" {{if r.stationCode==cStation}}selected{{/if}}>{{r.stationName}}
144 145 </option>
145 146 {{/each}}
146 147 </select>
  148 + <a class="uk-close uk-close-alt"></a>
147 149 </div>
148 150 </script>
149 151 <script>
... ... @@ -196,6 +198,10 @@
196 198 for (var code in rs) {
197 199 parks.push({code: code, name: rs[code]});
198 200 }
  201 +
  202 + parks.sort(function (a, b) {
  203 + return $.trim(a.name).localeCompare($.trim(b.name), 'zh-CN');
  204 + });
199 205 renderPSDom();
200 206 });
201 207 //上行站点路由
... ... @@ -221,14 +227,28 @@
221 227 });
222 228  
223 229 function changeTwinsParkAndStation() {
224   - var park = $('select[name=twinsPark]', wrap).val();
225   - var station = $('select[name=twinsStation]', wrap).val();
  230 + var parks='',stations=''
  231 + ,$panel = $('.park-and-station-wrap', wrap);
  232 +
  233 + $('select[name=twinsPark]', $panel).each(function () {
  234 + parks += ($(this).val() + ',');
  235 + });
  236 +
  237 + $('select[name=twinsStation]', $panel).each(function () {
  238 + stations += ($(this).val() + ',');
  239 + });
  240 +
  241 + if(parks.length > 0)
  242 + parks = parks.substr(0, parks.length - 1);
  243 + if(stations.length > 0)
  244 + stations = stations.substr(0, stations.length - 1);
  245 +
226 246 gb_common.$post('/lineConfig/parkAndStationSet', {
227 247 lineCode: conf.line.lineCode,
228   - twinsPark: park,
229   - twinsStation: station
  248 + twinsPark: parks,
  249 + twinsStation: stations
230 250 }, function (rs) {
231   - notify_succ('设置成功!!');
  251 + notify_succ('已保存!!');
232 252 conf = rs.conf;
233 253 });
234 254 }
... ... @@ -261,10 +281,15 @@
261 281 var data = {lineCode: lineCode, type: type, parkCode: '', stationCode: ''};
262 282 //出站既是出场
263 283 if (type == 2) {
264   - //默认关联 线路标准停车场
265   - data.parkCode = gb_data_basic.getLineInformation(lineCode).carPark;
266   - //和上行起点站
267   - data.stationCode = upStationRoutes[0].stationCode;
  284 + //如果配置上有信息
  285 + if(conf.twinsParks){
  286 + data.parkCode = conf.twinsParks;
  287 + data.stationCode = conf.twinsStations;
  288 + }
  289 + else{
  290 + data.parkCode = gb_data_basic.getLineInformation(lineCode).carPark;//默认关联 线路标准停车场
  291 + data.stationCode = upStationRoutes[0].stationCode;//和上行起点站
  292 + }
268 293 }
269 294 gb_common.$post('/lineConfig/editOutTimeType', data, function (rs) {
270 295 notify_succ('调整出场时间类型成功!');
... ... @@ -292,22 +317,36 @@
292 317 * 渲染场既是站dom
293 318 */
294 319 function renderPSDom() {
  320 + $('.c_2_s_list', $panel).html('');
  321 + var pArray = conf.twinsParks.split(','),
  322 + cArray = conf.twinsStations.split(',');
295 323 var htmlStr = '',
296 324 $panel = $('.park-and-station-wrap', wrap);
297   - if (conf['outConfig'] == 2) {
  325 +
  326 + if(conf['outConfig']!=2){
  327 + $panel.hide().find('.c_2_s_list').empty();
  328 + return;
  329 + }
  330 +
  331 + if(!conf.twinsParks)
  332 + return;
  333 +
  334 + for(var i=0,len=pArray.length; i<len; i++){
298 335 htmlStr = template('park-and-station-temp', {
299 336 parks: parks,
300 337 conf: conf,
  338 + cPark: pArray[i],
  339 + cStation: cArray[i],
  340 + index: i,
301 341 routes: [upStationRoutes[0], upStationRoutes[upStationRoutes.length - 1]]
302 342 });
303   - $panel.show().find('.c_2_s_list').html(htmlStr);
  343 + $('.c_2_s_list', $panel).append(htmlStr);
304 344 }
305   - else
306   - $panel.hide().find('.c_2_s_list').empty();
  345 + $panel.show();
307 346  
308 347 //切换场既是站的,停车场和站点
309   - $('select[name=twinsPark]', wrap).on('change', changeTwinsParkAndStation);
310   - $('select[name=twinsStation]', wrap).on('change', changeTwinsParkAndStation);
  348 + //$('select[name=twinsPark]', wrap).on('change', changeTwinsParkAndStation);
  349 + //$('select[name=twinsStation]', wrap).on('change', changeTwinsParkAndStation);
311 350 }
312 351  
313 352 /**
... ... @@ -352,20 +391,35 @@
352 391 */
353 392 $(wrap).on('click', '.add_btn_span', function () {
354 393 var htmlStr = '',
355   - $panel = $('.park-and-station-2-wrap', wrap);
  394 + $panel = $('.park-and-station-wrap', wrap);
  395 +
  396 + var $lastItem = $('.c_2_s_list>.item:last', $panel)
  397 + ,lastTcc = $('select[name=twinsPark]', $lastItem).val()
  398 + ,lastStation = $('select[name=twinsStation]', $lastItem).val();
  399 +
356 400 if (conf['outConfig'] == 2) {
357   - htmlStr = template('park-and-station-temp', {
  401 + htmlStr = template('park-and-station-2-temp', {
358 402 parks: parks,
359 403 conf: conf,
  404 + cPark: lastTcc,
  405 + cStation: lastStation,
360 406 routes: [upStationRoutes[0], upStationRoutes[upStationRoutes.length - 1]]
361 407 });
362 408 $('.c_2_s_list', $panel).append(htmlStr);
363 409 }
  410 + });
364 411  
365   - //切换场既是站的,停车场和站点
366   - //$('select[name=twinsPark]', wrap).on('change', changeTwinsParkAndStation);
367   - //$('select[name=twinsStation]', wrap).on('change', changeTwinsParkAndStation);
  412 + /**
  413 + * 删除 场既是站 项目
  414 + */
  415 + $(wrap).on('click', '.c_2_s_list .item .uk-close', function () {
  416 + $(this).parents('.item').remove();
  417 + changeTwinsParkAndStation();
368 418 });
  419 +
  420 +
  421 + $(wrap).on('change', 'select[name=twinsPark]', changeTwinsParkAndStation);
  422 + $(wrap).on('change', 'select[name=twinsStation]', changeTwinsParkAndStation);
369 423 })();
370 424 </script>
371 425 </div>
372 426 \ No newline at end of file
... ...
src/main/resources/static/real_control_v2/js/data/data_gps.js
... ... @@ -72,6 +72,10 @@ var gb_data_gps = (function () {
72 72 cb(addArr, upArr, upDownChange, rs.overspeedList);
73 73 });
74 74  
  75 + //班次站点编码检查信息
  76 + if(rs['scis'] && rs['scis'].length > 0)
  77 + gb_schedule_table.putSCodeErrorInfo(rs['scis']);
  78 +
75 79 //超速数据回调
76 80 //console.log('超速,,,', rs.overspeedList);
77 81  
... ...
src/main/resources/static/real_control_v2/js/line_schedule/layout.js
... ... @@ -52,6 +52,44 @@ var gb_line_layout = (function() {
52 52 });
53 53 });
54 54  
  55 + //站点编码不符 tootip
  56 + $(document).on('mouseenter', '.schedule-wrap .header-title span.warn_multi_station', function() {
  57 + $(this).qtip({
  58 + show: {
  59 + ready: true,
  60 + delay: 300
  61 + },
  62 + content: {
  63 + text: function() {
  64 + var lineCode = $(this).data('code')
  65 + ,updown = $(this).data('updown')
  66 + ,list = gb_schedule_table.findSCodeErrorInfo(lineCode, updown);
  67 + //console.log('this', this);
  68 + //var data = gb_schedule_table.findSCodeErrorInfo();
  69 + return temps['sch-table-m_station_error-temp']({list: list});
  70 + }
  71 + },
  72 + position: {
  73 + viewport: $(window),
  74 + my: 'top left',
  75 + at: 'bottom center'
  76 + },
  77 + style: {
  78 + classes: 'qtip-rounded qtip-shadow sch-tl-tip'
  79 + },
  80 + hide: {
  81 + fixed: true,
  82 + delay: 300
  83 + },
  84 + events: {
  85 + hidden: function(event, api) {
  86 + //destroy dom
  87 + $(this).qtip('destroy', true);
  88 + }
  89 + }
  90 + });
  91 + });
  92 +
55 93 return {
56 94 layout: layout
57 95 };
... ...
src/main/resources/static/real_control_v2/js/line_schedule/sch_table.js
... ... @@ -7,6 +7,8 @@ var gb_schedule_table = (function () {
7 7 var line2Schedule = {};
8 8 //车辆应发未发车辆数
9 9 var car_yfwf_map = {};
  10 + //班次站点编码和实际不符数据
  11 + var errorCodeData = {};
10 12  
11 13 var bcTypeOrderMap = {
12 14 'out':0,
... ... @@ -812,6 +814,38 @@ var gb_schedule_table = (function () {
812 814 console.log(e);
813 815 }
814 816 };
  817 +
  818 + /**
  819 + * 班次站点编码异常信息
  820 + * @param list
  821 + */
  822 + var putSCodeErrorInfo = function (list) {
  823 + //按线路走向分组
  824 + var data = {};
  825 + var k;
  826 + for(var i=0,obj;obj=list[i++];){
  827 + k = obj.lineCode+'_'+obj.upDown;
  828 + if(!data[k])
  829 + data[k] = [];
  830 + data[k].push(obj);
  831 + }
  832 +
  833 + var wrap;
  834 + for(var k in data){
  835 + wrap = $('.line_schedule[data-id=' + (k.split('_')[0]) + ']');
  836 + if(wrap.length==0)
  837 + continue;
  838 +
  839 + $('.schedule-wrap span.warn_multi_station', wrap)
  840 + .html('班次站点编码与实际不符!!!').show();
  841 + }
  842 +
  843 + errorCodeData = data;
  844 + };
  845 +
  846 + var findSCodeErrorInfo = function (lineCode, upDown) {
  847 + return errorCodeData[lineCode+'_'+upDown];
  848 + };
815 849  
816 850 return {
817 851 show: show,
... ... @@ -837,6 +871,8 @@ var gb_schedule_table = (function () {
837 871 getNextNormalSch: getNextNormalSch,
838 872 findNbbmByLineCode:findNbbmByLineCode,
839 873 showLpMileageTipBySch: showLpMileageTipBySch,
840   - renderCarRemark: renderCarRemark
  874 + renderCarRemark: renderCarRemark,
  875 + putSCodeErrorInfo: putSCodeErrorInfo,
  876 + findSCodeErrorInfo: findSCodeErrorInfo
841 877 };
842 878 })();
... ...