Commit af4c8c907718e1843dcc00d8d23a3365bd829d65
1 parent
40d6caca
帮周勤提交一下代码
Showing
3 changed files
with
151 additions
and
70 deletions
src/main/java/com/bsth/data/BasicData.java
| 1 | 1 | package com.bsth.data; |
| 2 | 2 | |
| 3 | -import java.util.ArrayList; | |
| 4 | -import java.util.HashMap; | |
| 5 | -import java.util.Iterator; | |
| 6 | -import java.util.List; | |
| 7 | -import java.util.Map; | |
| 8 | -import java.util.concurrent.TimeUnit; | |
| 9 | - | |
| 3 | +import com.bsth.Application; | |
| 4 | +import com.bsth.entity.*; | |
| 5 | +import com.bsth.entity.schedule.CarConfigInfo; | |
| 6 | +import com.bsth.repository.*; | |
| 7 | +import com.bsth.repository.schedule.CarConfigInfoRepository; | |
| 8 | +import com.google.common.collect.BiMap; | |
| 9 | +import com.google.common.collect.HashBiMap; | |
| 10 | 10 | import org.apache.commons.lang3.StringUtils; |
| 11 | 11 | import org.slf4j.Logger; |
| 12 | 12 | import org.slf4j.LoggerFactory; |
| ... | ... | @@ -14,24 +14,8 @@ import org.springframework.beans.factory.annotation.Autowired; |
| 14 | 14 | import org.springframework.boot.CommandLineRunner; |
| 15 | 15 | import org.springframework.stereotype.Component; |
| 16 | 16 | |
| 17 | -import com.bsth.Application; | |
| 18 | -import com.bsth.entity.CarPark; | |
| 19 | -import com.bsth.entity.Cars; | |
| 20 | -import com.bsth.entity.Line; | |
| 21 | -import com.bsth.entity.Personnel; | |
| 22 | -import com.bsth.entity.Station; | |
| 23 | -import com.bsth.entity.StationRoute; | |
| 24 | -import com.bsth.entity.schedule.CarConfigInfo; | |
| 25 | -import com.bsth.repository.CarParkRepository; | |
| 26 | -import com.bsth.repository.CarsRepository; | |
| 27 | -import com.bsth.repository.LineRepository; | |
| 28 | -import com.bsth.repository.PersonnelRepository; | |
| 29 | -import com.bsth.repository.StationRepository; | |
| 30 | -import com.bsth.repository.StationRouteRepository; | |
| 31 | -import com.bsth.repository.schedule.CarConfigInfoRepository; | |
| 32 | -import com.google.common.collect.BiMap; | |
| 33 | -import com.google.common.collect.HashBiMap; | |
| 34 | -import com.google.common.collect.TreeMultimap; | |
| 17 | +import java.util.*; | |
| 18 | +import java.util.concurrent.TimeUnit; | |
| 35 | 19 | |
| 36 | 20 | /** |
| 37 | 21 | * @author PanZhao |
| ... | ... | @@ -85,6 +69,9 @@ public class BasicData implements CommandLineRunner { |
| 85 | 69 | //全量员工 工号和姓名对照 |
| 86 | 70 | public static Map<String, String> allPerson; |
| 87 | 71 | |
| 72 | + //站点名和运管处编号 对照 | |
| 73 | + public static Map<String, Map<String, Map>> stationName2YgcNumber; | |
| 74 | + | |
| 88 | 75 | |
| 89 | 76 | static Logger logger = LoggerFactory.getLogger(BasicData.class); |
| 90 | 77 | |
| ... | ... | @@ -245,7 +232,14 @@ public class BasicData implements CommandLineRunner { |
| 245 | 232 | * @Title: loadLineInfo |
| 246 | 233 | * @Description: TODO(加载线路相关信息) |
| 247 | 234 | */ |
| 248 | - public void loadLineInfo() { | |
| 235 | + public void loadLineInfo(){ | |
| 236 | + List<StationRoute> stationsList = null;// 站点路由集 | |
| 237 | + StationRoute stationRoute = null; | |
| 238 | + int size = 0; | |
| 239 | + Map<String, Integer> station2Number ; | |
| 240 | + Map<String, Map> dirs2Statioin ; | |
| 241 | + int[] dirs = {0,1};// 运行方向 上下行 | |
| 242 | + int num = 1; | |
| 249 | 243 | Iterator<Line> iterator = lineRepository.findAll().iterator(); |
| 250 | 244 | |
| 251 | 245 | Line line; |
| ... | ... | @@ -253,19 +247,46 @@ public class BasicData implements CommandLineRunner { |
| 253 | 247 | Map<String, String> code2name = new HashMap<>(); |
| 254 | 248 | Map<Integer, String> id2SHcode = new HashMap<Integer, String>(); |
| 255 | 249 | Map<String, String> code2SHcode = new HashMap<String, String>(); |
| 250 | + Map<String, Map<String, Map>> tempStationName2YgcNumber = new HashMap<String, Map<String, Map>>(); | |
| 256 | 251 | |
| 257 | - while (iterator.hasNext()) { | |
| 252 | + while(iterator.hasNext()){ | |
| 258 | 253 | line = iterator.next(); |
| 259 | 254 | biMap.put(line.getId(), line.getLineCode()); |
| 260 | 255 | code2name.put(line.getLineCode(), line.getName()); |
| 261 | - id2SHcode.put(line.getId(), line.getShanghaiLinecode()); | |
| 256 | + id2SHcode.put(line.getId(),line.getShanghaiLinecode()); | |
| 262 | 257 | code2SHcode.put(line.getLineCode(), line.getShanghaiLinecode()); |
| 258 | + | |
| 259 | + /** | |
| 260 | + * 加载运管处的站点及序号 | |
| 261 | + * 上行从1开始,下行顺序续编 | |
| 262 | + | |
| 263 | + num = 1; | |
| 264 | + dirs2Statioin = new HashMap<String, Map>(); | |
| 265 | + for (int i = 0; i < dirs.length; i++) { | |
| 266 | + // 分别取得上下行的站点 | |
| 267 | + stationsList = stationRouteRepository.findByLine(line.getLineCode(), dirs[i]); | |
| 268 | + size = stationsList == null ? 0 :stationsList.size(); | |
| 269 | + if(size > 0 ){ | |
| 270 | + station2Number = new HashMap<String, Integer>(); | |
| 271 | + for (int j = 0; j < size; j++) { | |
| 272 | + stationRoute = stationsList.get(j); | |
| 273 | + // map保存为(站点名称 -->序号) | |
| 274 | + station2Number.put(stationRoute.getStationName(), num++); | |
| 275 | + } | |
| 276 | + // 保存两个数据,(0 --> station2Number)(1 --> station2Number) 0上行 1 下行 | |
| 277 | + dirs2Statioin.put(dirs[i]+"", station2Number); | |
| 278 | + } | |
| 279 | + } | |
| 280 | + // 保存(站点编码 --> dirs2Statioin) | |
| 281 | + tempStationName2YgcNumber.put(line.getLineCode(), dirs2Statioin); | |
| 282 | + */ | |
| 263 | 283 | } |
| 264 | 284 | |
| 265 | 285 | lineId2CodeMap = biMap; |
| 266 | 286 | lineCode2NameMap = code2name; |
| 267 | 287 | lineId2ShangHaiCodeMap = id2SHcode; |
| 268 | 288 | lineCode2ShangHaiCodeMap = code2SHcode; |
| 289 | + stationName2YgcNumber = tempStationName2YgcNumber; | |
| 269 | 290 | } |
| 270 | 291 | |
| 271 | 292 | /** | ... | ... |
src/main/java/com/bsth/service/TrafficManageService.java
| 1 | 1 | package com.bsth.service; |
| 2 | 2 | |
| 3 | -import com.bsth.entity.Line; | |
| 4 | - | |
| 5 | 3 | /** |
| 6 | - * | |
| 4 | + * | |
| 7 | 5 | * @Interface: LineService(线路service业务层实现接口) |
| 8 | - * | |
| 6 | + * | |
| 9 | 7 | * @extends : BaseService |
| 10 | - * | |
| 8 | + * | |
| 11 | 9 | * @Description: TODO(线路service业务层实现接口) |
| 12 | - * | |
| 10 | + * | |
| 13 | 11 | * @Author bsth@lq |
| 14 | - * | |
| 12 | + * | |
| 15 | 13 | * @Date 2016年4月28日 上午9:21:17 |
| 16 | 14 | * |
| 17 | 15 | * @Version 公交调度系统BS版 0.1 |
| 18 | - * | |
| 16 | + * | |
| 19 | 17 | */ |
| 20 | 18 | public interface TrafficManageService { |
| 21 | - | |
| 19 | + | |
| 22 | 20 | /** |
| 23 | 21 | * 上传线路信息 |
| 24 | - * | |
| 22 | + * | |
| 25 | 23 | * @return 调用接口返回信息 |
| 26 | 24 | */ |
| 27 | 25 | String setXL(); |
| 28 | - | |
| 26 | + | |
| 29 | 27 | /** |
| 30 | 28 | * 上传车辆信息 |
| 31 | - * | |
| 29 | + * | |
| 32 | 30 | * @return 调用接口返回信息 |
| 33 | 31 | */ |
| 34 | 32 | String setCL(); |
| 35 | - | |
| 33 | + | |
| 36 | 34 | /** |
| 37 | 35 | * 上传司机信息 |
| 38 | 36 | * @return 调用接口返回信息 |
| 39 | 37 | */ |
| 40 | 38 | String setSJ(); |
| 41 | - | |
| 39 | + | |
| 42 | 40 | /** |
| 43 | 41 | * 上传超速数据 |
| 44 | - * | |
| 42 | + * | |
| 45 | 43 | * @return 调用接口返回信息 |
| 46 | 44 | */ |
| 47 | 45 | String setCS(); |
| 48 | - | |
| 46 | + | |
| 49 | 47 | /** |
| 50 | 48 | * 上传线路班次时刻表数据 |
| 51 | - * | |
| 49 | + * | |
| 52 | 50 | * @return 调用接口返回信息 |
| 53 | 51 | */ |
| 54 | 52 | String setSKB(String ids); |
| 55 | - | |
| 53 | + | |
| 56 | 54 | /** |
| 57 | 55 | * 线路人员车辆配置信息 |
| 58 | 56 | * @return 调用接口返回信息 |
| 59 | 57 | */ |
| 60 | 58 | String setXLPC(); |
| 61 | - | |
| 59 | + | |
| 62 | 60 | /** |
| 63 | 61 | * 线路计划班次表 |
| 64 | 62 | * @return 调用接口返回信息 |
| 65 | 63 | */ |
| 66 | 64 | String setJHBC(); |
| 67 | - | |
| 65 | + | |
| 68 | 66 | String setLD(); |
| 69 | - | |
| 67 | + | |
| 70 | 68 | String setLCYH(); |
| 71 | - | |
| 72 | - String setDDRB(); | |
| 69 | + | |
| 70 | + String setDDRB(); | |
| 71 | + | |
| 72 | + /** | |
| 73 | + * 下载全量的公交基础数据 | |
| 74 | + * @return | |
| 75 | + */ | |
| 76 | + String getDownLoadAllDataFile(); | |
| 77 | + | |
| 78 | + /** | |
| 79 | + * 下载增量的公交基础数据 | |
| 80 | + * @return | |
| 81 | + */ | |
| 82 | + String getDownLoadIncreaseDataFile(); | |
| 83 | + | |
| 84 | + /** | |
| 85 | + * 指定线路查询方式公交基础数据下载 | |
| 86 | + * @return | |
| 87 | + */ | |
| 88 | + String getDownLoadWarrantsBusLineStation(); | |
| 73 | 89 | } | ... | ... |
src/main/java/com/bsth/service/impl/TrafficManageServiceImpl.java
| ... | ... | @@ -22,6 +22,7 @@ import org.slf4j.LoggerFactory; |
| 22 | 22 | import org.springframework.beans.factory.annotation.Autowired; |
| 23 | 23 | import org.springframework.data.domain.Sort; |
| 24 | 24 | import org.springframework.data.domain.Sort.Direction; |
| 25 | +import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate; | |
| 25 | 26 | import org.springframework.stereotype.Service; |
| 26 | 27 | |
| 27 | 28 | import com.bsth.data.BasicData; |
| ... | ... | @@ -119,6 +120,10 @@ public class TrafficManageServiceImpl implements TrafficManageService{ |
| 119 | 120 | @Autowired |
| 120 | 121 | private ScheduleRealInfoRepository scheduleRealInfoRepository; |
| 121 | 122 | |
| 123 | + @Autowired | |
| 124 | + NamedParameterJdbcTemplate jdbcTemplate; | |
| 125 | + | |
| 126 | + | |
| 122 | 127 | // 运管处接口 |
| 123 | 128 | private InternalPortType portType = new Internal().getInternalHttpSoap11Endpoint(); |
| 124 | 129 | private WebServiceSoap ssop ; |
| ... | ... | @@ -163,9 +168,6 @@ public class TrafficManageServiceImpl implements TrafficManageService{ |
| 163 | 168 | sBuffer.append("<XLs>"); |
| 164 | 169 | while(lineIterator.hasNext()){ |
| 165 | 170 | line = lineIterator.next(); |
| 166 | - if(line.getLinePlayType() == null){ | |
| 167 | - continue; | |
| 168 | - } | |
| 169 | 171 | if(BasicData.lineId2ShangHaiCodeMap.get(line.getId()) == null){ |
| 170 | 172 | continue; |
| 171 | 173 | } |
| ... | ... | @@ -189,7 +191,8 @@ public class TrafficManageServiceImpl implements TrafficManageService{ |
| 189 | 191 | sBuffer.append("<QZLC>").append(upMileage).append("</QZLC>"); |
| 190 | 192 | sBuffer.append("<ZQLC>").append(downMileage).append("</ZQLC>"); |
| 191 | 193 | } |
| 192 | - sBuffer.append("<XLGH>").append(line.getLinePlayType()).append("</XLGH>"); | |
| 194 | + sBuffer.append("<XLGH>").append(line.getLinePlayType() == null ?"0":line.getLinePlayType()) | |
| 195 | + .append("</XLGH>"); | |
| 193 | 196 | // 循环添加站点信息 |
| 194 | 197 | sBuffer.append("<StationList>"); |
| 195 | 198 | // 先查上行 |
| ... | ... | @@ -334,21 +337,28 @@ public class TrafficManageServiceImpl implements TrafficManageService{ |
| 334 | 337 | |
| 335 | 338 | int seqNumber = 0; |
| 336 | 339 | for(ScheduleRealInfo scheduleRealInfo:list){ |
| 337 | - if(schRealInfo.getXlBm().equals(scheduleRealInfo.getXlBm()) && schRealInfo.getLpName().equals(scheduleRealInfo.getLpName()) | |
| 340 | + if(schRealInfo.getXlBm().equals(scheduleRealInfo.getXlBm()) && schRealInfo.getLpName() | |
| 341 | + .equals(scheduleRealInfo.getLpName()) | |
| 338 | 342 | && schRealInfo.getClZbh().equals(scheduleRealInfo.getClZbh())){ |
| 343 | + if(scheduleRealInfo.getFcsjActual() == null ||scheduleRealInfo.getBcType().equals("in") | |
| 344 | + || scheduleRealInfo.getBcType().equals("out")){ | |
| 345 | + continue; | |
| 346 | + } | |
| 339 | 347 | scheduleRealInfo.getQdzCode(); |
| 340 | 348 | sf.append("<LD>"); |
| 341 | 349 | sf.append("<SJGH>"+scheduleRealInfo.getjGh()+"</SJGH>"); |
| 342 | 350 | sf.append("<SXX>"+scheduleRealInfo.getXlDir()+"</SXX>"); |
| 343 | 351 | sf.append("<FCZDMC>"+scheduleRealInfo.getQdzName()+"</FCZDMC>"); |
| 344 | - sf.append("<FCZDXH>" + ++seqNumber + "</FCZDXH>"); | |
| 352 | + sf.append("<FCZDXH>" + getYgcStationNumByLineCodeAndDirectionAndStationName( | |
| 353 | + scheduleRealInfo.getXlBm(), scheduleRealInfo.getXlDir(), scheduleRealInfo.getQdzName()) + "</FCZDXH>"); | |
| 345 | 354 | sf.append("<FCZDBM>"+scheduleRealInfo.getQdzCode()+"</FCZDBM>"); |
| 346 | 355 | sf.append("<JHFCSJ>"+scheduleRealInfo.getFcsj()+"</JHFCSJ>"); |
| 347 | 356 | sf.append("<DFSJ>"+scheduleRealInfo.getDfsj()+"</DFSJ>"); |
| 348 | 357 | sf.append("<SJFCSJ>"+scheduleRealInfo.getFcsjActual()+"</SJFCSJ>"); |
| 349 | 358 | sf.append("<FCZDLX>"+""+"</FCZDLX>"); |
| 350 | 359 | sf.append("<DDZDMC>"+scheduleRealInfo.getZdzName()+"</DDZDMC>"); |
| 351 | - sf.append("<DDZDXH>"+ seqNumber +"</DDZDXH>"); | |
| 360 | + sf.append("<DDZDXH>"+ getYgcStationNumByLineCodeAndDirectionAndStationName( | |
| 361 | + scheduleRealInfo.getXlBm(), scheduleRealInfo.getXlDir(), scheduleRealInfo.getZdzName()) +"</DDZDXH>"); | |
| 352 | 362 | sf.append("<DDZDBM>"+scheduleRealInfo.getZdzCode()+"</DDZDBM>"); |
| 353 | 363 | sf.append("<JHDDSJ>"+scheduleRealInfo.getZdsj()+"</JHDDSJ>"); |
| 354 | 364 | sf.append("<SJDDSJ>"+scheduleRealInfo.getZdsjActual()+"</SJDDSJ>"); |
| ... | ... | @@ -404,7 +414,8 @@ public class TrafficManageServiceImpl implements TrafficManageService{ |
| 404 | 414 | sf.append("<XLBM>"+BasicData.lineCode2ShangHaiCodeMap.get(schRealInfo.getXlBm())+"</XLBM>"); |
| 405 | 415 | sf.append("<CPH>"+car.getCarPlate()+"</CPH>"); |
| 406 | 416 | for(ScheduleRealInfo scheduleRealInfo:list){ |
| 407 | - if(schRealInfo.getXlBm().equals(scheduleRealInfo.getXlBm()) && schRealInfo.getClZbh().equals(scheduleRealInfo.getClZbh())){ | |
| 417 | + if(schRealInfo.getXlBm().equals(scheduleRealInfo.getXlBm()) && schRealInfo.getClZbh() | |
| 418 | + .equals(scheduleRealInfo.getClZbh())){ | |
| 408 | 419 | Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks(); |
| 409 | 420 | //如果没有子任务,里程就是已执行(Status=2);有子任务的,忽略主任务,子任务的烂班 |
| 410 | 421 | if(childTaskPlans.isEmpty()){ |
| ... | ... | @@ -412,7 +423,7 @@ public class TrafficManageServiceImpl implements TrafficManageService{ |
| 412 | 423 | totalKilometers += scheduleRealInfo.getJhlc()==null?0.0:scheduleRealInfo.getJhlc(); |
| 413 | 424 | if(scheduleRealInfo.getBcType().equals("in") || scheduleRealInfo.getBcType().equals("out") |
| 414 | 425 | || scheduleRealInfo.getBcType().equals("venting")){ |
| 415 | - emptyKilometers += scheduleRealInfo.getJhlc()==null?0.0:scheduleRealInfo.getJhlc();; | |
| 426 | + emptyKilometers += scheduleRealInfo.getJhlc()==null?0.0:scheduleRealInfo.getJhlc(); | |
| 416 | 427 | } |
| 417 | 428 | } |
| 418 | 429 | }else{ |
| ... | ... | @@ -588,14 +599,19 @@ public class TrafficManageServiceImpl implements TrafficManageService{ |
| 588 | 599 | if(xlbm.equals(schedulePlanInfo.getXlBm()) |
| 589 | 600 | && zbh.equals(schedulePlanInfo.getClZbh()) |
| 590 | 601 | && lp == schedulePlanInfo.getLp()){ |
| 602 | + if(schedulePlanInfo.getBcType().equals("in") || schedulePlanInfo.getBcType().equals("out")){ | |
| 603 | + continue; | |
| 604 | + } | |
| 591 | 605 | sBuffer.append("<BC>"); |
| 592 | 606 | sBuffer.append("<SJGH>").append(schedulePlanInfo.getjGh()).append("</SJGH>"); |
| 593 | 607 | sBuffer.append("<SXX>").append(schedulePlanInfo.getXlDir()).append("</SXX>"); |
| 594 | 608 | sBuffer.append("<FCZDMC>").append(schedulePlanInfo.getQdzName()).append("</FCZDMC>"); |
| 595 | - sBuffer.append("<ZDXH>").append(++startSerialNum).append("</ZDXH>"); | |
| 609 | + sBuffer.append("<ZDXH>").append(getYgcStationNumByLineCodeAndDirectionAndStationName( | |
| 610 | + schedulePlanInfo.getXlBm(), schedulePlanInfo.getXlDir(), schedulePlanInfo.getQdzName())).append("</ZDXH>"); | |
| 596 | 611 | sBuffer.append("<JHFCSJ>").append(schedulePlanInfo.getFcsj()).append("</JHFCSJ>"); |
| 597 | 612 | sBuffer.append("<DDZDMC>").append(schedulePlanInfo.getZdzName()).append("</DDZDMC>"); |
| 598 | - sBuffer.append("<ZDXH>").append(++endSerialNum).append("</ZDXH>"); | |
| 613 | + sBuffer.append("<ZDXH>").append(getYgcStationNumByLineCodeAndDirectionAndStationName( | |
| 614 | + schedulePlanInfo.getXlBm(), schedulePlanInfo.getXlDir(), schedulePlanInfo.getZdzName())).append("</ZDXH>"); | |
| 599 | 615 | sBuffer.append("<JHDDSJ>").append(calcDdsj(schedulePlanInfo.getFcsj(),schedulePlanInfo.getBcsj())) |
| 600 | 616 | .append("</JHDDSJ>"); |
| 601 | 617 | sBuffer.append("</BC>"); |
| ... | ... | @@ -643,6 +659,7 @@ public class TrafficManageServiceImpl implements TrafficManageService{ |
| 643 | 659 | Iterator<TTInfoDetail> ttInfoDetailIterator; |
| 644 | 660 | HashMap<String,Object> param = new HashMap<String, Object>(); |
| 645 | 661 | String ttinfoJhlc = null;//计划总里程 |
| 662 | + String lineCode ; | |
| 646 | 663 | sBuffer.append("<SKBs>"); |
| 647 | 664 | for (int i = 0; i < idArray.length; i++) { |
| 648 | 665 | ttInfo = ttInfoRepository.findOne(Long.valueOf(idArray[i])); |
| ... | ... | @@ -652,7 +669,8 @@ public class TrafficManageServiceImpl implements TrafficManageService{ |
| 652 | 669 | ttInfoDetailIterator = ttInfoDetailRepository.findAll(new CustomerSpecs<TTInfoDetail>(param), |
| 653 | 670 | new Sort(Direction.ASC, "xlDir")).iterator(); |
| 654 | 671 | sBuffer.append("<SKB>"); |
| 655 | - sBuffer.append("<XLBM>").append(BasicData.lineId2ShangHaiCodeMap.get(ttInfo.getXl())).append("</XLBM>"); | |
| 672 | + sBuffer.append("<XLBM>").append(BasicData.lineId2ShangHaiCodeMap.get(ttInfo.getXl().getId())) | |
| 673 | + .append("</XLBM>"); | |
| 656 | 674 | ttinfoJhlc = new String(); |
| 657 | 675 | sBuffer.append("<JHZLC>").append(ttinfoJhlc).append("</JHZLC>"); |
| 658 | 676 | sBuffer.append("<JHYYLC>").append(ttinfoJhlc).append("</JHYYLC>"); |
| ... | ... | @@ -662,23 +680,35 @@ public class TrafficManageServiceImpl implements TrafficManageService{ |
| 662 | 680 | sBuffer.append("<TBYY>").append("").append("</TBYY>"); |
| 663 | 681 | sBuffer.append("<UPDT>").append(sdfnyrsfm.format(new Date())).append("</UPDT>"); |
| 664 | 682 | int num = 1; |
| 683 | + // 加上<BCList> | |
| 684 | + if(ttInfoDetailIterator.hasNext()){ | |
| 685 | + sBuffer.append("<BCList>"); | |
| 686 | + } | |
| 665 | 687 | while (ttInfoDetailIterator.hasNext()) { |
| 666 | 688 | ttInfoDetail = ttInfoDetailIterator.next(); |
| 689 | + if(ttInfoDetail.getBcType().equals("in") || ttInfoDetail.getBcType().equals("out")){ | |
| 690 | + continue; | |
| 691 | + } | |
| 667 | 692 | ttinfoJhlc = ttInfoDetail.getJhlc()+"";// 设置计划总里程 |
| 668 | - sBuffer.append("<BCList>"); | |
| 693 | + lineCode = ttInfoDetail.getXl().getLineCode(); | |
| 669 | 694 | sBuffer.append("<BC>"); |
| 670 | 695 | sBuffer.append("<LPBH>").append(ttInfoDetail.getLp().getLpNo()).append("</LPBH>"); |
| 671 | 696 | sBuffer.append("<SXX>").append(ttInfoDetail.getXlDir()).append("</SXX>"); |
| 672 | - sBuffer.append("<FCZDMC>").append(ttInfoDetail.getQdz()).append("</FCZDMC>"); | |
| 673 | - sBuffer.append("<ZDXH>").append(num).append("</ZDXH>"); | |
| 697 | + sBuffer.append("<FCZDMC>").append(ttInfoDetail.getQdz().getStationName()).append("</FCZDMC>"); | |
| 698 | + sBuffer.append("<ZDXH>").append(getYgcStationNumByLineCodeAndDirectionAndStationName( | |
| 699 | + lineCode, ttInfoDetail.getXlDir(), ttInfoDetail.getQdz().getStationName())).append("</ZDXH>"); | |
| 674 | 700 | sBuffer.append("<JHFCSJ>").append(ttInfoDetail.getFcsj()).append("</JHFCSJ>"); |
| 675 | - sBuffer.append("<DDZDMC>").append(ttInfoDetail.getZdz()).append("</DDZDMC>"); | |
| 676 | - sBuffer.append("<ZDXH>").append(num).append("</ZDXH>"); | |
| 701 | + sBuffer.append("<DDZDMC>").append(ttInfoDetail.getZdz().getStationName()).append("</DDZDMC>"); | |
| 702 | + sBuffer.append("<ZDXH>").append(getYgcStationNumByLineCodeAndDirectionAndStationName( | |
| 703 | + lineCode, ttInfoDetail.getXlDir(), ttInfoDetail.getZdz().getStationName())).append("</ZDXH>"); | |
| 677 | 704 | sBuffer.append("<JHDDSJ>").append(calcDdsj(ttInfoDetail.getFcsj(),ttInfoDetail.getBcsj())).append("</JHDDSJ>"); |
| 678 | 705 | sBuffer.append("</BC>"); |
| 679 | - sBuffer.append("</BCList>"); | |
| 706 | + | |
| 680 | 707 | num++; |
| 681 | 708 | } |
| 709 | + if(sBuffer.indexOf("<BCList>") != -1){ | |
| 710 | + sBuffer.append("</BCList>"); | |
| 711 | + } | |
| 682 | 712 | sBuffer.append("</SKB>"); |
| 683 | 713 | } |
| 684 | 714 | sBuffer.append("</SKBs>"); |
| ... | ... | @@ -1008,7 +1038,7 @@ public class TrafficManageServiceImpl implements TrafficManageService{ |
| 1008 | 1038 | zdlx = "2"; |
| 1009 | 1039 | } |
| 1010 | 1040 | sBuffer.append("<Station>"); |
| 1011 | - sBuffer.append("<ZDXH>").append(startId).append("</ZDXH>"); | |
| 1041 | + sBuffer.append("<ZDXH>").append(getYgcStationNumByLineCodeAndDirectionAndStationName(srRoute.getLineCode(),srRoute.getDirections()+"",srRoute.getStationName())).append("</ZDXH>"); | |
| 1012 | 1042 | sBuffer.append("<SXX>").append(srRoute.getDirections()).append("</SXX>"); |
| 1013 | 1043 | sBuffer.append("<ZDMC>").append(srRoute.getStationName()).append("</ZDMC>"); |
| 1014 | 1044 | sBuffer.append("<ZDBM>").append(srRoute.getStationCode()).append("</ZDBM>"); |
| ... | ... | @@ -1023,4 +1053,18 @@ public class TrafficManageServiceImpl implements TrafficManageService{ |
| 1023 | 1053 | return startId; |
| 1024 | 1054 | } |
| 1025 | 1055 | |
| 1056 | + /** | |
| 1057 | + * | |
| 1058 | + * @param lineCode 线路编码 | |
| 1059 | + * @param direction 线路方向 | |
| 1060 | + * @param stationName 让点名称 | |
| 1061 | + * @return 运管处站点序号 | |
| 1062 | + */ | |
| 1063 | + private Integer getYgcStationNumByLineCodeAndDirectionAndStationName(String lineCode,String direction,String stationName){ | |
| 1064 | + Integer number = 0; | |
| 1065 | + Map<String, Map> dirs2Statioin = BasicData.stationName2YgcNumber.get(lineCode); | |
| 1066 | + Map<String, Integer> station2Number = dirs2Statioin.get(direction); | |
| 1067 | + number = station2Number.get(stationName); | |
| 1068 | + return number; | |
| 1069 | + } | |
| 1026 | 1070 | } | ... | ... |