Commit 7c4f630dbfcc5a8b71666bd8cabdc474c4891072
1 parent
607b0f31
update...
Showing
6 changed files
with
58 additions
and
49 deletions
src/main/java/com/bsth/controller/realcontrol/ScheduleRealInfoController.java
| ... | ... | @@ -30,7 +30,7 @@ public class ScheduleRealInfoController extends BaseController<ScheduleRealInfo, |
| 30 | 30 | DayOfSchedule dayOfSchedule; |
| 31 | 31 | |
| 32 | 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){ | |
| 33 | + public Map<String, Object> checkPCFgsAscription(@RequestParam Long schId, String jGh, String sGh, String nbbm){ | |
| 34 | 34 | return scheduleRealInfoService.checkPCFgsAscription(schId, jGh, sGh, nbbm); |
| 35 | 35 | } |
| 36 | 36 | ... | ... |
src/main/java/com/bsth/data/schedule/e_state_check/ScheduleStationCodeChecker.java
| ... | ... | @@ -103,7 +103,7 @@ public class ScheduleStationCodeChecker { |
| 103 | 103 | rs.add(sci); |
| 104 | 104 | continue; |
| 105 | 105 | } |
| 106 | - else if(null != sci && !sci.getRealStationCode().equals(getCode(sch, qdOrZd))){//名称一致的站点,编码不一致 | |
| 106 | + else if(null != sci && !codeEq(sci, getCode(sch, qdOrZd))){//名称一致的站点,编码不一致 | |
| 107 | 107 | sci.setStationCode(getCode(sch, qdOrZd)); |
| 108 | 108 | rs.add(sci); |
| 109 | 109 | continue; |
| ... | ... | @@ -112,6 +112,10 @@ public class ScheduleStationCodeChecker { |
| 112 | 112 | return rs; |
| 113 | 113 | } |
| 114 | 114 | |
| 115 | + private boolean codeEq(SCodeInfo sci, String code){ | |
| 116 | + return sci.getRealStationCode().equals(code) || sci.getRealStationCode().indexOf(code + "^") != -1; | |
| 117 | + } | |
| 118 | + | |
| 115 | 119 | private String getName(ScheduleRealInfo sch, String qdOrZd) { |
| 116 | 120 | return qdOrZd.equals("qd")?sch.getQdzName():sch.getZdzName(); |
| 117 | 121 | } |
| ... | ... | @@ -126,8 +130,19 @@ public class ScheduleStationCodeChecker { |
| 126 | 130 | List<SCodeInfo> realList = jdbcTemplate.query(sql, BeanPropertyRowMapper.newInstance(SCodeInfo.class)); |
| 127 | 131 | Map<String, SCodeInfo> realMap = new HashMap<>(); |
| 128 | 132 | |
| 133 | + String kName; | |
| 134 | + SCodeInfo old; | |
| 129 | 135 | for (SCodeInfo sci : realList) { |
| 130 | - realMap.put(sci.getLineCode() + "_" + sci.getUpDown() + "_" + sci.getStationName(), sci); | |
| 136 | + kName = sci.getLineCode() + "_" + sci.getUpDown() + "_" + sci.getStationName(); | |
| 137 | + | |
| 138 | + if(realMap.containsKey(kName)){ | |
| 139 | + //环线可能存在同名的站点 | |
| 140 | + old = realMap.get(kName); | |
| 141 | + old.setRealStationCode(old.getRealStationCode() + "^" + sci.getRealStationCode() + "^"); | |
| 142 | + continue; | |
| 143 | + } | |
| 144 | + | |
| 145 | + realMap.put(kName, sci); | |
| 131 | 146 | realMap.put(sci.getLineCode() + "_" + sci.getUpDown() + "_" + sci.getRealStationCode(), sci); |
| 132 | 147 | } |
| 133 | 148 | ... | ... |
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
| ... | ... | @@ -190,66 +190,57 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 190 | 190 | ScheduleRealInfo sch = dayOfSchedule.get(schId); |
| 191 | 191 | String gsbm = sch.getGsBm(), fgsbm = sch.getFgsBm(); |
| 192 | 192 | |
| 193 | - if(StringUtils.isBlank(jGh) || "/".equals(StringUtils.trim(jGh))){ | |
| 194 | - rs.put("msg", "无效的参数【驾驶员】"); | |
| 195 | - rs.put("status", ResponseCode.ERROR); | |
| 196 | - return rs; | |
| 197 | - } | |
| 198 | - //校验运营公司 | |
| 199 | - Personnel jsy = BasicData.perMap.get(gsbm + "-" + jGh); | |
| 200 | - if (null == jsy) { | |
| 201 | - msg = "【驾驶员】:" + sch.getGsName() + "暂无工号为" + "【" + jGh + "】的人员"; | |
| 202 | - rs.put("msg", msg); | |
| 203 | - return rs; | |
| 204 | - } | |
| 205 | - | |
| 206 | - if (!carExist(gsbm, nbbm)) { | |
| 193 | + if (nbbm != null && !carExist(gsbm, nbbm)) { | |
| 207 | 194 | msg = sch.getGsName() + "没有自编号为" + "[" + nbbm + "]的车辆"; |
| 208 | 195 | rs.put("msg", msg); |
| 209 | 196 | return rs; |
| 210 | 197 | } |
| 211 | 198 | |
| 212 | - if (!sch.getGsBm().equals(BasicData.nbbm2CompanyCodeMap.get(nbbm))) { | |
| 199 | + if (nbbm != null && !sch.getGsBm().equals(BasicData.nbbm2CompanyCodeMap.get(nbbm))) { | |
| 213 | 200 | rs.put("msg", sch.getXlName() + "所属的公司编码下找不到自编号为【" + nbbm + "】的车辆"); |
| 214 | 201 | return rs; |
| 215 | 202 | } |
| 216 | 203 | |
| 217 | - Personnel spy = null; | |
| 218 | - if (StringUtils.isNotEmpty(sGh)) { | |
| 219 | - spy = BasicData.perMap.get(gsbm + "-" + sGh); | |
| 220 | - if (null == spy) { | |
| 221 | - msg = "【售票员】: " + sch.getGsName() + "暂无工号为" + "【" + sGh + "】的人员"; | |
| 222 | - rs.put("msg", msg); | |
| 223 | - return rs; | |
| 224 | - } | |
| 225 | - } | |
| 204 | + if (nbbm != null && !(fgsbm + "_" + gsbm).equals(BasicData.nbbm2FgsCompanyCodeMap.get(nbbm))) { | |
| 226 | 205 | |
| 206 | + String clFgsName = BasicData.businessFgsCodeNameMap.get(BasicData.nbbm2FgsCompanyCodeMap.get(nbbm)); | |
| 227 | 207 | |
| 228 | - //校验分公司 | |
| 229 | - if (null != jsy && !fgsbm.equals(jsy.getBrancheCompanyCode())) { | |
| 230 | - msg = ("【驾驶员】:" + jGh + "/" + jsy.getPersonnelName() + "是" + jsy.getBrancheCompany() + "的人员"); | |
| 208 | + msg = ("【" + nbbm + "】" + "是" + clFgsName + "的车辆!"); | |
| 231 | 209 | rs.put("msg", msg); |
| 232 | 210 | rs.put("checkStatus", -1); |
| 233 | 211 | return rs; |
| 234 | 212 | } |
| 235 | 213 | |
| 236 | - if (StringUtils.isNotEmpty(sGh)) { | |
| 237 | - if (null != spy && !fgsbm.equals(spy.getBrancheCompanyCode())) { | |
| 238 | - msg = ("【售票员】: " + jGh + "/" + spy.getPersonnelName() + "是" + spy.getBrancheCompany() + "的人员"); | |
| 214 | + if(null != jGh && !"/".equals(StringUtils.trim(jGh))){ | |
| 215 | + Personnel jsy = BasicData.perMap.get(gsbm + "-" + jGh); | |
| 216 | + | |
| 217 | + if (null == jsy) { | |
| 218 | + msg = "【驾驶员】:" + sch.getGsName() + "暂无工号为" + "【" + jGh + "】的人员"; | |
| 219 | + rs.put("msg", msg); | |
| 220 | + return rs; | |
| 221 | + } | |
| 222 | + else if (!fgsbm.equals(jsy.getBrancheCompanyCode())) { | |
| 223 | + //校验分公司 | |
| 224 | + msg = ("【驾驶员】:" + jGh + "/" + jsy.getPersonnelName() + "是" + jsy.getBrancheCompany() + "的人员"); | |
| 239 | 225 | rs.put("msg", msg); |
| 240 | 226 | rs.put("checkStatus", -1); |
| 241 | 227 | return rs; |
| 242 | 228 | } |
| 243 | 229 | } |
| 244 | 230 | |
| 245 | - if (!(fgsbm + "_" + gsbm).equals(BasicData.nbbm2FgsCompanyCodeMap.get(nbbm))) { | |
| 246 | - | |
| 247 | - String clFgsName = BasicData.businessFgsCodeNameMap.get(BasicData.nbbm2FgsCompanyCodeMap.get(nbbm)); | |
| 248 | - | |
| 249 | - msg = ("【" + nbbm + "】" + "是" + clFgsName + "的车辆!"); | |
| 250 | - rs.put("msg", msg); | |
| 251 | - rs.put("checkStatus", -1); | |
| 252 | - return rs; | |
| 231 | + if (null != sGh && !"/".equals(StringUtils.trim(sGh))) { | |
| 232 | + Personnel spy = BasicData.perMap.get(gsbm + "-" + sGh); | |
| 233 | + if (null == spy) { | |
| 234 | + msg = "【售票员】: " + sch.getGsName() + "暂无工号为" + "【" + sGh + "】的人员"; | |
| 235 | + rs.put("msg", msg); | |
| 236 | + return rs; | |
| 237 | + } | |
| 238 | + else if (!fgsbm.equals(spy.getBrancheCompanyCode())) { | |
| 239 | + msg = ("【售票员】: " + jGh + "/" + spy.getPersonnelName() + "是" + spy.getBrancheCompany() + "的人员"); | |
| 240 | + rs.put("msg", msg); | |
| 241 | + rs.put("checkStatus", -1); | |
| 242 | + return rs; | |
| 243 | + } | |
| 253 | 244 | } |
| 254 | 245 | |
| 255 | 246 | rs.put("checkStatus", 1); |
| ... | ... | @@ -3318,11 +3309,9 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf |
| 3318 | 3309 | Set<ScheduleRealInfo> set = new HashSet<>(); |
| 3319 | 3310 | |
| 3320 | 3311 | ScheduleRealInfo sch; |
| 3321 | - //StringBuilder sb = new StringBuilder(); | |
| 3322 | 3312 | |
| 3323 | 3313 | String jGh = null, jName, sGh, sName; |
| 3324 | 3314 | for (ChangePersonCar cpc : cpcs) { |
| 3325 | - //sb = new StringBuilder(); | |
| 3326 | 3315 | |
| 3327 | 3316 | sch = dayOfSchedule.get(cpc.getSchId()); |
| 3328 | 3317 | if (sch == null) | ... | ... |
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/tzrc.html
| ... | ... | @@ -285,11 +285,11 @@ |
| 285 | 285 | }); |
| 286 | 286 | |
| 287 | 287 | function check_fgs_ascription(data, cb) { |
| 288 | - var jGh = data.jsy.split('/')[0] | |
| 289 | - ,sGh | |
| 290 | - ,nbbm = data.clZbh; | |
| 288 | + var jGh,sGh,nbbm = data.clZbh; | |
| 291 | 289 | if(data.spy) |
| 292 | 290 | sGh = data.spy.split('/')[0]; |
| 291 | + if(data.jsy) | |
| 292 | + jGh = data.jsy.split('/')[0]; | |
| 293 | 293 | |
| 294 | 294 | gb_common.$post('/realSchedule/check_fgs_ascription',{ |
| 295 | 295 | schId: data.schId, | ... | ... |
src/main/resources/static/real_control_v2/fragments/line_schedule/layout.html
| ... | ... | @@ -48,11 +48,12 @@ |
| 48 | 48 | <ul class="uk-list uk-list-line" style="margin-bottom: 0;"> |
| 49 | 49 | {{each list as obj i}} |
| 50 | 50 | {{if obj.realStationCode!=null}} |
| 51 | - <li>【{{obj.stationName}}】班次编码 <span style="color: red;">{{obj.stationCode}}</span> -实际:{{obj.realStationCode}}</li> | |
| 51 | + <li>【{{obj.stationName}}】班次用的站点 <span style="color: red;">{{obj.stationCode}}</span> -实际:{{obj.realStationCode}}</li> | |
| 52 | 52 | {{else}} |
| 53 | - <li>【{{obj.stationName}}】班次编码 <span style="color: red;">{{obj.stationCode}}</span> -在当前线路站点中不存在</li> | |
| 53 | + <li>【{{obj.stationName}}】班次用的站点 <span style="color: red;">{{obj.stationCode}}</span> -在站点路由中不存在的</li> | |
| 54 | 54 | {{/if}} |
| 55 | 55 | {{/each}} |
| 56 | + | |
| 56 | 57 | </ul> |
| 57 | 58 | </div> |
| 58 | 59 | </script> | ... | ... |
src/main/resources/static/real_control_v2/js/line_schedule/sch_table.js
| ... | ... | @@ -825,6 +825,10 @@ var gb_schedule_table = (function () { |
| 825 | 825 | var k; |
| 826 | 826 | for(var i=0,obj;obj=list[i++];){ |
| 827 | 827 | k = obj.lineCode+'_'+obj.upDown; |
| 828 | + | |
| 829 | + if(obj.realStationCode && obj.realStationCode.indexOf('^') != -1) | |
| 830 | + obj.realStationCode = obj.realStationCode.split('^')[0]; | |
| 831 | + | |
| 828 | 832 | if(!data[k]) |
| 829 | 833 | data[k] = []; |
| 830 | 834 | data[k].push(obj); |
| ... | ... | @@ -837,7 +841,7 @@ var gb_schedule_table = (function () { |
| 837 | 841 | continue; |
| 838 | 842 | |
| 839 | 843 | $(".schedule-wrap span.warn_multi_station[data-updown="+(k.split('_')[1])+"]", wrap) |
| 840 | - .html('o(* ̄▽ ̄*)o 班次站点编码有点问题!!').show(); | |
| 844 | + .html('o(* ̄▽ ̄*)o 班次和站点关联有点问题!!').show(); | |
| 841 | 845 | } |
| 842 | 846 | |
| 843 | 847 | errorCodeData = data; | ... | ... |