Commit bd22997921bceaccc825e7512066b24214dcd7e0

Authored by 王通
1 parent ec375259

1.百度地图key替换

2.区间子线路+线路文件、报站文件生成的完善,以及线调的处理变化
3.js打包兼容es6
src/main/java/com/bsth/service/impl/StationRouteServiceImpl.java
... ... @@ -12,6 +12,7 @@ import com.bsth.util.db.DBUtils_MS;
12 12 import com.google.common.base.Splitter;
13 13 import org.apache.commons.lang3.StringUtils;
14 14 import org.geolatte.geom.Polygon;
  15 +import org.springframework.beans.BeanUtils;
15 16 import org.springframework.beans.factory.annotation.Autowired;
16 17 import org.springframework.beans.factory.annotation.Value;
17 18 import org.springframework.data.domain.Sort;
... ... @@ -1039,27 +1040,44 @@ public class StationRouteServiceImpl extends BaseServiceImpl<StationRoute, Integ
1039 1040 private String subLine2Ftp(LineRegion lineRegion) {
1040 1041 StringBuilder builder = new StringBuilder();
1041 1042 int len = lineRegion.getStationRoutes().size();
  1043 + if (len < 2) throw new RuntimeException("无效的区间线路");
1042 1044 int idx = 1;
  1045 + List<LsStationRoute> stationRoutes = new ArrayList<>();
  1046 + stationRoutes.add(lineRegion.getStationRoutes().get(len - 1));
  1047 + stationRoutes.add(lineRegion.getStationRoutes().get(0));
  1048 + if (lineRegion.getDirection() == 1) {
  1049 + idx = mergeSubLine(stationRoutes, builder, idx);
  1050 + }
  1051 + idx = mergeSubLine(lineRegion.getStationRoutes(), builder, idx);
  1052 + if (lineRegion.getDirection() == 0) {
  1053 + mergeSubLine(stationRoutes, builder, idx);
  1054 + }
  1055 +
  1056 + return builder.toString();
  1057 + }
  1058 +
  1059 + private int mergeSubLine(List<LsStationRoute> stationRoutes, StringBuilder builder, int idx) {
  1060 + int len = stationRoutes.size();
1043 1061 for (int i = 0;i < len;i++) {
1044   - LsStationRoute route = lineRegion.getStationRoutes().get(i);
  1062 + LsStationRoute route = stationRoutes.get(i);
1045 1063 builder.append(route.getCenterPointWgs().getPosition().getCoordinate(0))
1046   - .append("\t").append(route.getCenterPointWgs().getPosition().getCoordinate(1))
1047   - .append("\t").append(i == len - 1 ? 2 : 1)
1048   - .append("\t").append(idx).append("\t");
  1064 + .append("\t").append(route.getCenterPointWgs().getPosition().getCoordinate(1))
  1065 + .append("\t").append(i == len - 1 ? 2 : 1)
  1066 + .append("\t").append(idx).append("\t");
1049 1067 for (int j = 0;j < 8 - route.getStationCode().length();j++) {
1050 1068 builder.append("0");
1051 1069 }
1052 1070 builder.append(route.getStationCode())
1053   - .append("\t").append((int) route.getDistances().doubleValue() * 1000)
1054   - .append("\t0")
1055   - .append("\t").append(route.getStationName())
1056   - .append("\t").append(route.getStationNameEn())
1057   - .append("\r\n");
  1071 + .append("\t").append((int) route.getDistances().doubleValue() * 1000)
  1072 + .append("\t0")
  1073 + .append("\t").append(route.getStationName())
  1074 + .append("\t").append(route.getStationNameEn())
  1075 + .append("\r\n");
1058 1076  
1059 1077 idx++;
1060 1078 }
1061 1079  
1062   - return builder.toString();
  1080 + return idx;
1063 1081 }
1064 1082  
1065 1083 /**
... ...